Skip to main content

Configuration

A ListThingy server works without any settings. Change them when you put the server behind a proxy, move it to another port or limit which websites may call its API.

Settings file​

Put settings in a file named .env next to docker-compose.yml. Docker Compose reads it when the stack starts. Every setting is optional.

PORT=8080
CORS_ALLOW_ORIGIN=https://lists.example.com
SettingDefaultWhat it does
PORT80The port on the host that serves the web app and the API.
CORS_ALLOW_ORIGIN*Which web origins may call the API from a browser. * allows all of them.
CORS_ALLOW_METHODSGET, POST, PUT, PATCH, DELETE, OPTIONSHTTP methods that browsers may use. Leave it alone.
CORS_ALLOW_HEADERSContent-Type, X-List-KeyRequest headers that browsers may send. Leave it alone.
TRUSTED_PROXIESemptyAddresses or ranges of the proxies in front of ListThingy, separated by commas. See Trust your proxy.
ERROR_REPORTINGfalseSet to true to show PHP errors in responses. Use it only while debugging.

Restart the stack after you change a setting:

docker compose up -d

Trust your proxy​

ListThingy blocks addresses that guess wrong PINs, so it must know each visitor's real address. Behind a proxy, every request seems to come from the proxy. TRUSTED_PROXIES fixes that. When a request comes from an address in that list, ListThingy reads the visitor's address from the X-Forwarded-For header instead.

A proxy on the same machine reaches ListThingy through Docker's network, which 172.16.0.0/12 covers. For a proxy on another machine, list that machine's address.

Leave TRUSTED_PROXIES empty when nothing sits in front of ListThingy. A wrong value lets anyone fake an address and dodge the blocks.