container-superposition 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +843 -0
- package/dist/scripts/init.d.ts +3 -0
- package/dist/scripts/init.d.ts.map +1 -0
- package/dist/scripts/init.js +1190 -0
- package/dist/scripts/init.js.map +1 -0
- package/dist/scripts/migrate-to-manifests.d.ts +12 -0
- package/dist/scripts/migrate-to-manifests.d.ts.map +1 -0
- package/dist/scripts/migrate-to-manifests.js +230 -0
- package/dist/scripts/migrate-to-manifests.js.map +1 -0
- package/dist/tool/questionnaire/composer.d.ts +6 -0
- package/dist/tool/questionnaire/composer.d.ts.map +1 -0
- package/dist/tool/questionnaire/composer.js +1232 -0
- package/dist/tool/questionnaire/composer.js.map +1 -0
- package/dist/tool/readme/markdown-parser.d.ts +30 -0
- package/dist/tool/readme/markdown-parser.d.ts.map +1 -0
- package/dist/tool/readme/markdown-parser.js +139 -0
- package/dist/tool/readme/markdown-parser.js.map +1 -0
- package/dist/tool/readme/readme-generator.d.ts +9 -0
- package/dist/tool/readme/readme-generator.d.ts.map +1 -0
- package/dist/tool/readme/readme-generator.js +422 -0
- package/dist/tool/readme/readme-generator.js.map +1 -0
- package/dist/tool/schema/custom-loader.d.ts +17 -0
- package/dist/tool/schema/custom-loader.d.ts.map +1 -0
- package/dist/tool/schema/custom-loader.js +149 -0
- package/dist/tool/schema/custom-loader.js.map +1 -0
- package/dist/tool/schema/overlay-loader.d.ts +47 -0
- package/dist/tool/schema/overlay-loader.d.ts.map +1 -0
- package/dist/tool/schema/overlay-loader.js +252 -0
- package/dist/tool/schema/overlay-loader.js.map +1 -0
- package/dist/tool/schema/types.d.ts +212 -0
- package/dist/tool/schema/types.d.ts.map +1 -0
- package/dist/tool/schema/types.js +5 -0
- package/dist/tool/schema/types.js.map +1 -0
- package/docs/README.md +308 -0
- package/docs/architecture.md +233 -0
- package/docs/creating-overlays.md +549 -0
- package/docs/custom-patches.md +540 -0
- package/docs/dependencies.md +279 -0
- package/docs/examples/custom-patches-example.md +85 -0
- package/docs/examples.md +576 -0
- package/docs/messaging-comparison.md +265 -0
- package/docs/messaging-quick-start.md +385 -0
- package/docs/observability-workflow.md +537 -0
- package/docs/overlay-manifest-refactoring.md +214 -0
- package/docs/overlay-metadata-archive.md +54 -0
- package/docs/overlays.md +523 -0
- package/docs/presets-architecture.md +498 -0
- package/docs/presets.md +366 -0
- package/docs/publishing.md +476 -0
- package/docs/quick-reference.md +326 -0
- package/docs/ux.md +170 -0
- package/features/README.md +85 -0
- package/features/cross-distro-packages/README.md +146 -0
- package/features/cross-distro-packages/devcontainer-feature.json +20 -0
- package/features/cross-distro-packages/install.sh +58 -0
- package/features/local-secrets-manager/devcontainer-feature.json +18 -0
- package/features/local-secrets-manager/install.sh +127 -0
- package/features/project-scaffolder/devcontainer-feature.json +24 -0
- package/features/project-scaffolder/install.sh +100 -0
- package/features/team-conventions/devcontainer-feature.json +24 -0
- package/features/team-conventions/install.sh +93 -0
- package/overlays/.registry/README.md +14 -0
- package/overlays/.registry/base-images.yml +26 -0
- package/overlays/.registry/base-templates.yml +7 -0
- package/overlays/README.md +155 -0
- package/overlays/alertmanager/.env.example +5 -0
- package/overlays/alertmanager/README.md +465 -0
- package/overlays/alertmanager/alert-rules.yml +56 -0
- package/overlays/alertmanager/alertmanager.yml +42 -0
- package/overlays/alertmanager/devcontainer.patch.json +12 -0
- package/overlays/alertmanager/docker-compose.yml +20 -0
- package/overlays/alertmanager/overlay.yml +17 -0
- package/overlays/alertmanager/setup.sh +53 -0
- package/overlays/alertmanager/verify.sh +31 -0
- package/overlays/aws-cli/README.md +473 -0
- package/overlays/aws-cli/devcontainer.patch.json +13 -0
- package/overlays/aws-cli/overlay.yml +13 -0
- package/overlays/azure-cli/README.md +551 -0
- package/overlays/azure-cli/devcontainer.patch.json +8 -0
- package/overlays/azure-cli/overlay.yml +13 -0
- package/overlays/bun/README.md +312 -0
- package/overlays/bun/devcontainer.patch.json +41 -0
- package/overlays/bun/overlay.yml +16 -0
- package/overlays/bun/setup.sh +79 -0
- package/overlays/bun/verify.sh +30 -0
- package/overlays/codex/README.md +128 -0
- package/overlays/codex/devcontainer.patch.json +3 -0
- package/overlays/codex/overlay.yml +14 -0
- package/overlays/codex/setup.sh +24 -0
- package/overlays/codex/verify.sh +30 -0
- package/overlays/commitlint/README.md +333 -0
- package/overlays/commitlint/devcontainer.patch.json +8 -0
- package/overlays/commitlint/overlay.yml +16 -0
- package/overlays/commitlint/setup.sh +234 -0
- package/overlays/direnv/README.md +504 -0
- package/overlays/direnv/devcontainer.patch.json +6 -0
- package/overlays/direnv/overlay.yml +13 -0
- package/overlays/direnv/setup.sh +139 -0
- package/overlays/docker-in-docker/README.md +534 -0
- package/overlays/docker-in-docker/devcontainer.patch.json +10 -0
- package/overlays/docker-in-docker/overlay.yml +13 -0
- package/overlays/docker-sock/README.md +256 -0
- package/overlays/docker-sock/devcontainer.patch.json +9 -0
- package/overlays/docker-sock/docker-compose.yml +8 -0
- package/overlays/docker-sock/overlay.yml +13 -0
- package/overlays/dotnet/README.md +147 -0
- package/overlays/dotnet/devcontainer.patch.json +51 -0
- package/overlays/dotnet/global-tools.txt +24 -0
- package/overlays/dotnet/overlay.yml +13 -0
- package/overlays/dotnet/setup.sh +51 -0
- package/overlays/dotnet/verify.sh +26 -0
- package/overlays/gcloud/README.md +269 -0
- package/overlays/gcloud/devcontainer.patch.json +14 -0
- package/overlays/gcloud/overlay.yml +14 -0
- package/overlays/gcloud/verify.sh +52 -0
- package/overlays/git-helpers/README.md +168 -0
- package/overlays/git-helpers/devcontainer.patch.json +33 -0
- package/overlays/git-helpers/overlay.yml +15 -0
- package/overlays/git-helpers/setup.sh +91 -0
- package/overlays/go/README.md +293 -0
- package/overlays/go/devcontainer.patch.json +43 -0
- package/overlays/go/overlay.yml +15 -0
- package/overlays/go/setup.sh +33 -0
- package/overlays/go/verify.sh +40 -0
- package/overlays/grafana/.env.example +9 -0
- package/overlays/grafana/README.md +462 -0
- package/overlays/grafana/dashboard-provider.yml +11 -0
- package/overlays/grafana/dashboards/observability-overview.json +263 -0
- package/overlays/grafana/devcontainer.patch.json +12 -0
- package/overlays/grafana/docker-compose.yml +27 -0
- package/overlays/grafana/grafana-datasources.yml +57 -0
- package/overlays/grafana/overlay.yml +21 -0
- package/overlays/grafana/verify.sh +34 -0
- package/overlays/jaeger/.env.example +7 -0
- package/overlays/jaeger/README.md +867 -0
- package/overlays/jaeger/devcontainer.patch.json +12 -0
- package/overlays/jaeger/docker-compose.yml +17 -0
- package/overlays/jaeger/overlay.yml +19 -0
- package/overlays/java/README.md +267 -0
- package/overlays/java/devcontainer.patch.json +44 -0
- package/overlays/java/overlay.yml +16 -0
- package/overlays/java/setup.sh +41 -0
- package/overlays/java/verify.sh +42 -0
- package/overlays/just/README.md +443 -0
- package/overlays/just/devcontainer.patch.json +3 -0
- package/overlays/just/overlay.yml +13 -0
- package/overlays/just/setup.sh +182 -0
- package/overlays/kubectl-helm/README.md +660 -0
- package/overlays/kubectl-helm/devcontainer.patch.json +10 -0
- package/overlays/kubectl-helm/overlay.yml +13 -0
- package/overlays/loki/.env.example +5 -0
- package/overlays/loki/README.md +1156 -0
- package/overlays/loki/devcontainer.patch.json +12 -0
- package/overlays/loki/docker-compose.yml +18 -0
- package/overlays/loki/loki-config.yaml +45 -0
- package/overlays/loki/overlay.yml +17 -0
- package/overlays/minio/.env.example +9 -0
- package/overlays/minio/README.md +639 -0
- package/overlays/minio/devcontainer.patch.json +30 -0
- package/overlays/minio/docker-compose.yml +28 -0
- package/overlays/minio/overlay.yml +18 -0
- package/overlays/minio/setup.sh +61 -0
- package/overlays/minio/verify.sh +64 -0
- package/overlays/mkdocs/README.md +309 -0
- package/overlays/mkdocs/devcontainer.patch.json +24 -0
- package/overlays/mkdocs/overlay.yml +15 -0
- package/overlays/modern-cli-tools/README.md +556 -0
- package/overlays/modern-cli-tools/devcontainer.patch.json +3 -0
- package/overlays/modern-cli-tools/overlay.yml +13 -0
- package/overlays/modern-cli-tools/setup.sh +153 -0
- package/overlays/mongodb/.env.example +9 -0
- package/overlays/mongodb/README.md +481 -0
- package/overlays/mongodb/devcontainer.patch.json +32 -0
- package/overlays/mongodb/docker-compose.yml +44 -0
- package/overlays/mongodb/overlay.yml +17 -0
- package/overlays/mongodb/verify.sh +48 -0
- package/overlays/mysql/.env.example +11 -0
- package/overlays/mysql/README.md +542 -0
- package/overlays/mysql/devcontainer.patch.json +34 -0
- package/overlays/mysql/docker-compose.yml +55 -0
- package/overlays/mysql/overlay.yml +16 -0
- package/overlays/mysql/verify.sh +48 -0
- package/overlays/nats/.env.example +5 -0
- package/overlays/nats/README.md +762 -0
- package/overlays/nats/devcontainer.patch.json +24 -0
- package/overlays/nats/docker-compose.yml +31 -0
- package/overlays/nats/overlay.yml +18 -0
- package/overlays/nats/verify.sh +50 -0
- package/overlays/ngrok/README.md +503 -0
- package/overlays/ngrok/devcontainer.patch.json +3 -0
- package/overlays/ngrok/overlay.yml +14 -0
- package/overlays/ngrok/setup.sh +125 -0
- package/overlays/nodejs/README.md +192 -0
- package/overlays/nodejs/devcontainer.patch.json +49 -0
- package/overlays/nodejs/global-packages.txt +16 -0
- package/overlays/nodejs/overlay.yml +14 -0
- package/overlays/nodejs/setup.sh +46 -0
- package/overlays/nodejs/verify.sh +32 -0
- package/overlays/otel-collector/.env.example +9 -0
- package/overlays/otel-collector/README.md +1257 -0
- package/overlays/otel-collector/devcontainer.patch.json +28 -0
- package/overlays/otel-collector/docker-compose.yml +22 -0
- package/overlays/otel-collector/otel-collector-config.yaml +68 -0
- package/overlays/otel-collector/overlay.yml +21 -0
- package/overlays/otel-collector/setup.sh +49 -0
- package/overlays/otel-demo-nodejs/.env.example +2 -0
- package/overlays/otel-demo-nodejs/Dockerfile-otel-demo-nodejs +17 -0
- package/overlays/otel-demo-nodejs/README.md +409 -0
- package/overlays/otel-demo-nodejs/devcontainer.patch.json +12 -0
- package/overlays/otel-demo-nodejs/docker-compose.yml +19 -0
- package/overlays/otel-demo-nodejs/overlay.yml +23 -0
- package/overlays/otel-demo-nodejs/package-otel-demo-nodejs.json +20 -0
- package/overlays/otel-demo-nodejs/server-otel-demo-nodejs.js +259 -0
- package/overlays/otel-demo-nodejs/tracing-otel-demo-nodejs.js +57 -0
- package/overlays/otel-demo-nodejs/verify.sh +31 -0
- package/overlays/otel-demo-python/.env.example +2 -0
- package/overlays/otel-demo-python/Dockerfile-otel-demo-python +16 -0
- package/overlays/otel-demo-python/README.md +82 -0
- package/overlays/otel-demo-python/app-otel-demo-python.py +208 -0
- package/overlays/otel-demo-python/devcontainer.patch.json +12 -0
- package/overlays/otel-demo-python/docker-compose.yml +19 -0
- package/overlays/otel-demo-python/overlay.yml +23 -0
- package/overlays/otel-demo-python/requirements-otel-demo-python.txt +4 -0
- package/overlays/otel-demo-python/verify.sh +31 -0
- package/overlays/playwright/README.md +629 -0
- package/overlays/playwright/devcontainer.patch.json +9 -0
- package/overlays/playwright/overlay.yml +13 -0
- package/overlays/postgres/.env.example +6 -0
- package/overlays/postgres/README.md +602 -0
- package/overlays/postgres/devcontainer.patch.json +21 -0
- package/overlays/postgres/docker-compose.yml +22 -0
- package/overlays/postgres/overlay.yml +15 -0
- package/overlays/postgres/verify.sh +45 -0
- package/overlays/powershell/README.md +314 -0
- package/overlays/powershell/devcontainer.patch.json +22 -0
- package/overlays/powershell/overlay.yml +13 -0
- package/overlays/powershell/setup.sh +29 -0
- package/overlays/powershell/verify.sh +38 -0
- package/overlays/pre-commit/README.md +263 -0
- package/overlays/pre-commit/devcontainer.patch.json +9 -0
- package/overlays/pre-commit/overlay.yml +16 -0
- package/overlays/pre-commit/setup.sh +129 -0
- package/overlays/presets/docs-site.yml +118 -0
- package/overlays/presets/fullstack.yml +181 -0
- package/overlays/presets/microservice.yml +118 -0
- package/overlays/presets/web-api.yml +109 -0
- package/overlays/prometheus/.env.example +5 -0
- package/overlays/prometheus/README.md +1246 -0
- package/overlays/prometheus/devcontainer.patch.json +12 -0
- package/overlays/prometheus/docker-compose.yml +22 -0
- package/overlays/prometheus/overlay.yml +17 -0
- package/overlays/prometheus/prometheus.yml +12 -0
- package/overlays/prometheus/verify.sh +34 -0
- package/overlays/promtail/.env.example +2 -0
- package/overlays/promtail/README.md +357 -0
- package/overlays/promtail/devcontainer.patch.json +5 -0
- package/overlays/promtail/docker-compose.yml +16 -0
- package/overlays/promtail/overlay.yml +17 -0
- package/overlays/promtail/promtail-config.yaml +60 -0
- package/overlays/promtail/verify.sh +31 -0
- package/overlays/pulumi/README.md +472 -0
- package/overlays/pulumi/devcontainer.patch.json +13 -0
- package/overlays/pulumi/overlay.yml +14 -0
- package/overlays/pulumi/verify.sh +31 -0
- package/overlays/python/README.md +919 -0
- package/overlays/python/devcontainer.patch.json +41 -0
- package/overlays/python/overlay.yml +12 -0
- package/overlays/python/requirements-overlay.txt +13 -0
- package/overlays/python/setup.sh +47 -0
- package/overlays/python/verify.sh +32 -0
- package/overlays/rabbitmq/.env.example +7 -0
- package/overlays/rabbitmq/README.md +680 -0
- package/overlays/rabbitmq/devcontainer.patch.json +28 -0
- package/overlays/rabbitmq/docker-compose.yml +30 -0
- package/overlays/rabbitmq/overlay.yml +18 -0
- package/overlays/rabbitmq/verify.sh +41 -0
- package/overlays/redis/.env.example +4 -0
- package/overlays/redis/README.md +776 -0
- package/overlays/redis/devcontainer.patch.json +21 -0
- package/overlays/redis/docker-compose.yml +21 -0
- package/overlays/redis/overlay.yml +15 -0
- package/overlays/redis/verify.sh +41 -0
- package/overlays/redpanda/.env.example +10 -0
- package/overlays/redpanda/README.md +703 -0
- package/overlays/redpanda/devcontainer.patch.json +37 -0
- package/overlays/redpanda/docker-compose.yml +67 -0
- package/overlays/redpanda/overlay.yml +21 -0
- package/overlays/redpanda/verify.sh +48 -0
- package/overlays/rust/README.md +299 -0
- package/overlays/rust/devcontainer.patch.json +39 -0
- package/overlays/rust/overlay.yml +15 -0
- package/overlays/rust/setup.sh +36 -0
- package/overlays/rust/verify.sh +51 -0
- package/overlays/sqlite/README.md +584 -0
- package/overlays/sqlite/devcontainer.patch.json +14 -0
- package/overlays/sqlite/overlay.yml +15 -0
- package/overlays/sqlite/setup.sh +27 -0
- package/overlays/sqlite/verify.sh +43 -0
- package/overlays/sqlserver/.env.example +6 -0
- package/overlays/sqlserver/README.md +592 -0
- package/overlays/sqlserver/devcontainer.patch.json +22 -0
- package/overlays/sqlserver/docker-compose.yml +32 -0
- package/overlays/sqlserver/overlay.yml +17 -0
- package/overlays/sqlserver/verify.sh +30 -0
- package/overlays/tempo/.env.example +5 -0
- package/overlays/tempo/README.md +273 -0
- package/overlays/tempo/devcontainer.patch.json +12 -0
- package/overlays/tempo/docker-compose.yml +20 -0
- package/overlays/tempo/overlay.yml +20 -0
- package/overlays/tempo/tempo-config.yaml +32 -0
- package/overlays/tempo/verify.sh +31 -0
- package/overlays/terraform/README.md +389 -0
- package/overlays/terraform/devcontainer.patch.json +15 -0
- package/overlays/terraform/overlay.yml +14 -0
- package/overlays/terraform/verify.sh +63 -0
- package/package.json +74 -0
- package/templates/README.md +285 -0
- package/templates/compose/.devcontainer/devcontainer.json +46 -0
- package/templates/compose/.devcontainer/docker-compose.yml +12 -0
- package/templates/compose/README.md +20 -0
- package/templates/plain/.devcontainer/devcontainer.json +35 -0
- package/templates/plain/README.md +21 -0
- package/tool/README.md +281 -0
- package/tool/schema/base-images.schema.json +43 -0
- package/tool/schema/base-templates.schema.json +34 -0
- package/tool/schema/config.schema.json +71 -0
- package/tool/schema/overlay-manifest.schema.json +86 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
|
|
3
|
+
"features": {
|
|
4
|
+
"./features/cross-distro-packages": {
|
|
5
|
+
"apt": "curl",
|
|
6
|
+
"apk": "curl"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"runServices": ["nats"],
|
|
10
|
+
"forwardPorts": [4222, 8222],
|
|
11
|
+
"portsAttributes": {
|
|
12
|
+
"4222": {
|
|
13
|
+
"label": "NATS Client Port",
|
|
14
|
+
"onAutoForward": "notify"
|
|
15
|
+
},
|
|
16
|
+
"8222": {
|
|
17
|
+
"label": "NATS Monitoring",
|
|
18
|
+
"onAutoForward": "openBrowser"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"remoteEnv": {
|
|
22
|
+
"NATS_URL": "nats://nats:4222"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
version: '3.8'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
nats:
|
|
5
|
+
image: nats:${NATS_VERSION:-latest}-alpine
|
|
6
|
+
restart: unless-stopped
|
|
7
|
+
command:
|
|
8
|
+
- '--jetstream'
|
|
9
|
+
- '--store_dir=/data'
|
|
10
|
+
- '--http_port=8222'
|
|
11
|
+
- '--port=4222'
|
|
12
|
+
volumes:
|
|
13
|
+
- nats-data:/data
|
|
14
|
+
ports:
|
|
15
|
+
- '${NATS_CLIENT_PORT:-4222}:4222'
|
|
16
|
+
- '${NATS_HTTP_PORT:-8222}:8222'
|
|
17
|
+
- '${NATS_CLUSTER_PORT:-6222}:6222'
|
|
18
|
+
networks:
|
|
19
|
+
- devnet
|
|
20
|
+
healthcheck:
|
|
21
|
+
test: ['CMD', 'wget', '--spider', '-q', 'http://localhost:8222/healthz']
|
|
22
|
+
interval: 10s
|
|
23
|
+
timeout: 5s
|
|
24
|
+
retries: 5
|
|
25
|
+
start_period: 10s
|
|
26
|
+
|
|
27
|
+
volumes:
|
|
28
|
+
nats-data:
|
|
29
|
+
|
|
30
|
+
networks:
|
|
31
|
+
devnet:
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
id: nats
|
|
2
|
+
name: NATS
|
|
3
|
+
description: Lightweight pub/sub messaging with JetStream
|
|
4
|
+
category: database
|
|
5
|
+
supports:
|
|
6
|
+
- compose
|
|
7
|
+
requires: []
|
|
8
|
+
suggests: []
|
|
9
|
+
conflicts: []
|
|
10
|
+
tags:
|
|
11
|
+
- database
|
|
12
|
+
- messaging
|
|
13
|
+
- pubsub
|
|
14
|
+
- nats
|
|
15
|
+
- jetstream
|
|
16
|
+
ports:
|
|
17
|
+
- 4222
|
|
18
|
+
- 8222
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Verification script for NATS overlay
|
|
3
|
+
# Confirms NATS is installed and accessible
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "🔍 Verifying NATS overlay..."
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# Check if NATS service is running
|
|
11
|
+
echo "1️⃣ Checking NATS service..."
|
|
12
|
+
# Wait up to 20 seconds for NATS to be ready
|
|
13
|
+
NATS_READY=false
|
|
14
|
+
for i in {1..20}; do
|
|
15
|
+
if curl -s http://nats:8222/healthz &> /dev/null; then
|
|
16
|
+
echo " ✅ NATS service is ready"
|
|
17
|
+
NATS_READY=true
|
|
18
|
+
break
|
|
19
|
+
fi
|
|
20
|
+
sleep 1
|
|
21
|
+
done
|
|
22
|
+
|
|
23
|
+
if [ "$NATS_READY" = false ]; then
|
|
24
|
+
echo " ❌ NATS service not ready after 20 seconds"
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
# Check NATS monitoring endpoint
|
|
29
|
+
echo ""
|
|
30
|
+
echo "2️⃣ Checking NATS monitoring endpoint..."
|
|
31
|
+
if curl -s http://nats:8222/varz &> /dev/null; then
|
|
32
|
+
echo " ✅ NATS monitoring endpoint is accessible"
|
|
33
|
+
else
|
|
34
|
+
echo " ❌ NATS monitoring endpoint not accessible"
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# Check JetStream is enabled
|
|
39
|
+
echo ""
|
|
40
|
+
echo "3️⃣ Checking JetStream..."
|
|
41
|
+
if curl -s http://nats:8222/jsz &> /dev/null; then
|
|
42
|
+
echo " ✅ JetStream is enabled"
|
|
43
|
+
else
|
|
44
|
+
echo " ⚠️ JetStream status unknown"
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
echo ""
|
|
48
|
+
echo "✅ NATS overlay verification complete"
|
|
49
|
+
echo " Client URL: nats://nats:4222"
|
|
50
|
+
echo " Monitoring: http://localhost:8222"
|
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
# ngrok Overlay
|
|
2
|
+
|
|
3
|
+
Secure tunneling to localhost for webhook testing and external access.
|
|
4
|
+
|
|
5
|
+
## What's Included
|
|
6
|
+
|
|
7
|
+
- **ngrok** - Secure tunneling service
|
|
8
|
+
- **Sample configuration** - Pre-configured ngrok.yml
|
|
9
|
+
- **Helper scripts** - Quick access scripts
|
|
10
|
+
- **Web inspector** - Traffic inspection UI
|
|
11
|
+
|
|
12
|
+
## What is ngrok?
|
|
13
|
+
|
|
14
|
+
ngrok creates secure tunnels from public internet to localhost, allowing:
|
|
15
|
+
|
|
16
|
+
- **Webhook testing** - Test webhooks locally (GitHub, Stripe, Twilio, etc.)
|
|
17
|
+
- **Remote access** - Access your local dev server from anywhere
|
|
18
|
+
- **Mobile testing** - Test on real devices
|
|
19
|
+
- **API demos** - Share work-in-progress with clients
|
|
20
|
+
- **SSH access** - Secure remote access to container
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
### 1. Authenticate (Required)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Sign up at https://dashboard.ngrok.com/signup
|
|
28
|
+
# Get token from https://dashboard.ngrok.com/get-started/your-authtoken
|
|
29
|
+
|
|
30
|
+
ngrok config add-authtoken YOUR_AUTHTOKEN
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Start a Tunnel
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Expose local web server on port 3000
|
|
37
|
+
ngrok http 3000
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Output:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Session Status online
|
|
44
|
+
Account your@email.com
|
|
45
|
+
Version 3.x.x
|
|
46
|
+
Region United States (us)
|
|
47
|
+
Forwarding https://abc123.ngrok.io -> localhost:3000
|
|
48
|
+
Web Interface http://127.0.0.1:4040
|
|
49
|
+
|
|
50
|
+
Connections ttl opn rt1 rt5 p50 p90
|
|
51
|
+
0 0 0.00 0.00 0.00 0.00
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 3. Access Your App
|
|
55
|
+
|
|
56
|
+
- Public URL: `https://abc123.ngrok.io`
|
|
57
|
+
- Web Inspector: `http://localhost:4040`
|
|
58
|
+
|
|
59
|
+
## Common Usage
|
|
60
|
+
|
|
61
|
+
### HTTP Tunnel
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Basic HTTP tunnel
|
|
65
|
+
ngrok http 3000
|
|
66
|
+
|
|
67
|
+
# Custom subdomain (requires paid plan)
|
|
68
|
+
ngrok http 3000 --subdomain myapp
|
|
69
|
+
|
|
70
|
+
# Custom domain (requires paid plan)
|
|
71
|
+
ngrok http 3000 --hostname myapp.example.com
|
|
72
|
+
|
|
73
|
+
# Basic authentication
|
|
74
|
+
ngrok http 3000 --basic-auth "user:password"
|
|
75
|
+
|
|
76
|
+
# Custom region
|
|
77
|
+
ngrok http 3000 --region eu
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### TCP Tunnel
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# PostgreSQL
|
|
84
|
+
ngrok tcp 5432
|
|
85
|
+
|
|
86
|
+
# MySQL
|
|
87
|
+
ngrok tcp 3306
|
|
88
|
+
|
|
89
|
+
# SSH
|
|
90
|
+
ngrok tcp 22
|
|
91
|
+
|
|
92
|
+
# Custom port binding
|
|
93
|
+
ngrok tcp 5432 --remote-addr 1.tcp.ngrok.io:12345
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### TLS Tunnel
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# TLS termination at ngrok
|
|
100
|
+
ngrok tls 443
|
|
101
|
+
|
|
102
|
+
# With custom domain
|
|
103
|
+
ngrok tls 443 --hostname secure.example.com
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Configuration File
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Start named tunnel from ngrok.yml
|
|
110
|
+
ngrok start web
|
|
111
|
+
|
|
112
|
+
# Start multiple tunnels
|
|
113
|
+
ngrok start web api
|
|
114
|
+
|
|
115
|
+
# Start all tunnels
|
|
116
|
+
ngrok start --all
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Configuration (ngrok.yml)
|
|
120
|
+
|
|
121
|
+
Located at `~/.config/ngrok/ngrok.yml`:
|
|
122
|
+
|
|
123
|
+
### Basic Configuration
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
version: '2'
|
|
127
|
+
authtoken: YOUR_AUTHTOKEN
|
|
128
|
+
region: us
|
|
129
|
+
console_ui: true
|
|
130
|
+
log_level: info
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Tunnel Definitions
|
|
134
|
+
|
|
135
|
+
```yaml
|
|
136
|
+
tunnels:
|
|
137
|
+
web:
|
|
138
|
+
proto: http
|
|
139
|
+
addr: 3000
|
|
140
|
+
inspect: true
|
|
141
|
+
|
|
142
|
+
api:
|
|
143
|
+
proto: http
|
|
144
|
+
addr: 8080
|
|
145
|
+
subdomain: myapi # Paid feature
|
|
146
|
+
auth: 'user:pass' # Basic auth
|
|
147
|
+
|
|
148
|
+
database:
|
|
149
|
+
proto: tcp
|
|
150
|
+
addr: 5432
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Advanced Options
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
tunnels:
|
|
157
|
+
web:
|
|
158
|
+
proto: http
|
|
159
|
+
addr: 3000
|
|
160
|
+
|
|
161
|
+
# Request/response modification
|
|
162
|
+
request_header:
|
|
163
|
+
add:
|
|
164
|
+
- 'X-Custom-Header: value'
|
|
165
|
+
remove:
|
|
166
|
+
- 'X-Unwanted-Header'
|
|
167
|
+
|
|
168
|
+
response_header:
|
|
169
|
+
add:
|
|
170
|
+
- 'X-Response-Header: value'
|
|
171
|
+
|
|
172
|
+
# IP restrictions (paid feature)
|
|
173
|
+
ip_restriction:
|
|
174
|
+
allow_cidrs:
|
|
175
|
+
- '1.2.3.4/32'
|
|
176
|
+
- '10.0.0.0/8'
|
|
177
|
+
|
|
178
|
+
# Circuit breaker (paid feature)
|
|
179
|
+
circuit_breaker: 0.5 # Open if >50% errors
|
|
180
|
+
|
|
181
|
+
# Compression
|
|
182
|
+
compression: true
|
|
183
|
+
|
|
184
|
+
# Mutual TLS (paid feature)
|
|
185
|
+
mutual_tls_cas: /path/to/ca.crt
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Web Interface
|
|
189
|
+
|
|
190
|
+
Access at `http://localhost:4040` while tunnel is active.
|
|
191
|
+
|
|
192
|
+
Features:
|
|
193
|
+
|
|
194
|
+
- **Request history** - All HTTP requests/responses
|
|
195
|
+
- **Request replay** - Replay requests for testing
|
|
196
|
+
- **Metrics** - Connection stats, latency
|
|
197
|
+
- **Status** - Tunnel information
|
|
198
|
+
|
|
199
|
+
### Replay Requests
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Via web UI - click "Replay" on any request
|
|
203
|
+
|
|
204
|
+
# Via API
|
|
205
|
+
curl -X POST http://localhost:4040/api/requests/http/[request-id]/replay
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Webhook Testing
|
|
209
|
+
|
|
210
|
+
### GitHub Webhooks
|
|
211
|
+
|
|
212
|
+
1. Start tunnel:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
ngrok http 3000
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
2. Configure webhook in GitHub:
|
|
219
|
+
- Go to repository Settings → Webhooks
|
|
220
|
+
- URL: `https://abc123.ngrok.io/webhook`
|
|
221
|
+
- Events: Push, Pull Request, etc.
|
|
222
|
+
|
|
223
|
+
3. Test locally:
|
|
224
|
+
```bash
|
|
225
|
+
# Your webhook handler runs on localhost:3000
|
|
226
|
+
# GitHub POSTs to https://abc123.ngrok.io/webhook
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Stripe Webhooks
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Start tunnel
|
|
233
|
+
ngrok http 4242
|
|
234
|
+
|
|
235
|
+
# Configure in Stripe Dashboard
|
|
236
|
+
# URL: https://abc123.ngrok.io/stripe-webhook
|
|
237
|
+
|
|
238
|
+
# Test with Stripe CLI
|
|
239
|
+
stripe listen --forward-to localhost:4242/stripe-webhook
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Twilio Webhooks
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# Start tunnel
|
|
246
|
+
ngrok http 3000
|
|
247
|
+
|
|
248
|
+
# Configure in Twilio Console
|
|
249
|
+
# Voice URL: https://abc123.ngrok.io/voice
|
|
250
|
+
# SMS URL: https://abc123.ngrok.io/sms
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Mobile Testing
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# Start tunnel
|
|
257
|
+
ngrok http 3000
|
|
258
|
+
|
|
259
|
+
# Access from mobile device
|
|
260
|
+
# URL: https://abc123.ngrok.io
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Benefits:
|
|
264
|
+
|
|
265
|
+
- Test on real devices
|
|
266
|
+
- Test over cellular networks
|
|
267
|
+
- No need for complex network setup
|
|
268
|
+
- Works with any framework (React, Vue, Angular, etc.)
|
|
269
|
+
|
|
270
|
+
## SSH Access
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
# Start TCP tunnel
|
|
274
|
+
ngrok tcp 22
|
|
275
|
+
|
|
276
|
+
# Output shows:
|
|
277
|
+
# Forwarding: tcp://0.tcp.ngrok.io:12345 -> localhost:22
|
|
278
|
+
|
|
279
|
+
# Connect from remote machine
|
|
280
|
+
ssh -p 12345 user@0.tcp.ngrok.io
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Database Access
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# PostgreSQL tunnel
|
|
287
|
+
ngrok tcp 5432
|
|
288
|
+
|
|
289
|
+
# Connect from remote machine
|
|
290
|
+
psql -h 0.tcp.ngrok.io -p [NGROK_PORT] -U user dbname
|
|
291
|
+
|
|
292
|
+
# MySQL tunnel
|
|
293
|
+
ngrok tcp 3306
|
|
294
|
+
|
|
295
|
+
# Connect from remote machine
|
|
296
|
+
mysql -h 0.tcp.ngrok.io -P [NGROK_PORT] -u user -p
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## API Usage
|
|
300
|
+
|
|
301
|
+
ngrok provides a local API for automation:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
# List tunnels
|
|
305
|
+
curl http://localhost:4040/api/tunnels
|
|
306
|
+
|
|
307
|
+
# Get tunnel details
|
|
308
|
+
curl http://localhost:4040/api/tunnels/web
|
|
309
|
+
|
|
310
|
+
# Request history
|
|
311
|
+
curl http://localhost:4040/api/requests/http
|
|
312
|
+
|
|
313
|
+
# Metrics
|
|
314
|
+
curl http://localhost:4040/api/metrics
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Advanced Features
|
|
318
|
+
|
|
319
|
+
### Reserved Domains (Paid)
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# Use reserved domain
|
|
323
|
+
ngrok http 3000 --hostname myapp.ngrok.io
|
|
324
|
+
|
|
325
|
+
# Configure in ngrok.yml
|
|
326
|
+
tunnels:
|
|
327
|
+
web:
|
|
328
|
+
proto: http
|
|
329
|
+
addr: 3000
|
|
330
|
+
hostname: myapp.ngrok.io
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### IP Whitelisting (Paid)
|
|
334
|
+
|
|
335
|
+
```yaml
|
|
336
|
+
tunnels:
|
|
337
|
+
api:
|
|
338
|
+
proto: http
|
|
339
|
+
addr: 8080
|
|
340
|
+
ip_restriction:
|
|
341
|
+
allow_cidrs:
|
|
342
|
+
- '1.2.3.4/32' # Single IP
|
|
343
|
+
- '10.0.0.0/8' # Private network
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### OAuth Protection (Paid)
|
|
347
|
+
|
|
348
|
+
```yaml
|
|
349
|
+
tunnels:
|
|
350
|
+
web:
|
|
351
|
+
proto: http
|
|
352
|
+
addr: 3000
|
|
353
|
+
oauth:
|
|
354
|
+
provider: google
|
|
355
|
+
allow_emails:
|
|
356
|
+
- user@example.com
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Mutual TLS (Paid)
|
|
360
|
+
|
|
361
|
+
```yaml
|
|
362
|
+
tunnels:
|
|
363
|
+
secure:
|
|
364
|
+
proto: tls
|
|
365
|
+
addr: 443
|
|
366
|
+
mutual_tls_cas: /path/to/ca-certificates.crt
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
## Automation
|
|
370
|
+
|
|
371
|
+
### Start on Container Launch
|
|
372
|
+
|
|
373
|
+
Add to `.bashrc` or startup script:
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
# Auto-start ngrok on container start
|
|
377
|
+
if [ -z "$NGROK_RUNNING" ]; then
|
|
378
|
+
export NGROK_RUNNING=1
|
|
379
|
+
ngrok http 3000 > /tmp/ngrok.log 2>&1 &
|
|
380
|
+
fi
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Get Public URL Programmatically
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
#!/bin/bash
|
|
387
|
+
# get-ngrok-url.sh
|
|
388
|
+
|
|
389
|
+
curl -s http://localhost:4040/api/tunnels | \
|
|
390
|
+
jq -r '.tunnels[0].public_url'
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Integration with CI/CD
|
|
394
|
+
|
|
395
|
+
```yaml
|
|
396
|
+
# .github/workflows/test.yml
|
|
397
|
+
- name: Start ngrok
|
|
398
|
+
run: |
|
|
399
|
+
ngrok http 3000 &
|
|
400
|
+
sleep 5
|
|
401
|
+
PUBLIC_URL=$(curl -s http://localhost:4040/api/tunnels | jq -r '.tunnels[0].public_url')
|
|
402
|
+
echo "NGROK_URL=$PUBLIC_URL" >> $GITHUB_ENV
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
## Regions
|
|
406
|
+
|
|
407
|
+
Available regions:
|
|
408
|
+
|
|
409
|
+
- `us` - United States (default)
|
|
410
|
+
- `eu` - Europe
|
|
411
|
+
- `ap` - Asia/Pacific
|
|
412
|
+
- `au` - Australia
|
|
413
|
+
- `sa` - South America
|
|
414
|
+
- `jp` - Japan
|
|
415
|
+
- `in` - India
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
ngrok http 3000 --region eu
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
## Security Best Practices
|
|
422
|
+
|
|
423
|
+
1. **Keep authtoken secret** - Never commit to version control
|
|
424
|
+
2. **Use authentication** - Add `--basic-auth` for sensitive endpoints
|
|
425
|
+
3. **IP restrictions** - Whitelist known IPs (paid feature)
|
|
426
|
+
4. **Monitor usage** - Check dashboard for unexpected traffic
|
|
427
|
+
5. **Rotate tokens** - Regenerate tokens periodically
|
|
428
|
+
6. **Use HTTPS** - Free tunnels use HTTPS by default
|
|
429
|
+
7. **Limit exposure** - Close tunnels when not in use
|
|
430
|
+
8. **Inspect traffic** - Review requests in web interface
|
|
431
|
+
|
|
432
|
+
## Free vs Paid Plans
|
|
433
|
+
|
|
434
|
+
### Free Plan
|
|
435
|
+
|
|
436
|
+
- 1 online ngrok agent
|
|
437
|
+
- 4 tunnels per agent
|
|
438
|
+
- 40 connections/minute
|
|
439
|
+
- Random URLs
|
|
440
|
+
- HTTP/TCP tunnels
|
|
441
|
+
|
|
442
|
+
### Paid Plans
|
|
443
|
+
|
|
444
|
+
- Reserved domains
|
|
445
|
+
- Custom subdomains
|
|
446
|
+
- IP whitelisting
|
|
447
|
+
- OAuth protection
|
|
448
|
+
- More tunnels
|
|
449
|
+
- Higher limits
|
|
450
|
+
- Priority support
|
|
451
|
+
|
|
452
|
+
## Troubleshooting
|
|
453
|
+
|
|
454
|
+
### Authentication Failed
|
|
455
|
+
|
|
456
|
+
```bash
|
|
457
|
+
# Re-add authtoken
|
|
458
|
+
ngrok config add-authtoken YOUR_TOKEN
|
|
459
|
+
|
|
460
|
+
# Verify in config
|
|
461
|
+
cat ~/.config/ngrok/ngrok.yml | grep authtoken
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
### Tunnel Connection Failed
|
|
465
|
+
|
|
466
|
+
Check logs:
|
|
467
|
+
|
|
468
|
+
```bash
|
|
469
|
+
tail -f /tmp/ngrok.log
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Port Already in Use
|
|
473
|
+
|
|
474
|
+
```bash
|
|
475
|
+
# Check what's using the port
|
|
476
|
+
lsof -i :4040
|
|
477
|
+
|
|
478
|
+
# Use different web interface port
|
|
479
|
+
ngrok http 3000 --web-addr localhost:4041
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
### Too Many Connections
|
|
483
|
+
|
|
484
|
+
Free plan limits to 40 connections/minute. Upgrade or wait.
|
|
485
|
+
|
|
486
|
+
### Domain Not Found
|
|
487
|
+
|
|
488
|
+
Ensure you're using the correct public URL from ngrok output.
|
|
489
|
+
|
|
490
|
+
## Alternatives
|
|
491
|
+
|
|
492
|
+
- **cloudflared** - Cloudflare Tunnel (free, unlimited)
|
|
493
|
+
- **localhost.run** - SSH-based tunneling (free, no signup)
|
|
494
|
+
- **serveo.net** - SSH-based tunneling (free)
|
|
495
|
+
- **Tailscale** - Private network tunneling (free for personal use)
|
|
496
|
+
|
|
497
|
+
## Additional Resources
|
|
498
|
+
|
|
499
|
+
- [ngrok Documentation](https://ngrok.com/docs)
|
|
500
|
+
- [ngrok Dashboard](https://dashboard.ngrok.com)
|
|
501
|
+
- [ngrok Pricing](https://ngrok.com/pricing)
|
|
502
|
+
- [ngrok API Reference](https://ngrok.com/docs/api)
|
|
503
|
+
- [Webhook Testing Guide](https://ngrok.com/docs/guides/webhook-testing)
|