mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-04-26 09:15:56 +03:00
[PR #1391] [MERGED] fix(template): use path.Join and rename parameter to fix embed path on Windows #1271
Labels
No labels
Q/A
bug
casdoor
dependencies
docker
documentation
duplicate
enhancement
help wanted
invalid
lego
platform:openwrt
platform:windows
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-ui#1271
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/0xJacky/nginx-ui/pull/1391
Author: @Alireza-Gholiei
Created: 10/13/2025
Status: ✅ Merged
Merged: 10/16/2025
Merged by: @0xJacky
Base:
dev← Head:fix/template-path-embed📝 Commits (1)
f621e16fix(template): use path.Join and rename param to avoid Windows embed path issue📊 Changes
1 file changed (+5 additions, -3 deletions)
View changed files
📝
internal/template/template.go(+5 -3)📄 Description
Summary
This PR fixes an issue where templates embedded with //go:embed couldn't be opened on Windows because paths were constructed with filepath.Join which produces backslashes (e.g.
block\letsencrypt.conf). embed.FS expects forward slashes.Changes
path->dirin:GetTemplateInfoParseTemplatepath.Join(dir, name)instead offilepath.Join(...)import "path/filepath"withimport "path"where appropriate.Why
embed.FSnormalizes file names with forward slashes (/). On Windowsfilepath.Joinproduces backslashes which lead to "file does not exist" errors at runtime.path.Joinworks on Linux/macOS and Windows for embedded resources.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.