Skip to content
This repository was archived by the owner on Feb 24, 2019. It is now read-only.

DynamicGravitySystems/dgs-web-backend

Repository files navigation

DgSAPI

This repository constitutes the backend API services for DgS's public website.

Currently this consists simply of an email send utility, which permits users to send an email to us via a web form, after completing a CAPTCHA challenge.


Environment Variables

Environment Variables used to control specific api functionality/authorization.

  • NODE_PORT - Port to run node app listener on [optional, default: 8080]
  • AWS_SES_SENDER - Email address used to send emails generated by web-form [optional, default: info@dynamicgravitysystems.com]
  • AWS_SES_RECVR - Email address to send generated emails to [optional, default: info@dynamicgravitysystems.com]
  • AWS_SES_REGION - AWS SES Region to use for email sending [optional, default: us-west-2]
  • CAPTCHA_SITE_KEY - reCAPTCHA Site key used for Google reCAPTCHA verification requests.
  • API_CORS_ORIGIN - CORS Allowed Origin

Example NGINX Config

upstream sendmail {
    server localhost:8080;
}

server {

    listen 443 ssl;
    # Do ssl configuration here
    # Or let certbot generate it
    
    server_name api.dynamicgravitysystems.com;
    
    location /sendmail {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_pass http://sendmail;
    }
}

Add the above configuration to an existing server block, or new config file in /etc/nginx/sites-available then add a symlink (ln -s /etc/nginx/sites-available/{config-file} /etc/nginx/sites-enabled/) as necessary. Note: On RHEL/CentOS the NGINX directories are different, typically there is just a /etc/nginx/conf.d directory which holds all enabled configurations.

After updating NGINX config execute the following to test and reload:

nginx -t
sudo nginx -s reload

About

Backend services for DgS public website.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published