container-superposition 0.1.1 β 0.1.4
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 +569 -8
- package/dist/scripts/init.js +436 -254
- package/dist/scripts/init.js.map +1 -1
- package/dist/tool/commands/doctor.d.ts +15 -0
- package/dist/tool/commands/doctor.d.ts.map +1 -0
- package/dist/tool/commands/doctor.js +862 -0
- package/dist/tool/commands/doctor.js.map +1 -0
- package/dist/tool/commands/explain.d.ts +13 -0
- package/dist/tool/commands/explain.d.ts.map +1 -0
- package/dist/tool/commands/explain.js +299 -0
- package/dist/tool/commands/explain.js.map +1 -0
- package/dist/tool/commands/list.d.ts +16 -0
- package/dist/tool/commands/list.d.ts.map +1 -0
- package/dist/tool/commands/list.js +121 -0
- package/dist/tool/commands/list.js.map +1 -0
- package/dist/tool/commands/plan.d.ts +67 -0
- package/dist/tool/commands/plan.d.ts.map +1 -0
- package/dist/tool/commands/plan.js +851 -0
- package/dist/tool/commands/plan.js.map +1 -0
- package/dist/tool/questionnaire/composer.d.ts +16 -2
- package/dist/tool/questionnaire/composer.d.ts.map +1 -1
- package/dist/tool/questionnaire/composer.js +411 -200
- package/dist/tool/questionnaire/composer.js.map +1 -1
- package/dist/tool/readme/markdown-parser.d.ts.map +1 -1
- package/dist/tool/readme/markdown-parser.js.map +1 -1
- package/dist/tool/readme/readme-generator.d.ts.map +1 -1
- package/dist/tool/readme/readme-generator.js +11 -6
- package/dist/tool/readme/readme-generator.js.map +1 -1
- package/dist/tool/schema/deployment-targets.d.ts +77 -0
- package/dist/tool/schema/deployment-targets.d.ts.map +1 -0
- package/dist/tool/schema/deployment-targets.js +91 -0
- package/dist/tool/schema/deployment-targets.js.map +1 -0
- package/dist/tool/schema/manifest-migrations.d.ts +51 -0
- package/dist/tool/schema/manifest-migrations.d.ts.map +1 -0
- package/dist/tool/schema/manifest-migrations.js +159 -0
- package/dist/tool/schema/manifest-migrations.js.map +1 -0
- package/dist/tool/schema/overlay-loader.d.ts +1 -1
- package/dist/tool/schema/overlay-loader.d.ts.map +1 -1
- package/dist/tool/schema/overlay-loader.js +42 -14
- package/dist/tool/schema/overlay-loader.js.map +1 -1
- package/dist/tool/schema/types.d.ts +62 -2
- package/dist/tool/schema/types.d.ts.map +1 -1
- package/dist/tool/utils/gitignore.d.ts +15 -0
- package/dist/tool/utils/gitignore.d.ts.map +1 -0
- package/dist/tool/utils/gitignore.js +41 -0
- package/dist/tool/utils/gitignore.js.map +1 -0
- package/dist/tool/utils/merge.d.ts +134 -0
- package/dist/tool/utils/merge.d.ts.map +1 -0
- package/dist/tool/utils/merge.js +277 -0
- package/dist/tool/utils/merge.js.map +1 -0
- package/dist/tool/utils/port-utils.d.ts +29 -0
- package/dist/tool/utils/port-utils.d.ts.map +1 -0
- package/dist/tool/utils/port-utils.js +128 -0
- package/dist/tool/utils/port-utils.js.map +1 -0
- package/dist/tool/utils/services-export.d.ts +14 -0
- package/dist/tool/utils/services-export.d.ts.map +1 -0
- package/dist/tool/utils/services-export.js +478 -0
- package/dist/tool/utils/services-export.js.map +1 -0
- package/dist/tool/utils/summary.d.ts +69 -0
- package/dist/tool/utils/summary.d.ts.map +1 -0
- package/dist/tool/utils/summary.js +260 -0
- package/dist/tool/utils/summary.js.map +1 -0
- package/dist/tool/utils/version.d.ts +9 -0
- package/dist/tool/utils/version.d.ts.map +1 -0
- package/dist/tool/utils/version.js +32 -0
- package/dist/tool/utils/version.js.map +1 -0
- package/docs/architecture.md +25 -21
- package/docs/deployment-targets.md +150 -0
- package/docs/discovery-commands.md +442 -0
- package/docs/merge-strategy.md +700 -0
- package/docs/minimal-and-editor.md +265 -0
- package/docs/overlay-imports.md +209 -0
- package/docs/overlay-manifest-refactoring.md +2 -2
- package/docs/overlay-metadata-archive.md +1 -1
- package/docs/overlays.md +139 -28
- package/docs/presets-architecture.md +3 -3
- package/docs/presets.md +1 -1
- package/docs/publishing.md +36 -35
- package/docs/team-workflow.md +540 -0
- package/overlays/.presets/data-engineering.yml +392 -0
- package/overlays/.presets/event-sourced-service.yml +262 -0
- package/overlays/.presets/frontend.yml +287 -0
- package/overlays/.presets/k8s-operator-dev.yml +462 -0
- package/overlays/{presets β .presets}/microservice.yml +32 -6
- package/overlays/.presets/web-api.yml +129 -0
- package/overlays/.registry/README.md +1 -1
- package/overlays/.registry/deployment-targets.yml +54 -0
- package/overlays/.shared/README.md +43 -0
- package/overlays/.shared/compose/common-healthchecks.yml +38 -0
- package/overlays/.shared/otel/instrumentation.env +20 -0
- package/overlays/.shared/otel/otel-base-config.yaml +30 -0
- package/overlays/.shared/vscode/recommended-extensions.json +14 -0
- package/overlays/README.md +1 -1
- package/overlays/cloudflared/README.md +190 -0
- package/overlays/cloudflared/devcontainer.patch.json +3 -0
- package/overlays/cloudflared/overlay.yml +15 -0
- package/overlays/cloudflared/setup.sh +49 -0
- package/overlays/cloudflared/verify.sh +21 -0
- package/overlays/codex/overlay.yml +1 -0
- package/overlays/direnv/README.md +6 -4
- package/overlays/direnv/setup.sh +0 -12
- package/overlays/duckdb/README.md +274 -0
- package/overlays/duckdb/devcontainer.patch.json +10 -0
- package/overlays/duckdb/overlay.yml +17 -0
- package/overlays/duckdb/setup.sh +45 -0
- package/overlays/duckdb/verify.sh +32 -0
- package/overlays/git-helpers/overlay.yml +1 -0
- package/overlays/grafana/README.md +5 -5
- package/overlays/grafana/dashboard-provider.yml +1 -1
- package/overlays/grafana/docker-compose.yml +2 -2
- package/overlays/grafana/overlay.yml +6 -1
- package/overlays/grpc-tools/README.md +242 -0
- package/overlays/grpc-tools/devcontainer.patch.json +14 -0
- package/overlays/grpc-tools/overlay.yml +14 -0
- package/overlays/grpc-tools/setup.sh +57 -0
- package/overlays/grpc-tools/verify.sh +47 -0
- package/overlays/jaeger/overlay.yml +16 -3
- package/overlays/jupyter/.env.example +6 -0
- package/overlays/jupyter/README.md +210 -0
- package/overlays/jupyter/devcontainer.patch.json +14 -0
- package/overlays/jupyter/docker-compose.yml +23 -0
- package/overlays/jupyter/overlay.yml +18 -0
- package/overlays/jupyter/verify.sh +35 -0
- package/overlays/keycloak/.env.example +5 -0
- package/overlays/keycloak/README.md +238 -0
- package/overlays/keycloak/devcontainer.patch.json +17 -0
- package/overlays/keycloak/docker-compose.yml +32 -0
- package/overlays/keycloak/overlay.yml +23 -0
- package/overlays/keycloak/verify.sh +54 -0
- package/overlays/kind/README.md +221 -0
- package/overlays/kind/devcontainer.patch.json +10 -0
- package/overlays/kind/overlay.yml +18 -0
- package/overlays/kind/setup.sh +43 -0
- package/overlays/kind/verify.sh +40 -0
- package/overlays/localstack/.env.example +6 -0
- package/overlays/localstack/README.md +188 -0
- package/overlays/localstack/devcontainer.patch.json +21 -0
- package/overlays/localstack/docker-compose.yml +25 -0
- package/overlays/localstack/overlay.yml +18 -0
- package/overlays/localstack/verify.sh +47 -0
- package/overlays/loki/overlay.yml +6 -1
- package/overlays/mailpit/.env.example +4 -0
- package/overlays/mailpit/README.md +191 -0
- package/overlays/mailpit/devcontainer.patch.json +20 -0
- package/overlays/mailpit/docker-compose.yml +17 -0
- package/overlays/mailpit/overlay.yml +26 -0
- package/overlays/mailpit/verify.sh +52 -0
- package/overlays/modern-cli-tools/overlay.yml +1 -0
- package/overlays/mongodb/overlay.yml +12 -2
- package/overlays/mysql/overlay.yml +12 -2
- package/overlays/nats/overlay.yml +12 -2
- package/overlays/ngrok/overlay.yml +2 -1
- package/overlays/openapi-tools/README.md +243 -0
- package/overlays/openapi-tools/devcontainer.patch.json +10 -0
- package/overlays/openapi-tools/overlay.yml +16 -0
- package/overlays/openapi-tools/setup.sh +45 -0
- package/overlays/openapi-tools/verify.sh +51 -0
- package/overlays/otel-collector/overlay.yml.example +26 -0
- package/overlays/postgres/overlay.yml +6 -1
- package/overlays/prometheus/overlay.yml +6 -1
- package/overlays/python/README.md +51 -35
- package/overlays/python/devcontainer.patch.json +7 -4
- package/overlays/python/setup.sh +50 -23
- package/overlays/python/verify.sh +29 -1
- package/overlays/rabbitmq/overlay.yml +12 -2
- package/overlays/redis/overlay.yml +6 -1
- package/overlays/tilt/README.md +259 -0
- package/overlays/tilt/devcontainer.patch.json +17 -0
- package/overlays/tilt/overlay.yml +19 -0
- package/overlays/tilt/setup.sh +25 -0
- package/overlays/tilt/verify.sh +24 -0
- package/package.json +8 -6
- package/tool/README.md +12 -16
- package/tool/schema/overlay-manifest.schema.json +64 -4
- package/tool/schema/superposition-manifest.schema.json +104 -0
- package/overlays/presets/web-api.yml +0 -109
- /package/overlays/{presets β .presets}/docs-site.yml +0 -0
- /package/overlays/{presets β .presets}/fullstack.yml +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Shared Overlay Configurations
|
|
2
|
+
|
|
3
|
+
This directory contains shared configuration fragments that can be imported by multiple overlays to reduce duplication and ensure consistency.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
.shared/
|
|
9
|
+
βββ otel/ # OpenTelemetry configurations
|
|
10
|
+
βββ compose/ # Docker Compose patterns (healthchecks, etc.)
|
|
11
|
+
βββ vscode/ # VS Code extension sets
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Overlays can import shared files by adding them to the `imports` field in `overlay.yml`:
|
|
17
|
+
|
|
18
|
+
```yaml
|
|
19
|
+
id: prometheus
|
|
20
|
+
imports:
|
|
21
|
+
- .shared/otel/otel-base-config.yaml
|
|
22
|
+
- .shared/compose/common-healthchecks.yml
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Benefits
|
|
26
|
+
|
|
27
|
+
- **DRY (Don't Repeat Yourself)**: Common patterns defined once
|
|
28
|
+
- **Consistency**: All overlays using the same shared config stay in sync
|
|
29
|
+
- **Maintainability**: Update shared config once, all overlays benefit
|
|
30
|
+
- **Best Practices**: Shared configs embody proven patterns
|
|
31
|
+
|
|
32
|
+
## Creating Shared Configs
|
|
33
|
+
|
|
34
|
+
1. Identify common patterns across overlays
|
|
35
|
+
2. Extract to appropriate `.shared/` subdirectory
|
|
36
|
+
3. Update overlays to import the shared file
|
|
37
|
+
4. Test that imports work correctly
|
|
38
|
+
|
|
39
|
+
## Import Resolution
|
|
40
|
+
|
|
41
|
+
- Imports are resolved relative to the `overlays/` directory
|
|
42
|
+
- Shared files are merged into the overlay during composition
|
|
43
|
+
- Files are applied in the order they are listed
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Common Docker Compose Healthcheck Patterns
|
|
2
|
+
# These can be referenced by overlays to ensure consistent healthcheck configuration
|
|
3
|
+
|
|
4
|
+
healthchecks:
|
|
5
|
+
http:
|
|
6
|
+
test: ['CMD-SHELL', 'curl -f http://localhost:${PORT}/health || exit 1']
|
|
7
|
+
interval: 30s
|
|
8
|
+
timeout: 10s
|
|
9
|
+
retries: 3
|
|
10
|
+
start_period: 40s
|
|
11
|
+
|
|
12
|
+
postgres:
|
|
13
|
+
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-postgres}']
|
|
14
|
+
interval: 10s
|
|
15
|
+
timeout: 5s
|
|
16
|
+
retries: 5
|
|
17
|
+
start_period: 10s
|
|
18
|
+
|
|
19
|
+
redis:
|
|
20
|
+
test: ['CMD', 'redis-cli', 'ping']
|
|
21
|
+
interval: 10s
|
|
22
|
+
timeout: 5s
|
|
23
|
+
retries: 5
|
|
24
|
+
start_period: 10s
|
|
25
|
+
|
|
26
|
+
mongodb:
|
|
27
|
+
test: ['CMD', 'mongosh', '--eval', "db.adminCommand('ping')"]
|
|
28
|
+
interval: 10s
|
|
29
|
+
timeout: 5s
|
|
30
|
+
retries: 5
|
|
31
|
+
start_period: 10s
|
|
32
|
+
|
|
33
|
+
mysql:
|
|
34
|
+
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
|
|
35
|
+
interval: 10s
|
|
36
|
+
timeout: 5s
|
|
37
|
+
retries: 5
|
|
38
|
+
start_period: 10s
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# OpenTelemetry Instrumentation Environment Variables
|
|
2
|
+
# Common variables for language-specific auto-instrumentation
|
|
3
|
+
|
|
4
|
+
# OTEL SDK Configuration
|
|
5
|
+
OTEL_SERVICE_NAME=my-service
|
|
6
|
+
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
|
|
7
|
+
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
|
|
8
|
+
|
|
9
|
+
# Resource Attributes
|
|
10
|
+
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=development
|
|
11
|
+
|
|
12
|
+
# Trace Configuration
|
|
13
|
+
OTEL_TRACES_SAMPLER=always_on
|
|
14
|
+
OTEL_TRACES_EXPORTER=otlp
|
|
15
|
+
|
|
16
|
+
# Metrics Configuration
|
|
17
|
+
OTEL_METRICS_EXPORTER=otlp
|
|
18
|
+
|
|
19
|
+
# Logs Configuration
|
|
20
|
+
OTEL_LOGS_EXPORTER=otlp
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# OpenTelemetry Base Configuration
|
|
2
|
+
# This file provides common OTEL environment variables for instrumentation
|
|
3
|
+
|
|
4
|
+
receivers:
|
|
5
|
+
otlp:
|
|
6
|
+
protocols:
|
|
7
|
+
grpc:
|
|
8
|
+
endpoint: 0.0.0.0:4317
|
|
9
|
+
http:
|
|
10
|
+
endpoint: 0.0.0.0:4318
|
|
11
|
+
|
|
12
|
+
exporters:
|
|
13
|
+
logging:
|
|
14
|
+
loglevel: debug
|
|
15
|
+
|
|
16
|
+
processors:
|
|
17
|
+
batch:
|
|
18
|
+
timeout: 10s
|
|
19
|
+
send_batch_size: 1024
|
|
20
|
+
|
|
21
|
+
service:
|
|
22
|
+
pipelines:
|
|
23
|
+
traces:
|
|
24
|
+
receivers: [otlp]
|
|
25
|
+
processors: [batch]
|
|
26
|
+
exporters: [logging]
|
|
27
|
+
metrics:
|
|
28
|
+
receivers: [otlp]
|
|
29
|
+
processors: [batch]
|
|
30
|
+
exporters: [logging]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Commonly recommended VS Code extensions across overlays",
|
|
3
|
+
"extensions": {
|
|
4
|
+
"productivity": [
|
|
5
|
+
"streetsidesoftware.code-spell-checker",
|
|
6
|
+
"usernamehw.errorlens",
|
|
7
|
+
"eamodio.gitlens"
|
|
8
|
+
],
|
|
9
|
+
"formatting": ["editorconfig.editorconfig", "esbenp.prettier-vscode"],
|
|
10
|
+
"docker": ["ms-azuretools.vscode-docker"],
|
|
11
|
+
"yaml": ["redhat.vscode-yaml"],
|
|
12
|
+
"markdown": ["yzhang.markdown-all-in-one", "davidanson.vscode-markdownlint"]
|
|
13
|
+
}
|
|
14
|
+
}
|
package/overlays/README.md
CHANGED
|
@@ -150,6 +150,6 @@ See [Creating Overlays Guide](../docs/creating-overlays.md) for complete documen
|
|
|
150
150
|
|
|
151
151
|
## Presets (Meta-Overlays)
|
|
152
152
|
|
|
153
|
-
Presets are special meta-overlays that select combinations of overlays for common scenarios (web-api, microservice, docs-site, fullstack). They're located in `overlays
|
|
153
|
+
Presets are special meta-overlays that select combinations of overlays for common scenarios (web-api, microservice, docs-site, fullstack). They're located in `overlays/.presets/*.yml`.
|
|
154
154
|
|
|
155
155
|
See [Presets Guide](../docs/presets.md) and [Presets Architecture](../docs/presets-architecture.md) for detailed documentation on creating and using presets.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Cloudflared Overlay
|
|
2
|
+
|
|
3
|
+
Cloudflare Tunnel for securely exposing local services to the internet β no port forwarding or firewall configuration required.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **cloudflared** - Cloudflare's tunneling daemon
|
|
8
|
+
- **No account required** - Anonymous tunnels work immediately
|
|
9
|
+
- **Free** - Generous free tier with no connection limits
|
|
10
|
+
- **Named tunnels** - Persistent URLs with a Cloudflare account (optional)
|
|
11
|
+
- **HTTPS by default** - All tunnels use TLS automatically
|
|
12
|
+
|
|
13
|
+
## How It Works
|
|
14
|
+
|
|
15
|
+
`cloudflared` creates an outbound-only connection from your dev container to Cloudflare's edge network. Incoming requests are routed through Cloudflare to your local service β no inbound firewall rules needed.
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Expose your local web server (no account required)
|
|
21
|
+
cloudflared tunnel --url http://localhost:3000
|
|
22
|
+
|
|
23
|
+
# Output:
|
|
24
|
+
# +--------------------------------------------------------------------------------------------+
|
|
25
|
+
# | Your quick Tunnel has been created! Visit it at (it may take some time to be reachable): |
|
|
26
|
+
# | https://random-words-here.trycloudflare.com |
|
|
27
|
+
# +--------------------------------------------------------------------------------------------+
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Common Commands
|
|
31
|
+
|
|
32
|
+
### Anonymous Tunnel (No Account)
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# HTTP service
|
|
36
|
+
cloudflared tunnel --url http://localhost:3000
|
|
37
|
+
|
|
38
|
+
# HTTPS service (pass through TLS)
|
|
39
|
+
cloudflared tunnel --url https://localhost:8443
|
|
40
|
+
|
|
41
|
+
# Custom local port
|
|
42
|
+
cloudflared tunnel --url http://localhost:8080
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Named Tunnel (Requires Cloudflare Account)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# 1. Log in to Cloudflare
|
|
49
|
+
cloudflared login
|
|
50
|
+
|
|
51
|
+
# 2. Create a named tunnel
|
|
52
|
+
cloudflared tunnel create my-dev-tunnel
|
|
53
|
+
|
|
54
|
+
# 3. Route traffic to a domain you own
|
|
55
|
+
cloudflared tunnel route dns my-dev-tunnel dev.yourdomain.com
|
|
56
|
+
|
|
57
|
+
# 4. Run the tunnel
|
|
58
|
+
cloudflared tunnel run my-dev-tunnel
|
|
59
|
+
|
|
60
|
+
# Run with a specific URL
|
|
61
|
+
cloudflared tunnel --url http://localhost:3000 run my-dev-tunnel
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Configuration File
|
|
65
|
+
|
|
66
|
+
Create `~/.cloudflared/config.yml` for persistent configuration:
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
tunnel: my-dev-tunnel
|
|
70
|
+
credentials-file: /home/user/.cloudflared/<tunnel-id>.json
|
|
71
|
+
|
|
72
|
+
ingress:
|
|
73
|
+
- hostname: dev.yourdomain.com
|
|
74
|
+
service: http://localhost:3000
|
|
75
|
+
- hostname: api.yourdomain.com
|
|
76
|
+
service: http://localhost:8080
|
|
77
|
+
- service: http_status:404
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Run using config file
|
|
82
|
+
cloudflared tunnel run
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Status and Diagnostics
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Check version
|
|
89
|
+
cloudflared --version
|
|
90
|
+
|
|
91
|
+
# List your tunnels (requires login)
|
|
92
|
+
cloudflared tunnel list
|
|
93
|
+
|
|
94
|
+
# Get tunnel info
|
|
95
|
+
cloudflared tunnel info my-dev-tunnel
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Use Cases
|
|
99
|
+
|
|
100
|
+
- **Webhook testing** - Receive webhooks from GitHub, Stripe, Twilio, etc.
|
|
101
|
+
- **Mobile device testing** - Test your app on real devices without complex setup
|
|
102
|
+
- **Demo sharing** - Share work-in-progress with clients or colleagues
|
|
103
|
+
- **OAuth callbacks** - Test OAuth flows that require a public redirect URI
|
|
104
|
+
- **Long-running tunnels** - More stable than temporary ngrok tunnels
|
|
105
|
+
|
|
106
|
+
## Webhook Testing Examples
|
|
107
|
+
|
|
108
|
+
### GitHub Webhooks
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# 1. Start tunnel
|
|
112
|
+
cloudflared tunnel --url http://localhost:3000
|
|
113
|
+
|
|
114
|
+
# 2. Copy the *.trycloudflare.com URL
|
|
115
|
+
# 3. Add webhook in GitHub: Settings β Webhooks β Add webhook
|
|
116
|
+
# Payload URL: https://random-words.trycloudflare.com/webhook
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Stripe Webhooks
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Start tunnel
|
|
123
|
+
cloudflared tunnel --url http://localhost:4242
|
|
124
|
+
|
|
125
|
+
# Configure Stripe webhook:
|
|
126
|
+
# Dashboard β Developers β Webhooks β Add endpoint
|
|
127
|
+
# URL: https://random-words.trycloudflare.com/stripe/webhook
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Benefits vs ngrok
|
|
131
|
+
|
|
132
|
+
| Feature | Cloudflared (this overlay) | ngrok |
|
|
133
|
+
| -------------------------- | -------------------------- | --------------------- |
|
|
134
|
+
| **Account required** | No (anonymous tunnels) | Yes |
|
|
135
|
+
| **Free tier limits** | No limits (anonymous) | 40 connections/minute |
|
|
136
|
+
| **Persistent URL (free)** | No (random per session) | No |
|
|
137
|
+
| **Named tunnels** | Yes (with account) | Yes (paid) |
|
|
138
|
+
| **Traffic inspector UI** | No | Yes (port 4040) |
|
|
139
|
+
| **Cloudflare integration** | β
Native | No |
|
|
140
|
+
| **Connection stability** | Very stable | Good |
|
|
141
|
+
|
|
142
|
+
## Security Considerations
|
|
143
|
+
|
|
144
|
+
β οΈ When exposing local services to the internet:
|
|
145
|
+
|
|
146
|
+
- Cloudflared exposes your local service to public internet traffic
|
|
147
|
+
- Use HTTPS endpoints when possible
|
|
148
|
+
- Do not expose services with sensitive data without authentication
|
|
149
|
+
- Anonymous tunnels are not persistent β URL changes each session
|
|
150
|
+
|
|
151
|
+
## Troubleshooting
|
|
152
|
+
|
|
153
|
+
### Tunnel not starting
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Check cloudflared version
|
|
157
|
+
cloudflared --version
|
|
158
|
+
|
|
159
|
+
# Run with verbose logging
|
|
160
|
+
cloudflared tunnel --url http://localhost:3000 --loglevel debug
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Connection refused
|
|
164
|
+
|
|
165
|
+
Ensure your local service is running and listening on the specified port:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Check if service is listening
|
|
169
|
+
curl http://localhost:3000
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Named tunnel errors
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Re-authenticate
|
|
176
|
+
cloudflared login
|
|
177
|
+
|
|
178
|
+
# List tunnels to verify it exists
|
|
179
|
+
cloudflared tunnel list
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## References
|
|
183
|
+
|
|
184
|
+
- [Cloudflare Tunnel Documentation](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/)
|
|
185
|
+
- [cloudflared GitHub](https://github.com/cloudflare/cloudflared)
|
|
186
|
+
- [Cloudflare Free Tunnel Guide](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/trycloudflare/)
|
|
187
|
+
|
|
188
|
+
**Related Overlays:**
|
|
189
|
+
|
|
190
|
+
- `ngrok` - Alternative tunneling tool (conflicts with this overlay)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
id: cloudflared
|
|
2
|
+
name: Cloudflared
|
|
3
|
+
description: Cloudflare Tunnel for securely exposing local services to the internet
|
|
4
|
+
category: dev
|
|
5
|
+
supports: []
|
|
6
|
+
requires: []
|
|
7
|
+
suggests: []
|
|
8
|
+
conflicts:
|
|
9
|
+
- ngrok
|
|
10
|
+
tags:
|
|
11
|
+
- dev
|
|
12
|
+
- tunneling
|
|
13
|
+
- proxy
|
|
14
|
+
- cloudflare
|
|
15
|
+
ports: []
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Cloudflared setup script
|
|
3
|
+
# Installs cloudflared from official repository
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "π Setting up Cloudflared..."
|
|
8
|
+
|
|
9
|
+
# Install cloudflared using official package
|
|
10
|
+
echo "π¦ Installing cloudflared..."
|
|
11
|
+
|
|
12
|
+
# Pin to a specific version for reproducibility and security
|
|
13
|
+
# Check https://github.com/cloudflare/cloudflared/releases for newer versions
|
|
14
|
+
CF_VERSION="${CLOUDFLARED_VERSION:-2025.2.1}"
|
|
15
|
+
|
|
16
|
+
# Detect architecture
|
|
17
|
+
ARCH=$(uname -m)
|
|
18
|
+
case "$ARCH" in
|
|
19
|
+
x86_64) CF_ARCH="amd64" ;;
|
|
20
|
+
aarch64 | arm64) CF_ARCH="arm64" ;;
|
|
21
|
+
*) echo " β οΈ Unsupported architecture: $ARCH" ; CF_ARCH="amd64" ;;
|
|
22
|
+
esac
|
|
23
|
+
|
|
24
|
+
CF_URL="https://github.com/cloudflare/cloudflared/releases/download/${CF_VERSION}/cloudflared-linux-${CF_ARCH}"
|
|
25
|
+
curl -sSL "$CF_URL" -o /tmp/cloudflared
|
|
26
|
+
sudo install -m 755 /tmp/cloudflared /usr/local/bin/cloudflared
|
|
27
|
+
rm -f /tmp/cloudflared
|
|
28
|
+
|
|
29
|
+
# Verify installation
|
|
30
|
+
if command -v cloudflared &> /dev/null; then
|
|
31
|
+
echo " β
cloudflared installed: $(cloudflared --version)"
|
|
32
|
+
else
|
|
33
|
+
echo " β cloudflared installation failed"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
echo ""
|
|
38
|
+
echo "β
Cloudflared setup complete"
|
|
39
|
+
echo ""
|
|
40
|
+
echo "π‘ Quick start (no account required):"
|
|
41
|
+
echo " cloudflared tunnel --url http://localhost:3000"
|
|
42
|
+
echo ""
|
|
43
|
+
echo "π‘ Named tunnel (persistent URL, requires Cloudflare account):"
|
|
44
|
+
echo " cloudflared login"
|
|
45
|
+
echo " cloudflared tunnel create my-tunnel"
|
|
46
|
+
echo " cloudflared tunnel route dns my-tunnel myapp.example.com"
|
|
47
|
+
echo " cloudflared tunnel run my-tunnel"
|
|
48
|
+
echo ""
|
|
49
|
+
echo "π Documentation: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Verification script for Cloudflared overlay
|
|
3
|
+
# Confirms cloudflared is installed
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "π Verifying Cloudflared overlay..."
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# Check cloudflared
|
|
11
|
+
echo "1οΈβ£ Checking cloudflared..."
|
|
12
|
+
if command -v cloudflared &> /dev/null; then
|
|
13
|
+
echo " β
cloudflared found: $(cloudflared --version)"
|
|
14
|
+
else
|
|
15
|
+
echo " β cloudflared not found"
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
echo ""
|
|
20
|
+
echo "β
Cloudflared overlay verification complete"
|
|
21
|
+
echo " Quick start: cloudflared tunnel --url http://localhost:3000"
|
|
@@ -214,7 +214,7 @@ dotenv_if_exists .env
|
|
|
214
214
|
source_env_if_exists .envrc.local
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
Create `.envrc.local` (
|
|
217
|
+
Create `.envrc.local` (automatically gitignored at generation time):
|
|
218
218
|
|
|
219
219
|
```bash
|
|
220
220
|
export PERSONAL_API_KEY="my-secret-key"
|
|
@@ -293,7 +293,7 @@ export NODE_ENV="development"
|
|
|
293
293
|
dotenv_if_exists .env
|
|
294
294
|
```
|
|
295
295
|
|
|
296
|
-
**.env** - Do NOT commit (
|
|
296
|
+
**.env** - Do NOT commit (automatically gitignored at generation time):
|
|
297
297
|
|
|
298
298
|
```bash
|
|
299
299
|
# Secrets - never commit
|
|
@@ -447,16 +447,18 @@ Settings are automatically loaded. Reload window if needed:
|
|
|
447
447
|
|
|
448
448
|
### Git
|
|
449
449
|
|
|
450
|
-
|
|
450
|
+
When this overlay is selected, the following patterns are automatically added to your projectβs `.gitignore` at generation time β no manual step required:
|
|
451
451
|
|
|
452
452
|
```bash
|
|
453
|
-
# .gitignore
|
|
453
|
+
# .gitignore (managed automatically)
|
|
454
454
|
.env
|
|
455
455
|
.env.local
|
|
456
456
|
.envrc.local
|
|
457
457
|
.direnv/
|
|
458
458
|
```
|
|
459
459
|
|
|
460
|
+
This ensures environment secrets are never accidentally committed.
|
|
461
|
+
|
|
460
462
|
### Docker Compose
|
|
461
463
|
|
|
462
464
|
```bash
|
package/overlays/direnv/setup.sh
CHANGED
|
@@ -117,18 +117,6 @@ EOF
|
|
|
117
117
|
echo "β Sample .env.example created"
|
|
118
118
|
fi
|
|
119
119
|
|
|
120
|
-
# Create .gitignore entries for environment files
|
|
121
|
-
if [ -f .gitignore ]; then
|
|
122
|
-
if ! grep -q ".envrc" .gitignore; then
|
|
123
|
-
echo "" >> .gitignore
|
|
124
|
-
echo "# Direnv" >> .gitignore
|
|
125
|
-
echo ".envrc.local" >> .gitignore
|
|
126
|
-
echo ".env" >> .gitignore
|
|
127
|
-
echo ".env.local" >> .gitignore
|
|
128
|
-
echo "β Added direnv entries to .gitignore"
|
|
129
|
-
fi
|
|
130
|
-
fi
|
|
131
|
-
|
|
132
120
|
echo "β direnv setup complete"
|
|
133
121
|
echo ""
|
|
134
122
|
echo "π‘ Usage:"
|