smerge

command module
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 9 Imported by: 0

README

SMerge

Go Version License

Subscriptions merge tool.

It's a web service that joins data from multiple stealth proxy subscriptions and provides it in a single endpoint. It can decode and encode data in base64 format and supports groups update periods.

Configuration

Simple JSON configuration file with groups and subscriptions. Example in config.json:

{
  "host": "localhost",
  "port": 43210,
  "user_agent": "SMerge/1.0",
  "timeout": "10s",
  "debug": true,
  "groups": [
    {
      "name": "group1",
      "endpoint": "/group1",
      "encoded": true,
      "period": "1h15m",
      "subscriptions": [
        {
          "name": "subscription1",
          "url": "http://localhost:43211/subscription1",
          "encoded": false,
          "has_prefixes": ["ss://", "vless://"],
          "timeout": "10s"
        },
        {
          "name": "subscription2",
          "url": "http://localhost:43212/subscription2",
          "encoded": true,
          "timeout": "10s"
        }
      ]
    }
  ]
}

Encoded is a flag what means that subscription data is encoded in base64.

Build

make build

Or using docker:

make docker

Test coverage:

make test
...
ok      github.com/z0rr0/smerge         (cached)        coverage: 65.4% of statements
ok      github.com/z0rr0/smerge/cfg     (cached)        coverage: 95.7% of statements
ok      github.com/z0rr0/smerge/crawler (cached)        coverage: 93.3% of statements
ok      github.com/z0rr0/smerge/server  (cached)        coverage: 90.9% of statements

Run

./smerge -help
Usage of ./smerge:
  -config string
        configuration file (default "config.json")
  -debug
        debug mode
  -version
        show version

Or using docker

  • directory data on host should contain config.json
  • port 43210 on host should be free
  • user ID can be changed to the current user ID on the host
docker run -d \
  --name smerge \
  --user 1000:1000 \
  -p 43210:43210 \
  -v $(pwd)/data:/data:ro \
  --restart unless-stopped \
  z0rr0/smerge:latest

Or using docker-compose:

docker compose up -d

License

This source code is governed by a MIT license that can be found in the LICENSE file.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL