small fixes and typos
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||

|
||||

|
||||

|
||||
[](https://goreportcard.com/report/github.com/alireza0/s-ui)
|
||||
[](https://img.shields.io/github/downloads/alireza0/s-ui/total.svg)
|
||||
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ func GetDBFolderPath() string {
|
||||
if dbFolderPath == "" {
|
||||
dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
|
||||
if err != nil {
|
||||
dbFolderPath = "/usr/local/s-ui/db"
|
||||
return "/usr/local/s-ui/db"
|
||||
}
|
||||
dbFolderPath = dir + "/db"
|
||||
}
|
||||
|
||||
@@ -336,6 +336,9 @@ func (s *InboundService) RestartInbounds(tx *gorm.DB, ids []uint) error {
|
||||
return err
|
||||
}
|
||||
inboundConfig, err = s.addUsers(tx, inboundConfig, inbound.Id, inbound.Type)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = corePtr.AddInbound(inboundConfig)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
+1
-1
@@ -185,7 +185,7 @@ func (s *ServerService) generateECHKeyPair(options string) []string {
|
||||
}
|
||||
|
||||
func (s *ServerService) generateTLSKeyPair(serverName string) []string {
|
||||
privateKeyPem, publicKeyPem, err := tls.GenerateKeyPair(time.Now, serverName, time.Now().AddDate(0, 12, 0))
|
||||
privateKeyPem, publicKeyPem, err := tls.GenerateCertificate(nil, nil, time.Now, serverName, time.Now().AddDate(0, 12, 0))
|
||||
if err != nil {
|
||||
return []string{"Failed to generate TLS keypair: ", err.Error()}
|
||||
}
|
||||
|
||||
+1
-1
@@ -358,7 +358,7 @@ func (s *SettingService) Save(tx *gorm.DB, data json.RawMessage) error {
|
||||
return err
|
||||
}
|
||||
for key, obj := range settings {
|
||||
// Secure file existance check
|
||||
// Secure file existence check
|
||||
if obj != "" && (key == "webCertFile" ||
|
||||
key == "webKeyFile" ||
|
||||
key == "subCertFile" ||
|
||||
|
||||
@@ -25,6 +25,9 @@ func FillOutJson(i *model.Inbound, hostname string) error {
|
||||
}
|
||||
|
||||
inbound, err := i.MarshalFull()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
outJson["type"] = i.Type
|
||||
outJson["tag"] = i.Tag
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
//go:embed html/*
|
||||
//go:embed *
|
||||
var content embed.FS
|
||||
|
||||
type Server struct {
|
||||
|
||||
Reference in New Issue
Block a user