Skip to content

Commit c39fc04

Browse files
authored
Release v15.0.0
Release v15.0.0
2 parents 7676572 + 0efe547 commit c39fc04

100 files changed

Lines changed: 7722 additions & 7674 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# GameVault Backend Server Changelog
22

3+
## 15.0.0
4+
5+
### Breaking Changes & Migration
6+
7+
- Completely Overhauled Authentication System -> **Update your GameVault Client Application. Clients older than 1.17.0.0 will no longer work with this version. If you use the API, make sure to consult the documentation to learn how to authenticate with this release.**
8+
- Renamed some environment variables -> **Update your environment variables if you rely on them.**
9+
- `SEARCH_RECURSIVE` to `GAMES_SEARCH_RECURSIVE`
10+
- `CONFIGURATION_STACK_TRACE_LIMIT` to `SERVER_STACK_TRACE_LIMIT`
11+
The deprecated variables will be removed in **v16.0.0**.
12+
- [#6](https://github.com/Phalcode/gamevault-backend/issues/6) **Added support for OAuth 2.0 and SSO Logins.**
13+
- Moved `/api/health` to `/api/status` -> **Health API will be removed in v16.0.0.**
14+
- **Removed deprecated APIs**.
15+
16+
### Changes
17+
18+
- Users can now also login via email and password using the basic-auth login.
19+
- Added more information about registrations to the server in the `/api/status` endpoint.
20+
- Fixed IGDB Integration throwing 429s for servers with lots of games
21+
- Fixed some wrong data in the OpenAPI Specification
22+
- Optimized some synchronous tasks
23+
- [#500](https://github.com/Phalcode/gamevault-backend/issues/500) Implemented `installer_parameters`, `uninstaller_parameters`, and `uninstaller_executable` fields in game metadata.
24+
- [#502](https://github.com/Phalcode/gamevault-backend/issues/502) & [#344](https://github.com/Phalcode/gamevault-backend/issues/344) Implemented Default Innosetup & NSIS Installer Params for IGDB Provider
25+
- [#488](https://github.com/Phalcode/gamevault-app/issues/488) Fixed bug where users could not be registered without first and last name.
26+
- [#496](https://github.com/Phalcode/gamevault-app/issues/496) Fixed bug where manually edited early access games would not show up in the early access list.
27+
- Added `GAMES_INDEX_USE_POLLING` env var to enable filewatching of remote networks or docker for windows containers.
28+
- [#359](https://github.com/Phalcode/gamevault-app/issues/359) Implemented API-Key Authentication
29+
30+
### Thanks
31+
32+
- @Toylerrr
33+
34+
## 14.1.2
35+
36+
### Changes
37+
38+
- Loosened some container internal permissions so non-root users can use plugins
39+
40+
### Thanks
41+
42+
- @HiImaWalrus
43+
344
## 14.1.1
445

546
### Changes
@@ -581,18 +622,15 @@ Recommended Gamevault App Version: `v1.6.1.0`
581622
### Breaking Changes & Migration
582623

583624
- Case Insensitivity for Usernames and Emails:
584-
585625
- Usernames and user emails are now treated as case-insensitive.
586626
- During the update to v7.0.0, a new database migration will check for users with conflicting usernames or emails caused by differences in letter casing.
587627
- If such conflicts are found, the migration will halt and report an error. This prevents the update to v7.0.0 until these conflicts are resolved.
588628
- Administrators are advised to revert to the previous GameVault version to address these conflicts and ensure a smooth transition to v7.0.0.
589629

590630
- Performance Enhancement: Removal of Progress Details and Filters from /games API:
591-
592631
- To further enhance performance, the /games API no longer includes progress details and filters.
593632

594633
- Improved User Progress Handling:
595-
596634
- User-related calls now include deleted game details in their progress information.
597635
- This enhancement allows for the correct display of progress even after a game has been deleted, ensuring a more comprehensive user experience.
598636

Dockerfile

Lines changed: 52 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,87 @@
1+
# Use the official Node LTS slim image as the base
12
FROM node:lts-slim AS base
23

3-
ENV TZ="Etc/UTC"
4-
ENV PUID=1000
5-
ENV PGID=1000
6-
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
7-
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
8-
ENV PATH=$PATH:/home/node/.npm-global/bin
9-
ENV PNPM_HOME=/pnpm
10-
ENV PATH=$PNPM_HOME:$PATH
11-
ENV SERVER_PORT=8080
12-
ENV YES=yes
13-
4+
# Set environment variables
5+
ENV TZ="Etc/UTC" \
6+
PUID=1000 \
7+
PGID=1000 \
8+
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
9+
NPM_CONFIG_PREFIX=/home/node/.npm-global \
10+
PNPM_HOME=/pnpm \
11+
SERVER_PORT=8080 \
12+
YES=yes \
13+
PATH="/home/node/.npm-global/bin:/pnpm:$PATH"
14+
15+
# Create necessary directories with appropriate permissions
1416
RUN mkdir -p /files /media /logs /db /plugins /savefiles \
15-
&& chown -R node:node /files /media /logs /db /plugins /savefiles \
16-
&& chmod -R 777 /files /media /logs /db /plugins /savefiles \
17-
&& sed -i -e's/ main/ main non-free non-free-firmware contrib/g' /etc/apt/sources.list.d/debian.sources \
17+
# Enable non-free and contrib repositories for Debian-based package installations
18+
&& sed -i -e 's/ main/ main non-free non-free-firmware contrib/g' /etc/apt/sources.list.d/debian.sources \
19+
# Update package list and install necessary dependencies
1820
&& apt update \
19-
&& apt install -y curl p7zip-full p7zip-rar postgresql-common sudo \
21+
&& apt install -y --no-install-recommends \
22+
build-essential \
23+
curl \
24+
g++ \
25+
make \
26+
p7zip-full \
27+
p7zip-rar \
28+
postgresql-common \
29+
python-is-python3 \
30+
python3 \
31+
sudo \
32+
# Install PostgreSQL client from the PostgreSQL Global Development Group (PGDG)
2033
&& /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh \
21-
&& apt install -y postgresql-client \
22-
&& apt clean \
23-
&& npm i -g pnpm@^10.4.1
34+
&& apt install -y --no-install-recommends postgresql-client \
35+
# Clean up to reduce image size
36+
&& apt clean && rm -rf /var/lib/apt/lists/* \
37+
# Install PNPM package manager globally
38+
&& npm i -g pnpm@^10.12.1
2439

40+
# Set working directory for the application
2541
WORKDIR /app
2642

43+
# ---- Build Stage ----
2744
FROM base AS build
2845

46+
# Copy dependency files and install dependencies
2947
COPY package.json pnpm-lock.yaml ./
3048
RUN pnpm install --frozen-lockfile
3149

50+
# Copy application source code and build the project
3251
COPY . .
3352
RUN pnpm run build
3453

54+
# ---- Production Dependencies Stage ----
3555
FROM base AS prod-deps
3656

57+
# Copy dependency files and install only production dependencies
3758
COPY package.json pnpm-lock.yaml ./
3859
RUN pnpm install --prod --frozen-lockfile
3960

61+
# ---- Release Stage ----
4062
FROM base AS release
4163

64+
# Set the environment to production mode
4265
ENV NODE_ENV=production
4366

67+
# Copy dependency files (ensuring same versions as build)
4468
COPY package.json pnpm-lock.yaml ./
4569

70+
# Copy built application and production dependencies
4671
COPY --from=build --chown=node:node /app/dist ./dist
4772
COPY --from=prod-deps --chown=node:node /app/node_modules ./node_modules
73+
COPY --chown=node:node entrypoint.sh /usr/local/bin/
4874

49-
COPY entrypoint.sh /usr/local/bin/
50-
RUN chmod +x /usr/local/bin/entrypoint.sh
75+
RUN chown -R node:node /app/dist /files /media /logs /db /plugins /savefiles \
76+
&& chmod -R 777 /app/dist /files /media /logs /db /plugins /savefiles \
77+
&& chmod +x /usr/local/bin/entrypoint.sh
5178

79+
# Expose the server port
5280
EXPOSE ${SERVER_PORT}/tcp
5381

54-
HEALTHCHECK --start-period=300s CMD curl -f http://localhost:${SERVER_PORT}/api/health || exit
82+
# Add a health check for the service
83+
HEALTHCHECK --start-period=300s CMD curl -f http://localhost:${SERVER_PORT}/api/status || exit 1
5584

85+
# Set entrypoint and default command
5686
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
57-
CMD [ "dist/src/main" ]
87+
CMD ["dist/src/main"]

docker-compose.coolify.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
services:
2+
gamevault-backend:
3+
build: .
4+
restart: unless-stopped
5+
environment:
6+
DB_HOST: db
7+
DB_USERNAME: gamevault
8+
DB_PASSWORD: ${DB_PASSWORD}
9+
healthcheck:
10+
test: ["CMD", "curl", "-f", "http://localhost:8080/api/status"]
11+
interval: 30s
12+
timeout: 10s
13+
retries: 3
14+
start_period: 5s
15+
volumes:
16+
- type: bind
17+
source: files
18+
target: /files
19+
is_directory: true
20+
- type: bind
21+
source: media
22+
target: /media
23+
is_directory: true
24+
- type: bind
25+
source: logs
26+
target: /logs
27+
is_directory: true
28+
- type: bind
29+
source: config
30+
target: /config
31+
is_directory: true
32+
- type: bind
33+
source: plugins
34+
target: /plugins
35+
is_directory: true
36+
- type: bind
37+
source: savefiles
38+
target: /savefiles
39+
is_directory: true
40+
41+
db:
42+
image: postgres:16
43+
restart: unless-stopped
44+
environment:
45+
POSTGRES_USER: gamevault
46+
POSTGRES_PASSWORD: ${DB_PASSWORD}
47+
POSTGRES_DB: gamevault
48+
volumes:
49+
- type: bind
50+
source: databae
51+
target: /var/lib/postgresql/data
52+
is_directory: true

entrypoint.sh

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,28 @@ echo "# ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚
99
echo "# developed by Phalcode #"
1010
echo "#################################################################################"
1111
set -e
12-
# If running as root, it means the --user directive for Docker CLI/Compose was not used
13-
# Use then the PUID env to set the user and group IDs
14-
if [ "$(id -u)" = '0' ]; then
15-
# Modify the group ID of the 'node' user to match the PGID environment variable
16-
groupmod -o -g "$PGID" node
17-
# Modify the user ID of the 'node' user to match the PUID environment variable
18-
usermod -o -u "$PUID" node
19-
# Run the specified command with the modified user and group IDs
20-
sudo -u "#$PUID" -g "#$PGID" -E node "${@}"
12+
13+
echo "Starting container with PUID=${PUID} and PGID=${PGID}"
14+
echo "Effective UID: $(id -u), GID: $(id -g)"
15+
16+
# If running as root, adjust the "node" user to match PUID/PGID,
17+
# change ownership on directories, and drop privileges.
18+
if [ "$(id -u)" = "0" ]; then
19+
# Adjust ownership and ensure permissions are open.
20+
chown -R "${PUID}:${PGID}" /app/dist /files /media /logs /db /plugins /savefiles
21+
chmod -R 775 /app/dist /files /media /logs /db /plugins /savefiles
22+
23+
# Only update the node user's UID/GID if different from defaults.
24+
if [ "${PUID}" != "1000" ] || [ "${PGID}" != "1000" ]; then
25+
echo "Updating 'node' user to PUID: ${PUID} and PGID: ${PGID}"
26+
groupmod -o -g "${PGID}" node
27+
usermod -o -u "${PUID}" node
28+
fi
29+
30+
# Drop privileges and run the command.
31+
exec sudo -u "#${PUID}" -g "#${PGID}" -E node "$@"
2132
else
22-
# If using the user directive, run the specified command normally
23-
exec node "${@}"
33+
# If running as non-root (e.g. using docker-compose "user:"), rely on open permissions.
34+
echo "Running as non-root user: $(id -u)"
35+
exec node "$@"
2436
fi

0 commit comments

Comments
 (0)