From 64fce153441c0590b06aa1fce419fe7c18fc561c Mon Sep 17 00:00:00 2001 From: nanchua <66629001+nanchu1396@users.noreply.github.com> Date: Thu, 16 Jun 2022 15:50:10 +0800 Subject: [PATCH 1/9] Add files via upload --- .github/workflows/main.yml | 82 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..e0818da41 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,82 @@ +name: Run it on actions + + + + +on: + + push: + + branches: + + - master + + schedule: + + - cron: 00 01 * * * + +jobs: + + run-it: + + runs-on: ubuntu-20.04 + + name: Run it on action + + steps: + + - name: Checkout master + + uses: actions/checkout@v2 + + - name: Setup PHP + + uses: shivammathur/setup-php@v2 + + with: + + php-version: '7.3' + + - name: Setting + + run: | + + echo 'Renew freenom domain name automatically.' + + echo '@Author of yml configuration file: RouRouX & mybsdc ' + + echo '@Url: https://github.com/luolongfei/freenom' + + cp .env.example .env + + if [[ ('${{ secrets.FREENOM_USERNAME }}' == '' || '${{ secrets.FREENOM_PASSWORD }}' == '') && '${{ secrets.MULTIPLE_ACCOUNTS }}' == '' ]]; then echo '你在 Github 的当前项目的 Settings > Secrets 画面没有设置任何与账户信息相关的 secret 值,无法正常运行,请添加新的 secret 值,设置 FREENOM_USERNAME 与 FREENOM_PASSWORD,或者设置 MULTIPLE_ACCOUNTS,以及 .env 文件中其它必要项,各项的具体含义与格式参考本项目 .env 文件中的说明。'; fi + + if [ '${{ secrets.FREENOM_USERNAME }}' != '' ]; then sed -i "s/^FREENOM_USERNAME=.*$/FREENOM_USERNAME='${{ secrets.FREENOM_USERNAME }}'/" .env; fi + + if [ '${{ secrets.FREENOM_PASSWORD }}' != '' ]; then sed -i "s/^FREENOM_PASSWORD=.*$/FREENOM_PASSWORD='${{ secrets.FREENOM_PASSWORD }}'/" .env; fi + + if [ '${{ secrets.MULTIPLE_ACCOUNTS }}' != '' ]; then sed -i "s/^MULTIPLE_ACCOUNTS=.*$/MULTIPLE_ACCOUNTS='${{ secrets.MULTIPLE_ACCOUNTS }}'/" .env; fi + + if [ '${{ secrets.MAIL_USERNAME }}' != '' ]; then sed -i "s/^MAIL_USERNAME=.*$/MAIL_USERNAME='${{ secrets.MAIL_USERNAME }}'/" .env; fi + + if [ '${{ secrets.MAIL_PASSWORD }}' != '' ]; then sed -i "s/^MAIL_PASSWORD=.*$/MAIL_PASSWORD='${{ secrets.MAIL_PASSWORD }}'/" .env; fi + + if [ '${{ secrets.TO }}' != '' ]; then sed -i "s/^TO=.*$/TO='${{ secrets.TO }}'/" .env; fi + + if [ '${{ secrets.MAIL_ENABLE }}' != '' ]; then sed -i "s/^MAIL_ENABLE=.*$/MAIL_ENABLE='${{ secrets.MAIL_ENABLE }}'/" .env; fi + + if [ '${{ secrets.TELEGRAM_CHAT_ID }}' != '' ]; then sed -i "s/^TELEGRAM_CHAT_ID=.*$/TELEGRAM_CHAT_ID='${{ secrets.TELEGRAM_CHAT_ID }}'/" .env; fi + + if [ '${{ secrets.TELEGRAM_BOT_TOKEN }}' != '' ]; then sed -i "s/^TELEGRAM_BOT_TOKEN=.*$/TELEGRAM_BOT_TOKEN='${{ secrets.TELEGRAM_BOT_TOKEN }}'/" .env; fi + + if [ '${{ secrets.TELEGRAM_BOT_ENABLE }}' != '' ]; then sed -i "s/^TELEGRAM_BOT_ENABLE=.*$/TELEGRAM_BOT_ENABLE='${{ secrets.TELEGRAM_BOT_ENABLE }}'/" .env; fi + + if [ '${{ secrets.NOTICE_FREQ }}' != '' ]; then sed -i "s/^NOTICE_FREQ=.*$/NOTICE_FREQ='${{ secrets.NOTICE_FREQ }}'/" .env; fi + + sed -i "s/^ON_GITHUB_ACTIONS=.*$/ON_GITHUB_ACTIONS=true/" .env + + - name: Run + + run: | + + php run From bf8c6e0a9ff89166bc6a29d6aa408ec4992ec000 Mon Sep 17 00:00:00 2001 From: nanchua <66629001+nanchu1396@users.noreply.github.com> Date: Thu, 16 Jun 2022 15:56:46 +0800 Subject: [PATCH 2/9] Create freenom.yml --- .github/workflows/freenom.yml | 82 +++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/freenom.yml diff --git a/.github/workflows/freenom.yml b/.github/workflows/freenom.yml new file mode 100644 index 000000000..e0818da41 --- /dev/null +++ b/.github/workflows/freenom.yml @@ -0,0 +1,82 @@ +name: Run it on actions + + + + +on: + + push: + + branches: + + - master + + schedule: + + - cron: 00 01 * * * + +jobs: + + run-it: + + runs-on: ubuntu-20.04 + + name: Run it on action + + steps: + + - name: Checkout master + + uses: actions/checkout@v2 + + - name: Setup PHP + + uses: shivammathur/setup-php@v2 + + with: + + php-version: '7.3' + + - name: Setting + + run: | + + echo 'Renew freenom domain name automatically.' + + echo '@Author of yml configuration file: RouRouX & mybsdc ' + + echo '@Url: https://github.com/luolongfei/freenom' + + cp .env.example .env + + if [[ ('${{ secrets.FREENOM_USERNAME }}' == '' || '${{ secrets.FREENOM_PASSWORD }}' == '') && '${{ secrets.MULTIPLE_ACCOUNTS }}' == '' ]]; then echo '你在 Github 的当前项目的 Settings > Secrets 画面没有设置任何与账户信息相关的 secret 值,无法正常运行,请添加新的 secret 值,设置 FREENOM_USERNAME 与 FREENOM_PASSWORD,或者设置 MULTIPLE_ACCOUNTS,以及 .env 文件中其它必要项,各项的具体含义与格式参考本项目 .env 文件中的说明。'; fi + + if [ '${{ secrets.FREENOM_USERNAME }}' != '' ]; then sed -i "s/^FREENOM_USERNAME=.*$/FREENOM_USERNAME='${{ secrets.FREENOM_USERNAME }}'/" .env; fi + + if [ '${{ secrets.FREENOM_PASSWORD }}' != '' ]; then sed -i "s/^FREENOM_PASSWORD=.*$/FREENOM_PASSWORD='${{ secrets.FREENOM_PASSWORD }}'/" .env; fi + + if [ '${{ secrets.MULTIPLE_ACCOUNTS }}' != '' ]; then sed -i "s/^MULTIPLE_ACCOUNTS=.*$/MULTIPLE_ACCOUNTS='${{ secrets.MULTIPLE_ACCOUNTS }}'/" .env; fi + + if [ '${{ secrets.MAIL_USERNAME }}' != '' ]; then sed -i "s/^MAIL_USERNAME=.*$/MAIL_USERNAME='${{ secrets.MAIL_USERNAME }}'/" .env; fi + + if [ '${{ secrets.MAIL_PASSWORD }}' != '' ]; then sed -i "s/^MAIL_PASSWORD=.*$/MAIL_PASSWORD='${{ secrets.MAIL_PASSWORD }}'/" .env; fi + + if [ '${{ secrets.TO }}' != '' ]; then sed -i "s/^TO=.*$/TO='${{ secrets.TO }}'/" .env; fi + + if [ '${{ secrets.MAIL_ENABLE }}' != '' ]; then sed -i "s/^MAIL_ENABLE=.*$/MAIL_ENABLE='${{ secrets.MAIL_ENABLE }}'/" .env; fi + + if [ '${{ secrets.TELEGRAM_CHAT_ID }}' != '' ]; then sed -i "s/^TELEGRAM_CHAT_ID=.*$/TELEGRAM_CHAT_ID='${{ secrets.TELEGRAM_CHAT_ID }}'/" .env; fi + + if [ '${{ secrets.TELEGRAM_BOT_TOKEN }}' != '' ]; then sed -i "s/^TELEGRAM_BOT_TOKEN=.*$/TELEGRAM_BOT_TOKEN='${{ secrets.TELEGRAM_BOT_TOKEN }}'/" .env; fi + + if [ '${{ secrets.TELEGRAM_BOT_ENABLE }}' != '' ]; then sed -i "s/^TELEGRAM_BOT_ENABLE=.*$/TELEGRAM_BOT_ENABLE='${{ secrets.TELEGRAM_BOT_ENABLE }}'/" .env; fi + + if [ '${{ secrets.NOTICE_FREQ }}' != '' ]; then sed -i "s/^NOTICE_FREQ=.*$/NOTICE_FREQ='${{ secrets.NOTICE_FREQ }}'/" .env; fi + + sed -i "s/^ON_GITHUB_ACTIONS=.*$/ON_GITHUB_ACTIONS=true/" .env + + - name: Run + + run: | + + php run From 4fdfc0fe14c61b52901f645edcf8bf5b9f0d1c87 Mon Sep 17 00:00:00 2001 From: nanchua <66629001+nanchu1396@users.noreply.github.com> Date: Thu, 16 Jun 2022 15:56:55 +0800 Subject: [PATCH 3/9] Delete main.yml --- .github/workflows/main.yml | 82 -------------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index e0818da41..000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Run it on actions - - - - -on: - - push: - - branches: - - - master - - schedule: - - - cron: 00 01 * * * - -jobs: - - run-it: - - runs-on: ubuntu-20.04 - - name: Run it on action - - steps: - - - name: Checkout master - - uses: actions/checkout@v2 - - - name: Setup PHP - - uses: shivammathur/setup-php@v2 - - with: - - php-version: '7.3' - - - name: Setting - - run: | - - echo 'Renew freenom domain name automatically.' - - echo '@Author of yml configuration file: RouRouX & mybsdc ' - - echo '@Url: https://github.com/luolongfei/freenom' - - cp .env.example .env - - if [[ ('${{ secrets.FREENOM_USERNAME }}' == '' || '${{ secrets.FREENOM_PASSWORD }}' == '') && '${{ secrets.MULTIPLE_ACCOUNTS }}' == '' ]]; then echo '你在 Github 的当前项目的 Settings > Secrets 画面没有设置任何与账户信息相关的 secret 值,无法正常运行,请添加新的 secret 值,设置 FREENOM_USERNAME 与 FREENOM_PASSWORD,或者设置 MULTIPLE_ACCOUNTS,以及 .env 文件中其它必要项,各项的具体含义与格式参考本项目 .env 文件中的说明。'; fi - - if [ '${{ secrets.FREENOM_USERNAME }}' != '' ]; then sed -i "s/^FREENOM_USERNAME=.*$/FREENOM_USERNAME='${{ secrets.FREENOM_USERNAME }}'/" .env; fi - - if [ '${{ secrets.FREENOM_PASSWORD }}' != '' ]; then sed -i "s/^FREENOM_PASSWORD=.*$/FREENOM_PASSWORD='${{ secrets.FREENOM_PASSWORD }}'/" .env; fi - - if [ '${{ secrets.MULTIPLE_ACCOUNTS }}' != '' ]; then sed -i "s/^MULTIPLE_ACCOUNTS=.*$/MULTIPLE_ACCOUNTS='${{ secrets.MULTIPLE_ACCOUNTS }}'/" .env; fi - - if [ '${{ secrets.MAIL_USERNAME }}' != '' ]; then sed -i "s/^MAIL_USERNAME=.*$/MAIL_USERNAME='${{ secrets.MAIL_USERNAME }}'/" .env; fi - - if [ '${{ secrets.MAIL_PASSWORD }}' != '' ]; then sed -i "s/^MAIL_PASSWORD=.*$/MAIL_PASSWORD='${{ secrets.MAIL_PASSWORD }}'/" .env; fi - - if [ '${{ secrets.TO }}' != '' ]; then sed -i "s/^TO=.*$/TO='${{ secrets.TO }}'/" .env; fi - - if [ '${{ secrets.MAIL_ENABLE }}' != '' ]; then sed -i "s/^MAIL_ENABLE=.*$/MAIL_ENABLE='${{ secrets.MAIL_ENABLE }}'/" .env; fi - - if [ '${{ secrets.TELEGRAM_CHAT_ID }}' != '' ]; then sed -i "s/^TELEGRAM_CHAT_ID=.*$/TELEGRAM_CHAT_ID='${{ secrets.TELEGRAM_CHAT_ID }}'/" .env; fi - - if [ '${{ secrets.TELEGRAM_BOT_TOKEN }}' != '' ]; then sed -i "s/^TELEGRAM_BOT_TOKEN=.*$/TELEGRAM_BOT_TOKEN='${{ secrets.TELEGRAM_BOT_TOKEN }}'/" .env; fi - - if [ '${{ secrets.TELEGRAM_BOT_ENABLE }}' != '' ]; then sed -i "s/^TELEGRAM_BOT_ENABLE=.*$/TELEGRAM_BOT_ENABLE='${{ secrets.TELEGRAM_BOT_ENABLE }}'/" .env; fi - - if [ '${{ secrets.NOTICE_FREQ }}' != '' ]; then sed -i "s/^NOTICE_FREQ=.*$/NOTICE_FREQ='${{ secrets.NOTICE_FREQ }}'/" .env; fi - - sed -i "s/^ON_GITHUB_ACTIONS=.*$/ON_GITHUB_ACTIONS=true/" .env - - - name: Run - - run: | - - php run From 2f8a30c78d1020ff3340c5ad8ddefbeca3a679b6 Mon Sep 17 00:00:00 2001 From: nanchua <66629001+nanchu1396@users.noreply.github.com> Date: Thu, 16 Jun 2022 15:59:14 +0800 Subject: [PATCH 4/9] Update freenom.yml --- .github/workflows/freenom.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/freenom.yml b/.github/workflows/freenom.yml index e0818da41..6ee2f218a 100644 --- a/.github/workflows/freenom.yml +++ b/.github/workflows/freenom.yml @@ -1,18 +1,8 @@ name: Run it on actions - - - on: - - push: - - branches: - - - master - + workflow_dispatch: schedule: - - cron: 00 01 * * * jobs: From 68dfb5dc16202d03b79ed3b10e8ad0ec345ff901 Mon Sep 17 00:00:00 2001 From: nanchua <66629001+nanchu1396@users.noreply.github.com> Date: Fri, 15 Jul 2022 16:27:15 +0800 Subject: [PATCH 5/9] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1143d1dce..b6db4ae51 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@
- +Cancel changes ![freenom logo](https://s1.ax1x.com/2022/03/10/bhzMG9.png) -

Freenom:freenom域名自动续期

+

Freenom:freenom域名自动续期w

[![PHP version](https://img.shields.io/badge/php-%3E=7.3-brightgreen.svg?style=for-the-badge)](https://secure.php.net/) [![Docker pulls](https://img.shields.io/docker/pulls/luolongfei/freenom.svg?style=for-the-badge)](https://hub.docker.com/r/luolongfei/freenom) From 5e117d41dc197061cf69bb1387b3b207b2b1a4d2 Mon Sep 17 00:00:00 2001 From: nanchua <66629001+nanchu1396@users.noreply.github.com> Date: Tue, 19 Jul 2022 14:40:57 +0800 Subject: [PATCH 6/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6db4ae51..82d64baa6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Cancel changes ![freenom logo](https://s1.ax1x.com/2022/03/10/bhzMG9.png) -

Freenom:freenom域名自动续期w

+

Freenom:freenom域名自动续期

[![PHP version](https://img.shields.io/badge/php-%3E=7.3-brightgreen.svg?style=for-the-badge)](https://secure.php.net/) [![Docker pulls](https://img.shields.io/docker/pulls/luolongfei/freenom.svg?style=for-the-badge)](https://hub.docker.com/r/luolongfei/freenom) From 256520a67c274cbf66b2de4695eaa213bff720e3 Mon Sep 17 00:00:00 2001 From: nanchua <66629001+nanchu1396@users.noreply.github.com> Date: Tue, 19 Jul 2022 15:03:13 +0800 Subject: [PATCH 7/9] Update FreeNom.php --- app/Console/FreeNom.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Console/FreeNom.php b/app/Console/FreeNom.php index 5de81d52a..4d24cb964 100644 --- a/app/Console/FreeNom.php +++ b/app/Console/FreeNom.php @@ -24,13 +24,13 @@ class FreeNom extends Base const TIMEOUT = 33; // FreeNom登录地址 - const LOGIN_URL = 'https://my.freenom.com/dologin.php'; + const LOGIN_URL = 'http://my.freenom.com/dologin.php'; // 域名状态地址 - const DOMAIN_STATUS_URL = 'https://my.freenom.com/domains.php?a=renewals'; + const DOMAIN_STATUS_URL = 'http://my.freenom.com/domains.php?a=renewals'; // 域名续期地址 - const RENEW_DOMAIN_URL = 'https://my.freenom.com/domains.php?submitrenewals=true'; + const RENEW_DOMAIN_URL = 'http://my.freenom.com/domains.php?submitrenewals=true'; // 匹配token的正则 const TOKEN_REGEX = '/name="token"\svalue="(?P[^"]+)"/i'; From d1b65538cfe1f141500c4a1174df90366912fe65 Mon Sep 17 00:00:00 2001 From: nanchua <66629001+nanchu1396@users.noreply.github.com> Date: Tue, 19 Jul 2022 15:04:52 +0800 Subject: [PATCH 8/9] Update FreeNom.php --- app/Console/FreeNom.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Console/FreeNom.php b/app/Console/FreeNom.php index 4d24cb964..5de81d52a 100644 --- a/app/Console/FreeNom.php +++ b/app/Console/FreeNom.php @@ -24,13 +24,13 @@ class FreeNom extends Base const TIMEOUT = 33; // FreeNom登录地址 - const LOGIN_URL = 'http://my.freenom.com/dologin.php'; + const LOGIN_URL = 'https://my.freenom.com/dologin.php'; // 域名状态地址 - const DOMAIN_STATUS_URL = 'http://my.freenom.com/domains.php?a=renewals'; + const DOMAIN_STATUS_URL = 'https://my.freenom.com/domains.php?a=renewals'; // 域名续期地址 - const RENEW_DOMAIN_URL = 'http://my.freenom.com/domains.php?submitrenewals=true'; + const RENEW_DOMAIN_URL = 'https://my.freenom.com/domains.php?submitrenewals=true'; // 匹配token的正则 const TOKEN_REGEX = '/name="token"\svalue="(?P[^"]+)"/i'; From b0aead7a1b15896a1cfd34bc63afbf21f98606c3 Mon Sep 17 00:00:00 2001 From: nanchua <66629001+nanchu1396@users.noreply.github.com> Date: Tue, 19 Jul 2022 15:05:33 +0800 Subject: [PATCH 9/9] Update freenom.yml --- .github/workflows/freenom.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/freenom.yml b/.github/workflows/freenom.yml index 6ee2f218a..5d4e0afe1 100644 --- a/.github/workflows/freenom.yml +++ b/.github/workflows/freenom.yml @@ -2,8 +2,8 @@ name: Run it on actions on: workflow_dispatch: - schedule: - - cron: 00 01 * * * +# schedule: +# - cron: 00 01 * * * jobs: