Minor refactor in 'core' package
This commit is contained in:
parent
a360324f62
commit
94263174cf
4 changed files with 25 additions and 19 deletions
|
|
@ -99,8 +99,8 @@ func (bs bootstrap) Run(context wisski_distillery.Context) error {
|
|||
if domain == "" {
|
||||
domain = hostname.FQDN()
|
||||
}
|
||||
overridesPath := filepath.Join(root, "overrides.json")
|
||||
authorizedKeysFile := filepath.Join(root, "authorized_keys")
|
||||
overridesPath := filepath.Join(root, core.OverridesJSON)
|
||||
authorizedKeysFile := filepath.Join(root, core.AuthorizedKeys)
|
||||
|
||||
{
|
||||
logging.LogMessage(context.IOStream, "Copying over wdcli executable")
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ type Config struct {
|
|||
PasswordLength int `env:"PASSWORD_LENGTH" default:"64" validator:"is_valid_number"`
|
||||
|
||||
// A file to be used for global authorized_keys for the ssh server.
|
||||
GlobalAuthorizedKeysFile string `env:"GLOBAL_AUTHORIZED_KEYS_FILE" default:"/distillery/authorized_keys" validator:"is_valid_file"`
|
||||
GlobalAuthorizedKeysFile string `env:"GLOBAL_AUTHORIZED_KEYS_FILE" default:"/var/www/deploy/authorized_keys" validator:"is_valid_file"`
|
||||
|
||||
// admin credentials for graphdb
|
||||
TriplestoreAdminUser string `env:"GRAPHDB_ADMIN_USER" default:"admin" validator:"is_nonempty"`
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
package core
|
||||
|
||||
import _ "embed"
|
||||
|
||||
// DefaultOverridesJSON contains a template for a new 'overrides.json' file
|
||||
//go:embed bootstrap/overrides.json
|
||||
var DefaultOverridesJSON []byte
|
||||
|
||||
// DefaultAuthorizedKeys contains a template for a new 'global_authorized_keys' file
|
||||
//go:embed bootstrap/global_authorized_keys
|
||||
var DefaultAuthorizedKeys []byte
|
||||
|
||||
// ConfigFileTemplate contains a template for a new configuration file
|
||||
//go:embed bootstrap/env
|
||||
var ConfigFileTemplate []byte
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
// It does not depend on any other packages.
|
||||
package core
|
||||
|
||||
import _ "embed"
|
||||
|
||||
// BaseDirectoryDefault is the default deploy directory to load the distillery from.
|
||||
const BaseDirectoryDefault = "/var/www/deploy"
|
||||
|
||||
|
|
@ -9,6 +11,25 @@ const BaseDirectoryDefault = "/var/www/deploy"
|
|||
// It should be located inside the deployment directory.
|
||||
const Executable = "wdcli"
|
||||
|
||||
// Config file is the name of the config file.
|
||||
// ConfigFile is the name of the config file.
|
||||
// It should be located inside the deployment directory.
|
||||
const ConfigFile = ".env"
|
||||
|
||||
// ConfigFileTemplate contains a template for a new configuration file
|
||||
//go:embed bootstrap/env
|
||||
var ConfigFileTemplate []byte
|
||||
|
||||
// OverridesJSON is the name of the json overrides file.
|
||||
// It should be located inside the deployment directory.
|
||||
const OverridesJSON = "overrides.json"
|
||||
|
||||
// DefaultOverridesJSON contains a template for a new 'overrides.json' file
|
||||
//go:embed bootstrap/overrides.json
|
||||
var DefaultOverridesJSON []byte
|
||||
|
||||
// AuthorizedKeys contains the default name for the 'global_authorized_keys' file
|
||||
const AuthorizedKeys = "authorized_keys"
|
||||
|
||||
// DefaultAuthorizedKeys contains a template for a new 'global_authorized_keys' file
|
||||
//go:embed bootstrap/global_authorized_keys
|
||||
var DefaultAuthorizedKeys []byte
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue