Environment Variables
Supported environment variables are defined in config/parse.go.
Their defaults are derived from options defined in config/options.go.
| Variable |
Default |
BASE_URL |
"http://localhost:8080" |
DATABASE_URL |
"./selfster.db" |
NO_MIGRATE |
"false" |
LISTEN_ADDR |
"127.0.0.1:8080" |
SMTP_URL |
"127.0.0.1:1025" |
SMTP_USER |
"" |
SMTP_PASS |
"" |
SMTP_FROM |
"" |
REVERSE_PROXY_HTTPS |
"false" |
To override a default, export it to the shell environment or define it inline (e.g., using env)
# Change port to 8888
$ env LISTEN_ADDR='127.0.0.1:8888' BASE_URL='http://localhost:8888' mage -v run
# Change listen address to allow remote connections by hostname
$ PORT=8080
$ export LISTEN_ADDR="$(ip route | awk 'BEGIN{ src=9 } /^default/{ print $src }'):${PORT}"
$ export BASE_URL="http://$(hostname -f):8080"
$ mage -v run