02e8cb264f
This diff adds the detect_base_url config, controlled by the DETECT_BASE_URL env variable. When set to true, the BASE_URL setting is ignored, and the base_url is derived from the request protocol and host header. Test Plan: Started up a local instance in my homelab, running docker node:15 image with a nginx reverse proxy. Configured nginx to use the same backend with multiple hostnames on https. Opened in browser and confirmed og:url meta tag uses correct url. |
||
---|---|---|
.. | ||
bin | ||
middleware | ||
routes | ||
storage | ||
clientConstants.js | ||
config.js | ||
fxa.js | ||
initScript.js | ||
layout.js | ||
limiter.js | ||
locale.js | ||
log.js | ||
metadata.js | ||
readme.md | ||
state.js |
readme.md
Server Code
The server provides the API, serves static assets, and renders the pages for Send. The production entrypoint is prod.js and the development entrypoint is dev.js via webpack-dev-server
.
Server configuration
config.js contains the schema for our configuration options. Environment variables are the preferred method for setting configuration.
Middleware
Contains authentication and localization middleware.
Routes
Contains all the server routes and handlers for the API and pages
Storage
Contains implementations of possible storage engines for the files and metadata