mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-16 23:27:14 +00:00
fix(sub): prevent default profile page URL disclosure (#6538)
* fix(sub): prevent default profile page URL disclosure Add explicit none, builtin, and custom profile page modes. Preserve existing custom URLs and warn before exposing the built-in page. Cover mode selection, legacy settings, and subscription response headers. * fix(subscription): add profile page link options and upgrade notes
This commit is contained in:
@@ -53,6 +53,7 @@ type cachedSubTemplate struct {
|
||||
type SUBController struct {
|
||||
subTitle string
|
||||
subSupportUrl string
|
||||
subProfileMode string
|
||||
subProfileUrl string
|
||||
subAnnounce string
|
||||
subEnableRouting bool
|
||||
@@ -115,6 +116,7 @@ type subControllerConfig struct {
|
||||
|
||||
subTitle string
|
||||
subSupportURL string
|
||||
subProfileMode string
|
||||
subProfileURL string
|
||||
subAnnounce string
|
||||
subEnableRouting bool
|
||||
@@ -224,6 +226,10 @@ func WithSUBProfileURL(value string) SUBControllerOption {
|
||||
return func(config *subControllerConfig) { config.subProfileURL = value }
|
||||
}
|
||||
|
||||
func WithSUBProfileMode(value string) SUBControllerOption {
|
||||
return func(config *subControllerConfig) { config.subProfileMode = value }
|
||||
}
|
||||
|
||||
func WithSUBAnnounce(value string) SUBControllerOption {
|
||||
return func(config *subControllerConfig) { config.subAnnounce = value }
|
||||
}
|
||||
@@ -260,6 +266,7 @@ func defaultSUBControllerConfig() subControllerConfig {
|
||||
subEncrypt: true,
|
||||
remarkTemplate: service.DefaultRemarkTemplate,
|
||||
updateInterval: "12",
|
||||
subProfileMode: service.SubProfileModeNone,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,6 +284,7 @@ func NewSUBController(g *gin.RouterGroup, options ...SUBControllerOption) *SUBCo
|
||||
a := &SUBController{
|
||||
subTitle: config.subTitle,
|
||||
subSupportUrl: config.subSupportURL,
|
||||
subProfileMode: config.subProfileMode,
|
||||
subProfileUrl: config.subProfileURL,
|
||||
subAnnounce: config.subAnnounce,
|
||||
subEnableRouting: config.subEnableRouting,
|
||||
@@ -485,8 +493,7 @@ func (a *SUBController) subs(c *gin.Context) {
|
||||
|
||||
// Add headers
|
||||
header := subReq.subscriptionUserinfo(traffic)
|
||||
profileURL := fmt.Sprintf("%s://%s%s", scheme, hostWithPort, c.Request.RequestURI)
|
||||
metadata := a.metadataForSubRequest(func() *SubService { return subReq }, subId, profileURL)
|
||||
metadata := a.metadataForSubRequest(func() *SubService { return subReq }, subId, builtinProfileURL(c, scheme, hostWithPort))
|
||||
a.ApplyCommonHeaders(c, header, a.updateInterval, metadata.Title, metadata.SupportURL, metadata.ProfileURL, metadata.Announce, a.subEnableRouting, a.subRoutingRules, a.subHideSettings)
|
||||
|
||||
if a.subIncyEnableRouting && a.subIncyRoutingRules != "" {
|
||||
@@ -818,14 +825,13 @@ func (a *SUBController) serveJsonBody(c *gin.Context, alwaysReturnArray bool, co
|
||||
if len(jsonSub) == 0 && header == "" {
|
||||
return false
|
||||
}
|
||||
profileURL := fmt.Sprintf("%s://%s%s", scheme, hostWithPort, c.Request.RequestURI)
|
||||
var subReq *SubService
|
||||
metadata := a.metadataForSubRequest(func() *SubService {
|
||||
if subReq == nil {
|
||||
subReq = a.subService.ForRequest(host)
|
||||
}
|
||||
return subReq
|
||||
}, subId, profileURL)
|
||||
}, subId, builtinProfileURL(c, scheme, hostWithPort))
|
||||
a.ApplyCommonHeaders(c, header, a.updateInterval, metadata.Title, metadata.SupportURL, metadata.ProfileURL, metadata.Announce, a.subEnableRouting, a.subRoutingRules, a.subHideSettings)
|
||||
if rawDownload {
|
||||
c.Writer.Header().Set("Content-Disposition", `attachment; filename="subscription.json"`)
|
||||
@@ -887,14 +893,13 @@ func (a *SUBController) serveClashBody(c *gin.Context, rawDownload bool, legacy
|
||||
if len(clashSub) == 0 && header == "" {
|
||||
return false
|
||||
}
|
||||
profileURL := fmt.Sprintf("%s://%s%s", scheme, hostWithPort, c.Request.RequestURI)
|
||||
var subReq *SubService
|
||||
metadata := a.metadataForSubRequest(func() *SubService {
|
||||
if subReq == nil {
|
||||
subReq = a.subService.ForRequest(host)
|
||||
}
|
||||
return subReq
|
||||
}, subId, profileURL)
|
||||
}, subId, builtinProfileURL(c, scheme, hostWithPort))
|
||||
a.ApplyCommonHeaders(c, header, a.updateInterval, metadata.Title, metadata.SupportURL, metadata.ProfileURL, metadata.Announce, a.subEnableRouting, a.subRoutingRules, a.subHideSettings)
|
||||
if rawDownload {
|
||||
c.Writer.Header().Set("Content-Disposition", `attachment; filename="subscription.yaml"`)
|
||||
@@ -906,6 +911,11 @@ func (a *SUBController) serveClashBody(c *gin.Context, rawDownload bool, legacy
|
||||
return true
|
||||
}
|
||||
|
||||
func builtinProfileURL(c *gin.Context, scheme, hostWithPort string) string {
|
||||
// Drop download/format selectors so the opt-in link always opens the HTML page.
|
||||
return fmt.Sprintf("%s://%s%s?html=1", scheme, hostWithPort, c.Request.URL.EscapedPath())
|
||||
}
|
||||
|
||||
// ApplyCommonHeaders sets common HTTP headers for subscription responses including user info, update interval, and profile title.
|
||||
func (a *SUBController) ApplyCommonHeaders(
|
||||
c *gin.Context,
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/database"
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/database/model"
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/logger"
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/web/service"
|
||||
)
|
||||
|
||||
type subPlaceholderData struct {
|
||||
@@ -76,10 +77,17 @@ func subMetadataUsesPlaceholders(values ...string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (a *SUBController) metadataForSubRequest(getSubReq func() *SubService, subID string, fallbackProfileURL string) renderedSubMetadata {
|
||||
func (a *SUBController) metadataForSubRequest(getSubReq func() *SubService, subID, builtinURL string) renderedSubMetadata {
|
||||
profileURL := ""
|
||||
switch a.subProfileMode {
|
||||
case service.SubProfileModeBuiltin:
|
||||
profileURL = builtinURL
|
||||
case service.SubProfileModeCustom:
|
||||
profileURL = strings.TrimSpace(a.subProfileUrl)
|
||||
}
|
||||
var context remarkContext
|
||||
var hasContext bool
|
||||
if subMetadataUsesPlaceholders(a.subTitle, a.subSupportUrl, a.subProfileUrl, a.subAnnounce) {
|
||||
if subMetadataUsesPlaceholders(a.subTitle, a.subSupportUrl, profileURL, a.subAnnounce) {
|
||||
var err error
|
||||
subReq := getSubReq()
|
||||
context, hasContext, err = subReq.subscriptionTemplateContextBySubID(subID)
|
||||
@@ -87,12 +95,8 @@ func (a *SUBController) metadataForSubRequest(getSubReq func() *SubService, subI
|
||||
logger.Warning("sub: load template contexts for subscription metadata:", err)
|
||||
}
|
||||
}
|
||||
profileURL := a.subProfileUrl
|
||||
if profileURL == "" {
|
||||
profileURL = fallbackProfileURL
|
||||
} else {
|
||||
profileURL = renderSubPlaceholders(profileURL, subPlaceholderData{SubID: subID, Context: context, HasCtx: hasContext, Escape: true})
|
||||
}
|
||||
// Disabled modes ignore the retained custom URL and never fall back to the request URL.
|
||||
profileURL = renderSubPlaceholders(profileURL, subPlaceholderData{SubID: subID, Context: context, HasCtx: hasContext, Escape: true})
|
||||
data := subPlaceholderData{SubID: subID, Context: context, HasCtx: hasContext}
|
||||
return renderedSubMetadata{
|
||||
Title: renderSubPlaceholders(a.subTitle, data),
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package sub
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/database"
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/database/model"
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/web/service"
|
||||
)
|
||||
|
||||
func TestRenderSubPlaceholders(t *testing.T) {
|
||||
@@ -68,20 +73,75 @@ func TestRenderSubPlaceholders(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMetadataForSubRequestDoesNotExpandFallbackProfileURL(t *testing.T) {
|
||||
func TestMetadataForSubRequestOmitsUnconfiguredProfileURL(t *testing.T) {
|
||||
a := &SUBController{
|
||||
subTitle: "isVPN",
|
||||
subSupportUrl: "https://support.example/",
|
||||
}
|
||||
fallback := "https://sub.example.com/sub/sub-123?x={{EMAIL}}"
|
||||
|
||||
metadata := a.metadataForSubRequest(func() *SubService {
|
||||
t.Fatal("metadataForSubRequest loaded a subscription context without configured placeholders")
|
||||
return nil
|
||||
}, "sub-123", fallback)
|
||||
}, "sub-123", "https://sub.example/sub-123")
|
||||
|
||||
if metadata.ProfileURL != fallback {
|
||||
t.Fatalf("ProfileURL = %q, want untouched fallback %q", metadata.ProfileURL, fallback)
|
||||
if metadata.ProfileURL != "" {
|
||||
t.Fatalf("ProfileURL = %q, want no link when unconfigured", metadata.ProfileURL)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSubscriptionProfileURLRequiresExplicitConfiguration(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
initSubDB(t)
|
||||
seedInfoEndpointSub(t, "profile-sub", "profile@example.com")
|
||||
|
||||
for _, config := range []struct {
|
||||
name, profileURL, want string
|
||||
}{
|
||||
{name: "empty"},
|
||||
{name: "whitespace", profileURL: " "},
|
||||
{name: "explicit", profileURL: "https://portal.example.com/account", want: "https://portal.example.com/account"},
|
||||
{name: "template", profileURL: "https://portal.example.com/account?sub={{SUB_ID}}", want: "https://portal.example.com/account?sub=profile-sub"},
|
||||
} {
|
||||
t.Run(config.name, func(t *testing.T) {
|
||||
for _, client := range []struct {
|
||||
name, userAgent string
|
||||
happAutoDetect bool
|
||||
}{
|
||||
{name: "Happ", userAgent: "Happ/3.22.0 (Android)", happAutoDetect: true},
|
||||
{name: "Happ without auto-detection", userAgent: "Happ/3.22.0 (Android)"},
|
||||
{name: "standard", userAgent: "v2rayNG/1.8.5", happAutoDetect: true},
|
||||
} {
|
||||
t.Run(client.name, func(t *testing.T) {
|
||||
// All formats must honor the opt-in, independently of Happ customization.
|
||||
router := gin.New()
|
||||
NewSUBController(router.Group("/"),
|
||||
WithSUBJsonEnabled(true), WithSUBClashEnabled(true),
|
||||
WithSUBProfileURL(config.profileURL),
|
||||
WithSUBProfileMode(service.SubProfileModeCustom),
|
||||
WithSUBHappConfig(HappConfig{AutoDetect: client.happAutoDetect}),
|
||||
)
|
||||
for _, path := range []string{"/sub/profile-sub", "/json/profile-sub", "/clash/profile-sub"} {
|
||||
t.Run(path, func(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodGet, path, nil)
|
||||
req.Host = "sub.example.com"
|
||||
req.Header.Set("User-Agent", client.userAgent)
|
||||
resp := httptest.NewRecorder()
|
||||
router.ServeHTTP(resp, req)
|
||||
if resp.Code != http.StatusOK {
|
||||
t.Fatalf("status = %d, want 200; body=%s", resp.Code, resp.Body.String())
|
||||
}
|
||||
if got := resp.Header().Get("Profile-Web-Page-Url"); got != config.want {
|
||||
t.Fatalf("Profile-Web-Page-Url = %q, want %q", got, config.want)
|
||||
}
|
||||
if config.want == "" {
|
||||
if _, present := resp.Header()["Profile-Web-Page-Url"]; present {
|
||||
t.Fatal("unconfigured profile header must be omitted")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,12 +170,13 @@ func TestMetadataForSubRequestUsesStableClientIdentity(t *testing.T) {
|
||||
}
|
||||
|
||||
a := &SUBController{
|
||||
subTitle: "isVPN — {{EMAIL}}",
|
||||
subSupportUrl: "https://support.example/?email={{EMAIL}}&tg={{TELEGRAM_ID}}",
|
||||
subProfileUrl: "https://profile.example/account/{{ID}}",
|
||||
subAnnounce: "Subscription {{SUB_ID}}",
|
||||
subTitle: "isVPN — {{EMAIL}}",
|
||||
subSupportUrl: "https://support.example/?email={{EMAIL}}&tg={{TELEGRAM_ID}}",
|
||||
subProfileUrl: "https://profile.example/account/{{ID}}",
|
||||
subProfileMode: service.SubProfileModeCustom,
|
||||
subAnnounce: "Subscription {{SUB_ID}}",
|
||||
}
|
||||
metadata := a.metadataForSubRequest(func() *SubService { return &SubService{} }, "sub-123", "https://fallback.example/{{EMAIL}}")
|
||||
metadata := a.metadataForSubRequest(func() *SubService { return &SubService{} }, "sub-123", "https://sub.example/sub-123")
|
||||
|
||||
if metadata.Title != "isVPN — john doe@example.com" {
|
||||
t.Fatalf("Title = %q", metadata.Title)
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package sub
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/database"
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/database/model"
|
||||
)
|
||||
|
||||
func TestSubscriptionProfileModesFromSavedSettings(t *testing.T) {
|
||||
oldFS, oldMode := distFS, gin.Mode()
|
||||
oldWriter, oldErrorWriter := gin.DefaultWriter, gin.DefaultErrorWriter
|
||||
SetDistFS(testDistFS)
|
||||
t.Cleanup(func() {
|
||||
SetDistFS(oldFS)
|
||||
gin.SetMode(oldMode)
|
||||
gin.DefaultWriter, gin.DefaultErrorWriter = oldWriter, oldErrorWriter
|
||||
})
|
||||
for _, config := range []struct {
|
||||
name, mode, profileURL, want string
|
||||
}{
|
||||
{name: "new installation"},
|
||||
{name: "legacy whitespace", profileURL: " "},
|
||||
{name: "legacy custom", profileURL: "https://portal.example/account", want: "https://portal.example/account"},
|
||||
{name: "none retains custom", mode: "none", profileURL: "https://portal.example/account"},
|
||||
{name: "builtin", mode: "builtin", profileURL: "https://portal.example/account"},
|
||||
{name: "custom", mode: "custom", profileURL: "https://portal.example/?sub={{SUB_ID}}", want: "https://portal.example/?sub=profile-sub"},
|
||||
{name: "empty custom", mode: "custom"},
|
||||
{name: "invalid mode", mode: "invalid", profileURL: "https://portal.example/account"},
|
||||
} {
|
||||
t.Run(config.name, func(t *testing.T) {
|
||||
initSubDB(t)
|
||||
seedInfoEndpointSub(t, "profile-sub", "profile@example.com")
|
||||
settings := []model.Setting{
|
||||
{Key: "subPath", Value: "/sub/"},
|
||||
{Key: "subJsonPath", Value: "/json/"},
|
||||
{Key: "subClashPath", Value: "/clash/"},
|
||||
{Key: "subJsonEnable", Value: "true"},
|
||||
{Key: "subClashEnable", Value: "true"},
|
||||
{Key: "subProfileUrl", Value: config.profileURL},
|
||||
}
|
||||
if config.mode != "" {
|
||||
settings = append(settings, model.Setting{Key: "subProfileMode", Value: config.mode})
|
||||
}
|
||||
for _, setting := range settings {
|
||||
if err := database.GetDB().Where("key = ?", setting.Key).Delete(&model.Setting{}).Error; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := database.GetDB().Create(&setting).Error; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
router, err := (&Server{}).initRouter()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, path := range []string{"/sub/profile-sub", "/json/profile-sub", "/clash/profile-sub", "/json/profile-sub?view=raw", "/clash/profile-sub?view=raw", "/mihomo/profile-sub"} {
|
||||
for _, userAgent := range []string{"Happ/3.22.0 (Android)", "v2rayNG/1.8.5"} {
|
||||
t.Run(path+"/"+userAgent, func(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodGet, "https://sub.example.com:8443"+path, nil)
|
||||
req.Header.Set("User-Agent", userAgent)
|
||||
resp := httptest.NewRecorder()
|
||||
router.ServeHTTP(resp, req)
|
||||
if resp.Code != http.StatusOK {
|
||||
t.Fatalf("status = %d; body=%s", resp.Code, resp.Body.String())
|
||||
}
|
||||
want := config.want
|
||||
if config.mode == "builtin" {
|
||||
want = "https://sub.example.com:8443" + req.URL.EscapedPath() + "?html=1"
|
||||
}
|
||||
if got := resp.Header().Get("Profile-Web-Page-Url"); got != want {
|
||||
t.Fatalf("Profile-Web-Page-Url = %q, want %q", got, want)
|
||||
}
|
||||
if want == "" {
|
||||
if _, present := resp.Header()["Profile-Web-Page-Url"]; present {
|
||||
t.Fatal("disabled profile header must be absent")
|
||||
}
|
||||
}
|
||||
if config.mode == "builtin" {
|
||||
// The restored link must open the page, even when copied from a raw download.
|
||||
page := httptest.NewRecorder()
|
||||
router.ServeHTTP(page, httptest.NewRequest(http.MethodGet, want, nil))
|
||||
if page.Code != http.StatusOK || !strings.Contains(page.Header().Get("Content-Type"), "text/html") {
|
||||
t.Fatalf("builtin link did not serve HTML: status=%d, type=%q", page.Code, page.Header().Get("Content-Type"))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -194,6 +194,10 @@ func (s *Server) initRouter() (*gin.Engine, error) {
|
||||
if err != nil {
|
||||
SubProfileUrl = ""
|
||||
}
|
||||
SubProfileMode, err := s.settingService.GetSubProfileMode()
|
||||
if err != nil {
|
||||
SubProfileMode = service.SubProfileModeNone
|
||||
}
|
||||
|
||||
SubAnnounce, err := s.settingService.GetSubAnnounce()
|
||||
if err != nil {
|
||||
@@ -329,6 +333,7 @@ func (s *Server) initRouter() (*gin.Engine, error) {
|
||||
WithSUBTitle(SubTitle),
|
||||
WithSUBSupportURL(SubSupportUrl),
|
||||
WithSUBProfileURL(SubProfileUrl),
|
||||
WithSUBProfileMode(SubProfileMode),
|
||||
WithSUBAnnounce(SubAnnounce),
|
||||
WithSUBEnableRouting(SubEnableRouting),
|
||||
WithSUBRoutingRules(SubRoutingRules),
|
||||
|
||||
@@ -94,6 +94,7 @@ type AllSetting struct {
|
||||
SubClashUserAgentRegex string `json:"subClashUserAgentRegex" form:"subClashUserAgentRegex"`
|
||||
SubTitle string `json:"subTitle" form:"subTitle"`
|
||||
SubSupportUrl string `json:"subSupportUrl" form:"subSupportUrl"`
|
||||
SubProfileMode string `json:"subProfileMode" form:"subProfileMode"`
|
||||
SubProfileUrl string `json:"subProfileUrl" form:"subProfileUrl"`
|
||||
SubAnnounce string `json:"subAnnounce" form:"subAnnounce"`
|
||||
SubEnableRouting bool `json:"subEnableRouting" form:"subEnableRouting"`
|
||||
|
||||
@@ -44,6 +44,13 @@ const (
|
||||
maxRegexLength = 2048
|
||||
)
|
||||
|
||||
// Built-in profile links expose the subscription URL and require an explicit opt-in.
|
||||
const (
|
||||
SubProfileModeNone = "none"
|
||||
SubProfileModeBuiltin = "builtin"
|
||||
SubProfileModeCustom = "custom"
|
||||
)
|
||||
|
||||
var defaultValueMap = map[string]string{
|
||||
"xrayTemplateConfig": xrayTemplateConfig,
|
||||
"webListen": "",
|
||||
@@ -101,6 +108,7 @@ var defaultValueMap = map[string]string{
|
||||
"subClashUserAgentRegex": "",
|
||||
"subTitle": "",
|
||||
"subSupportUrl": "",
|
||||
"subProfileMode": SubProfileModeNone,
|
||||
"subProfileUrl": "",
|
||||
"subAnnounce": "",
|
||||
"subEnableRouting": "false",
|
||||
@@ -298,6 +306,11 @@ func (s *SettingService) GetAllSetting() (*entity.AllSetting, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// A missing mode must still preserve URLs configured before modes existed.
|
||||
if !keyMap["subProfileMode"] {
|
||||
allSetting.SubProfileMode = ""
|
||||
}
|
||||
allSetting.SubProfileMode = effectiveSubProfileMode(allSetting.SubProfileMode, allSetting.SubProfileUrl)
|
||||
return allSetting, nil
|
||||
}
|
||||
|
||||
@@ -850,6 +863,34 @@ func (s *SettingService) GetSubProfileUrl() (string, error) {
|
||||
return common.EnsureURLScheme(value), err
|
||||
}
|
||||
|
||||
func (s *SettingService) GetSubProfileMode() (string, error) {
|
||||
setting, err := s.getSetting("subProfileMode")
|
||||
if err != nil && !database.IsNotFound(err) {
|
||||
return SubProfileModeNone, err
|
||||
}
|
||||
if err == nil && setting.Value != "" {
|
||||
return effectiveSubProfileMode(setting.Value, ""), nil
|
||||
}
|
||||
profileURL, err := s.getString("subProfileUrl")
|
||||
if err != nil {
|
||||
return SubProfileModeNone, err
|
||||
}
|
||||
return effectiveSubProfileMode("", profileURL), nil
|
||||
}
|
||||
|
||||
func effectiveSubProfileMode(mode, profileURL string) string {
|
||||
switch mode {
|
||||
case SubProfileModeNone, SubProfileModeBuiltin, SubProfileModeCustom:
|
||||
return mode
|
||||
case "":
|
||||
// Older settings have no mode; only an existing custom URL opts them in.
|
||||
if strings.TrimSpace(profileURL) != "" {
|
||||
return SubProfileModeCustom
|
||||
}
|
||||
}
|
||||
return SubProfileModeNone
|
||||
}
|
||||
|
||||
func (s *SettingService) GetSubAnnounce() (string, error) {
|
||||
return s.getString("subAnnounce")
|
||||
}
|
||||
@@ -1448,6 +1489,12 @@ type SecretClears struct {
|
||||
}
|
||||
|
||||
func (s *SettingService) UpdateAllSetting(allSetting *entity.AllSetting, clears SecretClears) error {
|
||||
switch allSetting.SubProfileMode {
|
||||
case "", SubProfileModeNone, SubProfileModeBuiltin, SubProfileModeCustom:
|
||||
allSetting.SubProfileMode = effectiveSubProfileMode(allSetting.SubProfileMode, allSetting.SubProfileUrl)
|
||||
default:
|
||||
return errors.New("subscription profile mode must be none, builtin, or custom")
|
||||
}
|
||||
if err := s.preserveRedactedSecrets(allSetting, clears); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/database"
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/database/model"
|
||||
)
|
||||
|
||||
func TestSubProfileModeReadsLegacyAndExplicitSettings(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
storedMode string
|
||||
storedURL string
|
||||
modeExists bool
|
||||
want string
|
||||
}{
|
||||
{name: "fresh installation", want: "none"},
|
||||
{name: "legacy URL", storedURL: " https://profile.example/account ", want: "custom"},
|
||||
{name: "legacy blank URL", storedURL: " \t ", want: "none"},
|
||||
{name: "legacy empty mode with URL", modeExists: true, storedURL: "https://profile.example/account", want: "custom"},
|
||||
{name: "legacy empty mode without URL", modeExists: true, want: "none"},
|
||||
{name: "explicit none preserves saved URL", modeExists: true, storedMode: "none", storedURL: "https://profile.example/account", want: "none"},
|
||||
{name: "explicit builtin", modeExists: true, storedMode: "builtin", storedURL: "https://profile.example/account", want: "builtin"},
|
||||
{name: "explicit custom", modeExists: true, storedMode: "custom", storedURL: "https://profile.example/account", want: "custom"},
|
||||
{name: "custom with empty URL", modeExists: true, storedMode: "custom", want: "custom"},
|
||||
{name: "invalid stored mode fails closed", modeExists: true, storedMode: "automatic", storedURL: "https://profile.example/account", want: "none"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
setupSettingTestDB(t)
|
||||
s := &SettingService{}
|
||||
if tt.modeExists {
|
||||
if err := s.saveSetting("subProfileMode", tt.storedMode); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
if err := s.saveSetting("subProfileUrl", tt.storedURL); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assertSubProfileSettings(t, s, tt.want, tt.storedURL)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSubProfileModeUpdatesPreserveURLAndLegacyPayloads(t *testing.T) {
|
||||
setupSettingTestDB(t)
|
||||
s := &SettingService{}
|
||||
if got := s.GetFactoryDefaults()["subProfileMode"]; got != "none" {
|
||||
t.Errorf("factory profile mode = %q, want none", got)
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
mode string
|
||||
url string
|
||||
want string
|
||||
}{
|
||||
{name: "custom", mode: "custom", url: "https://profile.example/account", want: "custom"},
|
||||
{name: "none retains custom URL", mode: "none", url: "https://profile.example/account", want: "none"},
|
||||
{name: "builtin retains custom URL", mode: "builtin", url: "https://profile.example/account", want: "builtin"},
|
||||
{name: "custom restores saved URL", mode: "custom", url: "https://profile.example/account", want: "custom"},
|
||||
{name: "legacy URL submission", url: "https://legacy.example/account", want: "custom"},
|
||||
{name: "legacy empty URL submission", want: "none"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
settings, err := s.GetAllSetting()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
payload, err := json.Marshal(map[string]string{"subProfileMode": tt.mode, "subProfileUrl": tt.url})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := json.Unmarshal(payload, settings); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := s.UpdateAllSetting(settings, SecretClears{}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assertSubProfileSettings(t, s, tt.want, tt.url)
|
||||
stored, err := s.getSetting("subProfileMode")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if stored.Value != tt.want {
|
||||
t.Fatalf("persisted mode = %q, want %q", stored.Value, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestSubProfileModeRejectsInvalidUpdateBeforeWrites(t *testing.T) {
|
||||
setupSettingTestDB(t)
|
||||
s := &SettingService{}
|
||||
if err := s.saveSetting("subTitle", "Original title"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var before []model.Setting
|
||||
if err := database.GetDB().Order("id").Find(&before).Error; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
settings, err := s.GetAllSetting()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := json.Unmarshal([]byte(`{"subProfileMode":"automatic","subTitle":"Changed title","subProfileUrl":"https://profile.example/account"}`), settings); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = s.UpdateAllSetting(settings, SecretClears{})
|
||||
if err == nil || err.Error() != "subscription profile mode must be none, builtin, or custom" {
|
||||
t.Errorf("UpdateAllSetting error = %v, want invalid profile mode error", err)
|
||||
}
|
||||
var after []model.Setting
|
||||
if err := database.GetDB().Order("id").Find(&after).Error; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(before, after) {
|
||||
t.Fatal("invalid profile mode update modified stored settings")
|
||||
}
|
||||
}
|
||||
|
||||
func assertSubProfileSettings(t *testing.T, s *SettingService, wantMode, wantURL string) {
|
||||
t.Helper()
|
||||
if mode, err := s.GetSubProfileMode(); err != nil || mode != wantMode {
|
||||
t.Fatalf("GetSubProfileMode = %q, %v; want %q, nil", mode, err, wantMode)
|
||||
}
|
||||
settings, err := s.GetAllSetting()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
payload, err := json.Marshal(settings)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var profile struct {
|
||||
Mode string `json:"subProfileMode"`
|
||||
URL string `json:"subProfileUrl"`
|
||||
}
|
||||
if err := json.Unmarshal(payload, &profile); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if profile.Mode != wantMode || profile.URL != wantURL {
|
||||
t.Fatalf("profile settings = (%q, %q), want (%q, %q)", profile.Mode, profile.URL, wantMode, wantURL)
|
||||
}
|
||||
}
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "العنوان اللي هيظهر في عميل VPN. يدعم رموز هوية العميل: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subSupportUrl": "رابط الدعم",
|
||||
"subSupportUrlDesc": "رابط الدعم الفني المعروض في عميل VPN. يدعم رموز هوية العميل: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileMode": "صفحة الملف الشخصي",
|
||||
"subProfileModeDesc": "اختر رابط الموقع الإلكتروني الذي يظهر في عميل VPN.",
|
||||
"subProfileModeNone": "بدون رابط",
|
||||
"subProfileModeBuiltin": "صفحة الاشتراك المدمجة",
|
||||
"subProfileModeCustom": "موقع إلكتروني مخصص",
|
||||
"subProfileBuiltinWarning": "تكشف هذه الصفحة روابط الاشتراك وإعدادات العقد، بما في ذلك اشتراكات Happ المشفرة.",
|
||||
"subProfileUrl": "رابط الملف الشخصي",
|
||||
"subProfileUrlDesc": "رابط لموقعك الإلكتروني يظهر في عميل VPN. يدعم رموز هوية العميل: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileUrlDesc": "رابط لموقعك الإلكتروني يظهر في عميل VPN. يدعم رموز هوية العميل: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}. اتركه فارغًا لعدم عرض رابط الموقع في عميل VPN.",
|
||||
"subAnnounce": "إعلان",
|
||||
"subAnnounceDesc": "نص الإعلان المعروض في عميل VPN. يدعم رموز هوية العميل: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subThemeDir": "مجلد قالب الاشتراك",
|
||||
|
||||
@@ -1322,8 +1322,14 @@
|
||||
"subTitleDesc": "Title shown in VPN client. Supports client identity tokens: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subSupportUrl": "Support URL",
|
||||
"subSupportUrlDesc": "Technical support link shown in the VPN client. Supports client identity tokens: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileMode": "Profile page",
|
||||
"subProfileModeDesc": "Choose which website link is shown in the VPN client.",
|
||||
"subProfileModeNone": "No link",
|
||||
"subProfileModeBuiltin": "Built-in subscription page",
|
||||
"subProfileModeCustom": "Custom website",
|
||||
"subProfileBuiltinWarning": "This page exposes subscription URLs and node configurations, including for Happ encrypted subscriptions.",
|
||||
"subProfileUrl": "Profile URL",
|
||||
"subProfileUrlDesc": "A link to your website displayed in the VPN client. Supports client identity tokens: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileUrlDesc": "A link to your website displayed in the VPN client. Supports client identity tokens: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}. Leave empty to omit the website link.",
|
||||
"subAnnounce": "Announce",
|
||||
"subAnnounceDesc": "The announcement text displayed in the VPN client. Supports client identity tokens: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subThemeDir": "Sub Theme Directory",
|
||||
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "Título mostrado en el cliente VPN. Admite tokens de identidad del cliente: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subSupportUrl": "URL de soporte",
|
||||
"subSupportUrlDesc": "Enlace de soporte técnico mostrado en el cliente VPN. Admite tokens de identidad del cliente: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileMode": "Página de perfil",
|
||||
"subProfileModeDesc": "Elige qué enlace al sitio web se muestra en el cliente VPN.",
|
||||
"subProfileModeNone": "Sin enlace",
|
||||
"subProfileModeBuiltin": "Página de suscripción integrada",
|
||||
"subProfileModeCustom": "Sitio web personalizado",
|
||||
"subProfileBuiltinWarning": "Esta página expone las URL de suscripción y las configuraciones de los nodos, incluso para las suscripciones cifradas de Happ.",
|
||||
"subProfileUrl": "URL del perfil",
|
||||
"subProfileUrlDesc": "Un enlace a tu sitio web mostrado en el cliente VPN. Admite tokens de identidad del cliente: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileUrlDesc": "Un enlace a tu sitio web mostrado en el cliente VPN. Admite tokens de identidad del cliente: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}. Déjalo vacío para omitir el enlace al sitio web en el cliente VPN.",
|
||||
"subAnnounce": "Anuncio",
|
||||
"subAnnounceDesc": "El texto del anuncio mostrado en el cliente VPN. Admite tokens de identidad del cliente: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subThemeDir": "Directorio del tema de suscripción",
|
||||
|
||||
@@ -1204,8 +1204,14 @@
|
||||
"subTitleDesc": "عنوان نمایش داده شده در کلاینت VPN. از توکنهای هویت کلاینت پشتیبانی میکند: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subSupportUrl": "آدرس پشتیبانی",
|
||||
"subSupportUrlDesc": "لینک پشتیبانی فنی که در کلاینت VPN نمایش داده میشود. از توکنهای هویت کلاینت پشتیبانی میکند: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileMode": "صفحه پروفایل",
|
||||
"subProfileModeDesc": "انتخاب کنید کدام لینک وبسایت در کلاینت VPN نمایش داده شود.",
|
||||
"subProfileModeNone": "بدون لینک",
|
||||
"subProfileModeBuiltin": "صفحه اشتراک داخلی",
|
||||
"subProfileModeCustom": "وبسایت سفارشی",
|
||||
"subProfileBuiltinWarning": "این صفحه آدرسهای اشتراک و پیکربندی گرهها را آشکار میکند، حتی برای اشتراکهای رمزگذاریشده Happ.",
|
||||
"subProfileUrl": "آدرس پروفایل",
|
||||
"subProfileUrlDesc": "لینک وبسایت شما که در کلاینت VPN نمایش داده میشود. از توکنهای هویت کلاینت پشتیبانی میکند: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileUrlDesc": "لینک وبسایت شما که در کلاینت VPN نمایش داده میشود. از توکنهای هویت کلاینت پشتیبانی میکند: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}. برای عدم نمایش لینک وبسایت در کلاینت VPN، این فیلد را خالی بگذارید.",
|
||||
"subAnnounce": "اعلان",
|
||||
"subAnnounceDesc": "متن اعلانی که در کلاینت VPN نمایش داده میشود. از توکنهای هویت کلاینت پشتیبانی میکند: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subThemeDir": "پوشه قالب صفحه اشتراک",
|
||||
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "Judul yang ditampilkan di klien VPN. Mendukung token identitas klien: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subSupportUrl": "URL Dukungan",
|
||||
"subSupportUrlDesc": "Tautan dukungan teknis yang ditampilkan di klien VPN. Mendukung token identitas klien: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileMode": "Halaman profil",
|
||||
"subProfileModeDesc": "Pilih tautan situs web yang ditampilkan di klien VPN.",
|
||||
"subProfileModeNone": "Tanpa tautan",
|
||||
"subProfileModeBuiltin": "Halaman langganan bawaan",
|
||||
"subProfileModeCustom": "Situs web kustom",
|
||||
"subProfileBuiltinWarning": "Halaman ini menampilkan URL langganan dan konfigurasi node, termasuk untuk langganan terenkripsi Happ.",
|
||||
"subProfileUrl": "URL Profil",
|
||||
"subProfileUrlDesc": "Tautan ke situs web Anda yang ditampilkan di klien VPN. Mendukung token identitas klien: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileUrlDesc": "Tautan ke situs web Anda yang ditampilkan di klien VPN. Mendukung token identitas klien: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}. Biarkan kosong agar tautan situs web tidak ditampilkan di klien VPN.",
|
||||
"subAnnounce": "Pengumuman",
|
||||
"subAnnounceDesc": "Teks pengumuman yang ditampilkan di klien VPN. Mendukung token identitas klien: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subThemeDir": "Direktori Tema Langganan",
|
||||
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "VPNクライアントに表示されるタイトル。クライアント識別トークンをサポートします: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}。",
|
||||
"subSupportUrl": "サポートURL",
|
||||
"subSupportUrlDesc": "VPNクライアントに表示されるテクニカルサポートへのリンク。クライアント識別トークンをサポートします: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}。",
|
||||
"subProfileMode": "プロフィールページ",
|
||||
"subProfileModeDesc": "VPNクライアントに表示するWebサイトへのリンクを選択します。",
|
||||
"subProfileModeNone": "リンクなし",
|
||||
"subProfileModeBuiltin": "組み込みのサブスクリプションページ",
|
||||
"subProfileModeCustom": "カスタムWebサイト",
|
||||
"subProfileBuiltinWarning": "このページでは、Happで暗号化されたサブスクリプションも含め、サブスクリプションURLとノード設定が公開されます。",
|
||||
"subProfileUrl": "プロフィールURL",
|
||||
"subProfileUrlDesc": "VPNクライアントに表示されるWebサイトへのリンク。クライアント識別トークンをサポートします: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}。",
|
||||
"subProfileUrlDesc": "VPNクライアントに表示されるWebサイトへのリンク。クライアント識別トークンをサポートします: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}。空欄にすると、VPNクライアントにWebサイトへのリンクを表示しません。",
|
||||
"subAnnounce": "お知らせ",
|
||||
"subAnnounceDesc": "VPNクライアントに表示されるお知らせのテキスト。クライアント識別トークンをサポートします: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}。",
|
||||
"subThemeDir": "サブスクリプションテーマディレクトリ",
|
||||
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "Título exibido no cliente VPN. Suporta tokens de identidade do cliente: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subSupportUrl": "URL de Suporte",
|
||||
"subSupportUrlDesc": "Link de suporte técnico exibido no cliente VPN. Suporta tokens de identidade do cliente: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileMode": "Página de perfil",
|
||||
"subProfileModeDesc": "Escolha qual link de site é exibido no cliente VPN.",
|
||||
"subProfileModeNone": "Sem link",
|
||||
"subProfileModeBuiltin": "Página de assinatura integrada",
|
||||
"subProfileModeCustom": "Site personalizado",
|
||||
"subProfileBuiltinWarning": "Esta página expõe as URLs de assinatura e as configurações dos nós, inclusive para assinaturas criptografadas do Happ.",
|
||||
"subProfileUrl": "URL de Perfil",
|
||||
"subProfileUrlDesc": "Um link para o seu site exibido no cliente VPN. Suporta tokens de identidade do cliente: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileUrlDesc": "Um link para o seu site exibido no cliente VPN. Suporta tokens de identidade do cliente: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}. Deixe em branco para omitir o link do site no cliente VPN.",
|
||||
"subAnnounce": "Anúncio",
|
||||
"subAnnounceDesc": "O texto do anúncio exibido no cliente VPN. Suporta tokens de identidade do cliente: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subThemeDir": "Diretório do tema de assinatura",
|
||||
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "Название подписки, которое видит клиент в VPN-клиенте. Поддерживает токены идентификации клиента: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subSupportUrl": "URL поддержки",
|
||||
"subSupportUrlDesc": "Ссылка на техническую поддержку, отображаемая в VPN-клиенте. Поддерживает токены идентификации клиента: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileMode": "Страница профиля",
|
||||
"subProfileModeDesc": "Выберите, какая ссылка на сайт будет отображаться в VPN-клиенте.",
|
||||
"subProfileModeNone": "Без ссылки",
|
||||
"subProfileModeBuiltin": "Встроенная страница подписки",
|
||||
"subProfileModeCustom": "Свой сайт",
|
||||
"subProfileBuiltinWarning": "Эта страница раскрывает URL-адреса подписок и конфигурации узлов, в том числе для зашифрованных подписок Happ.",
|
||||
"subProfileUrl": "URL профиля",
|
||||
"subProfileUrlDesc": "Ссылка на ваш сайт, отображаемая в VPN-клиенте. Поддерживает токены идентификации клиента: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileUrlDesc": "Ссылка на ваш сайт, отображаемая в VPN-клиенте. Поддерживает токены идентификации клиента: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}. Оставьте поле пустым, чтобы не отображать ссылку на сайт в VPN-клиенте.",
|
||||
"subAnnounce": "Объявление",
|
||||
"subAnnounceDesc": "Текст объявления, отображаемый в VPN-клиенте. Поддерживает токены идентификации клиента: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subThemeDir": "Каталог темы подписки",
|
||||
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "VPN istemcisinde gösterilen başlık. İstemci kimlik tokenlarını destekler: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subSupportUrl": "Destek URL'si",
|
||||
"subSupportUrlDesc": "VPN istemcisinde gösterilen teknik destek bağlantısı. İstemci kimlik tokenlarını destekler: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileMode": "Profil sayfası",
|
||||
"subProfileModeDesc": "VPN istemcisinde hangi web sitesi bağlantısının gösterileceğini seçin.",
|
||||
"subProfileModeNone": "Bağlantı yok",
|
||||
"subProfileModeBuiltin": "Yerleşik abonelik sayfası",
|
||||
"subProfileModeCustom": "Özel web sitesi",
|
||||
"subProfileBuiltinWarning": "Bu sayfa, Happ ile şifrelenmiş abonelikler dahil olmak üzere abonelik URL'lerini ve düğüm yapılandırmalarını açığa çıkarır.",
|
||||
"subProfileUrl": "Profil URL'si",
|
||||
"subProfileUrlDesc": "VPN istemcisinde görüntülenen web sitenize giden bağlantı. İstemci kimlik tokenlarını destekler: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileUrlDesc": "VPN istemcisinde görüntülenen web sitenize giden bağlantı. İstemci kimlik tokenlarını destekler: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}. Web sitesi bağlantısının VPN istemcisinde gösterilmemesi için boş bırakın.",
|
||||
"subAnnounce": "Duyuru",
|
||||
"subAnnounceDesc": "VPN istemcisinde görüntülenen duyuru metni. İstemci kimlik tokenlarını destekler: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subThemeDir": "Abonelik Tema Dizini",
|
||||
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "Назва, яка відображається у VPN-клієнті. Підтримує токени ідентифікації клієнта: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subSupportUrl": "URL підтримки",
|
||||
"subSupportUrlDesc": "Посилання на технічну підтримку, що відображається у VPN-клієнті. Підтримує токени ідентифікації клієнта: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileMode": "Сторінка профілю",
|
||||
"subProfileModeDesc": "Виберіть, яке посилання на вебсайт відображатиметься у VPN-клієнті.",
|
||||
"subProfileModeNone": "Без посилання",
|
||||
"subProfileModeBuiltin": "Вбудована сторінка підписки",
|
||||
"subProfileModeCustom": "Власний вебсайт",
|
||||
"subProfileBuiltinWarning": "Ця сторінка розкриває URL-адреси підписок і конфігурації вузлів, зокрема для зашифрованих підписок Happ.",
|
||||
"subProfileUrl": "URL профілю",
|
||||
"subProfileUrlDesc": "Посилання на ваш вебсайт, що відображається у VPN-клієнті. Підтримує токени ідентифікації клієнта: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileUrlDesc": "Посилання на ваш вебсайт, що відображається у VPN-клієнті. Підтримує токени ідентифікації клієнта: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}. Залиште поле порожнім, щоб не відображати посилання на вебсайт у VPN-клієнті.",
|
||||
"subAnnounce": "Оголошення",
|
||||
"subAnnounceDesc": "Текст оголошення, що відображається у VPN-клієнті. Підтримує токени ідентифікації клієнта: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subThemeDir": "Каталог теми підписки",
|
||||
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "Tiêu đề hiển thị trong ứng dụng VPN. Hỗ trợ token định danh khách hàng: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subSupportUrl": "URL Hỗ trợ",
|
||||
"subSupportUrlDesc": "Liên kết hỗ trợ kỹ thuật hiển thị trong ứng dụng VPN. Hỗ trợ token định danh khách hàng: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileMode": "Trang hồ sơ",
|
||||
"subProfileModeDesc": "Chọn liên kết trang web được hiển thị trong ứng dụng VPN.",
|
||||
"subProfileModeNone": "Không cung cấp liên kết",
|
||||
"subProfileModeBuiltin": "Trang đăng ký tích hợp",
|
||||
"subProfileModeCustom": "Trang web tùy chỉnh",
|
||||
"subProfileBuiltinWarning": "Trang này công khai URL đăng ký và cấu hình nút, kể cả đối với các đăng ký được mã hóa bằng Happ.",
|
||||
"subProfileUrl": "URL Hồ sơ",
|
||||
"subProfileUrlDesc": "Liên kết đến trang web của bạn hiển thị trong ứng dụng VPN. Hỗ trợ token định danh khách hàng: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subProfileUrlDesc": "Liên kết đến trang web của bạn hiển thị trong ứng dụng VPN. Hỗ trợ token định danh khách hàng: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}. Để trống để không hiển thị liên kết trang web trong ứng dụng VPN.",
|
||||
"subAnnounce": "Thông báo",
|
||||
"subAnnounceDesc": "Văn bản thông báo hiển thị trong ứng dụng VPN. Hỗ trợ token định danh khách hàng: {{EMAIL}}, {{ID}}, {{SHORT_ID}}, {{SUB_ID}}, {{TELEGRAM_ID}}.",
|
||||
"subThemeDir": "Thư mục giao diện Đăng ký",
|
||||
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "在 VPN 客户端中显示的标题。支持客户端身份令牌:{{EMAIL}}、{{ID}}、{{SHORT_ID}}、{{SUB_ID}}、{{TELEGRAM_ID}}。",
|
||||
"subSupportUrl": "支持链接",
|
||||
"subSupportUrlDesc": "VPN 客户端中显示的技术支持链接。支持客户端身份令牌:{{EMAIL}}、{{ID}}、{{SHORT_ID}}、{{SUB_ID}}、{{TELEGRAM_ID}}。",
|
||||
"subProfileMode": "资料页方式",
|
||||
"subProfileModeDesc": "选择在 VPN 客户端中提供的资料页入口。",
|
||||
"subProfileModeNone": "不提供",
|
||||
"subProfileModeBuiltin": "内置订阅页",
|
||||
"subProfileModeCustom": "自定义网站",
|
||||
"subProfileBuiltinWarning": "此页面会公开订阅地址和节点配置,HAPP 加密订阅也不例外。",
|
||||
"subProfileUrl": "个人资料链接",
|
||||
"subProfileUrlDesc": "VPN 客户端中显示的网站链接。支持客户端身份令牌:{{EMAIL}}、{{ID}}、{{SHORT_ID}}、{{SUB_ID}}、{{TELEGRAM_ID}}。",
|
||||
"subProfileUrlDesc": "VPN 客户端中显示的网站链接。支持客户端身份令牌:{{EMAIL}}、{{ID}}、{{SHORT_ID}}、{{SUB_ID}}、{{TELEGRAM_ID}}。留空则不在 VPN 客户端提供网站链接。",
|
||||
"subAnnounce": "公告",
|
||||
"subAnnounceDesc": "VPN 客户端中显示的公告文本。支持客户端身份令牌:{{EMAIL}}、{{ID}}、{{SHORT_ID}}、{{SUB_ID}}、{{TELEGRAM_ID}}。",
|
||||
"subThemeDir": "订阅主题目录",
|
||||
|
||||
@@ -1200,8 +1200,14 @@
|
||||
"subTitleDesc": "在 VPN 客戶端中顯示的標題。支援用戶端身分權杖:{{EMAIL}}、{{ID}}、{{SHORT_ID}}、{{SUB_ID}}、{{TELEGRAM_ID}}。",
|
||||
"subSupportUrl": "支援連結",
|
||||
"subSupportUrlDesc": "VPN 用戶端中顯示的技術支援連結。支援用戶端身分權杖:{{EMAIL}}、{{ID}}、{{SHORT_ID}}、{{SUB_ID}}、{{TELEGRAM_ID}}。",
|
||||
"subProfileMode": "資料頁方式",
|
||||
"subProfileModeDesc": "選擇在 VPN 用戶端中提供的資料頁入口。",
|
||||
"subProfileModeNone": "不提供",
|
||||
"subProfileModeBuiltin": "內建訂閱頁",
|
||||
"subProfileModeCustom": "自訂網站",
|
||||
"subProfileBuiltinWarning": "此頁面會公開訂閱網址和節點設定,HAPP 加密訂閱也不例外。",
|
||||
"subProfileUrl": "個人資料連結",
|
||||
"subProfileUrlDesc": "VPN 用戶端中顯示的網站連結。支援用戶端身分權杖:{{EMAIL}}、{{ID}}、{{SHORT_ID}}、{{SUB_ID}}、{{TELEGRAM_ID}}。",
|
||||
"subProfileUrlDesc": "VPN 用戶端中顯示的網站連結。支援用戶端身分權杖:{{EMAIL}}、{{ID}}、{{SHORT_ID}}、{{SUB_ID}}、{{TELEGRAM_ID}}。留空則不在 VPN 用戶端提供網站連結。",
|
||||
"subAnnounce": "公告",
|
||||
"subAnnounceDesc": "VPN 用戶端中顯示的公告文字。支援用戶端身分權杖:{{EMAIL}}、{{ID}}、{{SHORT_ID}}、{{SUB_ID}}、{{TELEGRAM_ID}}。",
|
||||
"subThemeDir": "訂閱主題目錄",
|
||||
|
||||
Reference in New Issue
Block a user