feat: use env to predefine admin user #214

This commit is contained in:
Jacky 2024-05-06 22:55:05 +08:00
parent 13c4eb04a3
commit 4c74bc8619
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
10 changed files with 89 additions and 28 deletions

View file

@ -52,6 +52,7 @@ func TestSetup(t *testing.T) {
_ = os.Setenv("NGINX_UI_LOGROTATE_CMD", "logrotate /custom/logrotate.conf")
_ = os.Setenv("NGINX_UI_LOGROTATE_INTERVAL", "60")
ConfPath = "app.testing.ini"
Setup()
assert.Equal(t, "8080", ServerSettings.HttpPort)
@ -96,4 +97,5 @@ func TestSetup(t *testing.T) {
assert.Equal(t, 60, LogrotateSettings.Interval)
os.Clearenv()
_ = os.Remove("app.testing.ini")
}