apisix-dashboard
apisix-dashboard copied to clipboard
feat: allow to use env variables in config
Why submit this pull request?
- [ ] Bugfix
- [x] New feature provided
- [ ] Improve performance
- [ ] Backport patches
What changes will this PR take into?
This ticket adds an ability to use environment variables in the dashboard configuration using viper decode hooks. Such change is required to simplify dashboard configuration based on the environment type. For example can be useful to provide dashboard users and their passwords.
Related issues
https://github.com/apache/apisix-dashboard/issues/2818
Checklist:
- [x] Did you explain what problem does this PR solve? Or what new features have been added?
- [x] Have you added corresponding test cases?
- [ ] Have you modified the corresponding document?
- [x] Is this PR backward compatible?
Codecov Report
Merging #2819 (14c292b) into master (e0290c8) will decrease coverage by
2.84%. The diff coverage is87.50%.
:exclamation: Current head 14c292b differs from pull request most recent head 06577e2. Consider uploading reports for the commit 06577e2 to get more accurate results
@@ Coverage Diff @@
## master #2819 +/- ##
==========================================
- Coverage 77.49% 74.65% -2.84%
==========================================
Files 139 201 +62
Lines 3746 7860 +4114
Branches 881 881
==========================================
+ Hits 2903 5868 +2965
- Misses 843 1681 +838
- Partials 0 311 +311
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test-ginkgo | 65.16% <87.50%> (?) |
|
| backend-unit-test | 50.10% <87.50%> (?) |
|
| frontend-e2e-test | 77.44% <ø> (-0.06%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| api/internal/conf/conf.go | 67.87% <87.50%> (ø) |
... and 62 files with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
@Gallardot fixed the failing unit test, please approve workflow execution
@juzhiyuan @bzp2010 @guoqqqi Sorry guys, can we proceed with this feature? Your reviews are very desired, thanks.
@juzhiyuan @bzp2010 @guoqqqi up for review, thanks
Hello, I personally not available those months.
@bzp2010 @Baoyuantop hi, hope you will be able to check proposed changes, thanks
I have to close this PR. Refer to https://github.com/apache/apisix-dashboard/issues/2981