mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2025-10-28 20:32:42 +00:00
Compare commits
65 Commits
xmake-test
...
v0.9.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d0ed9a105 | ||
|
|
63eee92062 | ||
|
|
b9b864cf51 | ||
|
|
bdd6bbf67a | ||
|
|
8a18d3564b | ||
|
|
2ee7c3aa04 | ||
|
|
598f6ac414 | ||
|
|
6c296bfbf2 | ||
|
|
43fc751a2d | ||
|
|
99c1ef8b1a | ||
|
|
53b561bce7 | ||
|
|
469feaf0f5 | ||
|
|
0895a16876 | ||
|
|
a8292b1fc6 | ||
|
|
1ff018c47b | ||
|
|
6227eb4e7d | ||
|
|
54c8e65c70 | ||
|
|
b90e63b506 | ||
|
|
185e3893bf | ||
|
|
5a4049af89 | ||
|
|
c842defea8 | ||
|
|
e26eaf0bf5 | ||
|
|
766bdcd6e1 | ||
|
|
897dc5ed43 | ||
|
|
7bd6670448 | ||
|
|
7af3bf1794 | ||
|
|
359d9794a8 | ||
|
|
089f782177 | ||
|
|
75023b028e | ||
|
|
322924f24a | ||
|
|
04a2c24904 | ||
|
|
e80ce5833c | ||
|
|
31ba5373f0 | ||
|
|
d3801b7951 | ||
|
|
31775a91a8 | ||
|
|
af4dd857a8 | ||
|
|
686f6b3517 | ||
|
|
ebad0e96f7 | ||
|
|
927c828a27 | ||
|
|
13a372511b | ||
|
|
119df56f35 | ||
|
|
0672bd11cd | ||
|
|
f4de5097a6 | ||
|
|
cb36b431ce | ||
|
|
d5b3f920b8 | ||
|
|
69e35d6657 | ||
|
|
936ff011e9 | ||
|
|
0cda1641d3 | ||
|
|
5b85906be1 | ||
|
|
03b6f02573 | ||
|
|
92db1f1f58 | ||
|
|
d68a2217fe | ||
|
|
ca6042bb8c | ||
|
|
3b7b519584 | ||
|
|
26f8f51eb5 | ||
|
|
9f8067ab11 | ||
|
|
3938ebfce9 | ||
|
|
0b15d63ef4 | ||
|
|
c9e074daf7 | ||
|
|
0409830b3f | ||
|
|
4563be3d45 | ||
|
|
615b3a404e | ||
|
|
6b29778351 | ||
|
|
3cc58f38dd | ||
|
|
81d9167840 |
9
.github/workflows/build.yml
vendored
9
.github/workflows/build.yml
vendored
@@ -1,7 +1,6 @@
|
||||
name: GitHub CI
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
tags:
|
||||
- '**'
|
||||
workflow_dispatch:
|
||||
@@ -64,12 +63,14 @@ jobs:
|
||||
|
||||
armv7_build:
|
||||
name: Linux armv7 Build
|
||||
runs-on: [self-hosted, linux, ARM]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Add commit id into version
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Build
|
||||
run: docker run --rm -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:armv7-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
|
||||
- name: Upload
|
||||
@@ -89,12 +90,14 @@ jobs:
|
||||
|
||||
aarch64_build:
|
||||
name: Linux aarch64 Build
|
||||
runs-on: [self-hosted, linux, ARM64]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Add commit id into version
|
||||
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||
run: SHA=$(git rev-parse --short HEAD) && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- name: Build
|
||||
run: docker run --rm -v $GITHUB_WORKSPACE:/root/workdir multiarch/alpine:aarch64-latest-stable /bin/sh -c "apk add bash git nodejs npm && cd /root/workdir && chmod +x scripts/build.alpine.release.sh && bash scripts/build.alpine.release.sh"
|
||||
- name: Upload
|
||||
|
||||
409
.github/workflows/docker.yml
vendored
409
.github/workflows/docker.yml
vendored
@@ -1,335 +1,130 @@
|
||||
name: Publish Docker Image
|
||||
on:
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
tags:
|
||||
- '**'
|
||||
|
||||
concurrency:
|
||||
concurrency:
|
||||
group: ${{ github.ref }}-${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
REGISTRY_IMAGE: asdlokj1qpi23/subconverter
|
||||
|
||||
jobs:
|
||||
amd64_build:
|
||||
name: Build AMD64 Image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout base
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Docker login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Get commit SHA
|
||||
id: vars
|
||||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and export
|
||||
id: build
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
context: scripts/
|
||||
tags: tindy2013/subconverter:latest
|
||||
build-args: |
|
||||
SHA=${{ steps.vars.outputs.sha_short }}
|
||||
outputs: type=image,push=true
|
||||
|
||||
- name: Replace tag without `v`
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: actions/github-script@v6
|
||||
id: version
|
||||
with:
|
||||
script: |
|
||||
return context.payload.ref.replace(/\/?refs\/tags\/v/, '')
|
||||
result-encoding: string
|
||||
|
||||
- name: Build release and export
|
||||
id: build_rel
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
context: scripts/
|
||||
tags: tindy2013/subconverter:${{steps.version.outputs.result}}
|
||||
outputs: type=image,push=true
|
||||
|
||||
- name: Save digest
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: echo ${{ steps.build.outputs.digest }} > /tmp/digest.txt
|
||||
|
||||
- name: Save release digest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: echo ${{ steps.build_rel.outputs.digest }} > /tmp/digest.txt
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: digest_amd64
|
||||
path: /tmp/digest.txt
|
||||
|
||||
x86_build:
|
||||
name: Build x86 Image
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout base
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Docker login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Get commit SHA
|
||||
id: vars
|
||||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and export
|
||||
id: build
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
platforms: linux/386
|
||||
context: scripts/
|
||||
tags: tindy2013/subconverter:latest
|
||||
build-args: |
|
||||
SHA=${{ steps.vars.outputs.sha_short }}
|
||||
outputs: type=image,push=true
|
||||
|
||||
- name: Replace tag without `v`
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: actions/github-script@v6
|
||||
id: version
|
||||
with:
|
||||
script: |
|
||||
return context.payload.ref.replace(/\/?refs\/tags\/v/, '')
|
||||
result-encoding: string
|
||||
|
||||
- name: Build release and export
|
||||
id: build_rel
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
platforms: linux/386
|
||||
context: scripts/
|
||||
tags: tindy2013/subconverter:${{steps.version.outputs.result}}
|
||||
outputs: type=image,push=true
|
||||
|
||||
- name: Save digest
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: echo ${{ steps.build.outputs.digest }} > /tmp/digest.txt
|
||||
|
||||
- name: Save release digest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: echo ${{ steps.build_rel.outputs.digest }} > /tmp/digest.txt
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: digest_386
|
||||
path: /tmp/digest.txt
|
||||
|
||||
armv7_build:
|
||||
name: Build ARMv7 Image
|
||||
runs-on: [self-hosted, linux, ARM]
|
||||
steps:
|
||||
- name: Checkout base
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Docker login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Get commit SHA
|
||||
id: vars
|
||||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and export
|
||||
id: build
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
platforms: linux/arm/v7
|
||||
context: scripts/
|
||||
tags: tindy2013/subconverter:latest
|
||||
build-args: |
|
||||
SHA=${{ steps.vars.outputs.sha_short }}
|
||||
THREADS=4
|
||||
outputs: type=image,push=true
|
||||
|
||||
- name: Replace tag without `v`
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: actions/github-script@v6
|
||||
id: version
|
||||
with:
|
||||
script: |
|
||||
return context.payload.ref.replace(/\/?refs\/tags\/v/, '')
|
||||
result-encoding: string
|
||||
|
||||
- name: Build release and export
|
||||
id: build_rel
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
platforms: linux/arm/v7
|
||||
context: scripts/
|
||||
tags: tindy2013/subconverter:${{steps.version.outputs.result}}
|
||||
build-args: |
|
||||
THREADS=4
|
||||
outputs: type=image,push=true
|
||||
|
||||
- name: Save digest
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: echo ${{ steps.build.outputs.digest }} > /tmp/digest.txt
|
||||
|
||||
- name: Save release digest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: echo ${{ steps.build_rel.outputs.digest }} > /tmp/digest.txt
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: digest_armv7
|
||||
path: /tmp/digest.txt
|
||||
|
||||
arm64_build:
|
||||
name: Build ARM64 Image
|
||||
runs-on: [self-hosted, linux, ARM64]
|
||||
steps:
|
||||
- name: Checkout base
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Docker login
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Get commit SHA
|
||||
id: vars
|
||||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and export
|
||||
id: build
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
platforms: linux/arm64
|
||||
context: scripts/
|
||||
tags: tindy2013/subconverter:latest
|
||||
build-args: |
|
||||
SHA=${{ steps.vars.outputs.sha_short }}
|
||||
THREADS=4
|
||||
outputs: type=image,push=true
|
||||
|
||||
- name: Replace tag without `v`
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: actions/github-script@v6
|
||||
id: version
|
||||
with:
|
||||
script: |
|
||||
return context.payload.ref.replace(/\/?refs\/tags\/v/, '')
|
||||
result-encoding: string
|
||||
|
||||
- name: Build release and export
|
||||
id: build_rel
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
platforms: linux/arm64
|
||||
context: scripts/
|
||||
tags: tindy2013/subconverter:${{steps.version.outputs.result}}
|
||||
build-args: |
|
||||
THREADS=4
|
||||
outputs: type=image,push=true
|
||||
|
||||
- name: Save digest
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: echo ${{ steps.build.outputs.digest }} > /tmp/digest.txt
|
||||
|
||||
- name: Save release digest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: echo ${{ steps.build_rel.outputs.digest }} > /tmp/digest.txt
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: digest_arm64
|
||||
path: /tmp/digest.txt
|
||||
|
||||
build:
|
||||
name: Build
|
||||
needs: [amd64_build, x86_build, armv7_build, arm64_build]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- platform: linux/amd64
|
||||
os: ubuntu-latest
|
||||
- platform: linux/386
|
||||
os: ubuntu-latest
|
||||
- platform: linux/arm/v7
|
||||
os: ubuntu-latest
|
||||
- platform: linux/arm64
|
||||
os: ubuntu-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: Build ${{ matrix.platform }} Image
|
||||
steps:
|
||||
- name: Prepare
|
||||
run: |
|
||||
platform=${{ matrix.platform }}
|
||||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout base
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# https://github.com/docker/setup-qemu-action
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
# https://github.com/docker/setup-buildx-action
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
config-inline: |
|
||||
[worker.oci]
|
||||
max-parallelism = 1
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
path: /tmp/images/
|
||||
images: ${{ env.REGISTRY_IMAGE }}
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
- name: Docker login
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Replace tag without `v`
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: actions/github-script@v6
|
||||
id: version
|
||||
with:
|
||||
script: |
|
||||
return context.payload.ref.replace(/\/?refs\/tags\/v/, '')
|
||||
result-encoding: string
|
||||
|
||||
- name: Merge and push manifest on master branch
|
||||
- name: Get commit SHA
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: python scripts/merge_manifest.py
|
||||
id: vars
|
||||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Merge and push manifest on release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: python scripts/merge_manifest.py ${{steps.version.outputs.result}}
|
||||
- name: Build and export
|
||||
id: build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
platforms: ${{ matrix.platform }}
|
||||
context: scripts/
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
SHA=${{ steps.vars.outputs.sha_short }}
|
||||
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
|
||||
|
||||
- name: Export digest
|
||||
run: |
|
||||
rm -rf /tmp/digests
|
||||
mkdir -p /tmp/digests
|
||||
digest="${{ steps.build.outputs.digest }}"
|
||||
touch "/tmp/digests/${digest#sha256:}"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digest-${{ env.PLATFORM_PAIR }}
|
||||
path: /tmp/digests/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
merge:
|
||||
name: Merge
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: /tmp/digests
|
||||
pattern: digest-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY_IMAGE }}
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
- name: Docker login
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Create manifest list and push
|
||||
working-directory: /tmp/digests
|
||||
run: |
|
||||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
||||
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
|
||||
|
||||
- name: Inspect image
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
# subconverter-docker
|
||||
|
||||
This is a minimized image to run https://github.com/tindy2013/subconverter.
|
||||
|
||||
For running this docker, simply use the following commands:
|
||||
```bash
|
||||
# run the container detached, forward internal port 25500 to host port 25500
|
||||
docker run -d --restart=always -p 25500:25500 tindy2013/subconverter:latest
|
||||
docker run -d --restart=always -p 25500:25500 asdlokj1qpi23/subconverter:latest
|
||||
# then check its status
|
||||
curl http://localhost:25500/version
|
||||
# if you see `subconverter vx.x.x backend` then the container is up and running
|
||||
@@ -16,7 +14,7 @@ Or run in docker-compose:
|
||||
version: '3'
|
||||
services:
|
||||
subconverter:
|
||||
image: tindy2013/subconverter:latest
|
||||
image: asdlokj1qpi23/subconverter:latest
|
||||
container_name: subconverter
|
||||
ports:
|
||||
- "15051:25500"
|
||||
|
||||
76
README.md
76
README.md
@@ -2,42 +2,67 @@
|
||||
|
||||
Utility to convert between various proxy subscription formats.
|
||||
|
||||
[](https://github.com/tindy2013/subconverter/actions)
|
||||
[](https://github.com/tindy2013/subconverter/tags)
|
||||
[](https://github.com/tindy2013/subconverter/releases)
|
||||
[](https://github.com/tindy2013/subconverter/blob/master/LICENSE)
|
||||
[](https://github.com/asdlokj1qpi23/subconverter/actions)
|
||||
[](https://github.com/asdlokj1qpi23/subconverter/tags)
|
||||
[](https://github.com/asdlokj1qpi23/subconverter/releases)
|
||||
[](https://github.com/tindy2013/subconverter/blob/master/LICENSE)
|
||||
|
||||
[Docker README](https://github.com/tindy2013/subconverter/blob/master/README-docker.md)
|
||||
[Docker README](https://github.com/asdlokj1qpi23/subconverter/blob/master/README-docker.md)
|
||||
|
||||
[中文文档](https://github.com/tindy2013/subconverter/blob/master/README-cn.md)
|
||||
[中文文档](https://github.com/asdlokj1qpi23/subconverter/blob/master/README-cn.md)
|
||||
|
||||
- [subconverter](#subconverter)
|
||||
- [Docker](#docker)
|
||||
- [Supported Types](#supported-types)
|
||||
- [Quick Usage](#quick-usage)
|
||||
- [Access Interface](#access-interface)
|
||||
- [Description](#description)
|
||||
- [Advanced Usage](#advanced-usage)
|
||||
- [Auto Upload](#auto-upload)
|
||||
|
||||
## Docker
|
||||
|
||||
For running this docker, simply use the following commands:
|
||||
```bash
|
||||
# run the container detached, forward internal port 25500 to host port 25500
|
||||
docker run -d --restart=always -p 25500:25500 asdlokj1qpi23/subconverter:latest
|
||||
# then check its status
|
||||
curl http://localhost:25500/version
|
||||
# if you see `subconverter vx.x.x backend` then the container is up and running
|
||||
```
|
||||
Or run in docker-compose:
|
||||
```yaml
|
||||
---
|
||||
version: '3'
|
||||
services:
|
||||
subconverter:
|
||||
image: asdlokj1qpi23/subconverter:latest
|
||||
container_name: subconverter
|
||||
ports:
|
||||
- "15051:25500"
|
||||
restart: always
|
||||
```
|
||||
## Supported Types
|
||||
|
||||
| Type | As Source | As Target | Target Name |
|
||||
| ------------ | :--------: | :----------: | ----------- |
|
||||
| Clash | ✓ | ✓ | clash |
|
||||
| ClashR | ✓ | ✓ | clashr |
|
||||
| Quantumult | ✓ | ✓ | quan |
|
||||
| Quantumult X | ✓ | ✓ | quanx |
|
||||
| Loon | ✓ | ✓ | loon |
|
||||
| SS (SIP002) | ✓ | ✓ | ss |
|
||||
| SS Android | ✓ | ✓ | sssub |
|
||||
| SSD | ✓ | ✓ | ssd |
|
||||
| SSR | ✓ | ✓ | ssr |
|
||||
| Surfboard | ✓ | ✓ | surfboard |
|
||||
| Surge 2 | ✓ | ✓ | surge&ver=2 |
|
||||
| Surge 3 | ✓ | ✓ | surge&ver=3 |
|
||||
| Surge 4 | ✓ | ✓ | surge&ver=4 |
|
||||
| V2Ray | ✓ | ✓ | v2ray |
|
||||
| Telegram-liked HTTP/Socks 5 links | ✓ | × | Only as source |
|
||||
| Type | As Source | As Target | Target Name |
|
||||
|-----------------------------------|:---------:| :----------: |----------------|
|
||||
| Clash | ✓ | ✓ | clash |
|
||||
| ClashR | ✓ | ✓ | clashr |
|
||||
| Quantumult | ✓ | ✓ | quan |
|
||||
| Quantumult X | ✓ | ✓ | quanx |
|
||||
| Loon | ✓ | ✓ | loon |
|
||||
| SS (SIP002) | ✓ | ✓ | ss |
|
||||
| SS Android | ✓ | ✓ | sssub |
|
||||
| SSD | ✓ | ✓ | ssd |
|
||||
| SSR | ✓ | ✓ | ssr |
|
||||
| Surfboard | ✓ | ✓ | surfboard |
|
||||
| Surge 2 | ✓ | ✓ | surge&ver=2 |
|
||||
| Surge 3 | ✓ | ✓ | surge&ver=3 |
|
||||
| Surge 4 | ✓ | ✓ | surge&ver=4 |
|
||||
| Surge 5 | ✓ | ✓ | surge&ver=5 |
|
||||
| V2Ray | ✓ | ✓ | v2ray |
|
||||
| Telegram-liked HTTP/Socks 5 links | ✓ | × | Only as source |
|
||||
| Singbox | ✓ | ✓ | singbox |
|
||||
|
||||
Notice:
|
||||
|
||||
@@ -95,7 +120,7 @@ Finally subscribe this link in Clash and you are done!
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
Please refer to [中文文档](https://github.com/tindy2013/subconverter/blob/master/README-cn.md#%E8%BF%9B%E9%98%B6%E7%94%A8%E6%B3%95).
|
||||
Please refer to [中文文档](https://github.com/asdlokj1qpi23/subconverter/blob/master/README-cn.md#%E8%BF%9B%E9%98%B6%E7%94%A8%E6%B3%95).
|
||||
|
||||
## Auto Upload
|
||||
|
||||
@@ -110,3 +135,6 @@ Example:
|
||||
;uncomment the following line and enter your token to enable upload function
|
||||
token = xxxxxxxxxxxxxxxxxxxxxxxx(Your Personal Access Token)
|
||||
```
|
||||
## Thanks
|
||||
[tindy2013](https://github.com/tindy2013)
|
||||
[https://github.com/tindy2013/subconverter](https://github.com/tindy2013/subconverter)
|
||||
@@ -5,7 +5,7 @@
|
||||
;For more available options, please check the readme section
|
||||
|
||||
target=clash
|
||||
url=ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@www.example.com:1080#Example
|
||||
url=trojan://65474277@sqcu.hostmsu.ru:55551?allowinsecure=0&peer=mza.hkfq.xyz&mux=1&ws=0&wspath=&wshost=&ss=0&ssmethod=aes-128-gcm&sspasswd=&group=#%E9%A6%99%E6%B8%AFCN2-MZA%E8%8A%82%E7%82%B9-%E5%AE%BF%E8%BF%81%E8%81%94%E9%80%9A%E4%B8%AD%E8%BD%AC
|
||||
;config=config/example_external_config.ini
|
||||
;ver=3
|
||||
;udp=true
|
||||
|
||||
@@ -35,7 +35,7 @@ RUN set -xe && \
|
||||
cmake -DCMAKE_CXX_STANDARD=11 . && \
|
||||
make install -j $THREADS && \
|
||||
cd .. && \
|
||||
git clone https://github.com/tindy2013/subconverter --depth=1 && \
|
||||
git clone https://github.com/asdlokj1qpi23/subconverter --depth=1 && \
|
||||
cd subconverter && \
|
||||
[ -n "$SHA" ] && sed -i 's/\(v[0-9]\.[0-9]\.[0-9]\)/\1-'"$SHA"'/' src/version.h;\
|
||||
python3 -m ensurepip && \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import glob
|
||||
import os, sys
|
||||
|
||||
MAIN_IMAGE_NAME="tindy2013/subconverter"
|
||||
MAIN_IMAGE_NAME="asdlokj1qpi23/subconverter"
|
||||
TARGET_TAG="latest" if len(sys.argv) < 2 else sys.argv[1]
|
||||
|
||||
args=["docker manifest create {}:{}".format(MAIN_IMAGE_NAME, TARGET_TAG)]
|
||||
|
||||
@@ -13,8 +13,8 @@ dest=base/config/
|
||||
keep_tree=false
|
||||
|
||||
[DivineEngine]
|
||||
url=https://github.com/DivineEngine/Profiles
|
||||
checkout=f4d75f7d48a3f42129e030bef751d4d22bca02da
|
||||
url=https://github.com/asdlokj1qpi23/DivineEngine.git
|
||||
checkout=e5043a1cee1678254b424267bdcfccbcb574bad6
|
||||
match=Surge/Ruleset/**
|
||||
|
||||
[NobyDa]
|
||||
|
||||
23
scripts/rules_config_bak.conf
Normal file
23
scripts/rules_config_bak.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
[ACL4SSR]
|
||||
name=ACL4SSR
|
||||
url=https://github.com/ACL4SSR/ACL4SSR
|
||||
checkout=1dc5c92b0c8ceaaecbc66530c309961f53e52c8c
|
||||
match=Clash/*.list|Clash/Ruleset/**
|
||||
|
||||
[ACL4SSR_config]
|
||||
name=ACL4SSR
|
||||
url=https://github.com/ACL4SSR/ACL4SSR
|
||||
checkout=1dc5c92b0c8ceaaecbc66530c309961f53e52c8c
|
||||
match=Clash/config/**
|
||||
dest=base/config/
|
||||
keep_tree=false
|
||||
|
||||
[DivineEngine]
|
||||
url=https://github.com/DivineEngine/Profiles
|
||||
checkout=f4d75f7d48a3f42129e030bef751d4d22bca02da
|
||||
match=Surge/Ruleset/**
|
||||
|
||||
[NobyDa]
|
||||
url=https://github.com/NobyDa/Script
|
||||
checkout=ae4c12f23de8078e02c373c9969b19af28257fcb
|
||||
match=Surge/*.list
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,7 @@ struct extra_settings
|
||||
std::string quanx_dev_id;
|
||||
tribool udp = tribool();
|
||||
tribool tfo = tribool();
|
||||
tribool xudp = tribool();
|
||||
tribool skip_cert_verify = tribool();
|
||||
tribool tls13 = tribool();
|
||||
bool clash_classical_ruleset = false;
|
||||
@@ -71,5 +72,5 @@ std::string proxyToQuan(std::vector<Proxy> &nodes, const std::string &base_conf,
|
||||
void proxyToQuan(std::vector<Proxy> &nodes, INIReader &ini, std::vector<RulesetContent> &ruleset_content_array, const ProxyGroupConfigs &extra_proxy_group, extra_settings &ext);
|
||||
std::string proxyToSSD(std::vector<Proxy> &nodes, std::string &group, std::string &userinfo, extra_settings &ext);
|
||||
std::string proxyToSingBox(std::vector<Proxy> &nodes, const std::string &base_conf, std::vector<RulesetContent> &ruleset_content_array, const ProxyGroupConfigs &extra_proxy_group, extra_settings &ext);
|
||||
|
||||
#endif // SUBEXPORT_H_INCLUDED
|
||||
void replaceAll(std::string& input, const std::string& search, const std::string& replace);
|
||||
#endif // SUBEXPORT_H_INCLUDED
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,8 +9,7 @@
|
||||
using String = std::string;
|
||||
using StringArray = std::vector<String>;
|
||||
|
||||
enum class ProxyType
|
||||
{
|
||||
enum class ProxyType {
|
||||
Unknown,
|
||||
Shadowsocks,
|
||||
ShadowsocksR,
|
||||
@@ -20,36 +19,44 @@ enum class ProxyType
|
||||
HTTP,
|
||||
HTTPS,
|
||||
SOCKS5,
|
||||
WireGuard
|
||||
WireGuard,
|
||||
VLESS,
|
||||
Hysteria,
|
||||
Hysteria2
|
||||
};
|
||||
|
||||
inline String getProxyTypeName(ProxyType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ProxyType::Shadowsocks:
|
||||
return "SS";
|
||||
case ProxyType::ShadowsocksR:
|
||||
return "SSR";
|
||||
case ProxyType::VMess:
|
||||
return "VMess";
|
||||
case ProxyType::Trojan:
|
||||
return "Trojan";
|
||||
case ProxyType::Snell:
|
||||
return "Snell";
|
||||
case ProxyType::HTTP:
|
||||
return "HTTP";
|
||||
case ProxyType::HTTPS:
|
||||
return "HTTPS";
|
||||
case ProxyType::SOCKS5:
|
||||
return "SOCKS5";
|
||||
default:
|
||||
return "Unknown";
|
||||
inline String getProxyTypeName(ProxyType type) {
|
||||
switch (type) {
|
||||
case ProxyType::Shadowsocks:
|
||||
return "SS";
|
||||
case ProxyType::ShadowsocksR:
|
||||
return "SSR";
|
||||
case ProxyType::VMess:
|
||||
return "VMess";
|
||||
case ProxyType::Trojan:
|
||||
return "Trojan";
|
||||
case ProxyType::Snell:
|
||||
return "Snell";
|
||||
case ProxyType::HTTP:
|
||||
return "HTTP";
|
||||
case ProxyType::HTTPS:
|
||||
return "HTTPS";
|
||||
case ProxyType::SOCKS5:
|
||||
return "SOCKS5";
|
||||
case ProxyType::WireGuard:
|
||||
return "WireGuard";
|
||||
case ProxyType::VLESS:
|
||||
return "Vless";
|
||||
case ProxyType::Hysteria:
|
||||
return "Hysteria";
|
||||
case ProxyType::Hysteria2:
|
||||
return "Hysteria2";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
struct Proxy
|
||||
{
|
||||
struct Proxy {
|
||||
ProxyType Type = ProxyType::Unknown;
|
||||
uint32_t Id = 0;
|
||||
uint32_t GroupId = 0;
|
||||
@@ -71,6 +78,8 @@ struct Proxy
|
||||
uint16_t AlterId = 0;
|
||||
String TransferProtocol;
|
||||
String FakeType;
|
||||
String AuthStr;
|
||||
|
||||
bool TLSSecure = false;
|
||||
|
||||
String Host;
|
||||
@@ -81,6 +90,7 @@ struct Proxy
|
||||
String QUICSecret;
|
||||
|
||||
tribool UDP;
|
||||
tribool XUDP;
|
||||
tribool TCPFastOpen;
|
||||
tribool AllowInsecure;
|
||||
tribool TLS13;
|
||||
@@ -99,6 +109,19 @@ struct Proxy
|
||||
uint16_t KeepAlive = 0;
|
||||
String TestUrl;
|
||||
String ClientId;
|
||||
String Ports;
|
||||
String Auth;
|
||||
String Alpn;
|
||||
String UpMbps;
|
||||
String DownMbps;
|
||||
String Insecure;
|
||||
String Fingerprint;
|
||||
String OBFSPassword;
|
||||
String GRPCServiceName;
|
||||
String GRPCMode;
|
||||
String ShortId;
|
||||
String Flow;
|
||||
bool FlowShow = false;
|
||||
};
|
||||
|
||||
#define SS_DEFAULT_GROUP "SSProvider"
|
||||
@@ -109,5 +132,8 @@ struct Proxy
|
||||
#define TROJAN_DEFAULT_GROUP "TrojanProvider"
|
||||
#define SNELL_DEFAULT_GROUP "SnellProvider"
|
||||
#define WG_DEFAULT_GROUP "WireGuardProvider"
|
||||
#define XRAY_DEFAULT_GROUP "XRayProvider"
|
||||
#define HYSTERIA_DEFAULT_GROUP "HysteriaProvider"
|
||||
#define HYSTERIA2_DEFAULT_GROUP "Hysteria2Provider"
|
||||
|
||||
#endif // PROXY_H_INCLUDED
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,8 +5,7 @@
|
||||
|
||||
#include "config/proxy.h"
|
||||
|
||||
enum class ConfType
|
||||
{
|
||||
enum class ConfType {
|
||||
Unknow,
|
||||
SS,
|
||||
SSR,
|
||||
@@ -20,26 +19,103 @@ enum class ConfType
|
||||
Local
|
||||
};
|
||||
|
||||
void vmessConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add, const std::string &port, const std::string &type, const std::string &id, const std::string &aid, const std::string &net, const std::string &cipher, const std::string &path, const std::string &host, const std::string &edge, const std::string &tls, const std::string &sni, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||
void ssrConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server, const std::string &port, const std::string &protocol, const std::string &method, const std::string &obfs, const std::string &password, const std::string &obfsparam, const std::string &protoparam, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool());
|
||||
void ssConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server, const std::string &port, const std::string &password, const std::string &method, const std::string &plugin, const std::string &pluginopts, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||
void socksConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server, const std::string &port, const std::string &username, const std::string &password, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool());
|
||||
void httpConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server, const std::string &port, const std::string &username, const std::string &password, bool tls, tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||
void trojanConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server, const std::string &port, const std::string &password, const std::string &network, const std::string &host, const std::string &path, bool tlssecure, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||
void snellConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server, const std::string &port, const std::string &password, const std::string &obfs, const std::string &host, uint16_t version = 0, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool());
|
||||
void hysteriaConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add,
|
||||
const std::string &port, const std::string &type, const std::string &auth,
|
||||
const std::string &auth_str, const std::string &host, const std::string &up,
|
||||
const std::string &down, const std::string &alpn, const std::string &obfsParam,
|
||||
const std::string &insecure, const std::string &ports, const std::string &sni,
|
||||
tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(),
|
||||
tribool tls13 = tribool());
|
||||
|
||||
void hysteria2Construct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add,
|
||||
const std::string &port, const std::string &password, const std::string &host,
|
||||
const std::string &up, const std::string &down, const std::string &alpn,
|
||||
const std::string &obfsParam, const std::string &obfsPassword, const std::string &sni,
|
||||
const std::string &publicKey, const std::string &ports,
|
||||
tribool udp, tribool tfo,
|
||||
tribool scv);
|
||||
|
||||
void vlessConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add,
|
||||
const std::string &port, const std::string &type, const std::string &id, const std::string &aid,
|
||||
const std::string &net, const std::string &cipher, const std::string &flow, const std::string &mode,
|
||||
const std::string &path, const std::string &host, const std::string &edge, const std::string &tls,
|
||||
const std::string &pkd, const std::string &sid, const std::string &fp, const std::string &sni,
|
||||
tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(),
|
||||
tribool tls13 = tribool());
|
||||
|
||||
void vmessConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &add,
|
||||
const std::string &port, const std::string &type, const std::string &id, const std::string &aid,
|
||||
const std::string &net, const std::string &cipher, const std::string &path, const std::string &host,
|
||||
const std::string &edge, const std::string &tls, const std::string &sni, tribool udp = tribool(),
|
||||
tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||
|
||||
void ssrConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server,
|
||||
const std::string &port, const std::string &protocol, const std::string &method,
|
||||
const std::string &obfs, const std::string &password, const std::string &obfsparam,
|
||||
const std::string &protoparam, tribool udp = tribool(), tribool tfo = tribool(),
|
||||
tribool scv = tribool());
|
||||
|
||||
void ssConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server,
|
||||
const std::string &port, const std::string &password, const std::string &method,
|
||||
const std::string &plugin, const std::string &pluginopts, tribool udp = tribool(),
|
||||
tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||
|
||||
void socksConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server,
|
||||
const std::string &port, const std::string &username, const std::string &password,
|
||||
tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool());
|
||||
|
||||
void httpConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server,
|
||||
const std::string &port, const std::string &username, const std::string &password, bool tls,
|
||||
tribool tfo = tribool(), tribool scv = tribool(), tribool tls13 = tribool());
|
||||
|
||||
void trojanConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server,
|
||||
const std::string &port, const std::string &password, const std::string &network,
|
||||
const std::string &host, const std::string &path, const std::string &fp, const std::string &sni,
|
||||
bool tlssecure, tribool udp = tribool(), tribool tfo = tribool(), tribool scv = tribool(),
|
||||
tribool tls13 = tribool());
|
||||
|
||||
void snellConstruct(Proxy &node, const std::string &group, const std::string &remarks, const std::string &server,
|
||||
const std::string &port, const std::string &password, const std::string &obfs,
|
||||
const std::string &host, uint16_t version = 0, tribool udp = tribool(), tribool tfo = tribool(),
|
||||
tribool scv = tribool());
|
||||
|
||||
void explodeVmess(std::string vmess, Proxy &node);
|
||||
|
||||
void explodeSSR(std::string ssr, Proxy &node);
|
||||
|
||||
void explodeSS(std::string ss, Proxy &node);
|
||||
|
||||
void explodeTrojan(std::string trojan, Proxy &node);
|
||||
|
||||
void explodeQuan(const std::string &quan, Proxy &node);
|
||||
|
||||
void explodeStdVMess(std::string vmess, Proxy &node);
|
||||
|
||||
void explodeStdVless(std::string vless, Proxy &node);
|
||||
|
||||
void explodeStdHysteria(std::string hysteria, Proxy &node);
|
||||
|
||||
void explodeStdHysteria2(std::string hysteria2, Proxy &node);
|
||||
|
||||
void explodeShadowrocket(std::string kit, Proxy &node);
|
||||
|
||||
void explodeKitsunebi(std::string kit, Proxy &node);
|
||||
|
||||
void explodeVless(std::string vless, Proxy &node);
|
||||
|
||||
void explodeHysteria(std::string hysteria, Proxy &node);
|
||||
|
||||
void explodeHysteria2(std::string hysteria2, Proxy &node);
|
||||
|
||||
/// Parse a link
|
||||
void explode(const std::string &link, Proxy &node);
|
||||
|
||||
void explodeSSD(std::string link, std::vector<Proxy> &nodes);
|
||||
|
||||
void explodeSub(std::string sub, std::vector<Proxy> &nodes);
|
||||
|
||||
int explodeConf(const std::string &filepath, std::vector<Proxy> &nodes);
|
||||
|
||||
int explodeConfContent(const std::string &content, std::vector<Proxy> &nodes);
|
||||
|
||||
#endif // SUBPARSER_H_INCLUDED
|
||||
|
||||
@@ -5,11 +5,9 @@
|
||||
#include <map>
|
||||
#include <string.h>
|
||||
|
||||
struct strICaseComp
|
||||
{
|
||||
bool operator() (const std::string &lhs, const std::string &rhs) const
|
||||
{
|
||||
return strcasecmp(lhs.c_str(), rhs.c_str());
|
||||
struct strICaseComp {
|
||||
bool operator()(const std::string &lhs, const std::string &rhs) const {
|
||||
return strcasecmp(lhs.c_str(), rhs.c_str()) > 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef VERSION_H_INCLUDED
|
||||
#define VERSION_H_INCLUDED
|
||||
|
||||
#define VERSION "v0.8.1"
|
||||
#define VERSION "v0.9.5"
|
||||
|
||||
#endif // VERSION_H_INCLUDED
|
||||
|
||||
Reference in New Issue
Block a user