Use authentication for Distillery control page
This commit is contained in:
parent
da32b67981
commit
1caecc0f19
8 changed files with 122 additions and 82 deletions
|
|
@ -84,11 +84,6 @@ type Config struct {
|
|||
// admin credentials for the Mysql database
|
||||
MysqlAdminUser string `env:"MYSQL_ADMIN_USER" default:"admin" parser:"nonempty"`
|
||||
MysqlAdminPassword string `env:"MYSQL_ADMIN_PASSWORD" default:"" parser:"nonempty"`
|
||||
|
||||
// admin credentials for the dis server
|
||||
DisAdminUser string `env:"DIS_ADMIN_USER" default:"admin" parser:"nonempty"`
|
||||
DisAdminPassword string `env:"DIS_ADMIN_PASSWORD" default:"" parser:"nonempty"`
|
||||
|
||||
// session secret holds the secret for login
|
||||
SessionSecret string `env:"SESSION_SECRET" default:"" parser:"nonempty"`
|
||||
|
||||
|
|
|
|||
|
|
@ -69,11 +69,6 @@ GRAPHDB_ADMIN_PASSWORD=${GRAPHDB_ADMIN_PASSWORD}
|
|||
MYSQL_ADMIN_USER=${MYSQL_ADMIN_USER}
|
||||
MYSQL_ADMIN_PASSWORD=${MYSQL_ADMIN_PASSWORD}
|
||||
|
||||
|
||||
# The admin user and password required to access the /dis/ server and api
|
||||
DIS_ADMIN_USER=${DIS_ADMIN_USER}
|
||||
DIS_ADMIN_PASSWORD=${DIS_ADMIN_PASSWORD}
|
||||
|
||||
# the interval to run cron in
|
||||
CRON_INTERVAL=10m
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ type Template struct {
|
|||
TriplestoreAdminPassword string `env:"GRAPHDB_ADMIN_PASSWORD"`
|
||||
MysqlAdminUsername string `env:"MYSQL_ADMIN_USER"`
|
||||
MysqlAdminPassword string `env:"MYSQL_ADMIN_PASSWORD"`
|
||||
DisAdminUsername string `env:"DIS_ADMIN_USER"`
|
||||
DisAdminPassword string `env:"DIS_ADMIN_PASSWORD"`
|
||||
DockerNetworkName string `env:"DOCKER_NETWORK_NAME"`
|
||||
SessionSecret string `env:"SESSION_SECRET"`
|
||||
}
|
||||
|
|
@ -76,17 +74,6 @@ func (tpl *Template) SetDefaults(env environment.Environment) (err error) {
|
|||
}
|
||||
}
|
||||
|
||||
if tpl.DisAdminUsername == "" {
|
||||
tpl.DisAdminUsername = "admin"
|
||||
}
|
||||
|
||||
if tpl.DisAdminPassword == "" {
|
||||
tpl.DisAdminPassword, err = password.Password(64)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if tpl.DockerNetworkName == "" {
|
||||
tpl.DockerNetworkName, err = password.Password(10)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue