Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: denylist needs to move to other package #150

Merged
merged 1 commit into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/cron-denylist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- main
paths:
- 'packages/edge-gateway/denylist.json'
- 'packages/denylist/denylist.json'

jobs:
update:
Expand All @@ -30,8 +30,8 @@ jobs:
- name: Run job
env:
CF_API_TOKEN: ${{ secrets.CF_GATEWAY_TOKEN }}
run: node packages/edge-gateway/scripts/cli.js denylist sync --env ${{ matrix.env }}
run: node packages/denylist/scripts/cli.js denylist sync --env ${{ matrix.env }}

- name: Heartbeat
if: ${{ success() }}
run: node packages/edge-gateway/scripts/cli.js heartbeat --token ${{ secrets.OPSGENIE_KEY }} --name cron-edge-gateway-denylist
run: node packages/denylist/scripts/cli.js heartbeat --token ${{ secrets.OPSGENIE_KEY }} --name cron-edge-gateway-denylist
1 change: 1 addition & 0 deletions packages/denylist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"npm-run-all": "^4.1.5",
"sade": "^1.7.4",
"standard": "^17.0.0",
"toml": "^3.0.0",
"typescript": "4.7.3"
},
"peerDependencies": {
Expand Down
12 changes: 12 additions & 0 deletions packages/denylist/scripts/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sade from 'sade'

import { buildCmd } from './build.js'
import { denylistSyncCmd, denylistAddCmd } from './denylist.js'

const env = process.env.ENV || 'dev'
const prog = sade('denylist')
Expand All @@ -12,5 +13,16 @@ prog
.describe('Build the worker.')
.option('--env', 'Environment', env)
.action(buildCmd)
.command('denylist sync')
.describe('Sync the gateway deny list with various sources.')
.option('--env', 'Wrangler environment to use.', env)
.action(denylistSyncCmd)
.command('denylist add <cid>')
.describe(
'Add a CID (or CID + path) to the local deny list. Note: we currently DO NOT support denying by CID + path in the API.'
)
.option('--status', 'HTTP status to send in response.')
.option('--reason', 'Reason for deny. Note: may be communicated in response')
.action(denylistAddCmd)

prog.parse(process.argv)
12 changes: 0 additions & 12 deletions packages/edge-gateway/scripts/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import sade from 'sade'

import { buildCmd } from './build.js'
import { ipfsCmd } from './ipfs.js'
import { denylistSyncCmd, denylistAddCmd } from './denylist.js'
import { heartbeatCmd } from './heartbeat.js'

const env = process.env.ENV || 'dev'
Expand All @@ -24,16 +23,5 @@ prog
.option('--token', 'Opsgenie Token')
.option('--name', 'Heartbeat Name')
.action(heartbeatCmd)
.command('denylist sync')
.describe('Sync the gateway deny list with various sources.')
.option('--env', 'Wrangler environment to use.', env)
.action(denylistSyncCmd)
.command('denylist add <cid>')
.describe(
'Add a CID (or CID + path) to the local deny list. Note: we currently DO NOT support denying by CID + path in the API.'
)
.option('--status', 'HTTP status to send in response.')
.option('--reason', 'Reason for deny. Note: may be communicated in response')
.action(denylistAddCmd)

prog.parse(process.argv)
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.