refactor: consolidate property fetching for nginx plugin into golang codebase

Also update the documentation to include docs for all properties.
This commit is contained in:
Jose Diaz-Gonzalez committed 2024-02-06 00:42:48 -05:00
1 parent 6625846ecc
commit d4b445985b
14 files changed
+1448 -492

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
package nginxvhosts
import (
"os"
)
func getLogRoot() string {
logRoot := "/var/log/nginx"
if isOpenRestyInstalled() {
logRoot = "/var/log/openresty"
}
return logRoot
}
func isOpenRestyInstalled() bool {
fi, err := os.Stat("/usr/bin/openresty")
if err != nil {
return false
}
if fi.IsDir() {
return false
}
return true
}