Skip to content

Instantly share code, notes, and snippets.

@ItsOnlyBinary
Last active November 10, 2024 15:00
Show Gist options
  • Save ItsOnlyBinary/2889e5fb335caad42b918019e6f29ddf to your computer and use it in GitHub Desktop.
Save ItsOnlyBinary/2889e5fb335caad42b918019e6f29ddf to your computer and use it in GitHub Desktop.
```
# clone repos
git clone https://github.com/kiwiirc/kiwiirc.git ~/kiwiirc/kiwiirc
git clone https://github.com/kiwiirc/webircgateway.git ~/kiwiirc/webircgateway
git clone https://github.com/kiwiirc/plugin-fileuploader.git ~/kiwiirc/fileuploader
# make destination directories
mkdir -p ~/kiwiirc/run/{www,uploads}
# build webircgateway
cd ~/kiwiirc/webircgateway/
go build -o webircgateway main.go
# build fileuploader
cd ~/kiwiirc/fileuploader/
go build -o fileuploader main.go
# copy binaries
cp ~/kiwiirc/webircgateway/webircgateway ~/kiwiirc/run/
cp ~/kiwiirc/fileuploader/fileuploader ~/kiwiirc/run/
chmod +x ~/kiwiirc/run/{webircgateway,fileuploader}
# copy configs
cp ~/kiwiirc/webircgateway/config.conf.example ~/kiwiirc/run/config.conf
cp ~/kiwiirc/fileuploader/fileuploader.config.example.toml ~/kiwiirc/run/fileuploader.config.toml
# build kiwiirc and copy files
cd ~/kiwiirc/kiwiirc
yarn; yarn build
cp -r ~/kiwiirc/kiwiirc/dist/* ~/kiwiirc/run/www/
mv ~/kiwiirc/run/www/static/config.json ~/kiwiirc/run/client.json
ln -s ~/kiwiirc/run/client.json ~/kiwiirc/run/www/static/config.json
# build fileuploader client plugin and copy
cd ~/kiwiirc/fileuploader/fileuploader-kiwiirc-plugin
yarn; yarn build
cp -r ~/kiwiirc/fileuploader/fileuploader-kiwiirc-plugin/dist/* ~/kiwiirc/run/www/static/plugins/
cd ~/kiwiirc/run/
```
# ~/kiwiirc/run/client.json edits
#
# ------------------------------------------------------------------------------------------------
#
# "kiwiServer": "https://localdev.clients.kiwiirc.com/webirc/kiwiirc/",
#
# to
#
# "kiwiServer": "/webirc/kiwiirc/",
#
# ------------------------------------------------------------------------------------------------
#
# "plugins": [
# { "name": "customise", "url": "static/plugins/customise.html" }
# ]
#
# to
#
# "plugins": [
# { "name": "customise", "url": "static/plugins/customise.html" },
# { "name": "fileuploader", "url": "static/plugins/plugin-fileuploader.js" }
# ],
# "fileuploader": {
# "server": "/files/",
# "maxFileSize": 10485760,
# "note": "Add an optional note to the upload dialog"
# }
#
# ------------------------------------------------------------------------------------------------
# ~/kiwiirc/run/config.conf edits
#
# ------------------------------------------------------------------------------------------------
#
# [server.1]
# bind = "0.0.0.0"
# port = 80
#
# to
#
# [server.1]
# bind = "127.0.0.1"
# port = 7778
#
# ------------------------------------------------------------------------------------------------
#
# [fileserving]
# enabled = false
# webroot = www/
#
# to
#
# [fileserving]
# enabled = true
# webroot = www/
#
# ------------------------------------------------------------------------------------------------
# also dont forget to edit [upstream.1] to your ircd details
# /etc/systemd/system/kiwiirc-webircgateway.service
```
[Unit]
Description=Kiwi IRC webircgateway
After=network.target
[Service]
User=kiwiirc
Group=kiwiirc
ExecStart=/home/kiwiirc/run/webircgateway --config=/home/kiwiirc/run/config.conf
ExecReload=/bin/kill -HUP $MAINPID
WorkingDirectory=/home/kiwiirc/
KillMode=process
Restart=always
[Install]
WantedBy=multi-user.target
```
# /etc/systemd/system/kiwiirc-fileuploader.service
```
[Unit]
Description=Kiwi IRC fileuploader
After=network.target
[Service]
User=kiwiirc
Group=kiwiirc
ExecStart=/home/kiwiirc/run/fileuploader --config=/home/kiwiirc/run/fileuploader.config.toml
ExecReload=/bin/kill -HUP $MAINPID
WorkingDirectory=/home/kiwiirc/
KillMode=process
Restart=always
[Install]
WantedBy=multi-user.target
```
# example nginx config https://gist.github.com/ItsOnlyBinary/ae8d41c4542e66bb259b0f1b312c7d29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment