Experimental: Update traefik Host() rules for v3

This commit is contained in:
Tom Wiesing 2023-04-12 19:21:11 +02:00
parent 34db2e1923
commit 285aaff77d
No known key found for this signature in database
10 changed files with 60 additions and 13 deletions

View file

@ -2,6 +2,8 @@ package liquid
import (
"net/url"
"github.com/FAU-CDI/wisski-distillery/internal/config"
)
// Domain returns the full domain name of this WissKI
@ -9,6 +11,15 @@ func (liquid *Liquid) Domain() string {
return liquid.Config.HTTP.HostFromSlug(liquid.Slug)
}
func (liquid *Liquid) Hostname() string {
return liquid.Domain() + ".wisski"
}
// HostRule returns a host rule for this wisski
func (liquid *Liquid) HostRule() string {
return config.MakeHostRule(liquid.Domain())
}
// URL returns the public URL of this instance
func (liquid *Liquid) URL() *url.URL {
// setup domain and path