Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Title: Throat Install Guide, base Debian Linux 10.0 MariaDB
- ###
- ### 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 python3 python3-pip libmagic-dev libexiv2-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget libffi-dev libboost-python-dev arcanist curl libssl-dev mariadb-server mariadb-client default-libmysqlclient-dev npm
- ## This is needed for the pip stage later on
- ln -s /usr/lib/x86_64-linux-gnu/libboost_python37.so /usr/lib/x86_64-linux-gnu/libboost_python36.so
- ## 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
- mysql_install_db --user=mysql --datadir=/var/lib/mysql
- systemctl mariadb start
- mysqladmin -u root password "Pass1234"
- Systemctl enable mariadb
- mysql -u root -p
- CREATE DATABASE throat;
- CREATE USER 'throat'@localhost IDENTIFIED BY 'Pass1234';
- GRANT ALL PRIVILEGES ON throat.* TO 'throat'@localhost;
- 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.6.8
- pyenv virtualenv 3.6.8 app
- ## Download throat, build css, assign dir to aforementioned virtualenv
- git clone https://phab.phuks.co/source/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
- pip uninstall werkzeug
- pip install werkzeug==0.16.0
- ## Create and modify config
- cp example.config.yaml config.yaml
- nano config.yaml
- ##
- ## Database connection configuration
- ##
- ## Comment out DATABASE_URL and add in the following:
- DATABASE = {
- 'host': 'localhost',
- 'name': 'throat',
- 'engine': 'MySQLDatabase',
- 'charset': 'utf8mb4',
- 'user': 'throat',
- 'password': 'Pass1234',
- }
- ## Setup database
- scripts/migrate.py
- ## to be able to access it from outside localhost...
- nano wsgi.py
- #add ", host='0.0.0.0'" to "socketio.run(app, debug=True)" inside parentheses
- ## to run: ./wsgi.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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement