go-duck-cli 1.0.9 → 1.1.12
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 +30 -15
- package/generators/ai_docs.js +130 -0
- package/generators/broker.js +63 -0
- package/generators/config.js +149 -7
- package/generators/devops.js +210 -43
- package/generators/docs.js +23 -4
- package/generators/elasticsearch.js +263 -0
- package/generators/kratos.js +229 -41
- package/generators/metering.js +280 -48
- package/generators/migrations.js +92 -198
- package/generators/mqtt.js +2 -39
- package/generators/multitenancy.js +274 -71
- package/generators/nats.js +39 -0
- package/generators/outbox.js +171 -0
- package/generators/postgrest.js +7 -3
- package/generators/postman.js +405 -0
- package/generators/repository.js +27 -0
- package/generators/router.js +27 -0
- package/generators/security.js +95 -14
- package/generators/serverless.js +147 -0
- package/generators/storage.js +589 -0
- package/generators/swagger.js +84 -60
- package/generators/telemetry.js +23 -32
- package/generators/websocket.js +55 -21
- package/index.js +493 -116
- package/package.json +6 -4
- package/parser/gdl.js +163 -24
- package/templates/docs/index.html.hbs +5 -5
- package/templates/docs/layout.hbs +221 -62
- package/templates/docs/pages/audit.hbs +83 -35
- package/templates/docs/pages/cli.hbs +18 -0
- package/templates/docs/pages/configuration.hbs +241 -0
- package/templates/docs/pages/datadog.hbs +46 -0
- package/templates/docs/pages/elasticsearch.hbs +121 -0
- package/templates/docs/pages/federation.hbs +241 -0
- package/templates/docs/pages/gdl-advanced.hbs +91 -0
- package/templates/docs/pages/gdl-annotations.hbs +137 -0
- package/templates/docs/pages/gdl-entities.hbs +134 -0
- package/templates/docs/pages/gdl-relationships.hbs +80 -0
- package/templates/docs/pages/gdl.hbs +60 -204
- package/templates/docs/pages/graphql.hbs +58 -44
- package/templates/docs/pages/grpc.hbs +53 -90
- package/templates/docs/pages/hybrid-store.hbs +127 -0
- package/templates/docs/pages/index.hbs +418 -149
- package/templates/docs/pages/keycloak.hbs +43 -0
- package/templates/docs/pages/legend.hbs +116 -0
- package/templates/docs/pages/mosquitto.hbs +39 -0
- package/templates/docs/pages/multitenancy.hbs +139 -71
- package/templates/docs/pages/otel.hbs +40 -0
- package/templates/docs/pages/realtime.hbs +38 -12
- package/templates/docs/pages/redis.hbs +40 -0
- package/templates/docs/pages/rest.hbs +120 -202
- package/templates/docs/pages/saga.hbs +94 -0
- package/templates/docs/pages/security.hbs +150 -44
- package/templates/docs/pages/serverless.hbs +157 -0
- package/templates/docs/pages/storage.hbs +127 -0
- package/templates/docs/pages/wizard.hbs +683 -0
- package/templates/docs/triple_identity_registry.png +0 -0
- package/templates/go/controller.go.hbs +287 -283
- package/templates/go/entity.go.hbs +17 -15
- package/templates/go/main.go.hbs +47 -180
- package/templates/go/migrator.go.hbs +65 -0
- package/templates/go/router.go.hbs +272 -0
- package/templates/graphql/resolver.go.hbs +53 -34
- package/templates/graphql/schema.graphql.hbs +17 -5
- package/templates/kratos/service.go.hbs +169 -34
- package/templates/proto/entity.proto.hbs +10 -14
- package/test_nested.gdl +21 -0
- package/templates/docs/intro.mp4 +0 -0
- package/test_parser.js +0 -9
|
@@ -1,51 +1,157 @@
|
|
|
1
|
-
<
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<p class="text-indigo-900"><strong>Golden Rule:</strong> In <code>application-dev.yml</code>, ensure your Keycloak Realm, ClientID, and Secret are accurately synced with the local running Docker Keycloak image.</p>
|
|
1
|
+
<div class="prose prose-slate max-w-none">
|
|
2
|
+
<div class="flex items-center space-x-3 mb-8 text-black">
|
|
3
|
+
<div class="p-4 bg-gradient-to-br from-slate-800 to-black rounded-2xl shadow-xl shadow-slate-200">
|
|
4
|
+
<svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
5
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
|
|
6
|
+
</svg>
|
|
7
|
+
</div>
|
|
8
|
+
<h1 class="text-5xl font-black text-slate-900 m-0 tracking-tighter leading-none">Zero-Trust Identity</h1>
|
|
10
9
|
</div>
|
|
11
10
|
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
GO-DUCK implements <strong>Enterprise-Grade Data Isolation</strong>. While the <code>X-Tenant-ID</code> header is required for request context, the system is immune to "Tenant Spoofing" attacks.
|
|
11
|
+
<p class="text-2xl text-slate-500 font-medium mb-12 leading-relaxed">
|
|
12
|
+
GO-DUCK enforces a battle-hardened, identity-first firewall. Built on standard OIDC, our zero-trust architecture ensures every request is verified, authorized, and traced from the gateway to the database.
|
|
15
13
|
</p>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
|
|
15
|
+
<!-- Key Security Pillars -->
|
|
16
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-20 px-4">
|
|
17
|
+
<div class="p-8 bg-white rounded-3xl border border-slate-200 shadow-sm border-t-8 border-t-indigo-600">
|
|
18
|
+
<h5 class="font-black text-slate-900 mb-2 uppercase text-xs tracking-widest">OIDC Hardened</h5>
|
|
19
|
+
<p class="text-sm text-slate-600 leading-relaxed font-medium">Native integration with Keycloak for real-time JWT validation and anti-spoofing context verification.</p>
|
|
22
20
|
</div>
|
|
23
|
-
<div class="bg-
|
|
24
|
-
<
|
|
25
|
-
<p class="text-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</
|
|
21
|
+
<div class="p-8 bg-white rounded-3xl border border-slate-200 shadow-sm border-t-8 border-t-emerald-600">
|
|
22
|
+
<h5 class="font-black text-slate-900 mb-2 uppercase text-xs tracking-widest">RSA Signed WebSocket</h5>
|
|
23
|
+
<p class="text-sm text-slate-600 leading-relaxed font-medium">Secure "REST-over-WS" implementation using HMAC-SHA256 signatures for total message integrity.</p>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="p-8 bg-white rounded-3xl border border-slate-200 shadow-sm border-t-8 border-t-rose-600">
|
|
26
|
+
<h5 class="font-black text-slate-900 mb-2 uppercase text-xs tracking-widest">Zero-Trust Multi-Tenancy</h5>
|
|
27
|
+
<p class="text-sm text-slate-600 leading-relaxed font-medium">No cross-tenant data leakage. Identity automatically selects the secure silo at the middleware layer.</p>
|
|
29
28
|
</div>
|
|
30
29
|
</div>
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
31
|
+
<!-- Identity Lifecycle Section -->
|
|
32
|
+
<section class="mb-20">
|
|
33
|
+
<h2 class="text-3xl font-black text-slate-900 mb-8 tracking-tighter italic uppercase text-center decoration-slate-400 underline underline-offset-8">The Secure Lifecycle</h2>
|
|
34
|
+
<div class="space-y-6">
|
|
35
|
+
<div class="bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-2xl relative overflow-hidden flex flex-col md:flex-row gap-12 group hover:scale-[1.01] transition-transform duration-300">
|
|
36
|
+
<div class="flex-shrink-0">
|
|
37
|
+
<div class="text-[5rem] font-black text-slate-800 absolute -left-10 -top-5 opacity-40 pointer-events-none group-hover:scale-110 duration-500 italic">01</div>
|
|
38
|
+
<h2 class="text-3xl font-black mb-6 relative">Protocol Verification</h2>
|
|
39
|
+
<p class="text-indigo-200 mb-6 leading-relaxed max-w-sm">Every request—HTTP, gRPC, or WebSocket—is challenged for a valid OIDC identity. The generator automatically scaffolds the necessary middleware for each protocol.</p>
|
|
40
|
+
<div class="flex gap-2">
|
|
41
|
+
<span class="px-3 py-1 bg-white/10 rounded-lg text-xs font-bold font-mono tracking-widest text-indigo-300">gin.jwt</span>
|
|
42
|
+
<span class="px-3 py-1 bg-white/10 rounded-lg text-xs font-bold font-mono tracking-widest text-indigo-300">kratos.authn</span>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="flex-grow p-6 bg-slate-800/50 rounded-3xl border border-slate-700/50 backdrop-blur-sm self-center">
|
|
46
|
+
<pre class="text-xs text-green-300 leading-relaxed whitespace-pre font-mono">
|
|
47
|
+
<span class="text-slate-500">// Example: JWTMiddleware automatically extracting Federated Role</span>
|
|
48
|
+
authHeader := ctx.GetHeader("Authorization")
|
|
49
|
+
claims, _ := keycloak.Verify(authHeader)
|
|
50
|
+
|
|
51
|
+
<span class="text-slate-500">// Silo matching happens here!</span>
|
|
52
|
+
siloID := MapRoleToSilo(claims.RealmRole)
|
|
53
|
+
</pre>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</section>
|
|
58
|
+
<!-- Silo Discovery & Privacy -->
|
|
59
|
+
<section class="mb-20">
|
|
60
|
+
<h2 class="text-3xl font-black text-slate-900 mb-8 tracking-tighter italic uppercase text-center decoration-slate-400 underline underline-offset-8">Silo Discovery & Privacy</h2>
|
|
61
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 px-4">
|
|
62
|
+
<div class="p-8 bg-slate-50 border border-slate-200 rounded-[2.5rem] shadow-sm italic hover:bg-white transition-all">
|
|
63
|
+
<h3 class="text-xl font-bold text-slate-900 mb-4">Silo Discovery API</h3>
|
|
64
|
+
<p class="text-slate-600 text-sm leading-relaxed mb-6 italic">
|
|
65
|
+
Authenticated users can discover their accessible silos via <code>GET /api/silos/me</code>. This allows front-end applications to build dynamic tenant selection interfaces.
|
|
66
|
+
</p>
|
|
67
|
+
<div class="p-4 bg-white rounded-2xl border border-slate-200 text-[11px] font-mono text-blue-800">
|
|
68
|
+
GET /api/silos/me<br>
|
|
69
|
+
[<br>
|
|
70
|
+
{ "tenantId": "bc72-91a0...", "roleName": "branch_usa" }<br>
|
|
71
|
+
]
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div class="p-8 bg-slate-900 border border-slate-800 rounded-[2.5rem] text-white shadow-xl italic relative overflow-hidden group">
|
|
76
|
+
<div class="relative z-10">
|
|
77
|
+
<h3 class="text-xl font-bold mb-4 text-emerald-400 shadow-emerald-400">HideSiloNames Toggle</h3>
|
|
78
|
+
<p class="text-slate-400 text-sm leading-relaxed mb-6 italic">
|
|
79
|
+
For maximum zero-trust compliance, you can hide internal <strong>DB-Names</strong> from the discovery API by enabling the <code>HideSiloNames</code> toggle in <code>application.yml</code>.
|
|
80
|
+
</p>
|
|
81
|
+
<div class="p-4 bg-white/5 rounded-2xl border border-white/10 text-[11px] font-mono text-emerald-300">
|
|
82
|
+
go-duck:<br>
|
|
83
|
+
multitenancy:<br>
|
|
84
|
+
hide-silo-names: true
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</section>
|
|
90
|
+
|
|
91
|
+
<!-- Anti-Burst Rate Limiting Module -->
|
|
92
|
+
<section class="mb-20">
|
|
93
|
+
<div class="bg-gradient-to-r from-red-900 to-black rounded-[2.5rem] p-16 text-white text-center shadow-2xl relative overflow-hidden group">
|
|
94
|
+
<h2 class="text-4xl font-black mb-6 tracking-tight">Anti-Burst Shielding <br><span class="text-rose-500 italic font-medium">Distributed Protection.</span></h2>
|
|
95
|
+
<p class="text-rose-100 text-lg mb-10 max-w-3xl mx-auto leading-relaxed italic">
|
|
96
|
+
Protect your infrastructure from "Noisy Neighbors" and NAT spoofing. Our Distributed Redis Rate Limiter tracks clients by <strong>Keycloak UserID</strong>—ensuring that limiting persists even if a user switches IPs or devices.
|
|
97
|
+
</p>
|
|
98
|
+
<div class="flex flex-col md:flex-row gap-6 justify-center">
|
|
99
|
+
<div class="px-8 py-4 bg-white/10 rounded-2xl border border-white/10 flex flex-col items-center group-hover:bg-white/20 transition-all duration-300">
|
|
100
|
+
<span class="text-red-400 font-black text-2xl uppercase italic">Redis-Backed</span>
|
|
101
|
+
<span class="text-xs text-white/50 tracking-[0.2em] font-bold">Fixed-Window Limit</span>
|
|
102
|
+
</div>
|
|
103
|
+
<div class="px-8 py-4 bg-white/10 rounded-2xl border border-white/10 flex flex-col items-center group-hover:bg-white/20 transition-all duration-300">
|
|
104
|
+
<span class="text-red-400 font-black text-2xl uppercase italic">Identity-First</span>
|
|
105
|
+
<span class="text-xs text-white/50 tracking-[0.2em] font-bold">Safe from NAT Spoofing</span>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</section>
|
|
110
|
+
|
|
111
|
+
<!-- Super Admin & Confidential Boundaries -->
|
|
112
|
+
<section class="mb-20">
|
|
113
|
+
<h2 class="text-3xl font-black text-slate-900 mb-8 tracking-tighter italic uppercase text-center decoration-red-500 underline underline-offset-8">The Super Admin Boundary</h2>
|
|
114
|
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-10">
|
|
115
|
+
<div class="p-10 bg-white border border-slate-200 rounded-[3rem] shadow-sm italic hover:bg-slate-50 transition-all">
|
|
116
|
+
<h3 class="text-2xl font-bold text-slate-900 mb-4 tracking-tight">Standard Business APIs</h3>
|
|
117
|
+
<p class="text-slate-500 text-sm leading-relaxed mb-6 italic">
|
|
118
|
+
Endpoints under <code>/api/*</code> are accessible to any authenticated user with a valid silo mapping. These handle standard CRUD, Federated Search, and Usage Reporting.
|
|
119
|
+
</p>
|
|
120
|
+
<div class="flex flex-wrap gap-2">
|
|
121
|
+
<span class="px-3 py-1 bg-blue-50 text-blue-700 rounded-lg text-[10px] font-bold font-mono">/api/cars</span>
|
|
122
|
+
<span class="px-3 py-1 bg-blue-50 text-blue-700 rounded-lg text-[10px] font-bold font-mono">/api/silos/me</span>
|
|
123
|
+
<span class="px-3 py-1 bg-blue-50 text-blue-700 rounded-lg text-[10px] font-bold font-mono">/api/search/*</span>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div class="p-10 bg-slate-900 border border-slate-800 rounded-[3rem] text-white shadow-2xl italic relative overflow-hidden group">
|
|
128
|
+
<div class="relative z-10">
|
|
129
|
+
<h3 class="text-2xl font-bold mb-4 text-rose-500 tracking-tight">Confidential Control Plane</h3>
|
|
130
|
+
<p class="text-slate-400 text-sm leading-relaxed mb-6 italic">
|
|
131
|
+
Sensitive endpoints under <code>/management/*</code> and <code>/api/admin/*</code> are restricted to the <strong>Super Admin Role</strong> defined in <code>application.yml</code>.
|
|
132
|
+
</p>
|
|
133
|
+
<div class="p-4 bg-white/5 rounded-2xl border border-white/10 text-[11px] font-mono text-rose-300">
|
|
134
|
+
go-duck:
|
|
135
|
+
security:
|
|
136
|
+
super-admin-role: "platform_admin"
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
<!-- Infrastructure Group Badge -->
|
|
140
|
+
<div class="absolute bottom-6 right-8 p-3 bg-rose-500/10 rounded-xl border border-rose-500/20">
|
|
141
|
+
<span class="text-[10px] text-rose-400 font-black uppercase tracking-widest">Confidential Mode Enabled</span>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</section>
|
|
146
|
+
|
|
147
|
+
<!-- Dev CTA -->
|
|
148
|
+
<section class="mb-16">
|
|
149
|
+
<h2 class="text-3xl font-black text-slate-900 mb-6 tracking-tighter text-center">Ready for Production Security?</h2>
|
|
150
|
+
<p class="text-slate-500 text-center font-medium italic mb-8">Deploy zero-trust identity across your cluster with one command.</p>
|
|
151
|
+
<div class="flex flex-col md:flex-row gap-4 justify-center">
|
|
152
|
+
<a href="keycloak.html" class="px-10 py-4 bg-slate-900 text-white font-black rounded-2xl hover:scale-105 transition-all text-sm uppercase tracking-widest text-center">
|
|
153
|
+
Review Keycloak Setup
|
|
154
|
+
</a>
|
|
155
|
+
</div>
|
|
156
|
+
</section>
|
|
157
|
+
</div>
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<div class="mb-12">
|
|
2
|
+
<h1 class="text-4xl font-extrabold tracking-tight text-slate-900 sm:text-5xl mb-4">
|
|
3
|
+
Serverless <span class="gradient-text">Transformation</span>
|
|
4
|
+
</h1>
|
|
5
|
+
<p class="text-xl text-slate-600 leading-relaxed max-w-3xl">
|
|
6
|
+
GO-DUCK isn't just for heavy-duty containers. With the <strong>Serverless Transformation Layer</strong>, your entire Federated Microservice can be deployed as an elastic, zero-cost-when-idle function on AWS, GCP, or Vercel.
|
|
7
|
+
</p>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<!-- Elite Adapter Concept -->
|
|
11
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 mb-16">
|
|
12
|
+
<div class="p-8 rounded-3xl bg-slate-50 border border-slate-100 shadow-sm">
|
|
13
|
+
<div class="w-12 h-12 bg-blue-100 text-blue-600 rounded-2xl flex items-center justify-center mb-6">
|
|
14
|
+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path></svg>
|
|
15
|
+
</div>
|
|
16
|
+
<h3 class="text-xl font-bold text-slate-900 mb-3">Stateless Silo Routing</h3>
|
|
17
|
+
<p class="text-slate-600 leading-relaxed">
|
|
18
|
+
Every serverless invocation is fully isolated and stateless. The system resolves the tenant's database silo dynamically from the JWT, ensuring 100% data privacy even in shared-compute environments.
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="p-8 rounded-3xl bg-slate-50 border border-slate-100 shadow-sm">
|
|
22
|
+
<div class="w-12 h-12 bg-purple-100 text-purple-600 rounded-2xl flex items-center justify-center mb-6">
|
|
23
|
+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg>
|
|
24
|
+
</div>
|
|
25
|
+
<h3 class="text-xl font-bold text-slate-900 mb-3">Shared Router Pattern</h3>
|
|
26
|
+
<p class="text-slate-600 leading-relaxed">
|
|
27
|
+
We use a unified internal <code>router</code> package. This means your security middlewares, search logic, and endpoint definitions are shared between <code>main.go</code> and all serverless entrypoints.
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<!-- Deployment Options -->
|
|
33
|
+
<section class="mb-16">
|
|
34
|
+
<h2 class="text-2xl font-bold text-slate-900 mb-8 flex items-center">
|
|
35
|
+
<span class="w-8 h-8 bg-slate-900 text-white rounded-lg flex items-center justify-center text-sm mr-3">1</span>
|
|
36
|
+
AWS Lambda
|
|
37
|
+
</h2>
|
|
38
|
+
<div class="prose prose-slate max-w-none">
|
|
39
|
+
<p>GO-DUCK generates a specialized <code>lambda_main.go</code> utilizing the <code>aws-lambda-go-api-proxy</code>. This adapter wraps the Gin router and translates API Gateway events into standard HTTP requests.</p>
|
|
40
|
+
|
|
41
|
+
<div class="bg-slate-900 rounded-2xl p-6 mb-6">
|
|
42
|
+
<h4 class="text-slate-400 text-xs font-bold uppercase tracking-wider mb-4">Build for AWS Lambda</h4>
|
|
43
|
+
<pre class="bg-transparent border-none p-0 m-0"><code class="language-bash"># Set target OS and Architecture
|
|
44
|
+
export GOOS=linux
|
|
45
|
+
export GOARCH=amd64
|
|
46
|
+
|
|
47
|
+
# Build with lambda tag to include the handler
|
|
48
|
+
go build -tags lambda -o bootstrap lambda_main.go
|
|
49
|
+
|
|
50
|
+
# Zip and deploy to AWS
|
|
51
|
+
zip function.zip bootstrap</code></pre>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="bg-blue-50 border-l-4 border-blue-400 p-6 rounded-r-xl">
|
|
54
|
+
<div class="flex">
|
|
55
|
+
<div class="flex-shrink-0">
|
|
56
|
+
<svg class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor">
|
|
57
|
+
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
|
|
58
|
+
</svg>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="ml-3">
|
|
61
|
+
<p class="text-sm text-blue-700">
|
|
62
|
+
<strong>Cold Start Warning:</strong> Lambda initializations include DB connection pooling. The shared router uses <code>sync.Once</code> to keep these connections warm across subsequent invocations.
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</section>
|
|
69
|
+
|
|
70
|
+
<section class="mb-16">
|
|
71
|
+
<h2 class="text-2xl font-bold text-slate-900 mb-8 flex items-center">
|
|
72
|
+
<span class="w-8 h-8 bg-slate-900 text-white rounded-lg flex items-center justify-center text-sm mr-3">2</span>
|
|
73
|
+
Vercel (Serverless Functions)
|
|
74
|
+
</h2>
|
|
75
|
+
<div class="prose prose-slate max-w-none">
|
|
76
|
+
<p>The system generates an <code>api/index.go</code> file compatible with Vercel's Go runtime. By using the generated <code>vercel.json</code>, all incoming traffic is routed to this single entrypoint.</p>
|
|
77
|
+
|
|
78
|
+
<div class="bg-slate-900 rounded-2xl p-6 mb-6">
|
|
79
|
+
<h4 class="text-slate-400 text-xs font-bold uppercase tracking-wider mb-4">Immediate Deployment</h4>
|
|
80
|
+
<pre class="bg-transparent border-none p-0 m-0"><code class="language-bash"># Login to vercel
|
|
81
|
+
vercel login
|
|
82
|
+
|
|
83
|
+
# Deploy the project
|
|
84
|
+
vercel deploy --prod</code></pre>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<p>The <code>vercel.json</code> configuration handles the necessary rewrites to ensure paths like <code>/api/users</code> are correctly served by the Go handler:</p>
|
|
88
|
+
<div class="bg-slate-900 rounded-2xl p-6 mb-6">
|
|
89
|
+
<pre class="bg-transparent border-none p-0 m-0"><code class="language-json">{
|
|
90
|
+
"version": 2,
|
|
91
|
+
"rewrites": [
|
|
92
|
+
{ "source": "/(.*)", "destination": "/api/index" }
|
|
93
|
+
]
|
|
94
|
+
}</code></pre>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</section>
|
|
98
|
+
|
|
99
|
+
<section class="mb-16">
|
|
100
|
+
<h2 class="text-2xl font-bold text-slate-900 mb-8 flex items-center">
|
|
101
|
+
<span class="w-8 h-8 bg-slate-900 text-white rounded-lg flex items-center justify-center text-sm mr-3">3</span>
|
|
102
|
+
Google Cloud Functions (GCF)
|
|
103
|
+
</h2>
|
|
104
|
+
<div class="prose prose-slate max-w-none">
|
|
105
|
+
<p>For GCP, we use the <strong>Functions Framework for Go</strong>. The generated <code>gcf_handler.go</code> exports a standard HTTP trigger named <code>GoDuckEntry</code>.</p>
|
|
106
|
+
|
|
107
|
+
<div class="bg-slate-900 rounded-2xl p-6 mb-6">
|
|
108
|
+
<h4 class="text-slate-400 text-xs font-bold uppercase tracking-wider mb-4">Deploying to Cloud Functions</h4>
|
|
109
|
+
<pre class="bg-transparent border-none p-0 m-0"><code class="language-bash"># Deploy using gcloud CLI
|
|
110
|
+
gcloud functions deploy GoDuckEntry \
|
|
111
|
+
--runtime go124 \
|
|
112
|
+
--trigger-http \
|
|
113
|
+
--allow-unauthenticated \
|
|
114
|
+
--region us-central1</code></pre>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<p>Ensure the <code>//go:build gcf</code> tag is handled correctly by your deployment pipeline if you are building remotely.</p>
|
|
118
|
+
</div>
|
|
119
|
+
</section>
|
|
120
|
+
|
|
121
|
+
<!-- Performance Tuning Table -->
|
|
122
|
+
<section class="mb-16">
|
|
123
|
+
<h3 class="text-xl font-bold text-slate-900 mb-6">Configuration Comparison</h3>
|
|
124
|
+
<div class="overflow-x-auto">
|
|
125
|
+
<table class="w-full text-left border-collapse">
|
|
126
|
+
<thead>
|
|
127
|
+
<tr class="border-b border-slate-200">
|
|
128
|
+
<th class="py-4 font-bold text-slate-900">Feature</th>
|
|
129
|
+
<th class="py-4 font-bold text-slate-900">Standard (Binary)</th>
|
|
130
|
+
<th class="py-4 font-bold text-slate-900">Serverless</th>
|
|
131
|
+
</tr>
|
|
132
|
+
</thead>
|
|
133
|
+
<tbody class="text-slate-600">
|
|
134
|
+
<tr class="border-b border-slate-100">
|
|
135
|
+
<td class="py-4 font-medium text-slate-900">Execution Mode</td>
|
|
136
|
+
<td class="py-4">Persistent Process</td>
|
|
137
|
+
<td class="py-4">On-Demand Invocations</td>
|
|
138
|
+
</tr>
|
|
139
|
+
<tr class="border-b border-slate-100">
|
|
140
|
+
<td class="py-4 font-medium text-slate-900">gRPC Server (Kratos)</td>
|
|
141
|
+
<td class="py-4 text-green-600 font-bold">Enabled</td>
|
|
142
|
+
<td class="py-4 text-red-500">Disabled (Async only)</td>
|
|
143
|
+
</tr>
|
|
144
|
+
<tr class="border-b border-slate-100">
|
|
145
|
+
<td class="py-4 font-medium text-slate-900">Outbox Worker</td>
|
|
146
|
+
<td class="py-4 text-green-600 font-bold">Automatic Background</td>
|
|
147
|
+
<td class="py-4 text-slate-400 italic">Recommended via Cloud Cron</td>
|
|
148
|
+
</tr>
|
|
149
|
+
<tr class="border-b border-slate-100">
|
|
150
|
+
<td class="py-4 font-medium text-slate-900">Cold Start Optimization</td>
|
|
151
|
+
<td class="py-4">N/A</td>
|
|
152
|
+
<td class="py-4">sync.Once initialization</td>
|
|
153
|
+
</tr>
|
|
154
|
+
</tbody>
|
|
155
|
+
</table>
|
|
156
|
+
</div>
|
|
157
|
+
</section>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<div class="prose prose-slate max-w-none">
|
|
2
|
+
<div class="flex items-center space-x-3 mb-8">
|
|
3
|
+
<div class="p-4 bg-gradient-to-br from-blue-600 to-indigo-700 rounded-2xl shadow-lg shadow-indigo-200">
|
|
4
|
+
<svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
5
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z" />
|
|
6
|
+
</svg>
|
|
7
|
+
</div>
|
|
8
|
+
<h1 class="text-5xl font-black text-slate-900 m-0 tracking-tight">The Universal Storage Bridge</h1>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<p class="text-2xl text-slate-500 font-medium mb-12 leading-relaxed">
|
|
12
|
+
Say goodbye to vendor lock-in. GO-DUCK provides an elite, cloud-agnostic abstraction that bridges 7 global storage providers under a single, unified developer experience.
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<!-- The 7 Wonders Section -->
|
|
16
|
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-16">
|
|
17
|
+
<div class="p-6 bg-white rounded-3xl border border-slate-200 shadow-sm">
|
|
18
|
+
<div class="text-3xl mb-4 text-blue-600">☁️</div>
|
|
19
|
+
<h4 class="font-bold text-slate-900 mb-2">Cloud Native</h4>
|
|
20
|
+
<p class="text-sm text-slate-600">AWS S3, Google Cloud Storage, and Cloudflare R2.</p>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="p-6 bg-white rounded-3xl border border-slate-200 shadow-sm">
|
|
23
|
+
<div class="text-3xl mb-4 text-green-600">🏛️</div>
|
|
24
|
+
<h4 class="font-bold text-slate-900 mb-2">On-Premises</h4>
|
|
25
|
+
<p class="text-sm text-slate-600">High-performance MinIO and Generic S3-compatible clusters.</p>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="p-6 bg-white rounded-3xl border border-slate-200 shadow-sm">
|
|
28
|
+
<div class="text-3xl mb-4 text-purple-600">🛡️</div>
|
|
29
|
+
<h4 class="font-bold text-slate-900 mb-2">Legacy & Git</h4>
|
|
30
|
+
<p class="text-sm text-slate-600">High-security SFTP (SSH) and Private GitHub persistence.</p>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<!-- The Masterpiece: GitHub Remote Bootstrapper -->
|
|
35
|
+
<section class="mb-20">
|
|
36
|
+
<div class="bg-gradient-to-r from-slate-900 to-indigo-950 rounded-[2.5rem] p-12 text-white shadow-2xl relative overflow-hidden">
|
|
37
|
+
<div class="relative z-10">
|
|
38
|
+
<div class="inline-block px-4 py-1 rounded-full bg-indigo-500/20 border border-indigo-400/30 text-indigo-300 text-xs font-bold uppercase tracking-widest mb-6">
|
|
39
|
+
Featured Elite Service
|
|
40
|
+
</div>
|
|
41
|
+
<h2 class="text-4xl font-black mb-6 leading-tight">GitHub Remote Bootstrapper <br><span class="text-indigo-400">The Death of Secret Sprawl.</span></h2>
|
|
42
|
+
|
|
43
|
+
<p class="text-indigo-100 text-lg mb-8 max-w-3xl leading-relaxed">
|
|
44
|
+
In modern, ephemeral Kubernetes clusters, host-path storage is a liability and "baking" keys into Docker images is a security nightmare. The **GitHub Remote Bootstrapper** is your Zero-Trust solution for identity management.
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-12">
|
|
48
|
+
<div class="space-y-6">
|
|
49
|
+
<h4 class="text-indigo-300 font-bold uppercase text-sm tracking-widest">Why Architects Love It:</h4>
|
|
50
|
+
<ul class="space-y-4">
|
|
51
|
+
<li class="flex items-start">
|
|
52
|
+
<span class="bg-indigo-500/20 p-1 rounded-lg mr-3 text-indigo-400">✓</span>
|
|
53
|
+
<div><strong class="text-white">Zero-Bake Images:</strong> Your Docker images remain clean and generic. No customer-specific keys are ever stored in the container layers.</div>
|
|
54
|
+
</li>
|
|
55
|
+
<li class="flex items-start">
|
|
56
|
+
<span class="bg-indigo-500/20 p-1 rounded-lg mr-3 text-indigo-400">✓</span>
|
|
57
|
+
<div><strong class="text-white">Ephemeral Isolation:</strong> Credentials are pulled into volatile RAM/Config storage on startup. When the pod dies, the keys vanish.</div>
|
|
58
|
+
</li>
|
|
59
|
+
<li class="flex items-start">
|
|
60
|
+
<span class="bg-indigo-500/20 p-1 rounded-lg mr-3 text-indigo-400">✓</span>
|
|
61
|
+
<div><strong class="text-white">Centralized Identity:</strong> Rotate keys for 1,000 pods instantly by updating a single private GitHub repository.</div>
|
|
62
|
+
</li>
|
|
63
|
+
</ul>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="bg-slate-800/50 rounded-2xl p-6 border border-slate-700/50 backdrop-blur-sm">
|
|
66
|
+
<div class="flex items-center space-x-2 mb-4">
|
|
67
|
+
<div class="w-3 h-3 rounded-full bg-red-400"></div>
|
|
68
|
+
<div class="w-3 h-3 rounded-full bg-yellow-400"></div>
|
|
69
|
+
<div class="w-3 h-3 rounded-full bg-green-400"></div>
|
|
70
|
+
</div>
|
|
71
|
+
<pre class="text-xs text-indigo-200 leading-relaxed">
|
|
72
|
+
# application.yml
|
|
73
|
+
go-duck:
|
|
74
|
+
storage:
|
|
75
|
+
bootstrap:
|
|
76
|
+
enabled: true
|
|
77
|
+
owner: "MyOrg"
|
|
78
|
+
repo: "InfraSecrets"
|
|
79
|
+
branch: "prod"
|
|
80
|
+
token: "${GH_BOOTSTRAP_TOKEN}"
|
|
81
|
+
files:
|
|
82
|
+
- "gcs-service-account.json"
|
|
83
|
+
- "id_rsa"
|
|
84
|
+
</pre>
|
|
85
|
+
<p class="mt-4 text-[10px] text-slate-400 italic font-mono">Automatically supplied to GCS & SFTP providers upon successful handshake.</p>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</section>
|
|
91
|
+
|
|
92
|
+
<!-- Implementation Architecture -->
|
|
93
|
+
<section class="mb-16">
|
|
94
|
+
<h2 class="text-3xl font-bold text-slate-900 mb-8 tracking-tight">The 3-Tier Lifecycle</h2>
|
|
95
|
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
96
|
+
<div class="p-8 bg-slate-50 rounded-3xl border border-slate-100">
|
|
97
|
+
<div class="font-black text-slate-300 text-4xl mb-4">01</div>
|
|
98
|
+
<h5 class="font-bold text-slate-900 mb-2">The Fetch</h5>
|
|
99
|
+
<p class="text-sm text-slate-600">Worker connects to GitHub API at T-0 (App Startup).</p>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="p-8 bg-slate-50 rounded-3xl border border-slate-100">
|
|
102
|
+
<div class="font-black text-slate-300 text-4xl mb-4">02</div>
|
|
103
|
+
<h5 class="font-bold text-slate-900 mb-2">The Pulse</h5>
|
|
104
|
+
<p class="text-sm text-slate-600">Secrets are hydrated locally in the ephemeral `config/` directory.</p>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="p-8 bg-slate-50 rounded-3xl border border-slate-100">
|
|
107
|
+
<div class="font-black text-slate-300 text-4xl mb-4">03</div>
|
|
108
|
+
<h5 class="font-bold text-slate-900 mb-2">The Link</h5>
|
|
109
|
+
<p class="text-sm text-slate-600">Storage drivers discover the keys and initialize with zero friction.</p>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</section>
|
|
113
|
+
|
|
114
|
+
<!-- Interface Snippet -->
|
|
115
|
+
<section class="mb-16">
|
|
116
|
+
<h2 class="text-3xl font-bold text-slate-900 mb-6 tracking-tight">One Interface. Infinite Clouds.</h2>
|
|
117
|
+
<div class="bg-slate-900 rounded-3xl p-10 shadow-2xl">
|
|
118
|
+
<pre class="text-blue-400 font-mono text-sm leading-8">
|
|
119
|
+
<span class="text-slate-500">// Your code never changes, whether you are on SFTP, S3, or GCS.</span>
|
|
120
|
+
provider, _ := storage.NewStorageProvider(cfg)
|
|
121
|
+
|
|
122
|
+
<span class="text-slate-500">// Upload to the active provider (e.g., GCS Hydrated by Bootstrapper)</span>
|
|
123
|
+
url, err := provider.Upload(ctx, "invoices/March.pdf", data)
|
|
124
|
+
</pre>
|
|
125
|
+
</div>
|
|
126
|
+
</section>
|
|
127
|
+
</div>
|