Skip to content

Commit

Permalink
fix: denylist needs to move to other package
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Mar 13, 2023
1 parent 7fcda01 commit a79ac16
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
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
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)
File renamed without changes.
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)

0 comments on commit a79ac16

Please sign in to comment.