Update nginx.conf, make aftok host configurable for cli scripts.

[?]
Jun 5, 2020, 5:21 AM
NSRSSSTRMJPPUYQANYDWGI5D3NVM6RQEVZCDUUNQAOL3OWQTD27AC

Dependencies

  • [2] LLKTCDRD Minor reorg of aftok.com paths.
  • [3] GMYPBCWE Make docker-compose work.
  • [4] PBD7LZYQ Postgres & auth are beginning to function.
  • [5] CDHZL3RP Add a couple of other CLI utilities for interacing with the service.
  • [6] E7GQXOID Allow the use of a local .env file to store username/project ID for UI scripts.
  • [7] SPJCFHXW Update shell scripts to point to https://aftok.com and prompt for input.
  • [8] VRMUVBP6 Make log script work on OSX.
  • [9] 3MERL4JA Fix incorrect variable in invitation script.
  • [10] XZLSHL4D The server is now (tenuously) running, and serving pages via SSL!
  • [11] UOG5H2TW Default work logging credit to logged-in user.
  • [*] G4BS4NND Add simple shell script demonstrating how to invite a companion.
  • [*] 2G3GNDDU Event logging is now functioning in postgres.

Change contents

  • replacement in deploy/nginx/nginx.conf at line 21
    [4.400][4.400:457]()
    listen 80;
    return 301 https://$host$request_uri;
    [4.400]
    [4.457]
    listen 80 default_server;
    location / {
    root /opt/static;
    index index.html;
    }
  • replacement in deploy/nginx/nginx.conf at line 30
    [4.473][3.1750:1770]()
    listen 443 ssl;
    [4.473]
    [4.489]
    listen 443 ssl default_server;
  • edit in deploy/nginx/nginx.conf at line 39
    [3.1944]
    [4.837]
    ssl_prefer_server_ciphers on;
  • replacement in deploy/nginx/nginx.conf at line 41
    [4.838][4.838:899]()
    access_log /var/log/nginx/jenkins.access.log;
    [4.838]
    [4.899]
    access_log /var/log/nginx/access.log;
  • edit in deploy/nginx/nginx.conf at line 44
    [4.917]
    [4.917]
    root /opt/static;
    index index.html;
    }
    location /api/ {
  • replacement in deploy/nginx/nginx.conf at line 55
    [4.1224][3.1945:1996]()
    proxy_pass http://aftok-server;
    [4.1224]
    [3.1996]
    proxy_pass http://aftok-server/;
  • replacement in deploy/nginx/nginx.conf at line 58
    [4.1304][3.2031:2100]()
    proxy_redirect http://aftok-server https://aftok.com;
    [4.1304]
    [4.1371]
    proxy_redirect http://aftok-server https://$host:$server_port/;
  • edit in docker-compose.yml at line 48
    [3.24689]
    [3.24689]
    - type: bind
    source: ${PWD}/local/db-dumps
    target: /opt/
  • edit in scripts/create_project.sh at line 5
    [4.47]
    [4.47]
    fi
    if [ -z "${AFTOK_HOST}" ]; then
    AFTOK_HOST="aftok.com"
  • replacement in scripts/create_project.sh at line 38
    [4.465][2.2:37]()
    'https://aftok.com/api/projects'
    [4.465]
    [4.1379]
    "https://$AFTOK_HOST/api/projects"
  • edit in scripts/create_user.sh at line 2
    [4.1437]
    [4.1437]
    if [ -f ".env" ]; then
    source .env
    fi
    if [ -z "${AFTOK_HOST}" ]; then
    AFTOK_HOST="aftok.com"
    fi
  • replacement in scripts/create_user.sh at line 20
    [4.618][2.39:74]()
    'https://aftok.com/api/register'
    [4.618]
    [4.1648]
    "https://$AFTOK_HOST/api/register"
  • edit in scripts/invite.sh at line 5
    [4.505]
    [4.505]
    fi
    if [ -z "${AFTOK_HOST}" ]; then
    AFTOK_HOST="aftok.com"
  • replacement in scripts/invite.sh at line 27
    [4.18][2.76:136]()
    "https://aftok.com/api/projects/$PID/invite?email=$EMAIL"
    [4.18]
    "https://$AFTOK_HOST/api/projects/$PID/invite?email=$EMAIL"
  • edit in scripts/list_projects.sh at line 5
    [4.706]
    [4.706]
    fi
    if [ -z "${AFTOK_HOST}" ]; then
    AFTOK_HOST="aftok.com"
  • replacement in scripts/list_projects.sh at line 17
    [4.862][4.862:880](),[4.880][2.138:173]()
    --request GET \
    "https://aftok.com/api/projects"
    [4.862]
    "https://$AFTOK_HOST/api/projects"
  • edit in scripts/log.sh at line 5
    [4.814]
    [4.814]
    fi
    if [ -z "${AFTOK_HOST}" ]; then
    AFTOK_HOST="aftok.com"
  • replacement in scripts/log.sh at line 29
    [4.972][2.221:287]()
    "https://aftok.com/api/projects/$PID/logEntries?after=${after}"
    [4.972]
    "https://$AFTOK_HOST/api/projects/$PID/logEntries?after=${after}"
  • edit in scripts/log_end.sh at line 5
    [4.989]
    [4.989]
    fi
    if [ -z "${AFTOK_HOST}" ]; then
    AFTOK_HOST="aftok.com"
  • replacement in scripts/log_end.sh at line 24
    [4.1202][2.289:337]()
    "https://aftok.com/api/projects/$PID/logEnd"
    [4.1202]
    "https://$AFTOK_HOST/api/projects/$PID/logEnd"
  • edit in scripts/log_start.sh at line 5
    [4.1164]
    [4.1164]
    fi
    if [ -z "${AFTOK_HOST}" ]; then
    AFTOK_HOST="aftok.com"
  • replacement in scripts/log_start.sh at line 24
    [4.1376][2.339:388]()
    "https://aftok.com/api/projects/$PID/logStart"
    [4.1376]
    "https://$AFTOK_HOST/api/projects/$PID/logStart"