diff options
Diffstat (limited to 'pkg/config/config.go')
-rw-r--r-- | pkg/config/config.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/pkg/config/config.go b/pkg/config/config.go index 812a06e..da6e0e7 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -55,8 +55,8 @@ type ( ConfigurationRepository struct { rootReadme string listenAddr string - passphrase string - aesKey string + passphrase []byte + aesKey []byte syntaxHighlight string repositories []*GitRepositoryConfiguration } @@ -74,9 +74,9 @@ func LoadConfigurationRepository(configPath string) (*ConfigurationRepository, e } repo := &ConfigurationRepository{ - aesKey: config.AESKey, + aesKey: []byte(config.AESKey), listenAddr: config.ListenAddr, - passphrase: config.Passphrase, + passphrase: []byte(config.Passphrase), repositories: config.Repositories, rootReadme: config.RootReadme, syntaxHighlight: config.SyntaxHighlight, @@ -105,6 +105,14 @@ func (c *ConfigurationRepository) GetListenAddr() string { return c.listenAddr } +func (c *ConfigurationRepository) GetPassphrase() []byte { + return c.passphrase +} + +func (c *ConfigurationRepository) GetBase64AesKey() []byte { + return c.aesKey +} + // GetByName returns configuration of repository for a given name. // It returns nil if there is not match for it. func (c *ConfigurationRepository) GetByName(name string) *GitRepositoryConfiguration { |