speedtest-tracker
speedtest-tracker copied to clipboard
[Chore] Consolidating application settings and environment variables
[!IMPORTANT]
TL;DR: Settings page is going away and will be replaced with environment variables.
📃 Description
Currently settings and application configuration are bifurcated between the UI and environment variables. This inconsistency has caused confusion on where to update a setting or configuration for a feature or function. UI based settings, specifically with the spatie/laravel-settings
package, also have been the cause of several stability issues over the release history (i.e. #1226).
After thinking about this change for a couple of weeks I have decided I'm going to remove UI based settings where applicable in favor of configurations defined with environment variables.
A side benefit to this will be the removal of the settings
table and less queries to the database for settings values. While a small benefit, less is always more.
Also could argue better GitOps, configuration as code, insert more buzzwords here.
✅ Completed work
- #1332
- #1333
✅ To-do list
- [x] Identify each UI setting that should be moved to an environment variable.
- [ ] Add those configuration options to
config/speedtest.php
. - [ ] Update documentation with a complete list of configuration / environment variables.
- [ ] Ultimately remove
spatie/laravel-settings
dependency. - [ ] tbd, likely more to come...
🤔 Confusion
- [x] Site name exists in the UI and
APP_NAME
exists as an environment variable. They both affect different areas of the application. closed #1332
I use the new image and also have the both environment variables in the docker command.
-e APP_NAME="Speedtest Tracker Eric" \
-e PUBLIC_DASHBOARD=true \
but i still get this message in the "General" settings
Site name
⚠️ DEPRECATED: Use APP_NAME environment variable.
Public dashboard
⚠️ DEPRECATED: Use PUBLIC_DASHBOARD environment variable.
but i still get this message in the "General" settings
Site name ⚠️ DEPRECATED: Use APP_NAME environment variable. Public dashboard ⚠️ DEPRECATED: Use PUBLIC_DASHBOARD environment variable.
Yep, you can ignore that if you're using the environment variables.