Skip to content
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
8 changes: 8 additions & 0 deletions apps/automation/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ services:
TZ: ${GENERIC_TIMEZONE:-UTC}
NODE_ENV: production
N8N_SECURE_COOKIE: "false"
# Allow workflow expressions to read process env ($env.*). n8n blocks this by
# default; our workflows resolve the Strapi base URL + token from env.
N8N_BLOCK_ENV_ACCESS_IN_NODE: "false"
# Strapi connection used by workflows ($env.STRAPI_BASE_URL / $env.STRAPI_API_TOKEN).
# Default targets the host Strapi via the podman host-gateway alias.
STRAPI_BASE_URL: ${STRAPI_BASE_URL:-http://host.containers.internal:1337}
STRAPI_API_URL: ${STRAPI_API_URL:-http://host.containers.internal:1337}
STRAPI_API_TOKEN: ${STRAPI_API_TOKEN:-}
volumes:
- n8n_data:/home/node/.n8n
healthcheck:
Expand Down
8 changes: 4 additions & 4 deletions apps/automation/workflows/plugin-approved/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@
"id": "a1",
"name": "package_id",
"type": "string",
"value": "={{ $json.body.package_id }}"
"value": "={{ $json.body.documentId }}"
},
{
"id": "a2",
"name": "package_name",
"type": "string",
"value": "={{ $json.body.plugin_name }}"
"value": "={{ $json.body.name }}"
},
{
"id": "a3",
"name": "package_slug",
"type": "string",
"value": "={{ $json.body.package_slug || '' }}"
"value": "={{ $json.body.slug || '' }}"
},
{
"id": "a4",
Expand All @@ -72,7 +72,7 @@
"id": "a6",
"name": "marketplace_link",
"type": "string",
"value": "={{ $json.body.marketplace_link || '' }}"
"value": "={{ $json.body.slug || '' }}"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"id": "a1",
"name": "package_id",
"type": "string",
"value": "={{ $json.body.submissionId }}"
"value": "={{ $json.body.documentId }}"
},
{
"id": "a2",
"name": "package_name",
"type": "string",
"value": "={{ $json.body.plugin_name }}"
"value": "={{ $json.body.name }}"
},
{
"id": "a3",
Expand Down
2 changes: 1 addition & 1 deletion apps/automation/workflows/plugin-declined/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"id": "a1",
"name": "package_name",
"type": "string",
"value": "={{ $json.body.plugin_name }}"
"value": "={{ $json.body.name }}"
},
{
"id": "a2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@
"id": "a1",
"name": "package_id",
"type": "string",
"value": "={{ $json.body.submissionId }}"
"value": "={{ $json.body.documentId }}"
},
{
"id": "a2",
"name": "package_name",
"type": "string",
"value": "={{ $json.body.plugin_name }}"
"value": "={{ $json.body.name }}"
},
{
"id": "a3",
"name": "git_repository",
"type": "string",
"value": "={{ $json.body.repository_url }}"
"value": "={{ $json.body.git_repository }}"
},
{
"id": "a4",
Expand Down
39 changes: 33 additions & 6 deletions apps/automation/workflows/scan-timeout-sweeper/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
],
"parameters": {
"method": "GET",
"url": "={{ $env.STRAPI_API_URL }}/api/moderation/plugin-submissions/stale-scans",
"authentication": "genericCredentialType",
"url": "={{ $env.STRAPI_BASE_URL }}/api/moderation/packages/stale-scans",
"authentication": "none",
"genericAuthType": "httpHeaderAuth",
"sendQuery": true,
"queryParameters": {
Expand All @@ -84,6 +84,15 @@
"responseFormat": "json"
}
}
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $env.STRAPI_API_TOKEN }}"
}
]
}
},
"onError": "continueRegularOutput",
Expand All @@ -103,8 +112,8 @@
],
"parameters": {
"method": "GET",
"url": "={{ $env.STRAPI_API_URL }}/api/moderation/template-submissions/stale-scans",
"authentication": "genericCredentialType",
"url": "={{ $env.STRAPI_BASE_URL }}/api/moderation/templates/stale-scans",
"authentication": "none",
"genericAuthType": "httpHeaderAuth",
"sendQuery": true,
"queryParameters": {
Expand All @@ -123,6 +132,15 @@
"responseFormat": "json"
}
}
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $env.STRAPI_API_TOKEN }}"
}
]
}
},
"onError": "continueRegularOutput",
Expand Down Expand Up @@ -157,15 +175,24 @@
],
"parameters": {
"method": "POST",
"url": "={{ $env.STRAPI_API_URL }}/api/moderation/{{ $json.kind === 'template' ? 'template-submissions' : 'plugin-submissions' }}/{{ $json.documentId }}/security-scan-result",
"authentication": "genericCredentialType",
"url": "={{ $env.STRAPI_BASE_URL }}/api/moderation/{{ $json.kind === 'template' ? 'templates' : 'packages' }}/{{ $json.documentId }}/security-scan-result",
"authentication": "none",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"contentType": "json",
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ stage: 'summary', status: 'failed', result: { runAt: new Date().toISOString(), error: 'Scan exceeded the 30-minute timeout and was reaped by scan-timeout-sweeper.', passed: false, reaped_at: new Date().toISOString(), started_at: $json.started_at } }) }}",
"options": {
"timeout": 15000
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $env.STRAPI_API_TOKEN }}"
}
]
}
},
"onError": "continueRegularOutput",
Expand Down
43 changes: 35 additions & 8 deletions apps/automation/workflows/security-scan/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"id": "a3",
"name": "plugin_name",
"type": "string",
"value": "={{ $json.body.plugin_name }}"
"value": "={{ $json.body.name }}"
},
{
"id": "a4",
Expand All @@ -82,7 +82,7 @@
"id": "a5",
"name": "repository_url",
"type": "string",
"value": "={{ $json.body.repository_url }}"
"value": "={{ $json.body.git_repository }}"
},
{
"id": "a6",
Expand Down Expand Up @@ -214,15 +214,24 @@
],
"parameters": {
"method": "POST",
"url": "={{ $env.STRAPI_API_URL }}/api/moderation/packages/{{ $('Extract Payload').item.json.packageId }}/security-scan-result",
"authentication": "genericCredentialType",
"url": "={{ $env.STRAPI_BASE_URL }}/api/moderation/packages/{{ $('Extract Payload').item.json.packageId }}/security-scan-result",
"authentication": "none",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"contentType": "json",
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ stage: $json.stage, result: $json.result }) }}",
"options": {
"timeout": 15000
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $env.STRAPI_API_TOKEN }}"
}
]
}
},
"onError": "continueRegularOutput",
Expand Down Expand Up @@ -310,15 +319,24 @@
],
"parameters": {
"method": "POST",
"url": "={{ $env.STRAPI_API_URL }}/api/moderation/packages/{{ $('Extract Payload').item.json.packageId }}/security-scan-result",
"authentication": "genericCredentialType",
"url": "={{ $env.STRAPI_BASE_URL }}/api/moderation/packages/{{ $('Extract Payload').item.json.packageId }}/security-scan-result",
"authentication": "none",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"contentType": "json",
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ stage: $json.stage, result: $json.result }) }}",
"options": {
"timeout": 15000
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $env.STRAPI_API_TOKEN }}"
}
]
}
},
"onError": "continueRegularOutput",
Expand Down Expand Up @@ -371,15 +389,24 @@
],
"parameters": {
"method": "POST",
"url": "={{ $env.STRAPI_API_URL }}/api/moderation/packages/{{ $('Extract Payload').item.json.packageId }}/security-scan-result",
"authentication": "genericCredentialType",
"url": "={{ $env.STRAPI_BASE_URL }}/api/moderation/packages/{{ $('Extract Payload').item.json.packageId }}/security-scan-result",
"authentication": "none",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"contentType": "json",
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ stage: $json.stage, result: $json.result, status: $json.status }) }}",
"options": {
"timeout": 15000
},
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $env.STRAPI_API_TOKEN }}"
}
]
}
},
"onError": "continueRegularOutput",
Expand Down
6 changes: 3 additions & 3 deletions apps/automation/workflows/template-approved/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"id": "a1",
"name": "package_id",
"type": "string",
"value": "={{ $json.body.submissionId }}"
"value": "={{ $json.body.documentId }}"
},
{
"id": "a2",
"name": "package_name",
"type": "string",
"value": "={{ $json.body.template_name }}"
"value": "={{ $json.body.name }}"
},
{
"id": "a3",
Expand All @@ -72,7 +72,7 @@
"id": "a6",
"name": "marketplace_link",
"type": "string",
"value": "={{ $json.body.demo_url || $json.body.repository_url }}"
"value": "={{ $json.body.slug || $json.body.git_repository }}"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion apps/automation/workflows/template-declined/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"id": "a1",
"name": "package_name",
"type": "string",
"value": "={{ $json.body.template_name }}"
"value": "={{ $json.body.name }}"
},
{
"id": "a2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@
"id": "a1",
"name": "package_id",
"type": "string",
"value": "={{ $json.body.submissionId }}"
"value": "={{ $json.body.documentId }}"
},
{
"id": "a2",
"name": "package_name",
"type": "string",
"value": "={{ $json.body.template_name }}"
"value": "={{ $json.body.name }}"
},
{
"id": "a3",
"name": "git_repository",
"type": "string",
"value": "={{ $json.body.repository_url }}"
"value": "={{ $json.body.git_repository }}"
},
{
"id": "a4",
Expand Down
1 change: 1 addition & 0 deletions apps/cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"airtable": "^0.12.2",
"better-auth": "catalog:better-auth",
"better-sqlite3": "12.4.1",
"pg": "^8.21.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-query": "^3.39.3",
Expand Down
Loading
Loading