A security camera application.
- Configure files: Copy
config.example.json,web/config.example.json,greenlock.d/config.example.json, and.env.exampleto their respective.jsonand.envfiles, replacing placeholders. - Run
yarn db:generateto set up the database. - Generate SSL certificates:
yarn generate:ssl. - Build and start:
yarn build && yarn start. - Access via your reverse-proxy (see nginx config)
- Serve the SSL certificates from
greenlock.d/live/YourWebsite.com/
- Serve the SSL certificates from
- Node.js v20+ (install via
nvm, enable yarn withcorepack). Latest tested: v25.2.1 - ffmpeg v7+ (tested with v7.1.2)
- A reverse proxy like nginx to handle HTTPS (see configuration)
- Configuration Files: Rename the following example configuration files, replacing placeholders with your real values:
.envconfig.jsonweb/config.jsongreenlock.d/config.json(if you don't have SSL certificates already)
-
Database: Run
yarn db:generateto initialize the database manager. -
SSL Certificates: Use
yarn generate:sslto generate SSL (HTTPS) certificates after editinggreenlock.d/config.jsonwith greenlock-express.- This starts an ACME authentication server on ports 80/443 and terminates automatically after certificate renewal or a 40-second timeout.
- If you wish, you can instead use your own SSL certificates with your reverse-proxy (nginx) by pointing nginx to wherever those are located on your system.
-
Build: Run
yarn buildto compile the server and client. -
Reverse Proxy: Configure nginx or a similar reverse-proxy to proxy to
http://localhost:3000(port 3000 is Gander's default), using the SSL certificates generated ingreenlock.d/live/(or your own).
Run yarn build and then yarn start. Ensure ports 80 and 443 are available for the reverse proxy. Access your site through the proxy.
# Gander HTTPS server configuration
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
# Change example.tld to your website's address (like example.com)
server_name example.tld;
# CHANGE these paths to include YOUR website's domain, NOT "example.tld"
ssl_certificate /path/to/gander/greenlock.d/live/example.tld/fullchain.pem;
ssl_certificate_key /path/to/gander/greenlock.d/live/example.tld/privkey.pem;
ssl_trusted_certificate /path/to/gander/greenlock.d/live/example.tld/fullchain.pem;
add_header Strict-Transport-Security "max-age=31536000;";
location / {
# You may have changed the port from the default of 3000 in config.json
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
# If you use Cloudflare proxying, replace $remote_addr with $http_cf_connecting_ip
# See https://developers.cloudflare.com/support/troubleshooting/restoring-visitor-ips/restoring-original-visitor-ips/#nginx-1
# alternatively use ngx_http_realip_module
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}