Updated install instructions
This commit is contained in:
parent
b9ed0a9b3b
commit
ee46c007c5
31
README.md
31
README.md
|
@ -1,28 +1,29 @@
|
||||||
# Installation
|
# Installation
|
||||||
* Open shell as user nxy will run. These instructions will use ```nxy``` as user and ```/home/nxy``` as its home directory.
|
* 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).
|
* Install virtualenvwrapper (ideally system wide).
|
||||||
* Open shell as user ```nxy```, source virtualenvwrappers script
|
* Open shell as user ```nxy```
|
||||||
- ```sudo -u nxy -i```
|
- ```sudo -u nxy -i```
|
||||||
- ```source $(which virtualenvwrapper.sh)```
|
|
||||||
* Clone repo and change current dir
|
* Clone repo and change current dir
|
||||||
- ```git clone https://gitfap.de/mrhanky/nxy.git```
|
- ```git clone https://gitfap.de/mrhanky/nxy.git```
|
||||||
- ```cd nxy```
|
- ```cd nxy```
|
||||||
* Create virtualenv and install dependencies
|
* Create virtualenv, activate it and install dependencies
|
||||||
- ```mkvirtualenv -a $PWD -r $PWD/requirements.txt nxy```
|
- ```python3 -m venv env```
|
||||||
|
- ```source env/bin/active```
|
||||||
|
- ```pip install -r nxy/requirements.txt```
|
||||||
* Create needed tables in the database:
|
* Create needed tables in the database:
|
||||||
- ```psql -U <your db user> < files/schema.sql```
|
- ```psql -U <your db user> < files/schema.sql```
|
||||||
* Copy ```files/.env``` and insert values in ```.env``` (replace everything wrapped in < and >)
|
* Copy ```nxy/files/.env``` and insert values in ```.env``` (replace everything wrapped in < and >)
|
||||||
- ```cp files/.env .env```
|
- ```cp nxy/files/.env .env```
|
||||||
- ```vim .env```
|
- ```vim .env```
|
||||||
* Copy ```files/config.json``` and modify it (setup ZNC etc.)
|
* Copy ```nxy/files/config.json``` and modify it (setup ZNC etc.)
|
||||||
- ```cp files/config.json config.json```
|
- ```cp nxy/files/config.json config.json```
|
||||||
- ```vim config.json```
|
- ```vim config.json```
|
||||||
* If database is empty, import your database dump:
|
* If database is empty, import your database dump:
|
||||||
- ```psql -U nxy -d nxy < /path/to/dump.sql```
|
- ```psql -U nxy -d nxy < /path/to/dump.sql```
|
||||||
* Leave (auto) activated virtualenv and exit the bot's shell
|
* Enable linger for nxy user (so the user unit starts on boot)
|
||||||
- ```deactivate && exit```
|
- ```sudo loginctl enable-linger nxy```
|
||||||
* 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!
|
* Link systemd unit, enable and run it
|
||||||
- ```sudo mkdir -p /usr/local/lib/systemd/system```
|
- ```mkdir -p $HOME/.config/systemd/user```
|
||||||
- ```sudo ln -fs /home/nxy/bot/files/nxy-bot.service /usr/local/lib/systemd/system```
|
- ```ln -fs $HOME/nxy/files/nxy-bot.service $HOME/.config/systemd/user```
|
||||||
- ```sudo systemctl daemon-reload```
|
- ```systemctl --user daemon-reload```
|
||||||
- ```sudo systemctl enable --now nxy-bot.service```
|
- ```systemctl --user enable --now nxy-bot.service```
|
||||||
|
|
|
@ -6,7 +6,7 @@ After=network.target
|
||||||
Type=simple
|
Type=simple
|
||||||
Restart=always
|
Restart=always
|
||||||
Environment=PYTHONPATH=%h/nxy
|
Environment=PYTHONPATH=%h/nxy
|
||||||
WorkingDirectory=/home/nxy/nxy
|
WorkingDirectory=/home/nxy
|
||||||
ExecStart=/home/nxy/env/bin/python -m bot config.json
|
ExecStart=/home/nxy/env/bin/python -m bot config.json
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user