Skip to content

Commit

Permalink
fix: no effect modify site title in site config (#461)
Browse files Browse the repository at this point in the history
Signed-off-by: BobDu <[email protected]>
  • Loading branch information
BobDu authored Mar 5, 2024
1 parent 93f0bd6 commit b8bc056
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 12 deletions.
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ RUN pnpm install --production && rm -rf /root/.npm /root/.pnpm-store /usr/local/

COPY /service /app

COPY --from=frontend /app/replace-title.sh /app

RUN chmod +x /app/replace-title.sh

COPY --from=frontend /app/dist /app/public

COPY --from=backend /app/build /app/build
Expand All @@ -65,4 +61,4 @@ COPY --from=backend /app/src/utils/templates /app/build/utils/templates

EXPOSE 3002

CMD ["sh", "-c", "./replace-title.sh && node --import tsx/esm ./build/index.js"]
CMD ["sh", "-c", "node --import tsx/esm ./build/index.js"]
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
<meta name="theme-color">
<title>${SITE_TITLE}</title>
<title>Loading -ˋˏ✄┈┈┈┈</title>
</head>

<body class="dark:bg-black">
Expand Down
5 changes: 0 additions & 5 deletions replace-title.sh

This file was deleted.

2 changes: 1 addition & 1 deletion service/src/storage/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function getOriginConfig() {
: '',
process.env.HTTPS_PROXY,
new SiteConfig(
process.env.SITE_TITLE || 'ChatGpt Web',
process.env.SITE_TITLE || 'ChatGPT Web',
isNotEmptyString(process.env.AUTH_SECRET_KEY),
process.env.AUTH_SECRET_KEY,
process.env.REGISTER_ENABLED === 'true',
Expand Down
1 change: 1 addition & 0 deletions src/router/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function setupPageGuard(router: Router) {
if (!authStore.session) {
try {
const data = await authStore.getSession()
document.title = data.title
if (String(data.auth) === 'false' && authStore.token)
await authStore.removeToken()
else
Expand Down

0 comments on commit b8bc056

Please sign in to comment.