adds SHA to infopage

This commit is contained in:
nai-degen 2023-04-10 03:11:26 -07:00 committed by nai-degen
parent 75e004d2b1
commit 1238ee77c9
2 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,8 @@ RUN apt-get update && \
apt-get install -y git apt-get install -y git
RUN git clone https://github.com/nai-degen/oai-reverse-proxy.git /app RUN git clone https://github.com/nai-degen/oai-reverse-proxy.git /app
WORKDIR /app WORKDIR /app
RUN git rev-parse HEAD > git-commit-sha.txt
ENV SHA=$(cat git-commit-sha.txt)
RUN npm install RUN npm install
COPY . . COPY . .
RUN npm run build RUN npm run build

View File

@ -53,6 +53,7 @@ function getInfoPageHtml(host: string) {
...(config.modelRateLimit ? { proomptingNow: getUniqueIps() } : {}), ...(config.modelRateLimit ? { proomptingNow: getUniqueIps() } : {}),
keyInfo, keyInfo,
config: listConfig(), config: listConfig(),
sha: (process.env.SHA?.slice(0, 7) || "dev").toUpperCase(),
}; };
const readme = require("fs").readFileSync("README.md", "utf8"); const readme = require("fs").readFileSync("README.md", "utf8");