Hugo: Disable watch and auto port append to URLs. Configure baseURL
Change-Id: Iaf3326782d503d412efc25277fa4224329b44000
diff --git a/core/installer/app.go b/core/installer/app.go
index 0eaa27d..1922b48 100644
--- a/core/installer/app.go
+++ b/core/installer/app.go
@@ -424,10 +424,10 @@
func NewDodoApp(appCfg []byte) (EnvApp, error) {
return NewCueEnvApp(CueAppData{
- "app.cue": appCfg,
- "base.cue": []byte(cueBaseConfig),
- "pcloud_app.cue": dodoAppCue,
- "env_app.cue": []byte(cueEnvAppGlobal),
+ "app.cue": appCfg,
+ "base.cue": []byte(cueBaseConfig),
+ "dodo.cue": dodoAppCue,
+ "env.cue": []byte(cueEnvAppGlobal),
})
}
diff --git a/core/installer/app_configs/dodo_app.cue b/core/installer/app_configs/dodo_app.cue
index 39788a7..b4878b3 100644
--- a/core/installer/app_configs/dodo_app.cue
+++ b/core/installer/app_configs/dodo_app.cue
@@ -13,6 +13,9 @@
network: string
subdomain: string
auth: #Auth
+
+ _network: networks[strings.ToLower(network)]
+ baseURL: "https://\(subdomain).\(_network.domain)"
}
#AppTmpl: {
@@ -72,7 +75,14 @@
args: []
}, {
bin: "/usr/bin/hugo",
- args: ["server", "--port=\(_appPort)", "--bind=0.0.0.0"]
+ args: [
+ "server",
+ "--watch=false",
+ "--bind=0.0.0.0",
+ "--port=\(_appPort)",
+ "--baseURL=\(ingress.baseURL)",
+ "--appendPort=false",
+ ]
}]
}
diff --git a/core/installer/app_test.go b/core/installer/app_test.go
index 5feb719..ef5a8ef 100644
--- a/core/installer/app_test.go
+++ b/core/installer/app_test.go
@@ -303,12 +303,6 @@
//go:embed app_configs/testapp.cue
var testAppCue []byte
-type appInput struct {
- RepoAddr string `json:"repoAddr"`
- SSHKey string `json:"sshKey"`
- Network Network `json:"network"`
-}
-
func TestPCloudApp(t *testing.T) {
_, err := NewDodoApp(testAppCue)
if err != nil {