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).
- 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 example config files, replacing placeholders with your real values. Required config files:
config.jsonweb/config.jsongreenlock.d/config.json.env
-
Database: Run
yarn db:generateto initialize Prisma. -
SSL Certificates: Use
yarn generate:sslto generate certificates with greenlock-express. This starts the server on ports 80/443 and terminates automatically after certificate renewal or a 40-second timeout. -
Build: Run
yarn buildto compile the server and client. -
Reverse Proxy: Configure nginx or similar to proxy to
http://localhost:3000(default port), using the generated SSL certificates.
Run yarn start after building. 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;
server_name 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 / {
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;
}
}