nxy/README.md

29 lines
1.5 KiB
Markdown
Raw Normal View History

2017-07-04 13:22:20 +00:00
# Installation
2017-07-04 13:47:57 +00:00
* 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```
2017-07-04 13:22:20 +00:00
- ```source $(which virtualenvwrapper.sh)```
2017-07-04 13:47:57 +00:00
* Clone repo and change current dir
2017-07-04 13:22:20 +00:00
- ```git clone https://gitfap.de/mrhanky/nxy.git```
2017-07-04 13:47:57 +00:00
- ```cd nxy```
2017-07-04 13:22:20 +00:00
* Create virtualenv and install dependencies
2017-07-04 13:47:57 +00:00
- ```mkvirtualenv -a $PWD -r $PWD/requirements.txt nxy```
2017-07-04 13:52:35 +00:00
* Create needed tables in the database:
- ```psql -U <your db user> < schema.sql```
2017-07-04 13:22:20 +00:00
* Copy ```.env-example``` and insert values in ```.env``` (replace everything wrapped in < and >)
- ```cp .env-example .env```
- ```vim .env```
2017-07-04 13:47:57 +00:00
* Copy ```config.json``` and modify it (setup ZNC etc.)
- ```cp config.json-example config.json```
- ```vim config.json```
2017-07-04 14:13:43 +00:00
* If database is empty, run the migrate script to populate the database with old nxy data:
- ```python bot/migrate.py```
2017-07-04 13:47:57 +00:00
* 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!
2017-07-04 13:22:20 +00:00
- ```sudo mkdir -p /usr/local/lib/systemd/system```
2017-07-04 13:47:57 +00:00
- ```sudo cp /home/nxy/nxy/nxy-bot.service /usr/local/lib/systemd/system```
- ```sudo systemctl daemon-reload```
- ```sudo systemctl enable --now nxy-bot.service```