Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormhsanaei <ho3ein.sanaei@gmail.com>2025-09-18 14:56:04 +0300
committermhsanaei <ho3ein.sanaei@gmail.com>2025-09-18 14:56:04 +0300
commit59ea2645db827335a0689d2fb7aeeef4e52af52b (patch)
treea52caa80571fef4919c3df59a4bceacd60ba6aa6 /sub/sub.go
parent8c8d280f147ce4e8f604080d1dbf066332e55efc (diff)
new: subJsonEnable
after this subEnable by default is true and subJsonEnable is false
Diffstat (limited to 'sub/sub.go')
-rw-r--r--sub/sub.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/sub/sub.go b/sub/sub.go
index 8a16120d..e2876a61 100644
--- a/sub/sub.go
+++ b/sub/sub.go
@@ -85,6 +85,12 @@ func (s *Server) initRouter() (*gin.Engine, error) {
return nil, err
}
+ // Determine if JSON subscription endpoint is enabled
+ subJsonEnable, err := s.settingService.GetSubJsonEnable()
+ if err != nil {
+ return nil, err
+ }
+
// Set base_path based on LinksPath for template rendering
engine.Use(func(c *gin.Context) {
c.Set("base_path", LinksPath)
@@ -186,7 +192,7 @@ func (s *Server) initRouter() (*gin.Engine, error) {
g := engine.Group("/")
s.sub = NewSUBController(
- g, LinksPath, JsonPath, Encrypt, ShowInfo, RemarkModel, SubUpdates,
+ g, LinksPath, JsonPath, subJsonEnable, Encrypt, ShowInfo, RemarkModel, SubUpdates,
SubJsonFragment, SubJsonNoises, SubJsonMux, SubJsonRules, SubTitle)
return engine, nil