mirror of
https://github.com/Nezumi-2711/cloudflare-gateway-pihole-scripts.git
synced 2026-09-22 13:38:37 +00:00
add npm scripts
This commit is contained in:
@@ -33,20 +33,18 @@ jobs:
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Download recommended whitelist
|
||||
run: bash ./get_recommended_whitelist.sh
|
||||
- name: Download allowlists
|
||||
run: npm run download:allowlist
|
||||
env:
|
||||
ALLOWLIST_URLS: ${{ vars.ALLOWLIST_URLS }}
|
||||
|
||||
- name: Download recommended filters
|
||||
run: bash ./get_recommended_filters.sh
|
||||
- name: Download blocklists
|
||||
run: npm run download:blocklist
|
||||
env:
|
||||
BLOCKLIST_URLS: ${{ vars.BLOCKLIST_URLS }}
|
||||
|
||||
- name: Delete old rules and lists
|
||||
run: |
|
||||
node cf_gateway_rule_delete.js
|
||||
node cf_list_delete.js
|
||||
run: npm run cloudflare-delete
|
||||
env:
|
||||
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
|
||||
CLOUDFLARE_ACCOUNT_EMAIL: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }}
|
||||
@@ -55,9 +53,7 @@ jobs:
|
||||
FAST_MODE: ${{ vars.FAST_MODE }}
|
||||
|
||||
- name: Create new rules and lists
|
||||
run: |
|
||||
node cf_list_create.js
|
||||
node cf_gateway_rule_create.js
|
||||
run: npm run cloudflare-create
|
||||
env:
|
||||
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
|
||||
CLOUDFLARE_ACCOUNT_EMAIL: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }}
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
{
|
||||
"scripts": {
|
||||
"start": "npm run download && npm run cloudflare-delete && npm run cloudflare-create",
|
||||
"dry": "npm run download && DRY_RUN=1 npm run cloudflare-create:list",
|
||||
"download": "node download_lists.js",
|
||||
"download:allowlist": "node download_lists.js allowlist",
|
||||
"download:blocklist": "node download_lists.js blocklist",
|
||||
"cloudflare-create": "npm run create:list && npm run create:rule",
|
||||
"cloudflare-delete": "npm run delete:rule && npm run delete:list",
|
||||
"cloudflare-create:rule": "node cf_gateway_rule_create.js",
|
||||
"cloudflare-create:list": "node cf_list_create.js",
|
||||
"cloudflare-delete:rule": "node cf_gateway_rule_delete.js",
|
||||
"cloudflare-delete:list": "node cf_list_delete.js"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"dotenv": "^16.0.3",
|
||||
|
||||
Reference in New Issue
Block a user