Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/preserve-forwarded-app-origin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ankhorage/infra': patch
---

Preserve the browser-visible forwarded origin when generated app nginx redirects canonical static routes such as `/products` to `/products/`.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# INFRA

![license: MIT](././paradox/badges/license.svg) ![npm: v1.0.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
![license: MIT](././paradox/badges/license.svg) ![npm: v1.0.1](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)

Executable infra provider and standalone CLI for Ankhorage project workflows.

Expand Down
6 changes: 3 additions & 3 deletions paradox/badges/npm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions paradox/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2943,70 +2943,70 @@ <h3>getAppImageDockerfile</h3>
data-search="getPortForwardScript src/adapters/minikube/base/index.ts "
>
<h3>getPortForwardScript</h3>
<p class="muted"><code>src/adapters/minikube/base/index.ts:2973:1</code></p>
<p class="muted"><code>src/adapters/minikube/base/index.ts:2974:1</code></p>
<p class="empty">No description available.</p>
</article>
<article class="item" data-search="getDownScript src/adapters/minikube/base/index.ts ">
<h3>getDownScript</h3>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3308:1</code></p>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3309:1</code></p>
<p class="empty">No description available.</p>
</article>
<article class="item" data-search="getResetScript src/adapters/minikube/base/index.ts ">
<h3>getResetScript</h3>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3342:1</code></p>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3343:1</code></p>
<p class="empty">No description available.</p>
</article>
<article
class="item"
data-search="getDestroyScript src/adapters/minikube/base/index.ts "
>
<h3>getDestroyScript</h3>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3406:1</code></p>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3407:1</code></p>
<p class="empty">No description available.</p>
</article>
<article
class="item"
data-search="getStatusScript src/adapters/minikube/base/index.ts "
>
<h3>getStatusScript</h3>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3433:1</code></p>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3434:1</code></p>
<p class="empty">No description available.</p>
</article>
<article
class="item"
data-search="getDefaultAppImage src/adapters/minikube/base/index.ts "
>
<h3>getDefaultAppImage</h3>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3602:1</code></p>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3603:1</code></p>
<p class="empty">No description available.</p>
</article>
<article
class="item"
data-search="resolveSupabaseHostPorts src/adapters/minikube/base/index.ts "
>
<h3>resolveSupabaseHostPorts</h3>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3606:1</code></p>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3607:1</code></p>
<p class="empty">No description available.</p>
</article>
<article
class="item"
data-search="resolvePortBucket src/adapters/minikube/base/index.ts "
>
<h3>resolvePortBucket</h3>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3616:1</code></p>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3617:1</code></p>
<p class="empty">No description available.</p>
</article>
<article class="item" data-search="hashSlug src/adapters/minikube/base/index.ts ">
<h3>hashSlug</h3>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3621:1</code></p>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3622:1</code></p>
<p class="empty">No description available.</p>
</article>
<article
class="item"
data-search="escapeYamlDoubleQuoted src/adapters/minikube/base/index.ts "
>
<h3>escapeYamlDoubleQuoted</h3>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3629:1</code></p>
<p class="muted"><code>src/adapters/minikube/base/index.ts:3630:1</code></p>
<p class="empty">No description available.</p>
</article>
</section>
Expand Down
22 changes: 11 additions & 11 deletions paradox/paradox.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"id": "npm",
"label": "npm",
"value": "v1.0.0",
"value": "v1.0.1",
"color": "cb3837"
},
{
Expand Down Expand Up @@ -1710,7 +1710,7 @@
"description": null,
"sourceLocation": {
"filePath": "src/adapters/minikube/base/index.ts",
"line": 2973,
"line": 2974,
"column": 1
}
},
Expand All @@ -1719,7 +1719,7 @@
"description": null,
"sourceLocation": {
"filePath": "src/adapters/minikube/base/index.ts",
"line": 3308,
"line": 3309,
"column": 1
}
},
Expand All @@ -1728,7 +1728,7 @@
"description": null,
"sourceLocation": {
"filePath": "src/adapters/minikube/base/index.ts",
"line": 3342,
"line": 3343,
"column": 1
}
},
Expand All @@ -1737,7 +1737,7 @@
"description": null,
"sourceLocation": {
"filePath": "src/adapters/minikube/base/index.ts",
"line": 3406,
"line": 3407,
"column": 1
}
},
Expand All @@ -1746,7 +1746,7 @@
"description": null,
"sourceLocation": {
"filePath": "src/adapters/minikube/base/index.ts",
"line": 3433,
"line": 3434,
"column": 1
}
},
Expand All @@ -1755,7 +1755,7 @@
"description": null,
"sourceLocation": {
"filePath": "src/adapters/minikube/base/index.ts",
"line": 3602,
"line": 3603,
"column": 1
}
},
Expand All @@ -1764,7 +1764,7 @@
"description": null,
"sourceLocation": {
"filePath": "src/adapters/minikube/base/index.ts",
"line": 3606,
"line": 3607,
"column": 1
}
},
Expand All @@ -1773,7 +1773,7 @@
"description": null,
"sourceLocation": {
"filePath": "src/adapters/minikube/base/index.ts",
"line": 3616,
"line": 3617,
"column": 1
}
},
Expand All @@ -1782,7 +1782,7 @@
"description": null,
"sourceLocation": {
"filePath": "src/adapters/minikube/base/index.ts",
"line": 3621,
"line": 3622,
"column": 1
}
},
Expand All @@ -1791,7 +1791,7 @@
"description": null,
"sourceLocation": {
"filePath": "src/adapters/minikube/base/index.ts",
"line": 3629,
"line": 3630,
"column": 1
}
},
Expand Down
28 changes: 28 additions & 0 deletions src/adapters/minikube/appRuntimeServing.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { describe, expect, test } from 'bun:test';

import { generateInfrastructure } from '../../index';
import { createAppManifest } from '../../testSupport';

describe('generated Minikube app runtime serving', () => {
test('keeps nginx redirects relative so port-forwarded browser origins are preserved', () => {
const result = generateInfrastructure(
{
deployment: {
target: 'minikube',
monitoring: false,
},
},
{
appManifest: createAppManifest('forwarded-origin'),
},
);
const dockerfile = result.files.find(
(file) => file.path === 'infra/minikube/app-image/Dockerfile',
);

expect(dockerfile).toBeDefined();
expect(dockerfile?.content).toContain('listen 8080;\n absolute_redirect off;');
expect(dockerfile?.content).toContain('try_files $uri $uri/ /index.html;');
expect(dockerfile?.content).not.toContain('port_in_redirect off;');
});
});
1 change: 1 addition & 0 deletions src/adapters/minikube/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2952,6 +2952,7 @@ function getAppImageDockerfile(): string {
RUN cat <<'EOF' > /etc/nginx/conf.d/default.conf
server {
listen 8080;
absolute_redirect off;
server_name _;
root /usr/share/nginx/html;
index index.html;
Expand Down
Loading