Skip to content

Commit 576d6ee

Browse files
feat: Add announce for subscription headers
1 parent d4b5996 commit 576d6ee

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app/models/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ class Subscription(BaseModel):
264264
update_interval: int = Field(default=12)
265265
support_url: str = Field(default="https://t.me/")
266266
profile_title: str = Field(default="Subscription")
267+
# only supported by v2RayTun and Happ apps
268+
announce: str = Field(default="", max_length=128)
269+
announce_url: str = Field(default="")
267270

268271
host_status_filter: bool
269272

app/operation/subscription.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def create_response_headers(user: UsersResponseWithInbounds, request_url: str, s
9090
"profile-title": encode_title(formatted_title),
9191
"profile-update-interval": str(sub_settings.update_interval),
9292
"subscription-userinfo": "; ".join(f"{key}={val}" for key, val in user_info.items()),
93+
"announce": encode_title(sub_settings.announce),
94+
"announce-url": sub_settings.announce_url,
9395
}
9496

9597
async def fetch_config(self, user: UsersResponseWithInbounds, client_type: ConfigFormat) -> tuple[str, str]:

0 commit comments

Comments
 (0)