-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,125 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: '3' | ||
services: | ||
xen-orchestra: | ||
restart: always | ||
image: ronivay/xen-orchestra:latest | ||
container_name: xen-orchestra | ||
stop_grace_period: 1m | ||
ports: | ||
- "1337:80" | ||
environment: | ||
- HTTP_PORT=80 | ||
cap_add: | ||
- SYS_ADMIN | ||
- DAC_READ_SEARCH | ||
security_opt: | ||
- apparmor:unconfined | ||
volumes: | ||
- xo-data:/var/lib/xo-server | ||
- redis-data:/var/lib/redis | ||
logging: &default_logging | ||
driver: "json-file" | ||
options: | ||
max-size: "1M" | ||
max-file: "2" | ||
volumes: | ||
xo-data: | ||
redis-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package configuration | ||
|
||
import ( | ||
"github.com/charmbracelet/log" | ||
"github.com/developing-today/code/src/identity/configuration" | ||
"github.com/knadh/koanf" | ||
"github.com/samber/do/v2" | ||
) | ||
|
||
func NewConfiguration() *configuration.SshServerConfiguration { | ||
return &configuration.SshServerConfiguration{ | ||
ConfigurationSeparator: configuration.Separator, | ||
Configuration: koanf.New(configuration.Separator), | ||
ConfigurationLocations: &configuration.ConfigurationLocations{ | ||
ConfigurationFilePaths: []string{ | ||
configuration.ConfigurationFilePath, | ||
// identity.kdl identity.config.kdl config.identity.kdl identity.config | ||
// run these against ? binary dir ? pwd of execution ? appdata ? .config ? .local ??? | ||
// then check for further locations/env-prefixes/etc from first pass, rerun on top with second pass | ||
// (maybe config.kdl next to binary sets a new set of configurationPaths, finish out loading from defaults, then load from new paths) | ||
// this pattern continues, after hard-code default env/file search, then custom file/env search, then eventually maybe nats/centrifuge/s3 or other remote or db config | ||
}, | ||
EmbeddedConfigurationFilePaths: []string{ | ||
configuration.EmbeddedConfigurationFilePath, | ||
}, | ||
}, | ||
EmbedFS: &configuration.EmbedFS, | ||
} | ||
} | ||
|
||
func LoadDefaultConfiguration() *configuration.SshServerConfiguration { | ||
config := NewConfiguration() | ||
config.LoadConfiguration() | ||
log.Info("Loaded config", "config", config.Configuration.Sprint()) | ||
return config | ||
} | ||
|
||
type SshServiceConfiguration interface { | ||
Configuration() *configuration.SshServerConfiguration | ||
} | ||
|
||
type IdentityServiceConfigurationImpl struct { | ||
config *configuration.SshServerConfiguration | ||
} | ||
|
||
func (isc *IdentityServiceConfigurationImpl) Configuration() *configuration.SshServerConfiguration { | ||
return isc.config | ||
} | ||
|
||
func NewSshServerConfigurationService(config *configuration.SshServerConfiguration) func(do.Injector) (SshServiceConfiguration, error) { | ||
return func(i do.Injector) (SshServiceConfiguration, error) { | ||
return &IdentityServiceConfigurationImpl{ | ||
config: config, | ||
}, nil | ||
} | ||
} |
Oops, something went wrong.