Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new clash subscription #1468

Closed
wants to merge 2 commits into from
Closed

add new clash subscription #1468

wants to merge 2 commits into from

Conversation

zhongfq
Copy link
Contributor

@zhongfq zhongfq commented Dec 1, 2024

I design a subscription system for clash like app, how to use:

  1. open the subscription setting in the men.
  2. add the proxy with tag, the available inbound of proxy are configed in xray_config.json.
3 4 3. open the dialog of user, add subscription domain and the tag(proxy grouped by tag) 1 4. copy the subscription url 2

other features:

  1. add proxy group
5

2.add a rule
6

  1. add a ruleset
7
  1. clash setting
8
  1. statistics for users
1

return dbsetting


def generate_subscription(db: Session, dbuser: User, user_agent: str):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a directory for subscription classes and generating them , why all of this cod this in routers ?
routers is just for api requests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it has a set of api to add, modify or delete proxy, proxy group, rule, ruleset or settings

@@ -63,6 +63,10 @@ def user_subscription(
{"user": user}
)
)

if len(user.sub_tags) > 0 and len(user.sub_url_prefix) > 0:
from app.routers.clash import generate_subscription
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also your importing from routers in here, if you just follow project structure and put your code in right place there is no need to make unnecessary dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to compat with current subscription of Marzban

@ImMohammad20000
Copy link
Collaborator

ImMohammad20000 commented Dec 1, 2024

can you dm me in telegram @zhongfq same id at telegram

@zhongfq
Copy link
Contributor Author

zhongfq commented Dec 1, 2024

can you dm me in telegram @zhongfq same id at telegram

sorry, I have no telegram

@ImMohammad20000
Copy link
Collaborator

ImMohammad20000 commented Dec 1, 2024

can you dm me in telegram @zhongfq same id at telegram

sorry, I have no telegram

can you you add next_plan to the front?
Its in user api

@zhongfq
Copy link
Contributor Author

zhongfq commented Dec 1, 2024

can you dm me in telegram @zhongfq same id at telegram

sorry, I have no telegram

can you you add next_plan to the front? Its in user api

ok, I will try in these days.

@SaintShit
Copy link
Contributor

Hello, thanks for you efforts. first check, add_clash_sub migration doesn't run, due to bad revision.
also, it's better to don't inject the clash config to the database, and use templates instead.

@zhongfq
Copy link
Contributor Author

zhongfq commented Dec 2, 2024

Hello, thanks for you efforts. first check, add_clash_sub migration doesn't run, due to bad revision. also, it's better to don't inject the clash config to the database, and use templates instead.

image I want to modify the some clash setting on web. use templates, it mean that i load the setting from templates and write modified setting into the template dynamically?

@zhongfq zhongfq closed this Jan 8, 2025
@zhongfq zhongfq deleted the clash-sub branch January 8, 2025 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants