{"id":20240055,"url":"https://github.com/sudoskys/clashrenew","last_synced_at":"2025-07-28T07:05:29.359Z","repository":{"id":45387872,"uuid":"513542196","full_name":"sudoskys/ClashRenew","owner":"sudoskys","description":"Linux clash或clash-meta 配置-config.yaml 自动开机订阅更新服务 (auto update script)，使用前请审计代码，且后果自负","archived":false,"fork":false,"pushed_at":"2022-11-23T02:18:01.000Z","size":76,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-14T08:45:50.568Z","etag":null,"topics":["clash","linux","systemd"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sudoskys.png","metadata":{"files":{"readme":"README.en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-13T13:57:11.000Z","updated_at":"2024-10-23T08:46:23.000Z","dependencies_parsed_at":"2023-01-23T03:00:51.985Z","dependency_job_id":null,"html_url":"https://github.com/sudoskys/ClashRenew","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudoskys%2FClashRenew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudoskys%2FClashRenew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudoskys%2FClashRenew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudoskys%2FClashRenew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudoskys","download_url":"https://codeload.github.com/sudoskys/ClashRenew/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233830212,"owners_count":18736893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clash","linux","systemd"],"created_at":"2024-11-14T08:42:55.716Z","updated_at":"2025-01-14T01:27:07.814Z","avatar_url":"https://github.com/sudoskys.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ClashRenew\n\nLinux clash or crash-meta configuration-config.yaml automatically updates the small script, please audit the code before use.\n\n\nPs: You can also use Clash proxy-provider, but it is better to isolate and update stable separately.\n\nWhen the proxy-provider directly uses the http type to subscribe to the source, if the URL cannot be accessed, Clash cannot be started at this time.\n\n\n\n**Users are responsible for all consequences of using this project.**\n\n\n## Install\n\nAfter cloning the project, please move the files to the ````～/```` (HOME) directory\n\n#### dependencies\n\n```pip install requirements.txt```\n\n\n\u003eBecause of the compatibility problem of the yaml library, the configuration needs to use 5.4.1\n\n\n\n### Configure automatic startup\n\n-------\n\nIt's best not to use ```.zshrc``` or ```.bashrc```, it will cause the problem of executing when the terminal is opened...\n\n**Run as follows to automatically start crash**\n````\nsystemctl --user enable clash.service\nsystemctl --user start clash.service\nsystemctl --user status clash.service\n````\n\n**copy cron.sh**\n````\nsudo cp ~/cron.sh /usr/local/bin\n````\n\nThe misleading tutorial is corrected here, using **login account** instead of full system crash.\n\n````\ncd /usr/lib/systemd/user/\nsudo vim clashrenew.service\n\n\n````\n\n\n**fill in**\n````\n[Unit]\nDescription=clashRenew\nAfter=network-online.target\n\n[Service]\nType=simple\nRestart=on-abort\nExecStart=sh /usr/local/bin/cron.sh\nExecStartPre=/bin/sleep 10\n\n[Install]\nWantedBy=default.target\n\n````\n\n**Start clashrenew program**\n````\nsystemctl --user enable clashrenew.service\nsystemctl --user start clashrenew.service\nsystemctl --user status clashrenew.service\n````\n\nIn this way, the user-defined service can be run.\n\nPS: ExecStartPre=/bin/sleep 20 represents a delay of 20 seconds, you can also modify the crash service to delay the start (if you are a wireless link)\n\nI clash.service for example! (applicable to successful startup but io timeout)\n\n````\n[Unit]\nDescription=A rule based proxy in Go.\nAfter=network-online.target\n\n[Service]\nType=exec\nRestart=on-abort\nExecStart=/usr/bin/clash\nExecStartPre=/bin/sleep 15\n\n[Install]\nWantedBy=default.target\n````\n\n**Note: ```After=network-online.target``` has adaptation problems, please pay attention!**\n\nPs: As for network , see https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/systemd-network-targets-and-services_configuring-and-managing-networking\n\n*Partial reference to this tutorial*\nhttps://blog.linioi.com/posts/clash-on-arch/\n\n\nReload configuration ```systemctl --user daemon-reload```\n\n\n### Program configuration file example\n\nNote the spaces\n\n````\nRenewConfig: True\nRenewNotify: True\n# If you don't want to be notified, please fill False in the above line\nRenewTargetKey: cloud22\ncontent:\n   cloud1:\n       - https://\n   cloud22:\n       - https://\n\n````\n\n```RenewConfig``` refers to whether to replace the running dependent config, ```RenewTargetKey``` refers to the replacement target (must be in the list)\n\n\n\n\nEdit the python script and configure the config file name and data directory as noted.\n\n#### Barrier-free feeding\n\n[![s](https://img.shields.io/badge/Become-sponsor-DB94A2)](https://dun.mianbaoduo.com/@Sky0717)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudoskys%2Fclashrenew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudoskys%2Fclashrenew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudoskys%2Fclashrenew/lists"}