Git Product home page Git Product logo

clash-docker's Introduction

clash-docker

Running Clash for Docker with configuration tools. Convert Loyalsoldier/clash-rules to clash (GPL version) compatible.

The configuration script is seriously primitive for now. For my own usage habits, this could only accepts trojan links from subscription. It will set all the proxies in to a single proxy group with method url-test. The config.yaml shall be reconfigured if needed.

Quickstart

A continer can be run directly from the image on docker hub.

docker run -e SUB_URL=<your_sub_link> -p 7890:7890 -v <path_to_dir>:/configs wuniu/clash-docker

Replace <your_sub_link with your subscription link (which returns aset of base64-encoded Trojan links). It is also recommended to set -v <path_to_dir>:/configs and replace <path_to_dir> with a local path to store the generated clash config to enable to change the clash config manually later.

The container will fetch rules from Loyalsoldier/clash-rules converts them for Clash, and combines them with your subscription Trojan links and default settings in config.yaml.

Container won't fetch the rules once the config.yaml have been generated.

Also, the project can be built locally hereafter.

docker build -t clash-build -f Dockerfile.build-clash
docker build -t clash-docker .
docker run -e SUB_URL=<your_sub_link> -p 7890:7890 -v <path_to_dir>:/configs clash-docker

This will build Clash locally (for AMD64), then run a Docker container. The container will automatically fetch Clash rules, adapt the rules for Clash (GPL version), and run Clash at port 7890.

After the config.yaml has been generated, you could add your rules to it.

Issues

  • Rules are re-fetched every time the container starts
  • An external config solution should be added (But it need to be easier.)
  • Currently only supports the url-test proxy group type
  • A filter is needed as some subscription links are invalid
  • Only supports Trojan links
  • The clashtools package cannot be installed for some reason (There is no need for doing this.)
  • The code needs refactoring

Author

Wunewww [email protected]

clash-docker's People

Contributors

wunewww avatar

Stargazers

Frank Fang avatar Zhazha_JiaYiZhen avatar  avatar  avatar Rowe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.