Skip to main content

Add your description here

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

xkeen-subscription-watcher

Использование

xkeen-subscription-watcher <tag>=<url>

Можно передать несколько пар <tag>=<url>

Скрипт получает из переданных подписок прокси, генерирует конфиги 04_outbounds.<tag>.json.

Если конфиги изменились, выполняется xkeen -restart.

Установка

opkg install python3
curl -sSo /opt/sbin/xkeen-subscription-watcher https://raw.githubusercontent.com/tkukushkin/xkeen-subscription-watcher/refs/heads/master/src/xkeen_subscription_watcher/main.py
chmod +x /opt/sbin/xkeen-subscription-watcher
crontab -e

Добавляем что-то вроде:

0 * * * * /opt/sbin/xkeen-subscription-watcher <tag>=<url>

Убираем из 04_outbounds.json прокси, которые будут теперь генерироваться из подписок, иначе теги будут конфликтовать, оставляем например такое:

{
  "outbounds": [
    {
      "tag": "direct",
      "protocol": "freedom"
    },
    {
      "tag": "block",
      "protocol": "blackhole",
      "response": {
        "type": "HTTP"
      }
    }
  ]
}

В 05_routing.json добавляем конфигурацию balancers и burstObservatory для автоматического выбора лучшего прокси, далее в rules используем balancerTag вместо outboundTag, например:

{
  "routing": {
    "domainStrategy": "AsIs",
    "balancers": [
      {
        "tag": "proxy",
        "selector": ["<tag>"],
        "strategy": {
          "type": "leastPing"
        }
      }
    ],
    "rules": [
      {
        "inboundTag": ["socks", "http"],
        "balancerTag": "proxy"
      }
    ]
  },
  "burstObservatory": {
    "subjectSelector": ["<tag>"],
    "pingConfig": {}
  }
}

Разово запускаем команду из crontab, проверяем, что всё работает.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xkeen_subscription_watcher-0.2.1.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xkeen_subscription_watcher-0.2.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file xkeen_subscription_watcher-0.2.1.tar.gz.

File metadata

File hashes

Hashes for xkeen_subscription_watcher-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1c97f2275492b56a81b82e89e89dcf24c3c4ebfb4b72871c3d79a9a2c5f100d4
MD5 ecc4854024a7eed88ba1a46b40bcab95
BLAKE2b-256 28f4a2f8358e2bca5a83f1337426a3fd9d7c7956b5b2b3f1c5aa9e26dbcd0f3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for xkeen_subscription_watcher-0.2.1.tar.gz:

Publisher: publish.yml on tkukushkin/xkeen-subscription-watcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xkeen_subscription_watcher-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for xkeen_subscription_watcher-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a61356abbc30c152e4a8bc7673d7dcaabe141e905b7956c2d1cd19e4e86f0c8
MD5 82271adba49f2f16037d7debdd4d5c36
BLAKE2b-256 354ce2d53399e8a94c1fa37c111b56c1a77de84a40b37adfe74aabd7ff01a748

See more details on using hashes here.

Provenance

The following attestation bundles were made for xkeen_subscription_watcher-0.2.1-py3-none-any.whl:

Publisher: publish.yml on tkukushkin/xkeen-subscription-watcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page