Updated README and systemd unit
This commit is contained in:
parent
928ad44db4
commit
b8330ae377
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.env
|
||||
config.json
|
||||
.idea/
|
||||
__pycache__/
|
||||
|
24
README.md
24
README.md
@ -1,16 +1,24 @@
|
||||
# Installation
|
||||
* Open shell as user nxy will run
|
||||
* Install virtualenvwrapper and source it
|
||||
* Open shell as user nxy will run. These instructions will use ```nxy``` as user and ```/home/nxy``` as its home directory.
|
||||
* Install virtualenvwrapper (ideally system wide).
|
||||
* Open shell as user ```nxy```, source virtualenvwrappers script
|
||||
- ```sudo -u nxy -i```
|
||||
- ```source $(which virtualenvwrapper.sh)```
|
||||
* Clone repo
|
||||
* Clone repo and change current dir
|
||||
- ```git clone https://gitfap.de/mrhanky/nxy.git```
|
||||
- ```cd nxy```
|
||||
* Create virtualenv and install dependencies
|
||||
- ```mkvirtualenv -a $PWD/nxy -r $PWD/nxy/requirements.txt nxy```
|
||||
- ```mkvirtualenv -a $PWD -r $PWD/requirements.txt nxy```
|
||||
* Copy ```.env-example``` and insert values in ```.env``` (replace everything wrapped in < and >)
|
||||
- ```cp .env-example .env```
|
||||
- ```vim .env```
|
||||
* Leave (auto) activated virtualenv and
|
||||
- ```deactivate```
|
||||
* Copy systemd unit (would recommend the ```/usr/local``` prefix)
|
||||
* Copy ```config.json``` and modify it (setup ZNC etc.)
|
||||
- ```cp config.json-example config.json```
|
||||
- ```vim config.json```
|
||||
* Leave (auto) activated virtualenv and exit the bot's shell
|
||||
- ```deactivate && exit```
|
||||
* Copy systemd unit and enable it (would recommend the ```/usr/local``` prefix). Don't forget to modify the systemd unit if your user and home directory are different!
|
||||
- ```sudo mkdir -p /usr/local/lib/systemd/system```
|
||||
- ```sudo cp $PWD/nxy/nxy-bot.service /usr/local/lib/systemd/system```
|
||||
- ```sudo cp /home/nxy/nxy/nxy-bot.service /usr/local/lib/systemd/system```
|
||||
- ```sudo systemctl daemon-reload```
|
||||
- ```sudo systemctl enable --now nxy-bot.service```
|
||||
|
@ -1,10 +1,9 @@
|
||||
{
|
||||
"username": "nxy",
|
||||
"host": "unterschicht.tv",
|
||||
"port": 56791,
|
||||
"host": "znc.host",
|
||||
"port": 1337,
|
||||
"ssl": true,
|
||||
"raw": true,
|
||||
"autojoins": ["#w0bm", "#f0ck"],
|
||||
"autojoins": ["#nxy-dev"],
|
||||
"flood_burst": 1,
|
||||
"flood_rate": 4,
|
||||
"flood_rate_delay": 1,
|
@ -5,8 +5,9 @@ After=network.target znc.service
|
||||
[Service]
|
||||
Type=simple
|
||||
User=nxy
|
||||
WorkingDirectory=$BOTDIR
|
||||
ExecStart=$VIRTUALENV/bin/python $BOTDIR/nxy/bot.py
|
||||
Environment=PYTHONPATH=/home/nxy/nxy
|
||||
WorkingDirectory=/home/nxy/nxy
|
||||
ExecStart=/home/nxy/.virtualenvs/nxy/bin/python nxy/bot.py config.json
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
Loading…
Reference in New Issue
Block a user