mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Hardcode keibi's prefix to /auth
This commit is contained in:
parent
b11b79ded0
commit
418eaa67f0
@ -1,9 +1,6 @@
|
|||||||
# vi: ft=sh
|
# vi: ft=sh
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
|
|
||||||
# http route prefix (will listen to $KEIBI_PREFIX/users for example)
|
|
||||||
KEIBI_PREFIX=""
|
|
||||||
|
|
||||||
# path of the private key used to sign jwts. If this is empty, a new one will be generated on startup
|
# path of the private key used to sign jwts. If this is empty, a new one will be generated on startup
|
||||||
RSA_PRIVATE_KEY_PATH=""
|
RSA_PRIVATE_KEY_PATH=""
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Configuration struct {
|
type Configuration struct {
|
||||||
Prefix string
|
|
||||||
JwtPrivateKey *rsa.PrivateKey
|
JwtPrivateKey *rsa.PrivateKey
|
||||||
JwtPublicKey *rsa.PublicKey
|
JwtPublicKey *rsa.PublicKey
|
||||||
JwtKid string
|
JwtKid string
|
||||||
@ -47,7 +46,6 @@ func LoadConfiguration(db *dbc.Queries) (*Configuration, error) {
|
|||||||
ret := DefaultConfig
|
ret := DefaultConfig
|
||||||
|
|
||||||
ret.PublicUrl = os.Getenv("PUBLIC_URL")
|
ret.PublicUrl = os.Getenv("PUBLIC_URL")
|
||||||
ret.Prefix = os.Getenv("KEIBI_PREFIX")
|
|
||||||
|
|
||||||
claims := os.Getenv("EXTRA_CLAIMS")
|
claims := os.Getenv("EXTRA_CLAIMS")
|
||||||
if claims != "" {
|
if claims != "" {
|
||||||
|
@ -228,8 +228,8 @@ func main() {
|
|||||||
}
|
}
|
||||||
h.config = conf
|
h.config = conf
|
||||||
|
|
||||||
g := e.Group(conf.Prefix)
|
g := e.Group("/auth")
|
||||||
r := e.Group(conf.Prefix)
|
r := e.Group("/auth")
|
||||||
r.Use(h.TokenToJwt)
|
r.Use(h.TokenToJwt)
|
||||||
r.Use(echojwt.WithConfig(echojwt.Config{
|
r.Use(echojwt.WithConfig(echojwt.Config{
|
||||||
SigningMethod: "RS256",
|
SigningMethod: "RS256",
|
||||||
|
@ -66,8 +66,6 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
environment:
|
|
||||||
- KEIBI_PREFIX=/auth
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.auth.rule=PathPrefix(`/auth/`)"
|
- "traefik.http.routers.auth.rule=PathPrefix(`/auth/`)"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user