Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/auxten/clash-rule
https://github.com/auxten/clash-rule
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/auxten/clash-rule
- Owner: auxten
- License: apache-2.0
- Created: 2024-09-08T04:53:48.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-08T05:03:02.000Z (2 months ago)
- Last Synced: 2024-10-12T10:07:03.444Z (about 1 month ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Clash Rule Manager
A Go application to manage Clash proxy rules by updating GitHub Gists and Clash providers.
## Features
- Update rules for different categories (global-tv, direct, reject, trusted)
- Modify GitHub Gists with new domain rules
- Update Clash providers via API
- Check rule update status## Usage
```
clash-rule
```Supported rule types: global-tv, direct, reject, trusted
## Requirements
- Go 1.16+
- GitHub personal access token (PAT)
- Clash API access (configure URL and auth token in the code)## Installation
1. Clone the repository
2. Set up your GitHub PAT:
- Option 1: Set environment variable: `export GITHUB_TOKEN=your_token_here`
- Option 2: Store in `~/.gist_pat` file
3. Build the application: `go build -o clash-rule`## Configuration
Edit the constants in `main.go` to set:
- Gist ID
- Clash API URL
- Clash API auth token## GitHub PAT
The application will look for the GitHub PAT in the following order:
1. `GITHUB_TOKEN` environment variable
2. `~/.gist_pat` fileIf using the file method, ensure it contains only the PAT and has appropriate permissions.
## License
[MIT License](LICENSE)