Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show software version in UI #73

Merged
merged 1 commit into from
Feb 20, 2024
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
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM node:16-alpine AS builder
ARG DATABASE_URL
ARG VERSION
ENV SKIP_ENV_VALIDATION true
ENV NEXT_TELEMETRY_DISABLED 1

Expand Down Expand Up @@ -44,5 +44,7 @@ USER nextjs
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME 0.0.0.0
ENV VERSION ${VERSION}
ENV NEXT_PUBLIC_VERSION ${VERSION}

CMD ["sh", "docker-start.sh"]
12 changes: 10 additions & 2 deletions src/components/nav/NavSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Flex, Stack, useColorModeValue } from "@chakra-ui/react";
import { Box, Flex, Stack, Text, useColorModeValue } from "@chakra-ui/react";
import { NavItems } from "./NavItems";
import { Logo } from "./Logo";
import { NavSearchBar } from "./search/NavSearchBar";
import { NavLogout } from "./NavLogout";
import { NavTeamSelector } from "./NavTeamSelector";
import Link from "next/link";

export const NavSidebar = () => {
return (
Expand All @@ -24,7 +25,14 @@ export const NavSidebar = () => {
<NavItems />
</Stack>
</Stack>
<NavLogout />
<Box>
<Text fontSize="sm" color="gray.500">
<Link href="https://github.com/KennethWussmann/tory">
Version {process.env.NEXT_PUBLIC_VERSION ?? "unknown"}
</Link>
</Text>
<NavLogout />
</Box>
</Stack>
</Flex>
);
Expand Down
2 changes: 2 additions & 0 deletions src/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const env = createEnv({
* isn't built with invalid env vars.
*/
server: {
VERSION: z.string().default("develop"),
DATABASE_URL: z.string().url(),
NODE_ENV: z
.enum(["development", "test", "production"])
Expand Down Expand Up @@ -65,6 +66,7 @@ export const env = createEnv({
* middlewares) or client-side so we need to destruct manually.
*/
runtimeEnv: {
VERSION: process.env.VERSION,
DATABASE_URL: process.env.DATABASE_URL,
NODE_ENV: process.env.NODE_ENV,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
Expand Down
Loading