Skip to content

Commit

Permalink
feat: update migrations and envs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-yarmosh committed Apr 19, 2024
1 parent a1a6633 commit 741374c
Show file tree
Hide file tree
Showing 30 changed files with 5 additions and 1,526 deletions.
19 changes: 0 additions & 19 deletions .env.development.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,6 @@ AUTH_GITHUB_IDENTIFIER_KEY=id
# GitHub API
# A classic token (not scoped), required permissions are: read:org, read:user
GITHUB_ACCESS_TOKEN=
# Generated during enabling of webhooks and passed to the app, to validate requests
# Create the webhook at https://github.com/sponsors/jsdelivr/dashboard/webhooks/441768912/edit#deliveries
# See WEBHOOK_FLOW_ID in .env.example for the webhook URL
GITHUB_WEBHOOK_SECRET=

# Globalping API
GLOBALPING_URL=https://api.globalping.io/v1
GP_SYSTEM_KEY=

# Geonames API
GEONAMES_USERNAME=

# App
CREDITS_PER_DOLLAR=2000
CREDITS_PER_ADOPTED_PROBE_DAY=150
ADOPTED_PROBES_CHECK_TIME_MAX_DEVIATION_MINS=5
# To trigger credits assignment probe need to be online >20 hours during the day. Current "Adopted probes status CRON" is "*/10 * * * *", which is 6 times an hour
# So required value is 20 * 6 = 120
ADOPTED_PROBES_REQUIRED_ONLINE_TIMES=120

# Are updated during `npm run init`
AUTH_GITHUB_DEFAULT_ROLE_ID=
Expand Down
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ DB_DATABASE=
DB_USER=
DB_PASSWORD=

# ID that will be used for the flow. Any valid UUID.
# The final URL for the webhook is ${host}/flows/trigger/${WEBHOOK_FLOW_ID}
WEBHOOK_FLOW_ID=e8a4c2b2-3ed4-4ddc-b98e-34c1952c2323
DIRECTUS_URL=

ADMIN_EMAIL=
Expand Down
19 changes: 0 additions & 19 deletions .env.production.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,6 @@ AUTH_GITHUB_IDENTIFIER_KEY=id
# GitHub API
# A classic token (not scoped), required permissions are: read:org, read:user
GITHUB_ACCESS_TOKEN=
# Generated during enabling of webhooks and passed to the app, to validate requests
# Create the webhook at https://github.com/sponsors/jsdelivr/dashboard/webhooks/441768912/edit#deliveries
# See WEBHOOK_FLOW_ID in .env.example for the webhook URL
GITHUB_WEBHOOK_SECRET=

# Globalping API
GLOBALPING_URL=https://api.globalping.io/v1
GP_SYSTEM_KEY=

# Geonames API
GEONAMES_USERNAME=

# App
CREDITS_PER_DOLLAR=2000
CREDITS_PER_ADOPTED_PROBE_DAY=150
ADOPTED_PROBES_CHECK_TIME_MAX_DEVIATION_MINS=5
# To trigger credits assignment probe need to be online >20 hours during the day. Current "Adopted probes status CRON" is "*/10 * * * *", which is 6 times an hour
# So required value is 20 * 6 = 120
ADOPTED_PROBES_REQUIRED_ONLINE_TIMES=120

# Are updated during `npm run init`
AUTH_GITHUB_DEFAULT_ROLE_ID=
Expand Down
8 changes: 4 additions & 4 deletions src/extensions/migrations/20230425A-create-user-role.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function createPermissions (roleId) {
method: 'POST',
body: JSON.stringify([
{
collection: 'tokens',
collection: 'jsd_purge_tokens',
action: 'create',
role: roleId,
permissions: {
Expand All @@ -44,7 +44,7 @@ async function createPermissions (roleId) {
fields: [ 'name', 'value', 'expire', 'origins' ],
},
{
collection: 'tokens',
collection: 'jsd_purge_tokens',
action: 'read',
role: roleId,
permissions: {
Expand All @@ -55,7 +55,7 @@ async function createPermissions (roleId) {
fields: [ '*' ],
},
{
collection: 'tokens',
collection: 'jsd_purge_tokens',
action: 'update',
role: roleId,
permissions: {
Expand All @@ -66,7 +66,7 @@ async function createPermissions (roleId) {
fields: [ 'name', 'value', 'expire', 'origins' ],
},
{
collection: 'tokens',
collection: 'jsd_purge_tokens',
action: 'delete',
role: roleId,
permissions: {
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/migrations/20230601A-hide-tokens-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function addCssRules () {
const response = await fetch(URL, {
method: 'PATCH',
body: JSON.stringify({
custom_css: '.search-input {\n display: none !important;\n}\n\nbody:not(:has(.router-link-active[href="/admin/content/tokens"])) .search-input {\n\tdisplay: flex !important;\n}',
custom_css: '.search-input {\n display: none !important;\n}\n\nbody:not(:has(.router-link-active[href="/admin/content/jsd_purge_tokens"])) .search-input {\n\tdisplay: flex !important;\n}',
}),
headers: {
'Content-Type': 'application/json',
Expand Down

This file was deleted.

88 changes: 0 additions & 88 deletions src/extensions/migrations/20230914A-add-github-webhook-handler.js

This file was deleted.

88 changes: 0 additions & 88 deletions src/extensions/migrations/20230919A-add-sponsors-cron-handler.js

This file was deleted.

Loading

0 comments on commit 741374c

Please sign in to comment.