Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions internal/gounicorn/gounicorn.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ import (
"goauthentik.io/internal/utils"
)

var (
manageCmd string = "./manage.py"
gunicornCmd string = "gunicorn"
gunicornConf string = "./lifecycle/gunicorn.conf.py"
pidDir string = ""
)

type GoUnicorn struct {
Healthcheck func() bool
healthyCallbacks []func()
Expand Down Expand Up @@ -58,16 +65,16 @@ func New(healthcheck func() bool) *GoUnicorn {
}

func (g *GoUnicorn) initCmd() {
command := "./manage.py"
command := manageCmd
args := []string{"dev_server"}
if !config.Get().Debug {
pidFile, err := os.CreateTemp("", "authentik-gunicorn.*.pid")
pidFile, err := os.CreateTemp(pidDir, "authentik-gunicorn.*.pid")
if err != nil {
panic(fmt.Errorf("failed to create temporary pid file: %v", err))
}
g.pidFile = pidFile.Name()
command = "gunicorn"
args = []string{"-c", "./lifecycle/gunicorn.conf.py", "authentik.root.asgi:application"}
command = gunicornCmd
args = []string{"-c", gunicornConf, "authentik.root.asgi:application"}
if g.pidFile != "" {
args = append(args, "--pid", g.pidFile)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/web/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (ws *WebServer) configureStatic() {
staticRouter.Use(ws.staticHeaderMiddleware)
staticRouter.Use(web.DisableIndex)

distFs := http.FileServer(http.Dir("./web/dist"))
distFs := http.FileServer(staticWeb.StaticDir)

pathStripper := func(handler http.Handler, paths ...string) http.Handler {
h := handler
Expand Down
4 changes: 3 additions & 1 deletion web/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ var RobotsTxt []byte
//go:embed security.txt
var SecurityTxt []byte

var StaticDir = http.Dir("./web/dist/")
var staticDir = "./web/dist/"

var StaticDir = http.Dir(staticDir)

var StaticHandler = http.FileServer(StaticDir)
Loading