diff --git a/.github/workflows/login.yml b/.github/workflows/login.yml index 438938b..1c438c8 100644 --- a/.github/workflows/login.yml +++ b/.github/workflows/login.yml @@ -40,4 +40,4 @@ jobs: - name: Login into Serv00/CT8 run: | set -e - xvfb-run --server-args="-screen 0 1366x768x32" node main.js \ No newline at end of file + xvfb-run --server-args="-screen 0 1366x768x32" node src/main.js \ No newline at end of file diff --git a/index.html b/docs/index.html similarity index 100% rename from index.html rename to docs/index.html diff --git a/serv00-alist/README.md b/serv00-alist/README.md deleted file mode 100644 index 04bae97..0000000 --- a/serv00-alist/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Serv00 - 免费主机脚本集合(大水库) -## 当前脚本 - -| 脚本名称 | 用途 |备注 | -| :------------: | :------------: | :------------: | -|Auto_connect_SSH.py|自动SSH登录以续期|| -|alist_freebsd_update.py|自动从uubulb/alist-freebsd拉取最新版本更新|| - -# 自动续期脚本说明 - -## 说明 -  本项目基于[LINUX DO](https://linux.do)论坛佬友`maohai`的[脚本](https://linux.do/t/topic/66483/15)进行修改,在其基础上增加了`发送通知`、以及`运行日志`功能。 - -## 发送说明 - -| 主机状态/设置条件 | 说明 |发送内容 |执行动作 | -| :------------: | :------------: | :------------: | :------------: | -| 200 | 正常 |不发送|无| -| 502| 机子凉了 |服务不可用|通过SSH执行PM2命令| -| [Errno 1] Address family for hostname not supported| 解析凉了 |解析失败|无| -| 自定义日期 | 固定日启动连接 |每月固定SSH连接提醒|连接SSH| - -## 使用方法 - -  将脚本放到`domains`目录下,使用`chmod +x Auto_connect_SSH.py`给`Auto_connect_SSH.py`添加可执行权限。 - -  在Serv00控制台的定时任务里面新建一个定时任务,`命令`如下: - -```shell -/home/你的用户名/domains/Auto_connect_SSH.py -``` - -#### 参考设置图 - -![参考图片](https://cdn.linux.do/uploads/default/optimized/3X/f/6/f6516994395858a19637f5acf5baeecec96ea3fa_2_690x445.png) - -# Alist自动更新脚本说明 - -  将脚本放到`domains`目录下你的 `Alist` 存储路径中,使用`chmod +x alist_freebsd_update.py`给`alist_freebsd_update.py`添加可执行权限。 -  然后自己到控制台创建一个定时任务。 - -#### 运行效果图 - - ![没有Alist文件](https://cdn.linux.do/uploads/default/original/3X/1/f/1f5b378d086d1935cfaf3927c9fc6c33d531eeb7.jpeg) - ![已经是最新版](https://cdn.linux.do/uploads/default/original/3X/e/7/e72105ffe5f1ee572cca2ded4138472241553bdb.jpeg) - ![正常更新](https://cdn.linux.do/uploads/default/original/3X/f/5/f58f94d755825005eae30df9dce0ad1f0b661f43.jpeg) - -## 参考来源 - -| 名称 |来源|地址| -| :------------: | :------------: | :------------: | -|Saika|Github|https://github.com/k0baya| -|Eric Lee|Github|https://github.com/giturass| -|maohai|LINUX DO|https://linux.do/t/topic/66483/15| \ No newline at end of file diff --git a/serv00-alist/alist_freebsd_update.py b/serv00-alist/alist_freebsd_update.py deleted file mode 100644 index 0a67992..0000000 --- a/serv00-alist/alist_freebsd_update.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python3 -''' -说明:脚本文件请放置于Alist FreeBSD程序目录下,并命名为alist_freebsd_auto_update.py,在终端内使用chmod +x alist_freebsd_auto_update.py赋予执行权限,然后执行./alist_freebsd_auto_update.py -测试方法:在Alist FreeBSD程序目录下执行命令 python3 alist_freebsd_auto_update.py或./alist_freebsd_auto_update.py -''' -import requests -import datetime -import subprocess -import os -import re - -# GitHub API URL 用于获取最新版本 -API_URL = "https://api.github.com/repos/uubulb/alist-freebsd/releases/latest" - -# 从 API 获取最新版本的数据 -try: - response = requests.get(API_URL) - response.raise_for_status() # 如果请求返回了一个错误状态码,将抛出异常 -except requests.exceptions.RequestException as e: - print(f"从 GitHub 获取最新版本信息出错: {e}") - exit(1) -release_data = response.json() - -# 检查 alist 文件是否存在 -if not os.path.exists('alist'): - print("Alist FreeBSD 程序未找到,正在准备下载...") -else: - # 执行 ./alist version 命令并获取输出 - try: - version_output = subprocess.check_output(['./alist', 'version'], text=True).strip() - except subprocess.CalledProcessError as e: - print("警告:执行查询Alist版本号命令出错:", e) - exit(1) - - # 解析获取到的版本号 - version_pattern = r"Version: v(\d+\.\d+\.\d+)-\d+-g[a-fA-F0-9]+" - match = re.search(version_pattern, version_output) - if match: - get_version = match.group(1) - current_version = f"v{get_version}" - print(f"当前 Alist 版本: {current_version}") - else: - print("未能从输出中找到正确的版本号。") - exit(1) - - # 从获取到的json数据中找到版本号 - alist_freebsd_version = release_data.get('name', None) - if not alist_freebsd_version: - print("没有找到 Alist FreeBSD 版本号。") - exit(1) - print(f"最新 Alist 版本: {alist_freebsd_version}") # 打印最新版本号(测试用) - - # 比较版本号 - if current_version == alist_freebsd_version: # 如果前面没做v字符,则需要使用alist_freebsd_version.lstrip('v')移除获取到的GitHub上版本号的'v' - print(f"当前 Alist FreeBSD 已经是最新版本,不需要更新!\n=============================================\n【Alist FreeBSD 信息如下】\n\n{version_output}\n=============================================\n") - exit(0) - else: - print(f"发现新版本 {alist_freebsd_version},当前版本为 {current_version},正在执行更新...\n") - - current_datetime = datetime.datetime.now().strftime('%Y%m%d%H%M%S') # 获取当前日期和时间并格式化为 YYYYMMDDHHMMSS - new_name = f"{current_datetime}_{current_version}_alist_bak" # 重命名现有文件,格式为 YYYYMMDDHHMMSS_alist_bak - if os.path.exists(new_name): - print(f"文件 '{new_name}' 已存在,尝试生成一个新的文件名...") # 如果重命名后的文件名已存在,再次循环直到找到一个不存在的文件名 - new_name = datetime.datetime.now().strftime('%Y%m%d%H%M%S') + f"_{current_version}_alist_bak" - os.rename('alist', new_name) - print(f"温馨提醒:'alist' 文件已存在,以防万一已重命名为 '{new_name}'。\n") - -# 查找名为 'alist' 的文件的下载链接 -for asset in release_data['assets']: - if 'alist' in asset['name'].lower(): - DOWNLOAD_URL = asset['browser_download_url'] - #DOWNLOAD_URL = DOWNLOAD_URL.replace("https://github.com", "https://download.nuaa.cf") # 本地测试加速用,Serv00可能会文件下载不全 - break -else: - print("在发布中未找到名为 'alist' 的文件。") - exit(1) - -# 开始下载文件 -print(f"正在从 {DOWNLOAD_URL} 下载最新 FreeBSD 版 Alist!\n下载中,请稍后...\n") -response = requests.get(DOWNLOAD_URL, stream=True) -with open('alist', 'wb') as f: - for chunk in response.iter_content(chunk_size=32768): # 从 HTTP 响应中读取数据块(chunks)的大小,8192(8KB)、32768(32KB)、65536(64KB),自己换! - f.write(chunk) - -# 赋予 alist 文件可执行权限 -os.chmod('alist', 0o755) - -# 检查是否存在 config.json 文件 -if os.path.exists('./data/config.json'): - new_version_output = subprocess.check_output(['./alist', 'version'], text=True).strip() - print(f"---------------------------------------------\n温馨提示:Alist-FreeBSD 最新版本已经下载完成!\n---------------------------------------------\n【Alist FreeBSD 最新信息如下】\n{new_version_output}\n---------------------------------------------\n") - # 启动 alist 服务 - try: - print("启动 Alist 服务...") - result = subprocess.run(['./alist', 'server'], text=True, capture_output=True) - stdout = result.stdout.strip() - stderr = result.stderr.strip() - print(result.stderr) # 打印启动服务的输出 - except subprocess.CalledProcessError as e: - exit(1) - # 使用 pm2 restart alist - try: - print("使用 pm2 重启 Alist 服务...") - subprocess.run(['pm2', 'restart', 'alist'], check=True, text=True) - except subprocess.CalledProcessError as e: - exit(1) - print("Alist 服务已成功启动并重启。") -else: - subprocess.Popen(['./alist', 'server'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) # 启动 alist 服务 - print("已下载最新版本的 Alist-FreeBSD ,并生成 config.json 文件。") - print("配置文件 config.json 已成功生成,路径:./data/config.json ,请自行修改端口!") - print("使用命令 cd 命令进入 data 路径下") - print("再使用文本编辑器编辑 config.json 文件,修改 port 字段为你放行的端口!") - print("例如,使用 vim: vim config.json") - print("修改完成后,使用命令 cd .. 回到上级目录") \ No newline at end of file diff --git a/serv00-login/.github/workflows/login.yml b/serv00-login/.github/workflows/login.yml deleted file mode 100644 index 8cb398b..0000000 --- a/serv00-login/.github/workflows/login.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Serv00/CT8 Login Tasks - -on: - workflow_dispatch: - schedule: - - cron: "14 13 */10 * *" # 每月1号开始,每10天运行一次,运行时间为13:14 - # push: - # paths-ignore: - # - "LICENSE" - # - "README.md" - # - "README_**" - # - "README-**" - # branches: - # - main - -env: - ACCOUNTS_JSON: ${{ secrets.ACCOUNTS_JSON }} - TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} - TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} - -jobs: - login: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Create accounts.json - run: echo "$ACCOUNTS_JSON" > accounts.json - - - name: Install Python, pipenv and Pipfile packages - uses: palewire/install-python-pipenv-pipfile@v4 - with: - python-version: '3.8' - - - name: Login into Serv00/CT8 - run: | - pipenv run python main.py \ No newline at end of file diff --git a/serv00-login/Pipfile b/serv00-login/Pipfile deleted file mode 100644 index cae850d..0000000 --- a/serv00-login/Pipfile +++ /dev/null @@ -1,14 +0,0 @@ -[[source]] -url = "https://mirrors.aliyun.com/pypi/simple" -verify_ssl = true -name = "pip_conf_index_global" - -[packages] -pyppeteer = "*" -aiofiles = "*" -requests = "*" - -[dev-packages] - -[requires] -python_version = "3.12" diff --git a/serv00-login/Pipfile.lock b/serv00-login/Pipfile.lock deleted file mode 100644 index 1ff091b..0000000 --- a/serv00-login/Pipfile.lock +++ /dev/null @@ -1,321 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "5254330b2be13cc5f22e8c479548c5ecbf51b1bc5f11d275590dcf9c3b38f154" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.12" - }, - "sources": [ - { - "name": "pip_conf_index_global", - "url": "https://mirrors.aliyun.com/pypi/simple", - "verify_ssl": true - } - ] - }, - "default": { - "aiofiles": { - "hashes": [ - "sha256:22a075c9e5a3810f0c2e48f3008c94d68c65d763b9b03857924c99e57355166c", - "sha256:b4ec55f4195e3eb5d7abd1bf7e061763e864dd4954231fb8539a0ef8bb8260e5" - ], - "index": "pip_conf_index_global", - "markers": "python_version >= '3.8'", - "version": "==24.1.0" - }, - "appdirs": { - "hashes": [ - "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41", - "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128" - ], - "version": "==1.4.4" - }, - "certifi": { - "hashes": [ - "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8", - "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9" - ], - "markers": "python_version >= '3.6'", - "version": "==2024.8.30" - }, - "charset-normalizer": { - "hashes": [ - "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621", - "sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6", - "sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8", - "sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912", - "sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c", - "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b", - "sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d", - "sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d", - "sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95", - "sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e", - "sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565", - "sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64", - "sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab", - "sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be", - "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e", - "sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907", - "sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0", - "sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2", - "sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62", - "sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62", - "sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23", - "sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc", - "sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284", - "sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca", - "sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455", - "sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858", - "sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b", - "sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594", - "sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc", - "sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db", - "sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b", - "sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea", - "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6", - "sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920", - "sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749", - "sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7", - "sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd", - "sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99", - "sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242", - "sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee", - "sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129", - "sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2", - "sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51", - "sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee", - "sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8", - "sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b", - "sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613", - "sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742", - "sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe", - "sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3", - "sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5", - "sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631", - "sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7", - "sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15", - "sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c", - "sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea", - "sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417", - "sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250", - "sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88", - "sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca", - "sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa", - "sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99", - "sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149", - "sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41", - "sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574", - "sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0", - "sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f", - "sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d", - "sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654", - "sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3", - "sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19", - "sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90", - "sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578", - "sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9", - "sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1", - "sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51", - "sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719", - "sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236", - "sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a", - "sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c", - "sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade", - "sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944", - "sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc", - "sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6", - "sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6", - "sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27", - "sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6", - "sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2", - "sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12", - "sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf", - "sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114", - "sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7", - "sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf", - "sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d", - "sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b", - "sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed", - "sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03", - "sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4", - "sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67", - "sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365", - "sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a", - "sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748", - "sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b", - "sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079", - "sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482" - ], - "markers": "python_full_version >= '3.7.0'", - "version": "==3.4.0" - }, - "colorama": { - "hashes": [ - "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", - "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", - "sha256:96e0137fb3ab6b56576b4638116d77c59f3e0565f4ea081172e4721c722afa92", - "sha256:bc3a1efa0b297242dcd0757e2e83d358bcd18bda77735e493aa89a634e74c9bf" - ], - "markers": "platform_system == 'Windows'", - "version": "==0.4.6" - }, - "idna": { - "hashes": [ - "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", - "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3" - ], - "markers": "python_version >= '3.6'", - "version": "==3.10" - }, - "importlib-metadata": { - "hashes": [ - "sha256:45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b", - "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7" - ], - "markers": "python_version >= '3.8'", - "version": "==8.5.0" - }, - "pyee": { - "hashes": [ - "sha256:82e1eb1853f8497c4ff1a0c7fa26b9cd2f1253e2b6ffb93b4700fda907017302", - "sha256:9e4cdd7c2f9fcf247db94bad39a260aceffefdbe52286ce71be01959de34a5c2" - ], - "markers": "python_version >= '3.8'", - "version": "==11.1.1" - }, - "pyppeteer": { - "hashes": [ - "sha256:29b326af9c3faf6535488723ce7633b5dcb62ccf5adf83a918dd57bc71b36947", - "sha256:306b052d9649b5cabbaaa2db3814472ee5882935bc6c258b156c6e25a2951445", - "sha256:38d1f9220f73bc07377989df164f09df75b7580e995255decfa9bf256227dd32", - "sha256:4af63473ff36a746a53347b2336a49efda669bcd781e400bc1799b81838358d9", - "sha256:661c1d3c8ad0eb1f2e03e71c57b856ad04d0ef4f40c609413a6aebdbf72642b9", - "sha256:6ff054e205598d47afe17c55e9dd4623f20bc36ac419ec9361e0977f3652695c", - "sha256:96f4c574fb36f1d15e02746303ab742b98941f0da58337187e7c1d2ef982adea", - "sha256:b176b4b2dafa52740e426ce2aaac87b7e3f3ddf6bd1201888225319f2d2e6222" - ], - "index": "pip_conf_index_global", - "markers": "python_version >= '3.8' and python_version < '4.0'", - "version": "==2.0.0" - }, - "requests": { - "hashes": [ - "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", - "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6" - ], - "index": "pip_conf_index_global", - "markers": "python_version >= '3.8'", - "version": "==2.32.3" - }, - "tqdm": { - "hashes": [ - "sha256:223e8b5359c2efc4b30555531f09e9f2f3589bcd7fdd389271191031b49b7a63", - "sha256:4bdd694238bef1485ce839d67967ab50af8f9272aab687c0d7702a01da0be090" - ], - "markers": "python_version >= '3.7'", - "version": "==4.66.6" - }, - "typing-extensions": { - "hashes": [ - "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", - "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8" - ], - "markers": "python_version >= '3.8'", - "version": "==4.12.2" - }, - "urllib3": { - "hashes": [ - "sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e", - "sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "version": "==1.26.20" - }, - "websockets": { - "hashes": [ - "sha256:00213676a2e46b6ebf6045bc11d0f529d9120baa6f58d122b4021ad92adabd41", - "sha256:00c870522cdb69cd625b93f002961ffb0c095394f06ba8c48f17eef7c1541f96", - "sha256:0154f7691e4fe6c2b2bc275b5701e8b158dae92a1ab229e2b940efe11905dff4", - "sha256:05a7233089f8bd355e8cbe127c2e8ca0b4ea55467861906b80d2ebc7db4d6b72", - "sha256:09a1814bb15eff7069e51fed0826df0bc0702652b5cb8f87697d469d79c23576", - "sha256:0cff816f51fb33c26d6e2b16b5c7d48eaa31dae5488ace6aae468b361f422b63", - "sha256:185929b4808b36a79c65b7865783b87b6841e852ef5407a2fb0c03381092fa3b", - "sha256:2fc8709c00704194213d45e455adc106ff9e87658297f72d544220e32029cd3d", - "sha256:33d69ca7612f0ddff3316b0c7b33ca180d464ecac2d115805c044bf0a3b0d032", - "sha256:389f8dbb5c489e305fb113ca1b6bdcdaa130923f77485db5b189de343a179393", - "sha256:38ea7b82bfcae927eeffc55d2ffa31665dc7fec7b8dc654506b8e5a518eb4d50", - "sha256:3d3cac3e32b2c8414f4f87c1b2ab686fa6284a980ba283617404377cd448f631", - "sha256:40e826de3085721dabc7cf9bfd41682dadc02286d8cf149b3ad05bff89311e4f", - "sha256:4239b6027e3d66a89446908ff3027d2737afc1a375f8fd3eea630a4842ec9a0c", - "sha256:45ec8e75b7dbc9539cbfafa570742fe4f676eb8b0d3694b67dabe2f2ceed8aa6", - "sha256:47a2964021f2110116cc1125b3e6d87ab5ad16dea161949e7244ec583b905bb4", - "sha256:48c08473563323f9c9debac781ecf66f94ad5a3680a38fe84dee5388cf5acaf6", - "sha256:4c6d2264f485f0b53adf22697ac11e261ce84805c232ed5dbe6b1bcb84b00ff0", - "sha256:4f72e5cd0f18f262f5da20efa9e241699e0cf3a766317a17392550c9ad7b37d8", - "sha256:56029457f219ade1f2fc12a6504ea61e14ee227a815531f9738e41203a429112", - "sha256:5c1289596042fad2cdceb05e1ebf7aadf9995c928e0da2b7a4e99494953b1b94", - "sha256:62e627f6b6d4aed919a2052efc408da7a545c606268d5ab5bfab4432734b82b4", - "sha256:74de2b894b47f1d21cbd0b37a5e2b2392ad95d17ae983e64727e18eb281fe7cb", - "sha256:7c584f366f46ba667cfa66020344886cf47088e79c9b9d39c84ce9ea98aaa331", - "sha256:7d27a7e34c313b3a7f91adcd05134315002aaf8540d7b4f90336beafaea6217c", - "sha256:7d3f0b61c45c3fa9a349cf484962c559a8a1d80dae6977276df8fd1fa5e3cb8c", - "sha256:82ff5e1cae4e855147fd57a2863376ed7454134c2bf49ec604dfe71e446e2193", - "sha256:84bc2a7d075f32f6ed98652db3a680a17a4edb21ca7f80fe42e38753a58ee02b", - "sha256:884be66c76a444c59f801ac13f40c76f176f1bfa815ef5b8ed44321e74f1600b", - "sha256:8a5cc00546e0a701da4639aa0bbcb0ae2bb678c87f46da01ac2d789e1f2d2038", - "sha256:8dc96f64ae43dde92530775e9cb169979f414dcf5cff670455d81a6823b42089", - "sha256:8f38706e0b15d3c20ef6259fd4bc1700cd133b06c3c1bb108ffe3f8947be15fa", - "sha256:90fcf8929836d4a0e964d799a58823547df5a5e9afa83081761630553be731f9", - "sha256:931c039af54fc195fe6ad536fde4b0de04da9d5916e78e55405436348cfb0e56", - "sha256:932af322458da7e4e35df32f050389e13d3d96b09d274b22a7aa1808f292fee4", - "sha256:942de28af58f352a6f588bc72490ae0f4ccd6dfc2bd3de5945b882a078e4e179", - "sha256:9bc42e8402dc5e9905fb8b9649f57efcb2056693b7e88faa8fb029256ba9c68c", - "sha256:a7a240d7a74bf8d5cb3bfe6be7f21697a28ec4b1a437607bae08ac7acf5b4882", - "sha256:a9f9a735deaf9a0cadc2d8c50d1a5bcdbae8b6e539c6e08237bc4082d7c13f28", - "sha256:ae5e95cfb53ab1da62185e23b3130e11d64431179debac6dc3c6acf08760e9b1", - "sha256:b029fb2032ae4724d8ae8d4f6b363f2cc39e4c7b12454df8df7f0f563ed3e61a", - "sha256:b0d15c968ea7a65211e084f523151dbf8ae44634de03c801b8bd070b74e85033", - "sha256:b343f521b047493dc4022dd338fc6db9d9282658862756b4f6fd0e996c1380e1", - "sha256:b627c266f295de9dea86bd1112ed3d5fafb69a348af30a2422e16590a8ecba13", - "sha256:b9968694c5f467bf67ef97ae7ad4d56d14be2751000c1207d31bf3bb8860bae8", - "sha256:ba089c499e1f4155d2a3c2a05d2878a3428cf321c848f2b5a45ce55f0d7d310c", - "sha256:bbccd847aa0c3a69b5f691a84d2341a4f8a629c6922558f2a70611305f902d74", - "sha256:bc0b82d728fe21a0d03e65f81980abbbcb13b5387f733a1a870672c5be26edab", - "sha256:c57e4c1349fbe0e446c9fa7b19ed2f8a4417233b6984277cce392819123142d3", - "sha256:c94ae4faf2d09f7c81847c63843f84fe47bf6253c9d60b20f25edfd30fb12588", - "sha256:c9b27d6c1c6cd53dc93614967e9ce00ae7f864a2d9f99fe5ed86706e1ecbf485", - "sha256:d210abe51b5da0ffdbf7b43eed0cfdff8a55a1ab17abbec4301c9ff077dd0342", - "sha256:d58804e996d7d2307173d56c297cf7bc132c52df27a3efaac5e8d43e36c21c48", - "sha256:d6a4162139374a49eb18ef5b2f4da1dd95c994588f5033d64e0bbfda4b6b6fcf", - "sha256:da39dd03d130162deb63da51f6e66ed73032ae62e74aaccc4236e30edccddbb0", - "sha256:db3c336f9eda2532ec0fd8ea49fef7a8df8f6c804cdf4f39e5c5c0d4a4ad9a7a", - "sha256:dd500e0a5e11969cdd3320935ca2ff1e936f2358f9c2e61f100a1660933320ea", - "sha256:dd9becd5fe29773d140d68d607d66a38f60e31b86df75332703757ee645b6faf", - "sha256:e0cb5cc6ece6ffa75baccfd5c02cffe776f3f5c8bf486811f9d3ea3453676ce8", - "sha256:e23173580d740bf8822fd0379e4bf30aa1d5a92a4f252d34e893070c081050df", - "sha256:e3a686ecb4aa0d64ae60c9c9f1a7d5d46cab9bfb5d91a2d303d00e2cd4c4c5cc", - "sha256:e789376b52c295c4946403bd0efecf27ab98f05319df4583d3c48e43c7342c2f", - "sha256:edc344de4dac1d89300a053ac973299e82d3db56330f3494905643bb68801269", - "sha256:eef610b23933c54d5d921c92578ae5f89813438fded840c2e9809d378dc765d3", - "sha256:f2c38d588887a609191d30e902df2a32711f708abfd85d318ca9b367258cfd0c", - "sha256:f55b5905705725af31ccef50e55391621532cd64fbf0bc6f4bac935f0fccec46", - "sha256:f5fc088b7a32f244c519a048c170f14cf2251b849ef0e20cbbb0fdf0fdaf556f", - "sha256:fe10ddc59b304cb19a1bdf5bd0a7719cbbc9fbdd57ac80ed436b709fcf889106", - "sha256:ff64a1d38d156d429404aaa84b27305e957fd10c30e5880d1765c9480bea490f" - ], - "markers": "python_version >= '3.7'", - "version": "==10.4" - }, - "zipp": { - "hashes": [ - "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350", - "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29" - ], - "markers": "python_version >= '3.8'", - "version": "==3.20.2" - } - }, - "develop": {} -} diff --git a/serv00-login/README.md b/serv00-login/README.md deleted file mode 100644 index aae5b9b..0000000 --- a/serv00-login/README.md +++ /dev/null @@ -1,88 +0,0 @@ -## serv00与ct8自动化批量保号,每3天自动登录一次面板,并且发送消息到Telegram - -## 视频教程看这里 -[免费白嫖10年VPS服务器serv00 并且一键部署自己的专属自建Vless节点 |小白教程|自动化批量保号](https://youtu.be/QnlzpvDl_mo) - -利用github Action以及python脚本实现 - -🙏🙏🙏点个Star!!Star!!Star!! - -交流群:https://t.me/yxjsjl - -### 将代码fork到你的仓库并运行的操作步骤 - -#### 1. Fork 仓库 - -1. **访问原始仓库页面**: - - 打开你想要 fork 的 GitHub 仓库页面。 - -2. **Fork 仓库**: - - 点击页面右上角的 "Fork" 按钮,将仓库 fork 到你的 GitHub 账户下。 - -#### 2. 设置 GitHub Secrets - -1. **创建 Telegram Bot** - - 在 Telegram 中找到 `@BotFather`,创建一个新 Bot,并获取 API Token。 - - 获取到你的 Chat ID 方法一,在[一休技术交流群](https://t.me/yxjsjl)里发送`/id@KinhRoBot`获取,返回用户信息中的`ID`就是Chat ID - - 获取到你的 Chat ID 方法二,可以通过向 Bot 发送一条消息,然后访问 `https://api.telegram.org/bot/getUpdates` 找到 Chat ID。 - -2. **配置 GitHub Secrets** - - 转到你 fork 的仓库页面。 - - 点击 `Settings`,然后在左侧菜单中选择 `Secrets`。 - - 添加以下 Secrets: - - `ACCOUNTS_JSON`: 包含账号信息的 JSON 数据。例如: - - - ```json - [ - {"username": "serv00的账号", "password": "serv00的密码", "panel": "panel6.serv00.com"}, - {"username": "ct8的账号", "password": "ct8的密码", "panel": "panel.ct8.pl"}, - {"username": "user2", "password": "password2", "panel": "panel6.serv00.com"} - ] - ``` - - `TELEGRAM_BOT_TOKEN`: 你的 Telegram Bot 的 API Token。 - - `TELEGRAM_CHAT_ID`: 你的 Telegram Chat ID。 - - - **获取方法**: - - 在 Telegram 中创建 Bot,并获取 API Token 和 Chat ID。 - - 在 GitHub 仓库的 Secrets 页面添加这些值,确保它们安全且不被泄露。 - -#### 3. 启动 GitHub Actions - -1. **配置 GitHub Actions** - - 在你的 fork 仓库中,进入 `Actions` 页面。 - - 如果 Actions 没有自动启用,点击 `Enable GitHub Actions` 按钮以激活它。 - -2. **运行工作流** - - GitHub Actions 将会根据你设置的定时任务(例如每三天一次)自动运行脚本。 - - 如果需要手动触发,可以在 Actions 页面手动运行工作流。 - -#### 示例 Secrets 和获取方法总结 - -- **TELEGRAM_BOT_TOKEN** - - 示例值: `1234567890:ABCDEFghijklmnopQRSTuvwxyZ` - - 获取方法: 在 Telegram 中使用 `@BotFather` 创建 Bot 并获取 API Token。 - -- **TELEGRAM_CHAT_ID** - - 示例值: `1234567890` - - 获取方法: 发送一条消息给你的 Bot,然后访问 `https://api.telegram.org/bot/getUpdates` 获取 Chat ID。 - -- **ACCOUNTS_JSON** - - 示例值: - ```json - [ - {"username": "serv00的账号", "password": "serv00的密码", "panel": "panel6.serv00.com"}, - {"username": "ct8的账号", "password": "ct8的密码", "panel": "panel.ct8.pl"}, - {"username": "user2", "password": "password2", "panel": "panel6.serv00.com"} - ] - ``` - - 获取方法: 创建一个包含serv00账号信息的 JSON 文件,并将其内容添加到 GitHub 仓库的 Secrets 中。 - -### 注意事项 - -- **保密性**: Secrets 是敏感信息,请确保不要将它们泄露到公共代码库或未授权的人员。 -- **更新和删除**: 如果需要更新或删除 Secrets,可以通过仓库的 Secrets 页面进行管理。 - -通过以上步骤,你就可以成功将代码 fork 到你的仓库下并运行它了。如果需要进一步的帮助或有其他问题,请随时告知! - -## 🌟🌟🌟Star!!!走起 -[![Stargazers over time](https://starchart.cc/yixiu001/serv00-login.svg?variant=adaptive)](https://starchart.cc/yixiu001/serv00-login) diff --git a/serv00-login/main.py b/serv00-login/main.py deleted file mode 100644 index 6371ab8..0000000 --- a/serv00-login/main.py +++ /dev/null @@ -1,133 +0,0 @@ -import json -import asyncio -from pyppeteer import launch -from datetime import datetime, timedelta -import aiofiles -import random -import requests -import os - -# 从环境变量中获取 Telegram Bot Token 和 Chat ID -TELEGRAM_BOT_TOKEN = os.getenv('TELEGRAM_BOT_TOKEN') -TELEGRAM_CHAT_ID = os.getenv('TELEGRAM_CHAT_ID') - -def format_to_iso(date): - return date.strftime('%Y-%m-%d %H:%M:%S') - -async def delay_time(ms): - await asyncio.sleep(ms / 1000) - -# 全局浏览器实例 -browser = None - -# telegram消息 -message = 'serv00&ct8自动化脚本运行\n' - -async def login(username, password, panel): - global browser - - page = None # 确保 page 在任何情况下都被定义 - serviceName = 'ct8' if 'ct8' in panel else 'serv00' - try: - if not browser: - browser = await launch(headless=True, args=['--no-sandbox', '--disable-setuid-sandbox']) - - page = await browser.newPage() - url = f'https://{panel}/login/?next=/' - await page.goto(url) - - username_input = await page.querySelector('#id_username') - if username_input: - await page.evaluate('''(input) => input.value = ""''', username_input) - - await page.type('#id_username', username) - await page.type('#id_password', password) - - login_button = await page.querySelector('#submit') - if login_button: - await login_button.click() - else: - raise Exception('无法找到登录按钮') - - await page.waitForNavigation() - - is_logged_in = await page.evaluate('''() => { - const logoutButton = document.querySelector('a[href="/logout/"]'); - return logoutButton !== null; - }''') - - return is_logged_in - - except Exception as e: - print(f'{serviceName}账号 {username} 登录时出现错误: {e}') - return False - - finally: - if page: - await page.close() - -async def main(): - global message - message = 'serv00&ct8自动化脚本运行\n' - - try: - async with aiofiles.open('accounts.json', mode='r', encoding='utf-8') as f: - accounts_json = await f.read() - accounts = json.loads(accounts_json) - except Exception as e: - print(f'读取 accounts.json 文件时出错: {e}') - return - - for account in accounts: - username = account['username'] - password = account['password'] - panel = account['panel'] - - serviceName = 'ct8' if 'ct8' in panel else 'serv00' - is_logged_in = await login(username, password, panel) - - if is_logged_in: - now_utc = format_to_iso(datetime.utcnow()) - now_beijing = format_to_iso(datetime.utcnow() + timedelta(hours=8)) - success_message = f'{serviceName}账号 {username} 于北京时间 {now_beijing}(UTC时间 {now_utc})登录成功!' - message += success_message + '\n' - print(success_message) - else: - message += f'{serviceName}账号 {username} 登录失败,请检查{serviceName}账号和密码是否正确。\n' - print(f'{serviceName}账号 {username} 登录失败,请检查{serviceName}账号和密码是否正确。') - - delay = random.randint(1000, 8000) - await delay_time(delay) - - message += f'所有{serviceName}账号登录完成!' - await send_telegram_message(message) - print(f'所有{serviceName}账号登录完成!') - -async def send_telegram_message(message): - url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage" - payload = { - 'chat_id': TELEGRAM_CHAT_ID, - 'text': message, - 'reply_markup': { - 'inline_keyboard': [ - [ - { - 'text': '问题反馈❓', - 'url': 'https://t.me/lopinv' - } - ] - ] - } - } - headers = { - 'Content-Type': 'application/json' - } - try: - response = requests.post(url, json=payload, headers=headers) - if response.status_code != 200: - print(f"发送消息到Telegram失败: {response.text}") - except Exception as e: - print(f"发送消息到Telegram时出错: {e}") - -if __name__ == '__main__': - asyncio.run(main()) diff --git a/serv00-ssh/README.md b/serv00-ssh/README.md deleted file mode 100644 index e34ff1e..0000000 --- a/serv00-ssh/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# Serv00 - 免费主机脚本集合(大水库) -## 当前脚本 - -| 脚本名称 | 用途 |备注 | -| :------------: | :------------: | :------------: | -|Auto_connect_SSH.py|自动SSH登录以续期|| -|alist_freebsd_update.py|自动从uubulb/alist-freebsd拉取最新版本更新|| - -# 自动续期脚本说明 - -## 说明 -  本项目基于[LINUX DO](https://linux.do)论坛佬友`maohai`的[脚本](https://linux.do/t/topic/66483/15)进行修改,在其基础上增加了`发送通知`、以及`运行日志`功能。 - -## 发送说明 - -| 主机状态/设置条件 | 说明 |发送内容 |执行动作 | -| :------------: | :------------: | :------------: | :------------: | -| 200 | 正常 |不发送|无| -| 502| 机子凉了 |服务不可用|通过SSH执行PM2命令| -| [Errno 1] Address family for hostname not supported| 解析凉了 |解析失败|无| -| 自定义日期 | 固定日启动连接 |每月固定SSH连接提醒|连接SSH| - -## 使用方法 - -  将脚本放到`domains`目录下,使用`chmod +x Auto_connect_SSH.py`给`Auto_connect_SSH.py`添加可执行权限。 - -  在Serv00控制台的定时任务里面新建一个定时任务,`命令`如下: - -```shell -/home/你的用户名/domains/Auto_connect_SSH.py -``` - -#### 参考设置图 - -![参考图片](https://cdn.linux.do/uploads/default/optimized/3X/f/6/f6516994395858a19637f5acf5baeecec96ea3fa_2_690x445.png) - -# Alist自动更新脚本说明 - -  将脚本放到`domains`目录下你的 `Alist` 存储路径中,使用`chmod +x alist_freebsd_update.py`给`alist_freebsd_update.py`添加可执行权限。 -  然后自己到控制台创建一个定时任务。 - -#### 运行效果图 - - ![没有Alist文件](https://cdn.linux.do/uploads/default/original/3X/1/f/1f5b378d086d1935cfaf3927c9fc6c33d531eeb7.jpeg) - ![已经是最新版](https://cdn.linux.do/uploads/default/original/3X/e/7/e72105ffe5f1ee572cca2ded4138472241553bdb.jpeg) - ![正常更新](https://cdn.linux.do/uploads/default/original/3X/f/5/f58f94d755825005eae30df9dce0ad1f0b661f43.jpeg) - -## 参考来源 - -| 名称 |来源|地址| -| :------------: | :------------: | :------------: | -|Saika|Github|https://github.com/k0baya| -|Eric Lee|Github|https://github.com/giturass| -|maohai|LINUX DO|https://linux.do/t/topic/66483/15| - -## SSH登录不上 - -> 登录不上是因为Ban IP, 点击此处解锁: [Ban](https://www.serv00.com/ip_unban/) - -> 还是登录不上的话: 请使用下方 `FinalShell`,并勾上 `智能海外加速`,登录失败在弹出框选择`取消`,在弹出框填入`[邮件中的SSH密码]` - -## FinalShell - -FinalShell是一体化的的服务器,网络管理软件,不仅是ssh客户端,还是功能强大的开发,运维工具,充分满足开发,运维需求. - -### 特色功能: - -云端同步,免费海外服务器远程桌面加速,ssh加速,本地化命令输入框,支持自动补全,命令历史,自定义命令参数 - -- Windows X64版,下载地址: - -- macOS Arm版,支持m1,m2,m3 cpu,下载地址: - -- macOS X64版,支持旧款intel cpu,下载地址: - -- Linux X64版,下载地址: - -- Linux Arm64版,下载地址: - -- Linux LoongArch64龙芯版,下载地址: \ No newline at end of file diff --git a/serv00-ssh/main.py b/serv00-ssh/main.py deleted file mode 100644 index 1a36583..0000000 --- a/serv00-ssh/main.py +++ /dev/null @@ -1,195 +0,0 @@ -#!/usr/bin/env python3 -import os -import requests -import paramiko -import socket -from datetime import datetime -import pytz - -# 预先定义的常量 -url = '你检测的地址,参考下一行注释' -# 测试URL 这个URL是个凉了的 url = 'https://edwgiz.serv00.net/' -ssh_info = { - 'host': 's3.serv00.com', # 主机地址 - 'port': 22, - 'username': '你的用户名', # 你的用户名,别写错了 - 'password': '你的SSH密码' # 你注册的时候收到的密码或者你自己改了的密码 -} - -WECHAT_ROBOT_KEY = '你的企业微信机器人的Key部分' # 需要替换成你的企业微信机器人的Webhook Key,参考 https://open.work.weixin.qq.com/help2/pc/14931 -webhook_url = f'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={WECHAT_ROBOT_KEY}' # 企业微信机器人的Webhook地址 - -# 获取当前脚本文件的绝对路径 -script_dir = os.path.dirname(os.path.abspath(__file__)) - -# 日志文件将保存在脚本所在的目录中 -log_file_path = os.path.join(script_dir, 'Auto_connect_SSH.log') -wechat_message_sent = False # 标记是否已经发送了成功的企业微信提醒消息 -flush_log_message = [] # 用于存储日志信息的全局变量 -# 写入日志的函数 -def write_log(log_message): - global flush_log_message - if not os.path.exists(log_file_path): - open(log_file_path, 'a').close() # 创建日志文件 - os.chmod(log_file_path, 0o644) # 设置#日志文件有可编辑权限(644权限) - log_info = f"{log_message}" - flush_log_message.append(log_info) - -# 把所有的日志信息写入日志文件 -def flush_log(): - global flush_log_message - # 获取当前系统时间、北京时间、星期以及 SSH 用户名,然后将所有信息合并为一行写到日志里面 - username = ssh_info['username'] - system_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') - beijing_time = datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S') - current_day = datetime.now(pytz.timezone('Asia/Shanghai')).weekday() - weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"] - current_weekday_name = weekdays[current_day] - flush_log_messages = f"{system_time} - {beijing_time} - {current_weekday_name} - {url} - {username} - {' - '.join(flush_log_message)}" - # 写入日志文件,并添加换行符 - with open(log_file_path, "a", encoding="utf-8") as log_file: - log_file.write(flush_log_messages + '\n') - # 清空累积的日志信息列表 - flush_log_message.clear() # 清空累积的消息,避免下一次会有重复消息 - -# 发送企业微信消息的函数 -def send_wechat_message(message): - global wechat_message_sent # 声明为全局变量 - headers = {'Content-Type': 'application/json'} - try: - response_wechat = requests.post(webhook_url, json=message, headers=headers) - response_wechat.raise_for_status() - wechat_status = "企业微信提醒消息发送成功" - print("温馨提醒:企业微信提醒消息发送成功。") - except requests.RequestException as e: - wechat_status = f"企业微信提醒消息发送失败,错误码: {e}" - print(f"警告:企业微信提醒消息发送失败!\n错误码: {e}") - finally: - # 测试的时候发现如果碰到又是规定的定期执行时间还有碰巧主机凉了会写两遍日志,改为只有在消息尚未发送的情况下才记录日志 - if not wechat_message_sent: - write_log(f"{wechat_status}") - wechat_message_sent = True # 消息发送后,将标记设置为 True - -# 尝试通过SSH恢复PM2进程的函数 -def restore_pm2_processes(): - transport = paramiko.Transport((ssh_info['host'], ssh_info['port'])) - try: - transport.connect(username=ssh_info['username'], password=ssh_info['password']) - # 创建SSH通道 - ssh = paramiko.SSHClient() - ssh._transport = transport - try: # 执行pm2 resurrect命令 - stdin, stdout, stderr = ssh.exec_command('/home/你的用户名/.npm-global/bin/pm2 resurrect') - print("STDOUT: ", stdout.read().decode()) - print("STDERR: ", stderr.read().decode()) - stdout.channel.recv_exit_status() # 等待命令执行完成 - if stdout.channel.exit_status == 0: - write_log("通过SSH执行PM2命令成功") - print("温馨提醒:PM2进程恢复成功。") - else: - write_log(f"通过SSH执行PM2命令时出错,错误信息:{stderr.read().decode()}") - print("警告:PM2进程恢复失败!\n错误信息:", stderr.read().decode()) - except Exception as e: - write_log(f"通过SSH执行PM2命令时出错: {e}") - print(f"通过SSH执行命令时出错: {e}") - finally: - ssh.close() # 关闭SSHClient - transport.close() # 关闭Transport连接 - -# 尝试通过SSH连接的函数 -def ssh_connect(): - try: - transport = paramiko.Transport((ssh_info['host'], ssh_info['port'])) - transport.connect(username=ssh_info['username'], password=ssh_info['password']) - ssh_status = "SSH连接成功" - print("SSH连接成功。") - except Exception as e: - ssh_status = f"SSH连接失败,错误信息: {e}" - print(f"SSH连接失败: {e}") - finally: - transport.close() - write_log(f"{ssh_status}") - -# 检查是否为每月的1号 -def is_first_day_of_month(): - now = datetime.now(pytz.timezone('Asia/Shanghai')) # 机子时间是UTC时间,为了便于识别这里需要使用东八区北京时间 - print("本来应该是系统时间,但是我要改成北京时间增强辨识度:",now) - current_day = now.day # 获取当前的天数 - return current_day == 1 or current_day == 15 # 设置每个月的哪一天或哪几天为每月固定SSH日期(如果只想每个月第一天就只需要保留return current_day == 1即可) - -# 返回当前的天、月和一年中的第几天 -def get_day_info(): - now = datetime.now(pytz.timezone('Asia/Shanghai')) # 使用东八区北京时间 - print("北京时间:",now) - current_day = now.day - current_month = now.month - current_year_day = now.timetuple().tm_yday # 今年中的第几天 - current_weekday = now.weekday() # 返回一个 0-6 的整数,0 是星期一,6 是星期日 - weekdays = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"] - current_weekday_name = weekdays[current_weekday] - return current_day, current_month, current_year_day, current_weekday_name - -# 每个月发送仅包含URL和时间的提醒消息 -def send_monthly_reminder(): - current_day, current_month, current_year_day, current_weekday_name = get_day_info() - system_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') - beijing_time = datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S') - message = { - "msgtype": "text", - "text": { - "content": f" [鼓掌]每月固定SSH提醒[鼓掌] \n-------------------------------------\n检测地址:\n{url}\n-------------------------------------\n  今天是{current_month}月{current_day}日( {current_weekday_name} ),本月的第 {current_day} 天,今年的第 {current_year_day} 天,例行SSH连接已经成功执行,以防万一空了可以到后台查看记录!\n-------------------------------------\n系统时间: {system_time}\n北京时间: {beijing_time}" - } - } - return message - -# 每月一次检查提醒 -if is_first_day_of_month(): - message = send_monthly_reminder() - send_wechat_message(message) - ssh_connect() - -# 检查URL状态和DNS的函数 -def check_url_status_and_dns(): - try: - # 尝试解析URL的域名 - host = socket.gethostbyname(url.split('/')[2]) - print(f"解析成功,IP地址为: {host}") - write_log(f"{host}") - except socket.gaierror as e: - # 解析失败,发送通知 - write_log(f"Error: {e}") - system_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') - beijing_time = datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S') - message = { - "msgtype": "text", - "text": { - "content": f"----- [炸弹]解析失败提醒[炸弹] -----\n地址: {url}\n错误: {e}\n[恐惧]抓紧尝试检查解析配置或联系管事的老铁。\n-------------------------------------\n系统时间: {system_time}\n北京时间: {beijing_time}" - } - } - send_wechat_message(message) - return - - # 尝试获取URL的状态码 - response = requests.get(url, timeout=10) - if response.status_code != 200: - # URL状态码不是200,发送通知并尝试恢复PM2进程 - system_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') - beijing_time = datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S') - message = { - "msgtype": "text", - "text": { - "content": f"----- [裂开]当前服务不可用[裂开] -----\n地址: {url}\n状态码: {response.status_code}\n[加油]正在尝试通过SSH恢复PM2进程,请稍后手动检查恢复情况!\n-------------------------------------\n系统时间: {system_time}\n北京时间: {beijing_time}" - } - } - write_log(f"主机状态码: {response.status_code}") - send_wechat_message(message) - restore_pm2_processes() - else: - write_log(f"主机状态码: {response.status_code}") - print(f"主机状态码: {response.status_code}") - -if __name__ == '__main__': - # 检查URL状态和DNS - check_url_status_and_dns() - # 所有日志信息已经收集完成,写入日志文件 - flush_log() diff --git a/serv00-vless/LICENSE b/serv00-vless/LICENSE deleted file mode 100644 index 0ad25db..0000000 --- a/serv00-vless/LICENSE +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/serv00-vless/README.md b/serv00-vless/README.md deleted file mode 100644 index ed179fb..0000000 --- a/serv00-vless/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# serv00-vless - -在 Serv00 免费托管网站上部署 vless 节点 - -## 部署教程 - -待更新 - -## 免责声明 - -* 本程序仅供学习了解, 非盈利目的,请于下载后 24 小时内删除, 不得用作任何商业用途, 文字、数据及图片均有所属版权, 如转载须注明来源。 -* 使用本程序必循遵守部署免责声明。使用本程序必循遵守部署服务器所在地、所在国家和用户所在国家的法律法规, 程序作者不对使用者任何不当行为负责. \ No newline at end of file diff --git a/serv00-vless/index.js b/serv00-vless/index.js deleted file mode 100644 index 84d982d..0000000 --- a/serv00-vless/index.js +++ /dev/null @@ -1,58 +0,0 @@ -const net=require('net'); -const {WebSocket,createWebSocketStream}=require('ws'); -const { TextDecoder } = require('util'); -const logcb= (...args)=>console.log.bind(this,...args); -const errcb= (...args)=>console.error.bind(this,...args); -const { spawn } = require('child_process'); -const uuid= (process.env.UUID||'b91f0e06-d350-4f3f-8902-13b183bdbd99').replace(/-/g, ""); -const port= process.env.PORT||14138; -const shellFilePath = './start.sh'; -const childProcess = spawn('sh', [shellFilePath]); -const wss=new WebSocket.Server({port},logcb('listen:', port)); -const path = require('path'); - -// 获取当前执行脚本的目录路径 -const currentDirectoryPath = __dirname; - -// 使用 path.basename 获取目录的名称 -const directoryName = path.basename(currentDirectoryPath); - - -const address = directoryName; -const no_tls = `vless://${uuid}@${address}:${port}?security=none&type=ws&path=/&host=${address}&encryption=none`; -const tls_str = `vless://${uuid}@${address}:443?encryption=none&security=tls&sni=${address}&type=ws&host=${address}`; -console.log(no_tls,'\n',tls_str) -wss.on('connection', ws=>{ - console.log("connected successfully") - ws.once('message', msg=>{ - const [VERSION]=msg; - const id=msg.slice(1, 17); - if(!id.every((v,i)=>v==parseInt(uuid.substr(i*2,2),16))) return; - let i = msg.slice(17, 18).readUInt8()+19; - const port = msg.slice(i, i+=2).readUInt16BE(0); - const ATYP = msg.slice(i, i+=1).readUInt8(); - const host= ATYP==1? msg.slice(i,i+=4).join('.')://IPV4 - (ATYP==2? new TextDecoder().decode(msg.slice(i+1, i+=1+msg.slice(i,i+1).readUInt8()))://domain - (ATYP==3? msg.slice(i,i+=16).reduce((s,b,i,a)=>(i%2?s.concat(a.slice(i-1,i+1)):s), []).map(b=>b.readUInt16BE(0).toString(16)).join(':'):''));//ipv6 - - logcb('conn:', host,port); - ws.send(new Uint8Array([VERSION, 0])); - const duplex=createWebSocketStream(ws); - net.connect({host,port}, function(){ - this.write(msg.slice(i)); - duplex.on('error',errcb('E1:')).pipe(this).on('error',errcb('E2:')).pipe(duplex); - }).on('error',errcb('Conn-Err:',{host,port})); - }).on('error',errcb('EE:')); -}); - -childProcess.stdout.on('data', (data) => { - console.log(`stdout: ${data}`); -}); - -childProcess.stderr.on('data', (data) => { - console.error(`stderr: ${data}`); -}); - -childProcess.on('close', (code) => { - console.log(`Child process exit, exit code:${code}`); -}); diff --git a/serv00-vless/package.json b/serv00-vless/package.json deleted file mode 100644 index 8dc425f..0000000 --- a/serv00-vless/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "okka-express", - "version": "1.0.0", - "description": "okka Hello World", - "main": "index.js", - "author": "okka", - "license": "MIT", - "private": false, - "scripts": { - "start": "node index.js", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "dependencies": { - "ws": "^8.14.2", - "express": "^4.18.2", - "http-proxy": "latest" - }, - "engines": { - "node": ">=14" - } -} \ No newline at end of file diff --git a/serv00-vless/start.sh b/serv00-vless/start.sh deleted file mode 100644 index 57b5575..0000000 --- a/serv00-vless/start.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/bash -export NEZHA_SERVER="abc.xyz:5555" -export NEZHA_KEY="abcdwfghijklmnopqrstuvwxyz" - -chmod +x swith start.sh -nohup ./swith -s ${NEZHA_SERVER} -p ${NEZHA_KEY} > /dev/null 2>&1 & #需要tls在 > 前面加上 --tls即可 - -tail -f /dev/null \ No newline at end of file diff --git a/main.js b/src/main.js similarity index 98% rename from main.js rename to src/main.js index 2ea078a..42c22ad 100644 --- a/main.js +++ b/src/main.js @@ -36,7 +36,7 @@ async function sendTelegramMessage(token, chatId, message) { } (async () => { - const accountsJson = fs.readFileSync('accounts.json', 'utf-8'); + const accountsJson = fs.readFileSync('../accounts.json', 'utf-8'); const accounts = JSON.parse(accountsJson); const telegramToken = process.env.TELEGRAM_BOT_TOKEN; const telegramChatId = process.env.TELEGRAM_CHAT_ID;