Hello all, can I use environmet variables in krato...
# talk-kratos
k
Hello all, can I use environmet variables in kratos configuration file? Somethin akin to:
Copy code
serve:
  public:
    base_url: http://${KRATOS_BASE_URL}:4433/
I am aware of https://www.ory.sh/docs/ecosystem/configuring#loading-configuration-from-environment-variables, but with this technique I need to override a dozen of properties to change the base url in the whole cofiguration. I just do not believe this is the only way to go:
Copy code
SERVE_PUBLIC_BASE_URL=<http://kamilk:4433/>
SERVE_PUBLIC_CORS_ALLOWED_ORIGINS_0=<http://kamilk:4433/>
SERVE_ADMIN_BASE_URL=<http://kamilk:4434/>
SELFSERVICE_DEFAULT_BROWSER_RETURN_URL=<http://kamilk:4455/welcome>
SELFSERVICE_ALLOWED_RETURN_URLS_0=<http://kamilk:4455>
SELFSERVICE_FLOWS_ERROR_UI_URL=<http://kamilk:4455/error>
SELFSERVICE_FLOWS_SETTINGS_UI_URL=<http://kamilk:4455/settings>
SELFSERVICE_FLOWS_RECOVERY_UI_URL=<http://kamilk:4455/recovery>
SELFSERVICE_FLOWS_VERIFICATION_UI_URL=<http://kamilk:4455/verification>
SELFSERVICE_FLOWS_VERIFICATION_AFTER_DEFAULT_BROWSER_RETURN_URL=<http://kamilk:4455/>
SELFSERVICE_FLOWS_LOGOUT_AFTER_DEFAULT_BROWSER_RETURN_URL=<http://kamilk:4455/login>
SELFSERVICE_FLOWS_LOGIN_UI_URL=<http://kamilk:4455/login>
SELFSERVICE_FLOWS_REGISTRATION_UI_URL=<http://kamilk:4455/registration>


ERRORS_HANDLERS_REDIRECT_CONFIG_TO: "<http://kamilk:4455/login>"
ACCESS_RULES_REPOSITORIES_0_UPSTREAM_URL: "<http://kamilk:8083/api/v1>"
ACCESS_RULES_REPOSITORIES_0_MATCH_URL: "<http://kamilk:8080/><*>"
ACCESS_RULES_REPOSITORIES_0_ERRORS_0_CONFIG_TO: "<http://kamilk:4455/login>"
c
I've got a basic system working that has a template of the config, with env var parameters. This template is then parsed by envsubst and put into the config folder
Will try and OS it over the next week or so