diff --git a/main.go b/main.go index c8e4d1c..eed7937 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( _ "beszel/migrations" + "beszel/site" "bytes" "crypto/ed25519" "encoding/json" @@ -83,8 +84,10 @@ func main() { e.Router.Any("/*", echo.WrapHandler(proxy)) e.Router.Any("/", echo.WrapHandler(proxy)) default: - e.Router.GET("/icons/*", apis.StaticDirectoryHandler(os.DirFS("./site/dist/icons"), false)) - e.Router.Any("/*", apis.StaticDirectoryHandler(os.DirFS("./site/dist"), true)) + assets, _ := site.Assets() + icons, _ := site.Icons() + e.Router.GET("/icons/*", apis.StaticDirectoryHandler(icons, false)) + e.Router.Any("/*", apis.StaticDirectoryHandler(assets, true)) } return nil }) diff --git a/site/embed.go b/site/embed.go new file mode 100644 index 0000000..41a0d58 --- /dev/null +++ b/site/embed.go @@ -0,0 +1,17 @@ +package site + +import ( + "embed" + "io/fs" +) + +//go:embed all:dist +var assets embed.FS + +func Assets() (fs.FS, error) { + return fs.Sub(assets, "dist") +} + +func Icons() (fs.FS, error) { + return fs.Sub(assets, "dist/icons") +} diff --git a/site/src/components/login/auth-form.tsx b/site/src/components/login/auth-form.tsx index ce60547..81eec4b 100644 --- a/site/src/components/login/auth-form.tsx +++ b/site/src/components/login/auth-form.tsx @@ -306,7 +306,7 @@ export function UserAuthForm({ )} - {authMethods.emailPassword && ( + {authMethods.emailPassword && !isFirstRun && ( Command line instructions

- If you don't have an SMTP server configured, you can use the following command to reset + Use the following command to reset your password: