Move code into new component package

This commit cleans up the resources in the 'embed' package, and instead
moves them into subpackages of a new 'compose' package. This makes sure
that '.env' templates and docker compose contexts are located in the
same location.
This commit is contained in:
Tom Wiesing 2022-09-11 15:41:11 +02:00
parent 2ee90bf462
commit 7b2f79bea1
No known key found for this signature in database
44 changed files with 579 additions and 559 deletions

21
env/distillery.go vendored
View file

@ -3,7 +3,6 @@ package env
import (
"context"
"os"
"strings"
"github.com/FAU-CDI/wisski-distillery/core"
"github.com/FAU-CDI/wisski-distillery/internal/config"
@ -22,26 +21,6 @@ type Upstream struct {
Triplestore string
}
func (dis Distillery) HTTPSEnabled() bool {
return dis.Config.CertbotEmail != ""
}
// Returns the default virtual host
func (dis Distillery) DefaultVirtualHost() string {
VIRTUAL_HOST := dis.Config.DefaultDomain
if len(dis.Config.SelfExtraDomains) > 0 {
VIRTUAL_HOST += "," + strings.Join(dis.Config.SelfExtraDomains, ",")
}
return VIRTUAL_HOST
}
func (dis Distillery) DefaultLetsencryptHost() string {
if !dis.HTTPSEnabled() {
return ""
}
return dis.DefaultVirtualHost()
}
// Context returns a new Context belonging to this distillery
func (dis Distillery) Context() context.Context {
return context.Background()