Skip to content

Commit e09c576

Browse files
committed
chore: random quick fixes
1 parent a824ea3 commit e09c576

4 files changed

Lines changed: 32 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- Removed several unnecessarily verbose or spammy log messages.
1414
- Updated the minimum Docker API used to support the latest Docker versions (via [#370](https://github.com/tale/headplane/pull/370)).
1515
- Enhanced the node tag dialog to show a dropdown of assignable tags (via [#362](https://github.com/tale/headplane/pull/362)).
16+
- Fixed an issue where the website favicon would not load correctly (closes [#323](https://github.com/tale/headplane/issues/323)).
1617
---
1718

1819
# 0.6.1 (October 12, 2025)

app/server/index.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { join } from 'node:path';
2-
import { versions } from 'node:process';
2+
import { exit, versions } from 'node:process';
33
import { createHonoServer } from 'react-router-hono-server/node';
44
import log from '~/utils/log';
55
import { loadIntegration } from './config/integration';
@@ -19,7 +19,17 @@ declare global {
1919
// This module contains a side-effect because everything running here
2020
// exists for the lifetime of the process, making it appropriate.
2121
log.info('server', 'Running Node.js %s', versions.node);
22-
const config = await loadConfig();
22+
let config: HeadplaneConfig;
23+
24+
try {
25+
config = await loadConfig();
26+
} catch (error) {
27+
if (error instanceof ConfigError) {
28+
log.error('server', 'Unable to load configuration: %s', error.message);
29+
}
30+
31+
exit(1);
32+
}
2333

2434
const db = await createDbClient(join(config.server.data_path, 'hp_persist.db'));
2535
const agents = await createHeadplaneAgent(
@@ -39,6 +49,8 @@ const hsApi = await createHeadscaleInterface(
3949
export type LoadContext = typeof appLoadContext;
4050

4151
import 'react-router';
52+
import { HeadplaneConfig } from './config/config-schema';
53+
import { ConfigError } from './config/error';
4254
import { createOidcConnector } from './web/oidc-connector';
4355

4456
declare module 'react-router' {
@@ -92,6 +104,11 @@ export default createHonoServer({
92104
});
93105
},
94106
serveStaticOptions: {
107+
publicAssets: {
108+
// This is part of our monkey-patch for react-router-hono-server
109+
// To see the first part, go to the patches/ directory.
110+
rewriteRequestPath: (path) => path.replace(`${__PREFIX__}`, ''),
111+
},
95112
clientAssets: {
96113
// This is part of our monkey-patch for react-router-hono-server
97114
// To see the first part, go to the patches/ directory.
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/dist/adapters/node.js b/dist/adapters/node.js
2-
index ec81622898d583ddd8c2f4d9eaf5c0ed23776475..047ef1d45ad82e4b476a882b4ab5c8962faa0df1 100644
2+
index e081ab36a04ea100cf5da3fb5eb54c5174186f4d..35433810d05a829f2c824d63714e71bf5ed069a0 100644
33
--- a/dist/adapters/node.js
44
+++ b/dist/adapters/node.js
5-
@@ -49,7 +49,7 @@ async function createHonoServer(options) {
5+
@@ -49,13 +49,13 @@ async function createHonoServer(options) {
66
}
77
await mergedOptions.beforeAll?.(app);
88
app.use(
@@ -11,3 +11,10 @@ index ec81622898d583ddd8c2f4d9eaf5c0ed23776475..047ef1d45ad82e4b476a882b4ab5c896
1111
cache(60 * 60 * 24 * 365),
1212
// 1 year
1313
serveStatic({ root: clientBuildPath, ...mergedOptions.serveStaticOptions?.clientAssets })
14+
);
15+
app.use(
16+
- "*",
17+
+ `${import.meta.env.REACT_ROUTER_HONO_SERVER_BASENAME}*`,
18+
cache(60 * 60),
19+
// 1 hour
20+
serveStatic({ root: PRODUCTION ? clientBuildPath : "./public", ...mergedOptions.serveStaticOptions?.publicAssets })

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)