nxy/README.md
2017-07-04 16:13:43 +02:00

1.5 KiB

Installation

  • 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
    • source $(which virtualenvwrapper.sh)
  • Clone repo and change current dir
    • git clone https://gitfap.de/mrhanky/nxy.git
    • cd nxy
  • 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
    • vim .env
  • Copy config.json and modify it (setup ZNC etc.)
    • cp config.json-example 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
  • 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 systemctl daemon-reload
    • sudo systemctl enable --now nxy-bot.service