Refactor Package structure
This commit cleans up the package structure, to make two new top-level packages `internal` (for internal-use packages) and `pkg` (for general shared utility code).
This commit is contained in:
parent
487ce09979
commit
a360324f62
124 changed files with 97 additions and 101 deletions
42
internal/component/self/self.go
Normal file
42
internal/component/self/self.go
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package self
|
||||
|
||||
import (
|
||||
"embed"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/component"
|
||||
)
|
||||
|
||||
type Self struct {
|
||||
component.ComponentBase
|
||||
}
|
||||
|
||||
func (Self) Name() string {
|
||||
return "self"
|
||||
}
|
||||
|
||||
//go:embed all:stack
|
||||
//go:embed self.env
|
||||
var resources embed.FS
|
||||
|
||||
func (self Self) Stack() component.Installable {
|
||||
// TODO: Move me into config!
|
||||
TARGET := "https://github.com/FAU-CDI/wisski-distillery"
|
||||
if self.Config.SelfRedirect != nil { // TODO: move to config!
|
||||
TARGET = self.Config.SelfRedirect.String()
|
||||
}
|
||||
|
||||
return self.ComponentBase.MakeStack(component.Installable{
|
||||
Resources: resources,
|
||||
|
||||
ContextPath: "stack",
|
||||
EnvPath: "self.env",
|
||||
|
||||
EnvContext: map[string]string{
|
||||
"VIRTUAL_HOST": self.Config.DefaultHost(),
|
||||
"LETSENCRYPT_HOST": self.Config.DefaultSSLHost(),
|
||||
"LETSENCRYPT_EMAIL": self.Config.CertbotEmail,
|
||||
"TARGET": TARGET,
|
||||
"OVERRIDES_FILE": self.Config.SelfOverridesFile,
|
||||
},
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue