commit
f7a4432300
8 changed files with 232 additions and 0 deletions
@ -0,0 +1,2 @@ |
|||||||
|
config.json |
||||||
|
kiwiirc.conf |
@ -0,0 +1,2 @@ |
|||||||
|
kiwiirc.conf |
||||||
|
config.json |
@ -0,0 +1,41 @@ |
|||||||
|
FROM alpine:latest as builder |
||||||
|
|
||||||
|
RUN apk --update add git yarn npm wget unzip go make |
||||||
|
|
||||||
|
RUN git clone --branch v1.5.1 https://github.com/kiwiirc/kiwiirc.git |
||||||
|
|
||||||
|
WORKDIR kiwiirc |
||||||
|
|
||||||
|
# Remove silly dice command |
||||||
|
COPY ./nodice.patch . |
||||||
|
RUN git apply ./nodice.patch |
||||||
|
|
||||||
|
RUN yarn install |
||||||
|
|
||||||
|
RUN yarn run build |
||||||
|
|
||||||
|
WORKDIR / |
||||||
|
RUN apk --update add go make |
||||||
|
RUN git clone https://github.com/kiwiirc/webircgateway.git && cd webircgateway |
||||||
|
WORKDIR webircgateway |
||||||
|
|
||||||
|
RUN make build |
||||||
|
|
||||||
|
FROM alpine:latest |
||||||
|
|
||||||
|
LABEL maintainer jerryaldrichiii@gmail.com |
||||||
|
|
||||||
|
COPY --from=builder /kiwiirc/dist /srv/kiwiirc/www |
||||||
|
COPY --from=builder /webircgateway/webircgateway /srv/kiwiirc |
||||||
|
|
||||||
|
EXPOSE 8080 |
||||||
|
|
||||||
|
COPY entrypoint.sh /entrypoint.sh |
||||||
|
RUN chmod +x /entrypoint.sh |
||||||
|
|
||||||
|
RUN adduser -H -D -s /bin/false kiwi |
||||||
|
RUN chown -R kiwi:kiwi /srv/ |
||||||
|
|
||||||
|
USER kiwi |
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"] |
@ -0,0 +1,22 @@ |
|||||||
|
# Kiwi IRC |
||||||
|
|
||||||
|
## How to run |
||||||
|
|
||||||
|
Create a config.json: |
||||||
|
|
||||||
|
[https://github.com/kiwiirc/kiwiirc/blob/master/static/config.json](https://github.com/kiwiirc/kiwiirc/blob/master/static/config.json) |
||||||
|
|
||||||
|
Create a kiwiirc.conf: |
||||||
|
|
||||||
|
[https://github.com/kiwiirc/webircgateway/blob/master/config.conf.example](https://github.com/kiwiirc/webircgateway/blob/master/config.conf.example) |
||||||
|
|
||||||
|
> Alternatively, you could copy the example files in this repo |
||||||
|
|
||||||
|
Run the following: |
||||||
|
``` |
||||||
|
docker run -it --rm \ |
||||||
|
-p 8080:8080 \ |
||||||
|
-v $PWD/kiwiirc.conf:/bootstrap/kiwiirc.conf \ |
||||||
|
-v $PWD/config.json:/bootstrap/config.json \ |
||||||
|
jerryaldrichiii/kiwiirc:latest |
||||||
|
``` |
@ -0,0 +1,28 @@ |
|||||||
|
{ |
||||||
|
"windowTitle": "Your IRC", |
||||||
|
"startupScreen": "welcome", |
||||||
|
"kiwiServer": "/webirc/kiwiirc/", |
||||||
|
"restricted": true, |
||||||
|
"theme": "dark", |
||||||
|
"themes": [ |
||||||
|
{ "name": "Default", "url": "static/themes/default" }, |
||||||
|
{ "name": "Dark", "url": "static/themes/dark" }, |
||||||
|
{ "name": "Coffee", "url": "static/themes/coffee" }, |
||||||
|
{ "name": "GrayFox", "url": "static/themes/grayfox" }, |
||||||
|
{ "name": "Nightswatch", "url": "static/themes/nightswatch" }, |
||||||
|
{ "name": "Osprey", "url": "static/themes/osprey" }, |
||||||
|
{ "name": "Radioactive", "url": "static/themes/radioactive" }, |
||||||
|
{ "name": "Sky", "url": "static/themes/sky" } |
||||||
|
], |
||||||
|
"startupOptions" : { |
||||||
|
"server": "irc.yourserver.com", |
||||||
|
"port": 6697, |
||||||
|
"tls": true, |
||||||
|
"direct": false, |
||||||
|
"channel": "#general", |
||||||
|
"nick": "kiwiirc-?", |
||||||
|
"greetingText": "Welcome. Happy Hacking!", |
||||||
|
"infoBackground": "", |
||||||
|
"infoContent": "" |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
#!/bin/sh |
||||||
|
|
||||||
|
set -e |
||||||
|
|
||||||
|
cp /bootstrap/kiwiirc.conf /srv/kiwiirc/kiwiirc.conf |
||||||
|
cp /bootstrap/config.json /srv/kiwiirc/www/config.json |
||||||
|
|
||||||
|
/srv/kiwiirc/webircgateway -config /srv/kiwiirc/kiwiirc.conf |
@ -0,0 +1,82 @@ |
|||||||
|
# 1 = Debug; 2 = Info; 3 = Warn; |
||||||
|
logLevel = 2 |
||||||
|
|
||||||
|
# Enable the built in identd server (listens on port 113) |
||||||
|
identd = false |
||||||
|
|
||||||
|
# The name of this gateway as reported in WEBIRC to IRC servers |
||||||
|
gateway_name = "webircgateway" |
||||||
|
|
||||||
|
# A secret string used for generating client JWT tokens. Do not share this! |
||||||
|
secret = "" |
||||||
|
|
||||||
|
[verify] |
||||||
|
recaptcha_secret = "" |
||||||
|
recaptcha_key = "" |
||||||
|
|
||||||
|
[clients] |
||||||
|
# Default username / realname for IRC connections. If disabled it will use |
||||||
|
# the values provided from the IRC client itself. |
||||||
|
# %h will be replaced with the users hostname |
||||||
|
# %i will be replaced with a hexed value of the users IP |
||||||
|
username = "%i" |
||||||
|
realname = "I am a webchat user" |
||||||
|
|
||||||
|
# This hostname value will only be used when using a WEBIRC password |
||||||
|
#hostname = "%h" |
||||||
|
|
||||||
|
# The websocket / http server |
||||||
|
[server.1] |
||||||
|
bind = "0.0.0.0" |
||||||
|
port = 8080 |
||||||
|
#tls = true |
||||||
|
#cert = server.crt |
||||||
|
#key = server.key |
||||||
|
|
||||||
|
# Serve static files from a web root folder. |
||||||
|
# Optional, but handy for serving the Kiwi IRC client if no other webserver is available |
||||||
|
[fileserving] |
||||||
|
enabled = true |
||||||
|
webroot = www/ |
||||||
|
|
||||||
|
[transports] |
||||||
|
websocket |
||||||
|
sockjs |
||||||
|
kiwiirc |
||||||
|
|
||||||
|
# Websites (hostnames) that are allowed to connect here |
||||||
|
# No entries here will allow any website to connect. |
||||||
|
[allowed_origins] |
||||||
|
#*://example.com |
||||||
|
|
||||||
|
# If using a reverse proxy, it must be whitelisted for the client |
||||||
|
# hostnames to be read correctly. In CIDR format. |
||||||
|
# The user IPs are read from the standard X-Forwarded-For HTTP header |
||||||
|
[reverse_proxies] |
||||||
|
127.0.0.0/8 |
||||||
|
10.0.0.0/8 |
||||||
|
172.16.0.0/12 |
||||||
|
192.168.0.0/16 |
||||||
|
"::1/128" |
||||||
|
"fd00::/8" |
||||||
|
|
||||||
|
# Connections will be sent to a random upstream |
||||||
|
[upstream.1] |
||||||
|
hostname = "irc.yourserver.com" |
||||||
|
port = 6697 |
||||||
|
tls = true |
||||||
|
# Connection timeout in seconds |
||||||
|
timeout = 5 |
||||||
|
# Throttle the lines being written by X per second |
||||||
|
throttle = 5 |
||||||
|
# Webirc password as set in the IRC server config |
||||||
|
webirc = "CHANGEME" |
||||||
|
|
||||||
|
# A public gateway to any IRC network |
||||||
|
# If enabled, Kiwi IRC clients may connect to any IRC network (or a whitelisted |
||||||
|
# network below) through the kiwiirc engine |
||||||
|
[gateway] |
||||||
|
enabled = false |
||||||
|
timeout = 5 |
||||||
|
throttle = 2 |
||||||
|
|
@ -0,0 +1,47 @@ |
|||||||
|
diff --git a/src/libs/InputHandler.js b/src/libs/InputHandler.js
|
||||||
|
index 0f18b283..7dd54602 100644
|
||||||
|
--- a/src/libs/InputHandler.js
|
||||||
|
+++ b/src/libs/InputHandler.js
|
||||||
|
@@ -199,31 +199,6 @@ inputCommands.action = function inputCommandMsg(event, command, line) {
|
||||||
|
inputCommands.notice = function inputCommandMsg(event, command, line) {
|
||||||
|
handleMessage.call(this, 'notice', event, command, line);
|
||||||
|
};
|
||||||
|
-inputCommands.dice = function inputCommandDice(event, command, line) {
|
||||||
|
- // /dice 100
|
||||||
|
-
|
||||||
|
- event.handled = true;
|
||||||
|
- let buffer = this.state.getActiveBuffer();
|
||||||
|
- let network = this.state.getActiveNetwork();
|
||||||
|
-
|
||||||
|
- let sides = line.replace(/\D/g, '');
|
||||||
|
- sides = parseInt(sides || '0', 10);
|
||||||
|
- if (sides <= 0) {
|
||||||
|
- sides = 6;
|
||||||
|
- }
|
||||||
|
- let rndNumber = Math.floor(Math.random() * sides) + 1;
|
||||||
|
-
|
||||||
|
- let msg = TextFormatting.t('dice_roll', {
|
||||||
|
- sides: TextFormatting.formatNumber(sides),
|
||||||
|
- number: TextFormatting.formatNumber(rndNumber),
|
||||||
|
- });
|
||||||
|
- network.ircClient.action(buffer.name, msg);
|
||||||
|
- this.state.addMessage(buffer, {
|
||||||
|
- nick: network.nick,
|
||||||
|
- message: msg,
|
||||||
|
- type: 'action',
|
||||||
|
- });
|
||||||
|
-};
|
||||||
|
|
||||||
|
inputCommands.ctcp = function inputCommandCtcp(event, command, line) {
|
||||||
|
event.handled = true;
|
||||||
|
diff --git a/src/res/autocompleteCommands.js b/src/res/autocompleteCommands.js
|
||||||
|
index 64111754..0113af40 100644
|
||||||
|
--- a/src/res/autocompleteCommands.js
|
||||||
|
+++ b/src/res/autocompleteCommands.js
|
||||||
|
@@ -27,5 +27,5 @@ export default [
|
||||||
|
{ command: 'encoding', alias: [], description: 'locale_id_command_encoding' },
|
||||||
|
{ command: 'ignore', alias: [], description: 'locale_id_command_ignore' },
|
||||||
|
{ command: 'unignore', alias: [], description: 'locale_id_command_unignore' },
|
||||||
|
- { command: 'dice', alias: [], description: 'locale_id_command_dice' },
|
||||||
|
+
|
||||||
|
];
|
Loading…
Reference in new issue