diff --git a/app/subscription/share.py b/app/subscription/share.py index ecd879432..b42fb5b51 100644 --- a/app/subscription/share.py +++ b/app/subscription/share.py @@ -21,7 +21,7 @@ DISABLED_STATUS_TEXT, EXPIRED_STATUS_TEXT, LIMITED_STATUS_TEXT, - ONHOLD_STATUS_TEXT + ONHOLD_STATUS_TEXT, ) SERVER_IP = get_public_ip() @@ -272,6 +272,9 @@ def process_inbounds_and_tags( salt = secrets.token_hex(8) sni = random.choice(sni_list).replace("*", salt) + if sids := inbound.get("sids"): + inbound["sid"] = random.choice(sids) + req_host = "" req_host_list = host["host"] or inbound["host"] if req_host_list: diff --git a/app/xray/config.py b/app/xray/config.py index 5da276d4f..446d8c084 100644 --- a/app/xray/config.py +++ b/app/xray/config.py @@ -237,7 +237,8 @@ def _resolve_inbounds(self): f"You need to provide publicKey in realitySettings of {inbound['tag']}") try: - settings['sid'] = tls_settings.get('shortIds')[0] + settings['sids'] = tls_settings.get('shortIds') + settings['sids'][0] # check if there is any shortIds except (IndexError, TypeError): raise ValueError( f"You need to define at least one shortID in realitySettings of {inbound['tag']}")