autocat3/configuring.txt

105 lines
3.1 KiB
Plaintext
Raw Permalink Normal View History

2019-04-16 20:02:09 +00:00
sudo yum install git
#sudo yum install postgresql-server
#sudo yum install postgresql-contrib
# install py3 (might not be the bast way to do this)
2019-04-16 20:02:09 +00:00
#sudo yum install centos-release-scl
#sudo yum install rh-python36
#scl enable rh-python36 bash
2019-04-16 20:02:09 +00:00
#install pip
sudo yum groupinstall 'Development Tools'
# pip is not on secure_path
sudo /opt/rh/rh-python36/root/usr/bin/pip install --upgrade pip
sudo /opt/rh/rh-python36/root/usr/bin/pip install pipenv
# create autocat user with home directory /var/lib/autocat
sudo useradd -d /var/lib/ autocat
sudo passwd autocat
sudo su - autocat
# create ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub using app key from the gutenbergtools/autocat3 repo
# id_rsa should have permissions 400
2019-04-16 20:02:09 +00:00
mkdir .ssh
install -m 600 .ssh/id_rsa
touch .ssh/id_rsa.pub
#!! from local
# scp [local:]~.ssh/github [autocat@host:]~/.ssh/id_rsa
# scp [local:]~.ssh/github.pub [autocat@host:]~/.ssh/id_rsa.pub
chmod 400 .ssh/id_rsa
# create ~/.pgpass file to store password in format
# [pghost]:*:[pgdatabase]:[pguser]:[password]
chmod 400 .pgpass
2019-04-16 20:02:09 +00:00
#set default python - only needed if pu3 is
2019-04-16 20:02:09 +00:00
scl enable rh-python36 bash
echo 'source scl_source enable rh-python36' >> /var/lib/autocat/.bash_profile
git clone git@github.com:gutenbergtools/autocat3.git
cd autocat3
pipenv --three
git checkout remotes/origin/master
2019-04-16 20:02:09 +00:00
pipenv install
2019-04-24 18:04:48 +00:00
# add local conf file. keep secrets here!
# for production .autocat3 should set values for these parameters:
# pghost, pguser,
2019-04-26 01:58:13 +00:00
# dropbox_client_secret, gdrive_client_secret, msdrive_client_secret,
2019-04-24 18:04:48 +00:00
# log.error_file, log.access_file
2019-04-16 20:02:09 +00:00
#!! from local
2019-04-24 19:04:37 +00:00
# Better to copy conf file from guten2 cause it's up-to-date
2019-04-16 20:18:48 +00:00
# scp [local:]~/autocat3.conf [autocat@host:]~/.autocat3
2019-04-16 20:02:09 +00:00
mkdir /var/lib/autocat/log/
2019-04-16 20:18:48 +00:00
touch /var/lib/autocat/log/error.log
touch /var/lib/autocat/log/access.log
2019-04-16 20:02:09 +00:00
exit
sudo mkdir /var/run/autocat
sudo touch /var/run/autocat/autocat3.pid
2019-04-24 19:04:37 +00:00
# sudo chown autocat /var/run/autocat/autocat3.pid
# Better to set the group name as pgweb for /var/run/autocat
sudo chown -R autocat:pgweb /var/run/autocat
2019-04-16 20:02:09 +00:00
#####
##### To install or update the autocat3 service
#####
2019-04-16 20:02:09 +00:00
sudo systemctl enable /var/lib/autocat/autocat3/autocat3.service
sudo systemctl start autocat3
# If there are problems with `sudo systemctl enable /var/lib/autocat/autocat3/autocat3.service`
# it might be due to monit (the monitoring system) fighting to restart. Or it might be that the
# service is in an uncertain state, not stopped. Try:
sudo service autocat3 stop
sudo systemctl disable autocat3.service
sudo systemctl enable /var/lib/autocat/autocat3/autocat3.service
sudo systemctl restart autocat3.service
sudo systemctl status autocat3.service
# `sudo rm /etc/systemd/system/autocat3.service` is probably not needed. As of July 20 2019,
# we are having problems with monit trying to restart. It might be necessary to also stop
# monit. Further diagnosis is forthcoming.
2019-05-03 18:53:44 +00:00
## updates
su - autocat
2019-05-10 22:21:59 +00:00
# or sudo su - autocat if you can sudo
2019-05-03 18:53:44 +00:00
cd autocat3
git pull
git checkout remotes/origin/master
# for gutenberg2
# git checkout remotes/origin/gutenberg2
pipenv install --ignore-pipfile
sudo systemctl restart autocat3