Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Title: Throat Install Guide, base Alpine Linux 3.10 MariaDB
- ###
- ### Assume basic installation of Alpine Linux, openssh server installed and setup, a non-root user created and added to /etc/sudoers, bash installed
- ###
- ## Switch to root and install dependencies
- sudo su -
- apk add --no-cache git bash build-base libffi-dev openssl-dev bzip2-dev zlib-dev readline-dev sqlite-dev curl bash bash-doc bash-completion redis npm jpeg-dev exiv2-dev boost-dev libxml2-dev libxslt-dev freetype-dev
- ## This is needed for the pip stage later on
- ln -s /usr/lib/libboost_python37.so /usr/lib/libboost_python3.so
- ## Create user under which throat is installed and switch to it.
- adduser --disabled-password --gecos "" -s /bin/bash 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
- apk add --no-cache mariadb mariadb-client mariadb-connector-c-dev
- mysql_install_db --user=mysql --datadir=/var/lib/mysql
- rc-service mariadb start
- mysqladmin -u root password "Pass1234"
- rc-update add mariadb default
- 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
- rc-service redis start
- rc-update add redis default
- ## 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
- ## Create and modify config
- cp example.config.py config.py
- nano config.py
- ##
- ## Database connection configuration
- ##
- DATABASE = {
- 'host': 'localhost',
- 'name': 'throat',
- 'engine': 'MySQLDatabase',
- '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