banner
๐Ÿ”ฅ๐“ข๐“ฒ๐“ฐ๐“ฎ!๐“ข๐“ฑ๐“พ๐“ธ

๐Ÿ”ฅ๐“ข๐“ฒ๐“ฐ๐“ฎ!๐“ข๐“ฑ๐“พ๐“ธ

tg_channel
telegram
discord server
x
github
medium
threads
instagram
phaver
warpcast
debank

Clash Node Aggregation Management

For users who use scientific internet access, there may be more than one airport purchased, so they usually have multiple subscription addresses. As shown in the figure below:

image

One airport corresponding to one subscription address brings the following disadvantages:

  1. High cost of subscription address changes
    When the airport changes the subscription address, the Clash client needs to manually update the subscription address. If multiple subscription addresses are used simultaneously, the workload of modifications will increase exponentially. Especially when the subscription is used on multiple devices, each device needs to be modified separately, making the operation more cumbersome.

  2. Inconvenient subscription switching
    The Clash client can only select one subscription at a time. Although different subscriptions may have higher quality nodes, switching subscriptions is required to use them, which is a cumbersome and inefficient process.

To address the above issues, we urgently need a solution that can merge nodes from multiple subscriptions into one subscription. This way, users only need to deal with a unified subscription address, greatly simplifying operations.

Sub-Store#

Sub-Store is a tool designed to solve this problem. It can merge nodes from multiple subscriptions into a unified subscription, allowing users to conveniently manage and use all nodes with this unified subscription address. With Sub-Store, the complexity of changing subscription addresses is significantly reduced, and there is no need to frequently switch subscriptions, easily achieving flexible use of optimal nodes.

Setup#

Prepare Directory Structure#

.
โ”œโ”€โ”€ docker-compose.yaml
โ”œโ”€โ”€ .env
โ””โ”€โ”€ redis
    โ””โ”€โ”€ redis.conf

.env

# Container name prefix
COMPOSE_PROJECT_NAME=sub-store
# Container data root directory
PROJECT_HOME=/opt/sub-store
# Subscription scheduled update cycle
SUB_STORE_BACKEND_SYNC_CRON='55 23 * * *'
# Security key (do not disclose)
SUB_STORE_FRONTEND_BACKEND_PATH=/h1j2k3l4m5n6o7p8q9r0s1t2u3v

.redis.conf

# Redis configuration file example

# Enable RDB persistence
save 900 1
save 300 10
save 60 10000

# Enable AOF persistence
appendonly yes

docker-compose.yaml
Assuming our server IP is: 198.22.145.117

services:
 # Subscription conversion service
  sub:
    image: stilleshan/sub
    restart: always
    environment:
      - API_URL=http://198.22.145.117:13001
      - SHORT_URL=http://198.22.145.117:13003
      - SITE_NAME=SigeShuo
    ports:
      - "13001:80"
  # Sub-Store subscription management service
  app:
    image: xream/sub-store
    restart: always
    environment:
      - SUB_STORE_BACKEND_SYNC_CRON=${SUB_STORE_BACKEND_SYNC_CRON}
      - SUB_STORE_FRONTEND_BACKEND_PATH=${SUB_STORE_FRONTEND_BACKEND_PATH}
    ports:
      - "13002:3001"
    volumes:
      - ${PROJECT_HOME}/data:/opt/app/data
  # Short link service
  myurls:
    image: stilleshan/myurls:latest
    restart: always
    environment:
      - MYURLS_DOMAIN=198.22.145.117:13003
      - MYURLS_PROTO=http
    volumes:
      - ${PROJECT_HOME}/myurls/logs:/app/logs
    ports:
      - "13003:8080"
    depends_on:
      - redis
  # Short link caching service
  redis:
    image: redis:latest
    restart: always
    volumes:
      - ${PROJECT_HOME}/redis:/data
      - ./redis/redis.conf:/usr/local/etc/redis/redis.conf
    command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
  # Container self-update monitoring service
  watchtower:
    image: containrrr/watchtower
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
# Execute the following command in the same directory as docker-compose.yaml to deploy
docker compose up -d

If using a domain name or nginx reverse proxy, simply change the IP in the above configuration to the domain name.

Usage#

Sub-Store#

Sub-Store access address:

http://198.22.145.117:13002?api=http://198.22.145.117:13002/h1j2k3l4m5n6o7p8q9r0s1t2u3v
  • h1j2k3l4m5n6o7p8q9r0s1t2u3v This is the security key configured in the .env file, which you can modify as you wish. When the key is updated, the key in the above address needs to be replaced with the updated value.

Add a Single Subscription#

image

image

Add Combined Subscription#

image

image

Subconverter Subscription Conversion#

image

First, copy the aggregated subscription address from Sub-Store

image

Convert it to a grouped subscription address through Subconverter

Clash Import Subscription Conversion Address#

image

Import the subscription address converted by Subconverter, and you can also use the short link generated by the short address.

Summary:
When using Sub-Store to manage multiple subscription addresses, you only need to perform add, delete, or modify operations in the Sub-Store backend, or modify the individual subscription information included in the aggregated subscription management to easily manage the node information of the Clash client. The Clash client only needs to refresh when needed, and the changes will take effect without manually adjusting the Clash configuration.
Please note that when Sub-Store is deployed on the public network, be sure to protect the SUB_STORE_FRONTEND_BACKEND_PATH configuration key in the .env file to prevent others from obtaining your subscription information.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.