Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Title: Throat Install Guide, base Debian Linux 10.4 PostgreSQL
- ###
- ### Assume basic installation of Debian Linux, openssh server installed and setup, a non-root user created and added to /etc/sudoers
- ###
- ## Switch to root and install dependencies
- sudo su -
- apt install -y git redis-server build-essential libmagic-dev libexiv2-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget libffi-dev curl libssl-dev npm libboost-python-dev libcairo2-dev libgirepository1.0-dev libgexiv2-dev libpq-dev
- ## Create user under which throat is installed and switch to it.
- adduser --disabled-password --gecos "" app
- su - app
- ## Setup pyenv
- curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
- echo 'export PATH="/home/app/.pyenv/bin:$PATH"' >> ~/.profile
- echo 'eval "$(pyenv init -)"' >> ~/.profile
- echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.profile
- exit
- ## Database setup
- apt install postgresql postgresql-client
- sudo su - postgres
- psql
- CREATE DATABASE throat;
- CREATE USER throat PASSWORD 'Pass1234';
- GRANT ALL PRIVILEGES ON DATABASE throat TO throat;
- exit
- exit
- ## Start redis and add to startup
- systemctl enable redis-server
- systemctl start redis-server
- ## Switch back to app and install python and set virtualenv
- su - app
- pyenv install 3.7.8
- pyenv virtualenv 3.7.8 app
- ## Download throat, build css, assign dir to aforementioned virtualenv
- git clone https://github.com/Phuks-co/throat.git
- cd throat
- npm install
- npm run build
- pyenv local app
- ## Upgrade pip, get requirements
- pip install --upgrade pip
- pip install -r requirements.txt
- ## Install psycopg2 for Peewee Postgres driver
- pip install psycopg2
- ## Create and modify config
- cp example.config.yaml config.yaml
- nano config.yaml
- ##
- ## Database connection configuration
- ##
- ## Fill out the "database:" section:
- engine: 'PostgresqlDatabase'
- host: 'localhost'
- port: 5432
- user: 'throat'
- password: 'Pass1234'
- name: 'throat'
- autocommit: True
- ## Setup database
- scripts/migrate.py
- ## to be able to access it from outside localhost...
- nano throat.py
- #add ", host='0.0.0.0'" to "socketio.run(app, debug=True)" inside parentheses
- ## to run: ./throat.py
- ## find IP of your machine (ifconfig), visit: http://<ip address>:5000
- ## Create an account for admin, close wsgi, then run:
- scripts/admins.py --add admin
- ## To add created subs to defaults:
- scripts/defaults.py -a subname
Add Comment
Please, Sign In to add comment