2017-07-04 13:22:20 +00:00
|
|
|
# Installation
|
2017-08-22 17:09:15 +00:00
|
|
|
* Setup pgsql, create user and database, create schema (last step only if you have a dump):
|
|
|
|
- ```psql -U postgres```
|
|
|
|
- ```CREATE ROLE nxy WITH ENCRYPTED PASSWORD 'your-password';```
|
|
|
|
- ```ALTER ROLE nxy LOGIN;```
|
|
|
|
- ```CREATE DATABASE nxy_prod OWNER nxy;```
|
|
|
|
- ```\q```
|
|
|
|
- ```psql -U nxy -U nxy_prod < nxy/files/schema.sql```
|
|
|
|
- ```psql -U nxy -d nxy_prod < path/to/dump.sql```
|
|
|
|
* Clone repo
|
2017-07-04 13:22:20 +00:00
|
|
|
- ```git clone https://gitfap.de/mrhanky/nxy.git```
|
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-08-22 17:09:15 +00:00
|
|
|
* Copy ```nxy/files/config.json``` and ```nxy/files/config.json``` and modify them
|
|
|
|
- ```cp nxy/files/{.env,config.json} .```
|
|
|
|
- ```vim .env config.json```
|
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```
|