Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Set app.root_url from TOML or env var #705

Closed
m3nu opened this issue Feb 15, 2022 · 5 comments · Fixed by #710
Closed

Set app.root_url from TOML or env var #705

m3nu opened this issue Feb 15, 2022 · 5 comments · Fixed by #710
Labels
enhancement New feature or request

Comments

@m3nu
Copy link
Contributor

m3nu commented Feb 15, 2022

Is your feature request related to a problem? Please describe.
Just set up Listmonk for use with PikaPods.com. Works all well thus far. I just noticed that it's not possible to set app.root_url and app.logo_url (defined here during initial setup. It just defaults to localhost:9000. As a result the logo won't load and the user needs to visit the Settings page to update the URL.

Describe the solution you'd like
It would be helpful to set at least app.root_url in the TOML file during initial setup or use a value from there during initial setup. Editing the URL in Settings is helpful too, so I see why it's not in the TOML.

Alternative I've considered is to run a DB query to update this setting after running --install.

@m3nu m3nu added the enhancement New feature or request label Feb 15, 2022
@knadh
Copy link
Owner

knadh commented Feb 15, 2022

Setting LISTMONK_APP__ROOT_URL should work. However, this will always override the value set in the UI creating an ambiguous UX.

@m3nu
Copy link
Contributor Author

m3nu commented Feb 15, 2022

That would be too easy. No luck with LISTMONK_APP__ROOT_URL, LISTMONK_app__rooturl or LISTMONK_app__root_url.

I've added a note for now to update this in Settings. Available for testing here: https://www.pikapods.com/apps

@knadh
Copy link
Owner

knadh commented Feb 15, 2022

Ah yes, sorry, my bad. DB settings override environment variables for precisely the same reason. If env vars took precedence, then whatever is configured on the settings UI would be moot, rendering settings unreliable wholly.

@m3nu
Copy link
Contributor Author

m3nu commented Feb 16, 2022

Thanks for checking. I'll manage app.root_url from the database then and remove app.logo_url initially, so it falls back to the default (and doesn't cause a broken image) and users can set their own if they like. I think the latter point could be a good general improvement. In detail:

Set the optional setting app.logo_url to an empty value initially so it doesn't cause a broken image on the login page when the URL isn't correct. This would be in line with app.favicon_url, which is already set to "" after installation.

Happy to do a PR if this is a desired change.

@knadh
Copy link
Owner

knadh commented Feb 16, 2022

+1. Makes sense.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants