Create README_en.md

New Readme?
This commit is contained in:
北野樱奈 2024-11-24 23:32:51 +08:00 committed by GitHub
parent cb66597549
commit 8f76f1a5b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

207
README_en.md Normal file
View File

@ -0,0 +1,207 @@
# Project Introduction
This project utilizes the open-source tool [Clash (discontinued)](https://github.com/Dreamacro/clash) as its core program, combined with custom scripts to implement a simple proxy solution.
Backup repository for Clash: [Clash-backup](https://github.com/Elegycloud/clash-for-linux-backup)
The primary purpose of this project is to address the slow download speeds for GitHub and other overseas resources on servers.
---
# Disclaimer
1. This project is licensed under the GNU General Public License (GPL) v3.0. Please review the LICENSE file in this repository for details.
2. The original authors of this project retain all intellectual property rights. Users must comply with the requirements of the GPL v3.0 and bear all risks associated with using this project.
3. This project is provided "as is" without any explicit or implicit guarantees. To the fullest extent permitted by law, the original authors are not liable for any direct, indirect, special, incidental, or consequential damages.
4. This project and its repository are entirely unrelated to the creator and maintainer. It is solely a backup repository, and any disputes, conflicts, or losses arising from using this project are entirely unrelated to the author or maintainer.
5. Users must adhere to the laws and regulations of their own country and resolve any legal or regulatory issues arising from the use of this project on their own.
---
# Additional Notes
Since the original author has discontinued this project, this repository serves as a backup only. If any of its content infringes on your rights, please submit an issue, and I will address it promptly.
*(Note dated 2024/06/07):* Due to limited time, I may not respond to all issues. My apologies! Contributions to maintain and resolve repository issues are welcome.
This is a backup of Clash for Linux (Backup ID: 202311091510).
If you enjoy this project, please give it a star!
---
# Usage Notes
- It is recommended to run this project as the root user or with `sudo` privileges.
- If issues arise during usage, please first consult the existing [Issues](https://github.com/Elegycloud/clash-for-linux-backup/issues).
- When submitting an issue, ensure that sensitive information (e.g., subscription URLs) is removed or replaced.
- This project integrates configurations from [Clash (discontinued)](https://github.com/Dreamacro/clash) and [YACD](https://github.com/haishanh/yacd). For detailed configurations, please refer to the original projects.
- This project does not provide any subscription information. You must prepare your own Clash subscription URL.
- Before running, manually modify the `CLASH_URL` variable in the `.env` file, or the program will not work correctly.
- Tested on RHEL series, Debian, Kali Linux, Ubuntu, and other Linux systems. Other distributions may require minor script modifications.
- Supports x86_64 and aarch64 platforms.
- **Note:** For some Linux desktop systems, you may need to set the proxy in your browser for proper usage.
- **If the system proxy doesn't work, but you need it, try modifying the port in `start.sh` and reloading the environment variables.**
- **If issues persist, consider changing your network environment (this may also be a factor).**
- **On some Linux systems, sites like Google, Twitter, or YouTube may not respond to ping requests—this is normal.**
> **Tip:** If you encounter issues you cannot resolve independently, please prioritize checking the [Issues](https://github.com/Elegycloud/clash-for-linux-backup/issues) section. Due to limited availability, repeated questions regarding resolved or documented issues may not receive responses.
---
# Usage Guide
## Download the Project
Clone the project repository:
```bash
$ git clone https://github.com/Elegycloud/clash-for-linux-backup.git
```
Navigate to the project directory and edit the `.env` file to modify the `CLASH_URL` variable.
```bash
$ cd clash-for-linux
$ vim .env
```
> **Note:** The `CLASH_SECRET` variable in the `.env` file is used for the custom Clash secret. If left empty, a random string will be automatically generated by the script.
---
## Start the Program
Run the `start.sh` script:
- Navigate to the project directory:
```bash
$ cd clash-for-linux
```
- Run the startup script:
```bash
$ sudo bash start.sh
Checking subscription URL...
Clash subscription URL is accessible! [ OK ]
Downloading Clash configuration file...
Config file `config.yaml` downloaded successfully! [ OK ]
Starting Clash service...
Service started successfully! [ OK ]
Clash Dashboard URL: http://<ip>:9090/ui
Secret: xxxxxxxxxxxxxxx
Execute the following command to load environment variables: source /etc/profile.d/clash.sh
Enable the system proxy using: proxy_on
To temporarily disable the system proxy, use: proxy_off
```
```bash
$ source /etc/profile.d/clash.sh
$ proxy_on
```
- Check service ports:
```bash
$ netstat -tln | grep -E '9090|789.'
tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN
tcp6 0 0 :::7890 :::* LISTEN
tcp6 0 0 :::7891 :::* LISTEN
tcp6 0 0 :::7892 :::* LISTEN
```
- Check environment variables:
```bash
$ env | grep -E 'http_proxy|https_proxy'
http_proxy=http://127.0.0.1:7890
https_proxy=http://127.0.0.1:7890
```
If the above steps are successful, the Clash program is running, and you can now experience faster downloads for GitHub resources.
---
## Restart the Program
To modify Clash configurations, edit the `conf/config.yaml` file. Then restart the program using the `restart.sh` script.
> **Note:**
> The `restart.sh` script does not update subscription information.
---
## Stop the Program
- Navigate to the project directory:
```bash
$ cd clash-for-linux
```
- Stop the service:
```bash
$ sudo bash shutdown.sh
```
Stop the system proxy:
```bash
$ proxy_off
```
Verify that the program's ports, processes, and environment variables (`http_proxy|https_proxy`) are no longer active. If none are active, the service has successfully stopped.
---
## Clash Dashboard
- Access the Clash Dashboard:
Use a browser to visit the URL provided in the `start.sh` output, e.g., `http://192.168.0.1:9090/ui`.
- Log in to the management interface:
Enter `http://<ip>:9090` in the `API Base URL` field and the secret provided in the `start.sh` output in the `Secret (optional)` field.
Click "Add" and select the newly added management interface to configure Clash via the browser.
- Additional Tutorials:
This Clash Dashboard uses the [YACD](https://github.com/haishanh/yacd) project. For more detailed usage instructions, refer to the YACD repository.
---
## Terminal-Based Proxy Node Selection
For users unable to use the browser-based Clash Dashboard to select proxy nodes or modify proxy modes, a simple script is provided to configure these settings via the Linux terminal.
The script is located at: `scripts/clash_proxy-selector.sh`
> **Note:**
> Before using the script, ensure that the `Secret` variable in the script matches the secret provided during the `start.sh` execution or the `CLASH_SECRET` value defined in the `.env` file.
---
# FAQs
1. **Issue with `/bin/sh` being replaced by `dash` on some Linux systems:**
If errors occur while running scripts (e.g., `-en [ OK ]`), use `bash xxx.sh` to run the scripts.
2. **Proxy nodes not appearing in the UI:**
This may occur if the Clash configuration file provided by your subscription is base64-encoded or does not conform to Clash standards. The project includes automatic recognition and conversion of such configurations. If the issue persists, consider converting the subscription URL using self-hosted or third-party tools (not recommended due to potential privacy risks).
3. **Error `unsupported rule type RULE-SET` in logs:**
Refer to the official [Clash FAQ](https://github.com/Dreamacro/clash/wiki/FAQ#error-unsupported-rule-type-rule-set) for resolution.