XZLSHL4DE6B5OEJVXALEYXY5JY2EJYUL2SSUJEGMNX65Y6JRJJUAC
ZKJJVD2HTSIG4PWTVGAI6UQT55SIPE6WMR7RHW4EEFFLJT3XIJLAC
E2KOBKIJ2QMMC77UYNURGCTDGAIIRMBJNG7BMVLSFFPK5RAZ7KFAC
DLZRD7VBR2KY2D4CLOJDHENA47AJ527TFOCNC6EZJLM36ENPX5RQC
PGZJ736CG2E4HXIRYTZTGOMJRX2CHPIFG6H45PPO57EONOWJJ74QC
QO4NFWIYHF45PF7BA4IYGVZZ7CVZDHIV2427MQ6NXWHLIGBHBQCAC
PBD7LZYQHXAA3KLH2ZUX5GW4UFML6BQ32KXZF4KZ6OYFASUYFJ5QC
To start the server, you'll need to create an SSL X509 certificate that's
used for encryption of cookies. We're not currently taking advantage of this,
since there's no browser-based UI, but without it the server will fail to start.
openssl req -x509 -newkey rsa:2048 -keyout conf/key.pem -out conf/cert.pem -days 365 -nodes
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name aftok.com;
ssl_certificate /etc/nginx/aftok.crt;
ssl_certificate_key /etc/nginx/aftok.key;
ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/jenkins.access.log;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Fix the “It appears that your reverse proxy set up is broken" error.
proxy_pass http://localhost:8000;
proxy_read_timeout 90;
proxy_redirect http://localhost:8000 https://aftok.com;
}
}
}
mkdir -p /opt/containers/nginx
docker run --name aftok-nginx -v /opt/containers/nginx:/etc/nginx:ro --net="host" -d nginx
# set up nginx
mkdir -p /opt/containers/aftok-nginx
cp aftok/deploy/nginx.conf /opt/containers/aftok-nginx
openssl req -x509 -newkey rsa:2048 -keyout /opt/containers/aftok-nginx/aftok.key -out /opt/containers/aftok-nginx/aftok.crt -days 365 -nodes
# run nginx under docker
docker run --name aftok-nginx -v /opt/containers/aftok-nginx:/etc/nginx:ro --net="host" -d nginx
curl -v -H "Content-Type: application/json" -d '{"username":"nuttycom", "password":"kjntest", "email":"kris@quixoticcompany.com", "btcAddr":"1KamUn1BaRMd2HwikyQWGTdUvfPScg9QA5"}' http://localhost:8000/register
read -p "Username: " USER
read -s -p "Password: " PASS
echo
read -p "Email: " EMAIL
read -p "BTC Address: " BTC_ADDR
curl -k -v -H 'Content-Type: application/json' -d "{\"username\":\"$USER\", \"password\":\"$PASS\", \"email\":\"$EMAIL\", \"btcAddr\":\"$BTC_ADDR\"}" 'https://localhost/register'