asynqmon
asynqmon copied to clipboard
Not working on Windows
Hi, great project. I'm trying using it on Windows, but can't get it to work.
When running and trying to access the browser, the following error is displayed:
open ui\build\index.html: file does not exist
I have done some diging and have found the problem, but don't know the right "fix", so for this reason I'm opening this issue instead of PR.
Basically on this line, filepath.Abs
returns C:\
https://github.com/hibiken/asynqmon/blob/0eb9d88c5365d7f34c1a9ff61518a5075170bb41/main.go#L59
This causes problems with the check if is /
https://github.com/hibiken/asynqmon/blob/0eb9d88c5365d7f34c1a9ff61518a5075170bb41/main.go#L65
There is a problem with filepath.Join
as well, since it will use \
and GO embed.FS
will not find the file then.
https://golang.org/pkg/embed/#hdr-Directives
The path separator is a forward slash, even on Windows systems.
The only way I could get it to work was making the following changes:
p := r.URL.Path
if filepath.IsAbs(p) {
p = srv.indexFilePath()
} else {
p = path.Join(srv.staticDirPath, p)
}
// ...
func (srv *staticFileServer) indexFilePath() string {
return path.Join(srv.staticDirPath, srv.indexFileName)
}
@crossworth Thank you for reporting this issue! Apologies for not testing fully on other OSs 🙏
Is this blocking you from using the tool completely? Or have you found a way to work around it until the fix is in? (I'm trying to gauge the priority of this bug).
No worries, I'm able to use with the changes from my last message.
So maybe this can be low priority.
Got it, thanks for letting me know! I'll get to this issue in a few weeks 👍
What do you think about embeding templates ? https://pkg.go.dev/embed
@SkYNewZ thank you for the comment. There were some changes made to use the embed
package since this issue has been created, so this issue may be stale. I'll look into this issue once again soon when I have enough bandwidth.
The problem is still not fixed
Can't use it at all in Windows, only forking and fixing. Any news on this PR(https://github.com/hibiken/asynqmon/pull/251)?
+1
+1 template: pattern matches no files: ui\build\index.html
+1 template: pattern matches no files: ui\build\index.html
这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
+1 template: pattern matches no files: ui\build\index.html
这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
+1 It looks like a repository in disrepair, is there a better fork version? 看起来像是个年久失修的仓库,有没有比较好的fork版本呢?
这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。