Deployment Instructions - Pull-Request-Club/PRC GitHub Wiki
Ubuntu 20.04
Install some dependencies.
apt update && apt upgrade -y
apt install -y certbot gcc libssl-dev libz-dev make memcached nginx sqlite3
curl -L http://cpanmin.us | perl - App::cpanminus
cpanm Carton Starman App::Sqitch DBD::SQLite
Set up nginx.
regx="perl -i -pe"
nconf=/etc/nginx/sites-available/default
cp $nconf "$nconf.backup"
chmod a-w "$nconf.backup"
$regx 's/(\tserver_name) _/$1 pullrequest.club www.pullrequest.club/' $nconf
$regx 's{try_files \$uri \$uri/ =404}{include fastcgi_params; fastcgi_pass unix:/tmp/prc.socket}g' $nconf
systemctl reload nginx
Set up firewall.
ufw allow 'OpenSSH'
ufw allow 'Nginx Full'
ufw enable
For following to work, you need A
DNS record pointing to your machine.
From your local client, do this to confirm:
dig pullrequest.club +nostats +nocomments +nocmd
Get your SSL certificate for HTTPS. Redirect 80 to 443 when asked.
apt install python3-certbot-nginx
certbot --nginx -d pullrequest.club -d www.pullrequest.club
Get the repository.
git clone https://github.com/kyzn/PRC.git && cd PRC
Start a new DB.
cd sqitch
sqitch deploy db:sqlite:prc.db
cd ..
More dependencies
carton install
service memcached start
Run:
cd /root/PRC && CLIENT_ID=... CLIENT_SECRET=... carton exec script/prc_fastcgi.pl -l /tmp/prc.socket -n 5 -p /tmp/prc.pid -d
Or run with secrets.yml:
cd /root/PRC && carton exec script/prc_fastcgi.pl -l /tmp/prc.socket -n 5 -p /tmp/prc.pid -d