Move WissKI Parts to new ingredients system
This commit is contained in:
parent
b5b1ce2340
commit
42b8cbd865
83 changed files with 1016 additions and 646 deletions
5
internal/wisski/ingredient/reserve/reserve.env
Normal file
5
internal/wisski/ingredient/reserve/reserve.env
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
SLUG=${SLUG}
|
||||
VIRTUAL_HOST=${VIRTUAL_HOST}
|
||||
|
||||
DOCKER_NETWORK_NAME=${DOCKER_NETWORK_NAME}
|
||||
HTTPS_ENABLED=${HTTPS_ENABLED}
|
||||
40
internal/wisski/ingredient/reserve/reserve.go
Normal file
40
internal/wisski/ingredient/reserve/reserve.go
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package reserve
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
|
||||
)
|
||||
|
||||
// Reserve implements reserving a WissKI Instance
|
||||
// TODO: This should be integrated into the bookkeeping table.
|
||||
type Reserve struct {
|
||||
ingredient.Base
|
||||
}
|
||||
|
||||
//go:embed all:reserve reserve.env
|
||||
var reserveResources embed.FS
|
||||
|
||||
// Stack returns a stack representing the reserve instance
|
||||
func (reserve *Reserve) Stack() component.StackWithResources {
|
||||
return component.StackWithResources{
|
||||
Stack: component.Stack{
|
||||
Dir: reserve.FilesystemBase,
|
||||
Env: reserve.Malt.Environment,
|
||||
},
|
||||
|
||||
Resources: reserveResources,
|
||||
ContextPath: filepath.Join("reserve"),
|
||||
EnvPath: filepath.Join("reserve.env"),
|
||||
|
||||
EnvContext: map[string]string{
|
||||
"DOCKER_NETWORK_NAME": reserve.Malt.Config.DockerNetworkName,
|
||||
|
||||
"SLUG": reserve.Slug,
|
||||
"VIRTUAL_HOST": reserve.Domain(),
|
||||
"HTTPS_ENABLED": reserve.Malt.Config.HTTPSEnabledEnv(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
version: "3.7"
|
||||
|
||||
services:
|
||||
static:
|
||||
image: tkw01536/gostatic
|
||||
restart: always
|
||||
ports:
|
||||
- 8043
|
||||
|
||||
labels:
|
||||
- "traefik.enable=True"
|
||||
- "eu.wiss-ki.barrel.distillery=${DOCKER_NETWORK_NAME}"
|
||||
|
||||
- "traefik.http.routers.reserve_${SLUG}.rule=Host(`${VIRTUAL_HOST}`)"
|
||||
- "traefik.http.routers.reserve_${SLUG}.tls=${HTTPS_ENABLED}"
|
||||
- "traefik.http.routers.reserve_${SLUG}.tls.certresolver=distillery"
|
||||
- "traefik.http.services.reserve_${SLUG}.loadbalancer.server.port=8043"
|
||||
|
||||
|
||||
# volumes that are mounted
|
||||
volumes:
|
||||
- ./index.html:/srv/http/index.html:ro
|
||||
|
||||
networks:
|
||||
default:
|
||||
name: ${DOCKER_NETWORK_NAME}
|
||||
external: true
|
||||
4
internal/wisski/ingredient/reserve/reserve/index.html
Normal file
4
internal/wisski/ingredient/reserve/reserve/index.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
This domain name is reserved.
|
||||
Content is a work in progress.
|
||||
Loading…
Add table
Add a link
Reference in a new issue