diff --git a/app/routes/_data.tsx b/app/routes/_data.tsx
index 1dbdc4c..dfb1b7f 100644
--- a/app/routes/_data.tsx
+++ b/app/routes/_data.tsx
@@ -1,9 +1,10 @@
-import { type LoaderFunctionArgs, redirect } from '@remix-run/node'
+import { LoaderFunctionArgs, redirect } from '@remix-run/node'
import { Outlet, useLoaderData, useNavigation } from '@remix-run/react'
import { ProgressBar } from 'react-aria-components'
import { ErrorPopup } from '~/components/Error'
import Header from '~/components/Header'
+import Link from '~/components/Link'
import { cn } from '~/utils/cn'
import { loadContext } from '~/utils/config/headplane'
import { HeadscaleError, pull } from '~/utils/headscale'
@@ -36,10 +37,52 @@ export async function loader({ request }: LoaderFunctionArgs) {
const context = await loadContext()
return {
config: context.config,
+ url: context.headscalePublicUrl ?? context.headscaleUrl,
+ debug: context.debug,
user: session.get('user'),
}
}
+interface FooterProps {
+ url: string
+ debug: boolean
+}
+
+function Footer({ url, debug, integration }: FooterProps) {
+ return (
+
+ )
+}
+
export default function Layout() {
const data = useLoaderData()
const nav = useNavigation()
@@ -61,6 +104,7 @@ export default function Layout() {
+
>
)
}
@@ -70,6 +114,7 @@ export function ErrorBoundary() {
<>
+
>
)
}
diff --git a/vite.config.ts b/vite.config.ts
index 61ec5dd..668b574 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -3,6 +3,7 @@ import { installGlobals } from '@remix-run/node'
import { defineConfig } from 'vite'
import babel from 'vite-plugin-babel'
import tsconfigPaths from 'vite-tsconfig-paths'
+import { execSync } from 'node:child_process'
installGlobals()
@@ -11,6 +12,12 @@ if (prefix.endsWith('/')) {
throw new Error('Prefix must not end with a slash')
}
+// Load the version via git tags
+const version = execSync('git describe --tags --always').toString().trim()
+if (!version) {
+ throw new Error('Unable to execute git describe')
+}
+
export default defineConfig(({ isSsrBuild }) => {
// If we have the Headplane entry we build it as a single
// server.mjs file that is built for production server bundle
@@ -45,6 +52,9 @@ export default defineConfig(({ isSsrBuild }) => {
return ({
base: `${prefix}/`,
build: isSsrBuild ? { target: 'ES2022' } : {},
+ define: {
+ __VERSION__: JSON.stringify(version),
+ },
plugins: [
remix({
basename: `${prefix}/`,