nxy/README.md

30 lines
1.3 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).
2017-08-21 16:17:13 +00:00
* Open shell as user ```nxy```
2017-07-04 13:47:57 +00:00
- ```sudo -u nxy -i```
* 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-08-21 16:17:13 +00:00
* Create virtualenv, activate it and install dependencies
- ```python3 -m venv env```
- ```source env/bin/active```
- ```pip install -r nxy/requirements.txt```
2017-07-04 13:52:35 +00:00
* Create needed tables in the database:
2017-07-07 00:11:20 +00:00
- ```psql -U <your db user> < files/schema.sql```
2017-08-21 16:17:13 +00:00
* Copy ```nxy/files/.env``` and insert values in ```.env``` (replace everything wrapped in < and >)
- ```cp nxy/files/.env .env```
2017-07-04 13:22:20 +00:00
- ```vim .env```
2017-08-21 16:17:13 +00:00
* Copy ```nxy/files/config.json``` and modify it (setup ZNC etc.)
- ```cp nxy/files/config.json config.json```
2017-07-04 13:47:57 +00:00
- ```vim config.json```
2017-07-07 00:11:20 +00:00
* If database is empty, import your database dump:
- ```psql -U nxy -d nxy < /path/to/dump.sql```
2017-08-21 16:17:13 +00:00
* Enable linger for nxy user (so the user unit starts on boot)
- ```sudo loginctl enable-linger nxy```
* Link systemd unit, enable and run it
- ```mkdir -p $HOME/.config/systemd/user```
- ```ln -fs $HOME/nxy/files/nxy-bot.service $HOME/.config/systemd/user```
- ```systemctl --user daemon-reload```
- ```systemctl --user enable --now nxy-bot.service```