Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Conversation

@pano9000
Copy link
Contributor

@pano9000 pano9000 commented Jan 23, 2025

Hi,

this PR is a continuation of @perfectra1n's PR #1031

It allows users to set the currently defined values via env variables (new!), config.ini (as before) or use fallback values (semi-new!).

The order is:
ENV > config.ini > fallback values

as @perfectra1n mentioned in the matrix Development channel, there still are a couple of env vars, scattered around, that are currently not part of this config file.
Let's split that out into a separate task though – this PR only concentrates on the ones that can be mapped to values in the config.ini file

Also some additional clean up will be necessary, e.g. in port.ts, but will split that out to separate task as well.

big thanks to @perfectra1n for letting me take over here!

edit:

once this PR is merged, TriliumNext/Docs#125 can be adjusted slightly and then merged as well

this also closes TriliumNext/Trilium#5186

pano9000 and others added 11 commits January 23, 2025 20:18
turns "true" / "false" strings from a process.env property into actual boolean values or undefined
envToBoolean used to turn "string booleans" into JS booleans
these are used in the codebase, but are not defined in the sample.ini
original idea of using config-sample.ini for default values
is not backwards compatible unfortunately

fallback values taken from config-sample.ini and directly from other code in this codebase, where these values were set
this is now handled in config.ts already
… consistency

backwards compatibility ensured, by still checking the iniConfig for the old value first
Copy link
Contributor

@eliandoran eliandoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@eliandoran eliandoran merged commit e4b186c into develop Jan 26, 2025
5 checks passed
@eliandoran eliandoran deleted the feat_env-config branch January 26, 2025 12:32
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(Feature request) Support configuring trustedReverseProxy via environment variables

4 participants