Compare commits
No commits in common. "main" and "fix-profile" have entirely different histories.
main
...
fix-profil
14
.drone.yml
14
.drone.yml
@ -6,23 +6,14 @@ name: build
|
||||
steps:
|
||||
- name: build-backend
|
||||
image: plugins/docker
|
||||
environment:
|
||||
TAG:
|
||||
${DRONE_TAG}
|
||||
COMMIT:
|
||||
${DRONE_COMMIT}
|
||||
settings:
|
||||
insecure: true
|
||||
repo: 10.5.0.103:1222/simrail-backend
|
||||
registry: 10.5.0.103:1222
|
||||
context: './packages/backend'
|
||||
dockerfile: './packages/backend/Dockerfile'
|
||||
build_args_from_env:
|
||||
- TAG
|
||||
- COMMIT
|
||||
tags:
|
||||
- latest
|
||||
- ${DRONE_TAG##v}
|
||||
|
||||
- name: build-frontend
|
||||
image: plugins/docker
|
||||
@ -42,8 +33,7 @@ steps:
|
||||
- VITE_STATS_KEY
|
||||
tags:
|
||||
- latest
|
||||
- ${DRONE_TAG##v}
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
branch:
|
||||
- main
|
||||
|
@ -6,12 +6,8 @@ COPY . .
|
||||
RUN yarn add -D typescript
|
||||
RUN yarn rawbuild
|
||||
|
||||
ARG COMMIT
|
||||
ENV COMMIT $COMMIT
|
||||
ARG TAG
|
||||
ENV TAG $TAG
|
||||
RUN ls
|
||||
|
||||
RUN yarn make-git-info
|
||||
|
||||
# Install Doppler CLI
|
||||
RUN wget -q -t3 'https://packages.doppler.com/public/cli/rsa.8004D9FF50437357.key' -O /etc/apk/keys/cli@doppler-8004D9FF50437357.rsa.pub && \
|
||||
@ -21,4 +17,4 @@ RUN wget -q -t3 'https://packages.doppler.com/public/cli/rsa.8004D9FF50437357.ke
|
||||
|
||||
|
||||
ENTRYPOINT ["doppler", "run", "--"]
|
||||
CMD ["node", "/app/dist/src"]
|
||||
CMD ["node", "/app/dist"]
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"tag": "",
|
||||
"commit": ""
|
||||
}
|
@ -6,8 +6,7 @@
|
||||
"scripts": {
|
||||
"build": "docker build --progress=plain -t simrailpro:backend .",
|
||||
"rawbuild": "yarn tsc",
|
||||
"start": "yarn rawbuild && node --env-file=.env dist/index.js",
|
||||
"make-git-info": "node scripts/make-git.js"
|
||||
"start": "yarn rawbuild && node --env-file=.env dist/index.js"
|
||||
},
|
||||
"author": "Aleksander <alekswilc> Wilczyński",
|
||||
"license": "AGPL-3.0-only",
|
||||
|
@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2025 Aleksander <alekswilc> Wilczyński (aleks@alekswilc.dev)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* See LICENSE for more.
|
||||
*/
|
||||
|
||||
import fs from 'node:fs/promises';
|
||||
|
||||
(async () => {
|
||||
await fs.writeFile('dist/git.json', JSON.stringify({
|
||||
tag: process.env.TAG ?? "",
|
||||
commit: process.env.COMMIT?.substring(0, 7) ?? "",
|
||||
}))
|
||||
})();
|
@ -14,7 +14,7 @@
|
||||
* See LICENSE for more.
|
||||
*/
|
||||
|
||||
import gitInfo from '../../git.json' with { type: "json" };
|
||||
import { execSync } from "child_process";
|
||||
|
||||
export class GitUtil
|
||||
{
|
||||
@ -22,12 +22,28 @@ export class GitUtil
|
||||
|
||||
private static getLatestVersion()
|
||||
{
|
||||
return gitInfo.tag;
|
||||
return process.env.CURRENT_VERSION;
|
||||
// try
|
||||
// {
|
||||
// const data = execSync("git describe --tags --exact-match").toString();
|
||||
// return data.replace("\n", "");
|
||||
// } catch
|
||||
// {
|
||||
// return undefined;
|
||||
// }
|
||||
}
|
||||
|
||||
private static getLatestCommit()
|
||||
{
|
||||
return gitInfo.commit;
|
||||
return process.env.CURRENT_COMMIT;
|
||||
// try
|
||||
// {
|
||||
// const data = execSync("git rev-parse --short HEAD").toString();
|
||||
// return data.replace("\n", "");
|
||||
// } catch
|
||||
// {
|
||||
// return undefined;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
||||
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
||||
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
||||
"resolveJsonModule": true, /* Enable importing .json files. */
|
||||
// "resolveJsonModule": true, /* Enable importing .json files. */
|
||||
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
||||
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
||||
|
||||
|
@ -95,10 +95,10 @@ export const ProfileCard = ({ data, images }: { data: TProfileData, images: TIma
|
||||
return data.player.trainStats[b][(sortTrainsByList[sortTrainsBy] ?? 'distance') as 'distance'] - data.player.trainStats[a][(sortTrainsByList[sortTrainsBy] ?? 'distance') as 'distance'];
|
||||
}
|
||||
|
||||
const dispatcherStats = [...chunk(Object.keys(data.player.dispatcherStats).sort(sortStations), 8)];
|
||||
const dispatcherStats = [...chunk(Object.keys(data.player.dispatcherStats), 8)];
|
||||
const [dispatcherPage, setDispatcherPage] = useState(1);
|
||||
|
||||
const trainStats = [...chunk(Object.keys(data.player.trainStats).sort(sortTrains), 8)];
|
||||
const trainStats = [...chunk(Object.keys(data.player.trainStats), 8)];
|
||||
const [trainPage, setTrainPage] = useState(1);
|
||||
|
||||
const { t } = useTranslation();
|
||||
@ -166,10 +166,10 @@ export const ProfileCard = ({ data, images }: { data: TProfileData, images: TIma
|
||||
</p></a>
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-7.5 sm:grid-cols-3 xl:grid-cols-4 pt-4">
|
||||
{dispatcherStats[dispatcherPage - 1].map(stationName => {
|
||||
{dispatcherStats[dispatcherPage - 1].sort(sortStations).map(stationName => {
|
||||
const station = data.player.dispatcherStats[stationName];
|
||||
|
||||
return <StationStat stationName={stationName} time={station.time} image={images.stations[stationName] ?? images.stations['N/A']} />
|
||||
return <StationStat stationName={stationName} time={station.time} image={images.stations[stationName]} />
|
||||
})}
|
||||
</div>
|
||||
<div className="flex flex-col pt-4">
|
||||
@ -192,9 +192,9 @@ export const ProfileCard = ({ data, images }: { data: TProfileData, images: TIma
|
||||
</p></a>
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-7.5 sm:grid-cols-3 xl:grid-cols-4 pt-4">
|
||||
{trainStats[trainPage - 1].map(trainName => {
|
||||
{trainStats[trainPage - 1].sort(sortTrains).map(trainName => {
|
||||
const train = data.player.trainStats[trainName];
|
||||
return <TrainStat trainName={trainName} time={train.time} distance={train.distance} score={train.score} image={images.trains[trainName] ?? images.trains['N/A']} />
|
||||
return <TrainStat trainName={trainName} time={train.time} distance={train.distance} score={train.score} image={images.trains[trainName]} />
|
||||
})}
|
||||
</div>
|
||||
<div className="flex flex-col pt-4">
|
||||
|
@ -20,7 +20,7 @@
|
||||
"footer": {
|
||||
"license": "Licence:",
|
||||
"powered": "Založeno na:",
|
||||
"thanks": "Speciální poděkování: <bahu>BAHU.PRO hosting</bahu>, <simrailelite>Simrail ELITE discord</simrailelite>, komunita SimRail",
|
||||
"thanks": "Speciální poděkování: <bahu>BAHU.PRO hosting</bahu>, <simrailelite>Simrail ELITE discord</simrailelite>, komunita SimRail a moje přítelkyně",
|
||||
"author": "Pro komunitu SimRail vytvořeno s ❤️ uživatelem <anchor>{{author}}</anchor> "
|
||||
}
|
||||
},
|
||||
|
@ -20,7 +20,7 @@
|
||||
"footer": {
|
||||
"license": "License:",
|
||||
"powered": "Based on:",
|
||||
"thanks": "Special thanks to <bahu>BAHU.PRO hosting</bahu>, <simrailelite>Simrail ELITE discord</simrailelite> and Simrail community",
|
||||
"thanks": "Special thanks to <bahu>BAHU.PRO hosting</bahu>, <simrailelite>Simrail ELITE discord</simrailelite>, Simrail community and my girlfriend",
|
||||
"author": "Created by <anchor>{{author}}</anchor> with ❤️ for the Simrail community"
|
||||
}
|
||||
},
|
||||
|
@ -20,7 +20,7 @@
|
||||
"footer": {
|
||||
"license": "Licencja:",
|
||||
"powered": "Oparte na:",
|
||||
"thanks": "Specjalne podziękowania dla <bahu>serwerowni BAHU.PRO</bahu>, <simrailelite>discorda Simrail ELITE</simrailelite> i społeczności Simrail",
|
||||
"thanks": "Specjalne podziękowania dla <bahu>serwerowni BAHU.PRO</bahu>, <simrailelite>discorda Simrail ELITE</simrailelite>, społeczności Simrail i mojej dziewczyny",
|
||||
"author": "Stworzone przez <anchor>{{author}}</anchor> z ❤️ dla społeczności Simrail"
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user