refactor(config): separate base URL from API URL for CLI usage

Add signUrl property to config for CLI sign URL without /api/v1 suffix.
Update CLIGuidePage to use config.signUrl instead of hardcoded URL.
Update .env.example and add .swarm/ to .gitignore.
This commit is contained in:
2026-04-06 01:57:40 +09:30
parent a7310367a6
commit 3e0a7f9de4
5 changed files with 13 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
VITE_API_BASE_URL=http://localhost:5000/api/v1 VITE_API_BASE_URL=http://localhost:5000
+3 -1
View File
@@ -23,4 +23,6 @@ dist-ssr
*.sln *.sln
*.sw? *.sw?
*.env *.env
.swarm/
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

+7 -1
View File
@@ -1,12 +1,18 @@
// Secuird Configuration // Secuird Configuration
// Environment-specific settings for the application // Environment-specific settings for the application
// Base URL without /api/v1 suffix - used for CLI sign URL
const BASE_URL = import.meta.env.VITE_API_BASE_URL || "http://192.168.64.7:8888";
export const config = { export const config = {
// API Configuration // API Configuration
api: { api: {
baseUrl: import.meta.env.VITE_API_BASE_URL || "http://192.168.64.7:8888/api/v1", baseUrl: `${BASE_URL}/api/v1`,
}, },
// Sign URL for CLI (same as base URL, no /api/v1)
signUrl: BASE_URL,
// App metadata // App metadata
app: { app: {
name: "Secuird", name: "Secuird",
+2 -3
View File
@@ -6,8 +6,7 @@ import {
CollapsibleContent, CollapsibleContent,
CollapsibleTrigger, CollapsibleTrigger,
} from "@/components/ui/collapsible"; } from "@/components/ui/collapsible";
import { config } from "@/config";
const SIGN_URL = "https://api.secuird.tech";
// ── Code block with copy button ──────────────────────────────────────────────── // ── Code block with copy button ────────────────────────────────────────────────
function CodeBlock({ code }: { code: string }) { function CodeBlock({ code }: { code: string }) {
@@ -112,7 +111,7 @@ export default function CLIGuidePage() {
</Step> </Step>
<Step n={3} title="Set your server URL"> <Step n={3} title="Set your server URL">
<CodeBlock code={`echo 'SIGN_URL=${SIGN_URL}' > ~/.secuird/.env`} /> <CodeBlock code={`echo 'SIGN_URL=${config.signUrl}' > ~/.secuird/.env`} />
</Step> </Step>
<Step n={4} title="Register your SSH key (once)"> <Step n={4} title="Register your SSH key (once)">