Explorar el Código

fix: unify symlink handling for site and stream on posix and win

Jacky hace 15 horas
padre
commit
ab97f94356

+ 1 - 1
internal/self_check/resolve_path_win.go

@@ -9,5 +9,5 @@ import "path/filepath"
 // inclde sites-enabled/*.conf
 
 func resolvePath(path ...string) string {
-	return filepath.Join(path...) + ".conf"
+	return filepath.ToSlash(filepath.Join(path...) + ".conf")
 }

+ 1 - 1
internal/site/disable.go

@@ -17,7 +17,7 @@ import (
 
 // Disable disables a site by removing the symlink in sites-enabled
 func Disable(name string) (err error) {
-	enabledConfigFilePath := nginx.GetConfPath("sites-enabled", name)
+	enabledConfigFilePath := nginx.GetConfSymlinkPath(nginx.GetConfPath("sites-enabled", name))
 	_, err = os.Stat(enabledConfigFilePath)
 	if err != nil {
 		return

+ 1 - 1
internal/stream/disable.go

@@ -17,7 +17,7 @@ import (
 
 // Disable disables a site by removing the symlink in sites-enabled
 func Disable(name string) (err error) {
-	enabledConfigFilePath := nginx.GetConfPath("streams-enabled", name)
+	enabledConfigFilePath := nginx.GetConfSymlinkPath(nginx.GetConfPath("streams-enabled", name))
 	_, err = os.Stat(enabledConfigFilePath)
 	if err != nil {
 		return