Skip to content

Commit

Permalink
Release 13.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfagun74 authored Oct 20, 2024
2 parents c8f7df4 + 57b6daf commit 214dc00
Show file tree
Hide file tree
Showing 186 changed files with 14,644 additions and 5,878 deletions.
10 changes: 10 additions & 0 deletions .dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
VOLUMES_SQLITEDB=./.local/db
VOLUMES_MEDIA=./.local/media
VOLUMES_FILES=./.local/files
VOLUMES_LOGS=./.local/logs
VOLUMES_PLUGINS=./.local/plugins
VOLUMES_CONFIG=./.local/config
DB_SYSTEM=SQLITE
SERVER_API_DOCS_ENABLED=true
SERVER_LOG_LEVEL=debug
SERVER_ACCOUNT_ACTIVATION_DISABLED=true
25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/deployment-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ jobs:
tags: |
phalcode/gamevault-backend:unstable
ghcr.io/phalcode/gamevault-backend:unstable
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/deployment-early-access.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Deploy for Early Access

on:
push:
branches:
- early-access

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: phalcode
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: phalcode
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
phalcode/gamevault-backend:early-access
ghcr.io/phalcode/gamevault-backend:early-access
9 changes: 0 additions & 9 deletions .local.env

This file was deleted.

File renamed without changes.
File renamed without changes.
Empty file added .local/plugins/.gitkeep
Empty file.
6 changes: 5 additions & 1 deletion .npm-upgrade.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"ignore": {
"mime": {
"versions": "4",
"versions": ">3",
"reason": "ESM"
},
"better-sqlite3": {
"versions": ">9",
"reason": "TypeORM compatibility"
}
}
}
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"singleQuote": false,
"endOfLine": "auto"
"endOfLine": "auto",
"plugins": ["prettier-plugin-organize-imports"]
}
5 changes: 3 additions & 2 deletions .testing.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
VOLUMES_SQLITEDB=./.local/db
VOLUMES_IMAGES=./.local/images
VOLUMES_MEDIA=./.local/media
VOLUMES_FILES=./.local/files
VOLUMES_LOGS=./.local/logs
VOLUMES_PLUGINS=./.local/plugins

SERVER_LOG_LEVEL=debug
SERVER_ADMIN_USERNAME=admin
SERVER_ADMIN_PASSWORD=12345678
DB_SYSTEM=SQLITE
TESTING_IN_MEMORY_DB=true
TESTING_MOCK_FILES=true
RAWG_API_KEY=FAKEAPIKEY
DB_SYNCHRONIZE=true #TODO: Remove this after fixing migration
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sonarlint.connectedMode.project": {
"connectionId": "phalcode",
"projectKey": "Phalcode_gamevault-backend"
}
}
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# GameVault Backend Server Changelog

## 13.0.0

Recommended Gamevault App Version: `v1.12.0.5`

### Breaking Changes & Migration

**A lot** has changed in this version. Honestly, I’ve almost rewritten the entire codebase.

Please read the migration instructions below **BEFORE UPDATING**! (Migration instructions are marked **in bold**)

**For existing servers:** The migration process may take up to 30 minutes or even longer for larger servers. During this time, clients will not be able to use the server. The container may appear as UNHEALTHY after 5 minutes during a long migration, but don’t worry—let it run as long as logs are active. Be sure to disable any auto-heal processes for GameVault to avoid interruptions.

**After the migration:** The existing data might not be visible at first glance because we need to "merge" it. This could also take a while. Check the logs for inactivity before contacting us about this.

- Major database and codebase overhaul!
- **I’ve done my best to migrate your existing data, but nobody’s perfect. Be sure to back up your data thoroughly before migrating, and contact us if you encounter any migration errors.**
- Some configurations and environment variables have changed.
- **Ensure your environment variables are [configured correctly](https://gamevau.lt/docs/server-docs/configuration).**
- [#140](https://github.com/Phalcode/gamevault-backend/issues/140): Introduced a new plugin framework that universally supports any metadata provider plugin and implemented a built-in IGDB Metadata Provider Plugin as the new default.
- **This is necessary, as RAWG integration has been removed. Learn how to set up the IGDB plugin [here](https://gamevaul.lt/docs/server-docs/metadata-enrichment/provider-igdb).**
- **IGDB metadata is now prioritized over RAWG, as its data quality is superior. If you want your existing data to remain the primary source, set the `METADATA_IGDB_PRIORITY` environment variable to a value lower than `-10` before running the update.**
- **We recommend first migrating the server to v13, then setting up IGDB and restarting, to minimize downtime.**
- **Old experimental plugins are no longer supported. Remove them if you were using any (Spoiler: You probably weren’t).**
- Added support for more media types beyond just images. You can now upload audio and video files as well.
- **You now need to mount your `/images` volume as `/media`.**
- Implemented parental control features. [#304](https://github.com/Phalcode/gamevault-backend/issues/304)
- **Learn how it works and how to set it up [here](https://gamevau.lt/docs/server-docs/parental-control).**
- Various API changes.
- **Check the API documentation for any updates if you're using the REST API.**

### Changes

- Removed RAWG integration and all configurations for it.
- Removed Google Images Boxart Scraper. (Let's be honest, it was shit anyway.)
- Optimized the Game Indexer. It now usually only reads games that have changed instead of reading all files all the time.
- Optimized startup time.
- [#161](https://github.com/Phalcode/gamevault-backend/issues/161) Implemented editing of games.
- [#423](https://github.com/Phalcode/gamevault-app/issues/423) Implemented a `news.md` (a.k.a. Message of the Day) file and a `GET /config/news` API you can use to communicate news to your users. -> **Learn how to set it up [here](https://gamevau.lt/docs/server-docs/server-news).**
- Implemented a notes field in games.
- Implemented default launch parameters, default launch executable, and default installer file fields in games.

## 12.2.0

Recommended Gamevault App Version: `v1.11.0.0`
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ ENV PATH=$PNPM_HOME:$PATH
ENV SERVER_PORT=8080

# Create directories and set more restrictive permissions
RUN mkdir -p /files /images /logs /db \
&& chown -R node:node /files /images /logs /db \
&& chmod -R 777 /files /images /logs /db
RUN mkdir -p /files /media /logs /db /plugins \
&& chown -R node:node /files /media /logs /db /plugins \
&& chmod -R 777 /files /media /logs /db /plugins

# Install pnpm and other needed tools
RUN sed -i -e's/ main/ main non-free non-free-firmware contrib/g' /etc/apt/sources.list.d/debian.sources \
Expand Down Expand Up @@ -57,8 +57,8 @@ RUN chmod +x /usr/local/bin/entrypoint.sh

EXPOSE ${SERVER_PORT}/tcp

# Periodic Healthcheck on /api/v1/health
HEALTHCHECK CMD curl -f http://localhost:${SERVER_PORT}/api/health || exit
# Periodic Healthcheck on /api/health
HEALTHCHECK --start-period=300s CMD curl -f http://localhost:${SERVER_PORT}/api/health || exit

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD [ "dist/src/main" ]
14 changes: 14 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Security Policy

## Supported Versions

The following Docker Tags are supported by Phalcode and get regular security updates.

| Version | Regular Updates | Supported |
| ------- | ---|------------------ |
| ``latest`` | :white_check_mark:|:white_check_mark: |
| ``unstable`` |:white_check_mark: |:x: |
| ``early-access`` | :x: |:x:|

## Reporting a Vulnerability
Please report any vulnerabilities to Phalcode [via Email](mailto:contact@phalco.de).
1 change: 1 addition & 0 deletions assets/ignored-executables.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ installfile
installscript
installwizard
notification_helper
dotNetFx40_Full_setup
oalinst
patcher
patchinstaller
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions docker-compose.sqlite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
gamevault-backend:
build: .
restart: unless-stopped
environment:
DB_SYSTEM: SQLITE
ports:
- 8080:8080
7 changes: 1 addition & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.8"
services:
gamevault-backend:
build: .
Expand All @@ -7,14 +6,10 @@ services:
DB_HOST: db
DB_USERNAME: gamevault
DB_PASSWORD: RANDOMPASSWORD
# The Following Line grants Admin Role to account with this username upon registration.
SERVER_ADMIN_USERNAME: admin
# Uncomment and Insert your RAWG API Key here if you have one (https://gamevau.lt/docs/server-docs/indexing-and-metadata#rawg-api-key)
# RAWG_API_KEY: YOURAPIKEYHERE
ports:
- 8080:8080
db:
image: postgres:15
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_USER: gamevault
Expand Down
10 changes: 9 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/sh
echo "#################################################################################"
echo "# ██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ █████╗ ██╗ ██╗██╗ ████████╗ #"
echo "# ██╔════╝ ██╔══██╗████╗ ████║██╔════╝██║ ██║██╔══██╗██║ ██║██║ ╚══██╔══╝ #"
echo "# ██║ ███╗███████║██╔████╔██║█████╗ ██║ ██║███████║██║ ██║██║ ██║ #"
echo "# ██║ ██║██╔══██║██║╚██╔╝██║██╔══╝ ╚██╗ ██╔╝██╔══██║██║ ██║██║ ██║ #"
echo "# ╚██████╔╝██║ ██║██║ ╚═╝ ██║███████╗ ╚████╔╝ ██║ ██║╚██████╔╝███████╗██║ #"
echo "# ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ #"
echo "# developed by Phalcode #"
echo "#################################################################################"
set -e

# If running as root, it means the --user directive for Docker CLI/Compose was not used
# Use then the PUID env to set the user and group IDs
if [ "$(id -u)" = '0' ]; then
Expand Down
47 changes: 47 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: ["**/.eslintrc.js"],
},
...fixupConfigRules(
compat.extends(
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
),
),
{
plugins: {
"@typescript-eslint": fixupPluginRules(typescriptEslintEslintPlugin),
},
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
parser: tsParser,
ecmaVersion: "latest",
sourceType: "module",
parserOptions: {
project: "tsconfig.json",
},
},
},
];
Loading

0 comments on commit 214dc00

Please sign in to comment.