mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
feat: custom nginx conf dir path #62
This commit is contained in:
parent
7a98c16535
commit
02fb07f6b4
12 changed files with 625 additions and 615 deletions
|
@ -5,6 +5,11 @@ JwtSecret =
|
||||||
Email =
|
Email =
|
||||||
HTTPChallengePort = 9180
|
HTTPChallengePort = 9180
|
||||||
StartCmd = login
|
StartCmd = login
|
||||||
|
Database = database
|
||||||
|
CADir =
|
||||||
|
Demo =
|
||||||
|
GithubProxy =
|
||||||
|
NginxConfigDir =
|
||||||
|
|
||||||
[nginx_log]
|
[nginx_log]
|
||||||
AccessLogPath = /var/log/nginx/access.log
|
AccessLogPath = /var/log/nginx/access.log
|
||||||
|
|
2
main.go
2
main.go
|
@ -48,7 +48,7 @@ func prog(state overseer.State) {
|
||||||
gin.SetMode(settings.ServerSettings.RunMode)
|
gin.SetMode(settings.ServerSettings.RunMode)
|
||||||
|
|
||||||
settings.Init(confPath)
|
settings.Init(confPath)
|
||||||
log.Printf("Nginx config dir path: %s", nginx.GetNginxConfPath(""))
|
log.Printf("Nginx config dir path: %s", nginx.GetConfPath())
|
||||||
if "" != settings.ServerSettings.JwtSecret {
|
if "" != settings.ServerSettings.JwtSecret {
|
||||||
model.Init()
|
model.Init()
|
||||||
|
|
||||||
|
|
|
@ -110,8 +110,8 @@ func IssueCert(c *gin.Context) {
|
||||||
|
|
||||||
close(logChan)
|
close(logChan)
|
||||||
|
|
||||||
sslCertificatePath := nginx.GetNginxConfPath("ssl/" + domain + "/fullchain.cer")
|
sslCertificatePath := nginx.GetConfPath("ssl", domain, "fullchain.cer")
|
||||||
sslCertificateKeyPath := nginx.GetNginxConfPath("ssl/" + domain + "/private.key")
|
sslCertificateKeyPath := nginx.GetConfPath("ssl", domain, "private.key")
|
||||||
|
|
||||||
certModel, err := model.FirstOrCreateCert(domain)
|
certModel, err := model.FirstOrCreateCert(domain)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -22,7 +21,7 @@ func GetConfigs(c *gin.Context) {
|
||||||
"is_dir": "bool",
|
"is_dir": "bool",
|
||||||
}
|
}
|
||||||
|
|
||||||
configFiles, err := os.ReadDir(nginx.GetNginxConfPath(dir))
|
configFiles, err := os.ReadDir(nginx.GetConfPath(dir))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ErrHandler(c, err)
|
ErrHandler(c, err)
|
||||||
|
@ -42,7 +41,7 @@ func GetConfigs(c *gin.Context) {
|
||||||
}
|
}
|
||||||
case mode&os.ModeSymlink != 0: // is a symbol
|
case mode&os.ModeSymlink != 0: // is a symbol
|
||||||
var targetPath string
|
var targetPath string
|
||||||
targetPath, err = os.Readlink(nginx.GetNginxConfPath(file.Name()))
|
targetPath, err = os.Readlink(nginx.GetConfPath(file.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("GetConfigs Read Symlink Error", targetPath, err)
|
log.Println("GetConfigs Read Symlink Error", targetPath, err)
|
||||||
continue
|
continue
|
||||||
|
@ -77,7 +76,7 @@ func GetConfigs(c *gin.Context) {
|
||||||
|
|
||||||
func GetConfig(c *gin.Context) {
|
func GetConfig(c *gin.Context) {
|
||||||
name := c.Param("name")
|
name := c.Param("name")
|
||||||
path := filepath.Join(nginx.GetNginxConfPath("/"), name)
|
path := nginx.GetConfPath("/", name)
|
||||||
|
|
||||||
content, err := os.ReadFile(path)
|
content, err := os.ReadFile(path)
|
||||||
|
|
||||||
|
@ -108,7 +107,7 @@ func AddConfig(c *gin.Context) {
|
||||||
name := request.Name
|
name := request.Name
|
||||||
content := request.Content
|
content := request.Content
|
||||||
|
|
||||||
path := filepath.Join(nginx.GetNginxConfPath("/"), name)
|
path := nginx.GetConfPath("/", name)
|
||||||
|
|
||||||
if _, err = os.Stat(path); err == nil {
|
if _, err = os.Stat(path); err == nil {
|
||||||
c.JSON(http.StatusNotAcceptable, gin.H{
|
c.JSON(http.StatusNotAcceptable, gin.H{
|
||||||
|
@ -125,7 +124,7 @@ func AddConfig(c *gin.Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output := nginx.ReloadNginx()
|
output := nginx.Reload()
|
||||||
|
|
||||||
if output != "" && strings.Contains(output, "error") {
|
if output != "" && strings.Contains(output, "error") {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{
|
c.JSON(http.StatusInternalServerError, gin.H{
|
||||||
|
@ -153,7 +152,7 @@ func EditConfig(c *gin.Context) {
|
||||||
ErrHandler(c, err)
|
ErrHandler(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
path := filepath.Join(nginx.GetNginxConfPath("/"), name)
|
path := nginx.GetConfPath("/", name)
|
||||||
content := request.Content
|
content := request.Content
|
||||||
|
|
||||||
origContent, err := os.ReadFile(path)
|
origContent, err := os.ReadFile(path)
|
||||||
|
@ -171,7 +170,7 @@ func EditConfig(c *gin.Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output := nginx.ReloadNginx()
|
output := nginx.Reload()
|
||||||
|
|
||||||
if output != "" && strings.Contains(output, "error") {
|
if output != "" && strings.Contains(output, "error") {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{
|
c.JSON(http.StatusInternalServerError, gin.H{
|
||||||
|
|
|
@ -9,7 +9,6 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -25,14 +24,14 @@ func GetDomains(c *gin.Context) {
|
||||||
"modify": "time",
|
"modify": "time",
|
||||||
}
|
}
|
||||||
|
|
||||||
configFiles, err := os.ReadDir(nginx.GetNginxConfPath("sites-available"))
|
configFiles, err := os.ReadDir(nginx.GetConfPath("sites-available"))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ErrHandler(c, err)
|
ErrHandler(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
enabledConfig, err := os.ReadDir(filepath.Join(nginx.GetNginxConfPath("sites-enabled")))
|
enabledConfig, err := os.ReadDir(nginx.GetConfPath("sites-enabled"))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ErrHandler(c, err)
|
ErrHandler(c, err)
|
||||||
|
@ -86,10 +85,10 @@ func GetDomain(c *gin.Context) {
|
||||||
name = rewriteName.(string)
|
name = rewriteName.(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
path := filepath.Join(nginx.GetNginxConfPath("sites-available"), name)
|
path := nginx.GetConfPath("sites-available", name)
|
||||||
|
|
||||||
enabled := true
|
enabled := true
|
||||||
if _, err := os.Stat(filepath.Join(nginx.GetNginxConfPath("sites-enabled"), name)); os.IsNotExist(err) {
|
if _, err := os.Stat(nginx.GetConfPath("sites-enabled", name)); os.IsNotExist(err) {
|
||||||
enabled = false
|
enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,23 +167,23 @@ func EditDomain(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
path := filepath.Join(nginx.GetNginxConfPath("sites-available"), name)
|
path := nginx.GetConfPath("sites-available", name)
|
||||||
|
|
||||||
err := os.WriteFile(path, []byte(json.Content), 0644)
|
err := os.WriteFile(path, []byte(json.Content), 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ErrHandler(c, err)
|
ErrHandler(c, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
enabledConfigFilePath := filepath.Join(nginx.GetNginxConfPath("sites-enabled"), name)
|
enabledConfigFilePath := nginx.GetConfPath("sites-enabled", name)
|
||||||
// rename the config file if needed
|
// rename the config file if needed
|
||||||
if name != json.Name {
|
if name != json.Name {
|
||||||
newPath := filepath.Join(nginx.GetNginxConfPath("sites-available"), json.Name)
|
newPath := nginx.GetConfPath("sites-available", json.Name)
|
||||||
// recreate soft link
|
// recreate soft link
|
||||||
log.Println(enabledConfigFilePath)
|
log.Println(enabledConfigFilePath)
|
||||||
if _, err = os.Stat(enabledConfigFilePath); err == nil {
|
if _, err = os.Stat(enabledConfigFilePath); err == nil {
|
||||||
log.Println(enabledConfigFilePath)
|
log.Println(enabledConfigFilePath)
|
||||||
_ = os.Remove(enabledConfigFilePath)
|
_ = os.Remove(enabledConfigFilePath)
|
||||||
enabledConfigFilePath = filepath.Join(nginx.GetNginxConfPath("sites-enabled"), json.Name)
|
enabledConfigFilePath = nginx.GetConfPath("sites-enabled", json.Name)
|
||||||
err = os.Symlink(newPath, enabledConfigFilePath)
|
err = os.Symlink(newPath, enabledConfigFilePath)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -202,10 +201,10 @@ func EditDomain(c *gin.Context) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enabledConfigFilePath = filepath.Join(nginx.GetNginxConfPath("sites-enabled"), name)
|
enabledConfigFilePath = nginx.GetConfPath("sites-enabled", name)
|
||||||
if _, err = os.Stat(enabledConfigFilePath); err == nil {
|
if _, err = os.Stat(enabledConfigFilePath); err == nil {
|
||||||
// Test nginx configuration
|
// Test nginx configuration
|
||||||
err = nginx.TestNginxConf()
|
err = nginx.TestConf()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{
|
c.JSON(http.StatusInternalServerError, gin.H{
|
||||||
"message": err.Error(),
|
"message": err.Error(),
|
||||||
|
@ -214,7 +213,7 @@ func EditDomain(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
output := nginx.ReloadNginx()
|
output := nginx.Reload()
|
||||||
|
|
||||||
if output != "" && strings.Contains(output, "error") {
|
if output != "" && strings.Contains(output, "error") {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{
|
c.JSON(http.StatusInternalServerError, gin.H{
|
||||||
|
@ -228,8 +227,8 @@ func EditDomain(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func EnableDomain(c *gin.Context) {
|
func EnableDomain(c *gin.Context) {
|
||||||
configFilePath := filepath.Join(nginx.GetNginxConfPath("sites-available"), c.Param("name"))
|
configFilePath := nginx.GetConfPath("sites-available", c.Param("name"))
|
||||||
enabledConfigFilePath := filepath.Join(nginx.GetNginxConfPath("sites-enabled"), c.Param("name"))
|
enabledConfigFilePath := nginx.GetConfPath("sites-enabled", c.Param("name"))
|
||||||
|
|
||||||
_, err := os.Stat(configFilePath)
|
_, err := os.Stat(configFilePath)
|
||||||
|
|
||||||
|
@ -248,7 +247,7 @@ func EnableDomain(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test nginx config, if not pass then rollback.
|
// Test nginx config, if not pass then rollback.
|
||||||
err = nginx.TestNginxConf()
|
err = nginx.TestConf()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = os.Remove(enabledConfigFilePath)
|
_ = os.Remove(enabledConfigFilePath)
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{
|
c.JSON(http.StatusInternalServerError, gin.H{
|
||||||
|
@ -257,7 +256,7 @@ func EnableDomain(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
output := nginx.ReloadNginx()
|
output := nginx.Reload()
|
||||||
|
|
||||||
if output != "" && strings.Contains(output, "error") {
|
if output != "" && strings.Contains(output, "error") {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{
|
c.JSON(http.StatusInternalServerError, gin.H{
|
||||||
|
@ -272,7 +271,7 @@ func EnableDomain(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func DisableDomain(c *gin.Context) {
|
func DisableDomain(c *gin.Context) {
|
||||||
enabledConfigFilePath := filepath.Join(nginx.GetNginxConfPath("sites-enabled"), c.Param("name"))
|
enabledConfigFilePath := nginx.GetConfPath("sites-enabled", c.Param("name"))
|
||||||
|
|
||||||
_, err := os.Stat(enabledConfigFilePath)
|
_, err := os.Stat(enabledConfigFilePath)
|
||||||
|
|
||||||
|
@ -296,7 +295,7 @@ func DisableDomain(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
output := nginx.ReloadNginx()
|
output := nginx.Reload()
|
||||||
|
|
||||||
if output != "" {
|
if output != "" {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{
|
c.JSON(http.StatusInternalServerError, gin.H{
|
||||||
|
@ -313,8 +312,8 @@ func DisableDomain(c *gin.Context) {
|
||||||
func DeleteDomain(c *gin.Context) {
|
func DeleteDomain(c *gin.Context) {
|
||||||
var err error
|
var err error
|
||||||
name := c.Param("name")
|
name := c.Param("name")
|
||||||
availablePath := filepath.Join(nginx.GetNginxConfPath("sites-available"), name)
|
availablePath := nginx.GetConfPath("sites-available", name)
|
||||||
enabledPath := filepath.Join(nginx.GetNginxConfPath("sites-enabled"), name)
|
enabledPath := nginx.GetConfPath("sites-enabled", name)
|
||||||
|
|
||||||
if _, err = os.Stat(availablePath); os.IsNotExist(err) {
|
if _, err = os.Stat(availablePath); os.IsNotExist(err) {
|
||||||
c.JSON(http.StatusNotFound, gin.H{
|
c.JSON(http.StatusNotFound, gin.H{
|
||||||
|
|
|
@ -13,7 +13,6 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -107,7 +106,7 @@ func getLogPath(control *controlStruct) (logPath string, err error) {
|
||||||
switch control.Type {
|
switch control.Type {
|
||||||
case "site":
|
case "site":
|
||||||
var config *nginx.NgxConfig
|
var config *nginx.NgxConfig
|
||||||
path := filepath.Join(nginx.GetNginxConfPath("sites-available"), control.ConfName)
|
path := nginx.GetConfPath("sites-available", control.ConfName)
|
||||||
config, err = nginx.ParseNgxConfig(path)
|
config, err = nginx.ParseNgxConfig(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = errors.Wrap(err, "error parsing ngx config")
|
err = errors.Wrap(err, "error parsing ngx config")
|
||||||
|
|
|
@ -3,7 +3,6 @@ package model
|
||||||
import (
|
import (
|
||||||
"github.com/0xJacky/Nginx-UI/server/pkg/nginx"
|
"github.com/0xJacky/Nginx-UI/server/pkg/nginx"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -38,7 +37,7 @@ func GetAutoCertList() (c []Cert) {
|
||||||
db.Where("auto_cert", AutoCertEnabled).Find(&t)
|
db.Where("auto_cert", AutoCertEnabled).Find(&t)
|
||||||
|
|
||||||
// check if this domain is enabled
|
// check if this domain is enabled
|
||||||
enabledConfig, err := os.ReadDir(filepath.Join(nginx.GetNginxConfPath("sites-enabled")))
|
enabledConfig, err := os.ReadDir(nginx.GetConfPath("sites-enabled"))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|
|
@ -110,7 +110,7 @@ func IssueCert(domain []string, logChan chan string, errChan chan error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
name := strings.Join(domain, "_")
|
name := strings.Join(domain, "_")
|
||||||
saveDir := nginx.GetNginxConfPath("ssl/" + name)
|
saveDir := nginx.GetConfPath("ssl/" + name)
|
||||||
if _, err = os.Stat(saveDir); os.IsNotExist(err) {
|
if _, err = os.Stat(saveDir); os.IsNotExist(err) {
|
||||||
err = os.MkdirAll(saveDir, 0755)
|
err = os.MkdirAll(saveDir, 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -142,7 +142,7 @@ func IssueCert(domain []string, logChan chan string, errChan chan error) {
|
||||||
close(errChan)
|
close(errChan)
|
||||||
logChan <- "Reloading nginx"
|
logChan <- "Reloading nginx"
|
||||||
|
|
||||||
nginx.ReloadNginx()
|
nginx.Reload()
|
||||||
|
|
||||||
logChan <- "Finished"
|
logChan <- "Finished"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package nginx
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"github.com/0xJacky/Nginx-UI/server/settings"
|
||||||
"log"
|
"log"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -9,7 +10,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNginxConf() error {
|
func TestConf() error {
|
||||||
out, err := exec.Command("nginx", "-t").CombinedOutput()
|
out, err := exec.Command("nginx", "-t").CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
@ -22,7 +23,7 @@ func TestNginxConf() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ReloadNginx() string {
|
func Reload() string {
|
||||||
out, err := exec.Command("nginx", "-s", "reload").CombinedOutput()
|
out, err := exec.Command("nginx", "-s", "reload").CombinedOutput()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -38,19 +39,26 @@ func ReloadNginx() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetNginxConfPath(dir string) string {
|
func GetConfPath(dir ...string) string {
|
||||||
|
|
||||||
|
var confPath string
|
||||||
|
|
||||||
|
if settings.ServerSettings.NginxConfigDir == "" {
|
||||||
out, err := exec.Command("nginx", "-V").CombinedOutput()
|
out, err := exec.Command("nginx", "-V").CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println("nginx.GetConfPath exec.Command error", err)
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
// fmt.Printf("%s\n", out)
|
|
||||||
|
|
||||||
r, _ := regexp.Compile("--conf-path=(.*)/(.*.conf)")
|
r, _ := regexp.Compile("--conf-path=(.*)/(.*.conf)")
|
||||||
|
match := r.FindStringSubmatch(string(out))
|
||||||
|
if len(match) < 1 {
|
||||||
|
log.Println("nginx.GetConfPath len(match) < 1")
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
confPath = r.FindStringSubmatch(string(out))[1]
|
||||||
|
} else {
|
||||||
|
confPath = settings.ServerSettings.NginxConfigDir
|
||||||
|
}
|
||||||
|
|
||||||
confPath := r.FindStringSubmatch(string(out))[1]
|
return filepath.Join(confPath, filepath.Join(dir...))
|
||||||
|
|
||||||
// fmt.Println(confPath)
|
|
||||||
|
|
||||||
return filepath.Join(confPath, dir)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ type Server struct {
|
||||||
Demo bool `json:"demo"`
|
Demo bool `json:"demo"`
|
||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"`
|
||||||
GithubProxy string `json:"github_proxy"`
|
GithubProxy string `json:"github_proxy"`
|
||||||
|
NginxConfigDir string `json:"nginx_config_dir"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type NginxLog struct {
|
type NginxLog struct {
|
||||||
|
|
|
@ -46,7 +46,7 @@ func TestAcme(t *testing.T) {
|
||||||
"install",
|
"install",
|
||||||
"--log",
|
"--log",
|
||||||
"--home", "/usr/local/acme.sh",
|
"--home", "/usr/local/acme.sh",
|
||||||
"--cert-home", nginx.GetNginxConfPath("ssl")).
|
"--cert-home", nginx.GetConfPath("ssl")).
|
||||||
CombinedOutput()
|
CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
|
|
@ -20,14 +20,14 @@ func TestCert(t *testing.T) {
|
||||||
}
|
}
|
||||||
fmt.Printf("%s\n", out)
|
fmt.Printf("%s\n", out)
|
||||||
|
|
||||||
_, err = os.Stat(nginx.GetNginxConfPath("ssl/test.ojbk.me/fullchain.cer"))
|
_, err = os.Stat(nginx.GetConfPath("ssl/test.ojbk.me/fullchain.cer"))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Println("[found]", "fullchain.cer")
|
log.Println("[found]", "fullchain.cer")
|
||||||
_, err = os.Stat(nginx.GetNginxConfPath("ssl/test.ojbk.me/test.ojbk.me.key"))
|
_, err = os.Stat(nginx.GetConfPath("ssl/test.ojbk.me/test.ojbk.me.key"))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue