mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 05:41:13 +00:00
Adding an expires date, one year from build date.
This commit is contained in:
parent
1a33cd09be
commit
02026ec661
4 changed files with 6 additions and 2 deletions
|
@ -32,6 +32,7 @@ COPY .git .git
|
||||||
|
|
||||||
# Set UI version
|
# Set UI version
|
||||||
RUN echo "export const VERSION = '$(git describe --tag)';" > "src/shared/version.ts"
|
RUN echo "export const VERSION = '$(git describe --tag)';" > "src/shared/version.ts"
|
||||||
|
RUN echo "export const BUILD_DATE_ISO8601 = '$(date -d "+1 year" -u +"%Y-%m-%dT%H:%M:%SZ")';" > "src/shared/build-date.ts"
|
||||||
|
|
||||||
RUN yarn --production --prefer-offline --network-timeout 100000
|
RUN yarn --production --prefer-offline --network-timeout 100000
|
||||||
RUN yarn build:prod
|
RUN yarn build:prod
|
||||||
|
|
|
@ -24,6 +24,7 @@ COPY .git .git
|
||||||
|
|
||||||
# Set UI version
|
# Set UI version
|
||||||
RUN echo "export const VERSION = 'dev';" > "src/shared/version.ts"
|
RUN echo "export const VERSION = 'dev';" > "src/shared/version.ts"
|
||||||
|
RUN echo "export const BUILD_DATE_ISO8601 = 'dev-build-date';" > "src/shared/build-date.ts"
|
||||||
|
|
||||||
RUN yarn --prefer-offline
|
RUN yarn --prefer-offline
|
||||||
RUN yarn build:dev
|
RUN yarn build:dev
|
||||||
|
@ -34,4 +35,4 @@ COPY --from=builder /usr/src/app/node_modules /app/node_modules
|
||||||
|
|
||||||
EXPOSE 1234
|
EXPOSE 1234
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
CMD node dist/js/server.js
|
CMD node dist/js/server.js
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
import type { Response } from "express";
|
import type { Response } from "express";
|
||||||
|
import { BUILD_DATE_ISO8601 } from "../../shared/build-date";
|
||||||
|
|
||||||
export default async ({ res }: { res: Response }) => {
|
export default async ({ res }: { res: Response }) => {
|
||||||
res.setHeader("content-type", "text/plain; charset=utf-8");
|
res.setHeader("content-type", "text/plain; charset=utf-8");
|
||||||
|
|
||||||
res.send(
|
res.send(
|
||||||
`Contact: https://github.com/LemmyNet/lemmy-ui/security/advisories/new
|
`Contact: https://github.com/LemmyNet/lemmy-ui/security/advisories/new
|
||||||
Expires: 2025-01-01T04:59:00.000Z
|
Expires: ${BUILD_DATE_ISO8601}
|
||||||
`,
|
`,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
1
src/shared/build-date.ts
Normal file
1
src/shared/build-date.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export const BUILD_DATE_ISO8601 = "2025-01-19T16:08:27Z";
|
Loading…
Reference in a new issue