Giter Site home page Giter Site logo

clashd's Introduction

ClashD

This is a simple script to build a docker image to run clash in Linux.

Prerequired

Please make a full check about the following list:

  • A docker running well.

  • A connection could access the Internet.

  • A bash or other command-line environment could execute a bash script.

Quick Start

Just simply execute the build script to build an image:

# Build clashd image.
./build
# Run a container using the clashd image.
docker run -d --name clash \
    -p 7890:7890 -p 9090:9090 \
    -e CONFIG_URL=YOUR-SUBSCRIPTION-URL \
    clashd

Now, you have a clash running on your docker system. check out the dashboard from: http://127.0.0.1:9090/ui

Arguments for the build script

The options for the build script were listed below:

Argument Type Description
--build-clash switch Build the clash from the master branch.
If this argument was specified, the script will pull the master branch from Github, and run a golang container to build the clash.
Otherwise, the script will download the latest release version of the linux amd64 binary.
--build-dashboard switch Build the dashboard from the master branch.
If this argument was specified, the script will pull the mast branch from Github, and run a node container to build the dashboard.</br/> Otherwise, the script will pull the gh-pages branch directly.
--runtime-clash switch Download the clash binary when the first time a clash container is running.
If this argument was specified, the script will NOT builds nor downloads the clash in the image-building stage.
--runtime-geoip switch Download the GeoIP's database when the first time a clash container is running.
If this argument was specified, the script will NOT download the Country.mmdb file in the image-building stage.
--runtime-dashboard switch Download the dashboard when the first time a clash container is running.
If this argument was specified, the script will NOT download builds nor fetches the dashboard in the image-building stage
--clash-version string
eg.'v1.20.0'
Specify the clash version you want to use. Work only when the --build-clash and --runtime-clash were not specified.
-t | --tag string Specify the image tag name
--image string Specify the base image you want to use to build the clash image. By default, the script will use "ubuntu:18.04" instead.
--run string Specify the additional commands you want to execute in the container when the image is building.
-f | --config-file string Specify the clash configure file you want to embed in the image.
-u | --config-url string Specify the URL of the clash configure file you want to embed in the image.
-h | --help switch Make the script shows a Usage notice like this table.

Environment variables for the container.

You could like to specify some environment variables for the container to make some runtime settings. This is a table of the variables you could use:

Name Default Description
MIX_PORT Specify a port the clash will listen on to serve both the http(s) and socks. If the variable was specified, both HTTP_PORT and SOCKS_PORT will be ignored.
HTTP_PORT 7890 Specify a port the http(s) proxy will serves on
SOCKS_PORT 7891 Specify a port the socks proxy will serves on
CTRL_PORT 9090 Specify a port the API and dashboard will serves on
CONFIG_URL Specify a URL to your clash configure file. this will be ignored if you embed one in the image.

License

The script and this repository were published by Asuka under the MIT license. Please feel free to use, share, and make some upgrading.

Having fun on the internet.

clashd's People

Watchers

Asuka 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.