refactor: replace upgrader with version package for runtime and release information

This commit is contained in:
Jacky 2025-04-21 08:06:27 +00:00
parent 8e212ae79b
commit d0cf93d5e3
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
11 changed files with 182 additions and 121 deletions

View file

@ -2,10 +2,10 @@ package settings
import (
"log"
"os"
"strings"
"time"
"github.com/0xJacky/Nginx-UI/internal/helper"
"github.com/caarlos0/env/v11"
"github.com/elliotchance/orderedmap/v3"
"github.com/spf13/cast"
@ -81,7 +81,7 @@ func Init(confPath string) {
// if in official docker, set the restart cmd of nginx to "nginx -s stop",
// then the supervisor of s6-overlay will start the nginx again.
if cast.ToBool(os.Getenv("NGINX_UI_OFFICIAL_DOCKER")) {
if helper.InNginxUIOfficialDocker() {
NginxSettings.RestartCmd = "nginx -s stop"
}