Massive refactoring/-structuring

This commit is contained in:
mrhanky
2017-07-07 02:11:20 +02:00
parent a82175a44b
commit 59b67d9570
41 changed files with 202 additions and 1011 deletions

View File

@@ -10,19 +10,19 @@
* Create virtualenv and install dependencies
- ```mkvirtualenv -a $PWD -r $PWD/requirements.txt nxy```
* Create needed tables in the database:
- ```psql -U <your db user> < schema.sql```
* Copy ```.env-example``` and insert values in ```.env``` (replace everything wrapped in < and >)
- ```cp .env-example .env```
- ```psql -U <your db user> < files/schema.sql```
* Copy ```files/.env``` and insert values in ```.env``` (replace everything wrapped in < and >)
- ```cp files/.env .env```
- ```vim .env```
* Copy ```config.json``` and modify it (setup ZNC etc.)
- ```cp config.json-example config.json```
* Copy ```files/config.json``` and modify it (setup ZNC etc.)
- ```cp files/config.json config.json```
- ```vim config.json```
* If database is empty, run the migrate script to populate the database with old nxy data:
- ```python bot/migrate.py```
* If database is empty, import your database dump:
- ```psql -U nxy -d nxy < /path/to/dump.sql```
* 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 /home/nxy/nxy/nxy-bot.service /usr/local/lib/systemd/system```
- ```sudo ln -fs /home/nxy/bot/files/nxy-bot.service /usr/local/lib/systemd/system```
- ```sudo systemctl daemon-reload```
- ```sudo systemctl enable --now nxy-bot.service```