Commit Graph

29 Commits

Author SHA1 Message Date
Wraith 26f5d40819 build: migrate build system to Vite and test runner to Vitest & Remove depracated husky usage (#2703)
- Replace Webpack with Vite for faster client bundling and HMR.
- Migrate tests from Jest to Vitest and update configuration.
- Update Web Worker instantiation to standard ESM syntax.
- Implement Env utility in `src/core` for safe, hybrid environment
variable access (Vite vs Node).
- Refactor configuration loaders to remove direct `process.env`
dependencies in shared code.
- Update TypeScript environment definitions and project scripts for the
new toolchain.
- Remove the [depracated usage of the
husky](https://github.com/typicode/husky/releases/tag/v9.0.1).

## Description:

migrate build system to Vite and test runner to Vitest & Remove
depracated husky usage

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

wraith4081

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-12-28 22:10:26 -08:00
Evan a6d3fb1efd switch from dockerhub to ghcr, improve docker caching (#2695)
## Description:

Switch to GHCR for faster pulls/pushes and increased rate limits
Use cache-builder driver for better caching, so npm ci is cached if
dependencies don't change.



## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-12-25 16:00:28 -08:00
Evan 0d37db8a3f Update docker build to be smaller & faster (#2693)
## Description:

1. eliminate redundant curls/downloads
2. better stage organization
3. only copy required dirs & files, (removed the COPY . .) 

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-12-25 12:49:00 -08:00
Aleksey Orekhovsky 7743c39ecb Reintroduce commit metadata in the final image (#1737)
## Description:
This PR fixes a regression where the `GIT_COMMIT` environment variable
was no longer available in the final container image after a recent
Dockerfile refactoring.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

aaa4xu
2025-08-07 20:13:28 -04:00
Aleksey Orekhovsky ee459b7410 Reduce Docker image size by refactoring map loading (#1621)
## Description:

This PR implements a major refactoring of how map data is stored and
loaded, as described in #1242. Previously, map data (`.bin` files) was
bundled directly into the client-side JavaScript by Webpack using
`binary-loader`. This approach led to data duplication and increased
bundle/image sizes.

This refactoring changes the strategy entirely:
- `GameMapLoader` interface has been introduced to decouple the map
loading mechanism from the components that use it.
- New `FetchGameMapLoader` implementation loads map data by fetching it
from static server endpoint.
- Webpack configuration and `Dockerfile` have been updated to serve the
map files as static assets and to remove the source `resources/maps`
directory from the final image, thus eliminating data duplication.

This leads to several key improvements:
- Docker image size is reduced from ~750 MB to ~600 MB.
- Build time is decreased. On my local machine, the docker image build
time went from 48s to 43s.
Most of this speed-up comes from faster Webpack builds (reduced from 16s
to 11s), as it no longer needs to process large binary files. This
performance gain will be noticeable for all developers during local
development, not just in the CI workflow.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

aaa4xu
2025-08-01 04:49:07 +00:00
Aleksey Orekhovsky 97eb48a650 Reduce docker image size with multi-stage build and dependency pruning (#1581)
## Description:
This PR focuses on trimming down docker image size while keeping runtime
behaviour intact.
This partially addresses #1242 by slimming the production Docker image
by ~33%.
```
$ docker image ls | grep openfront
openfrontio  latest   992fb420f131   1 minute ago   1.05GB   # new
evanpelle/openfront-prod <none> 216c629def78 6 hours ago 1.58GB   # current prod
```

The savings come from three areas:
- Refactor `Dockerfile` into a three‑stage build (dependencies / build /
runtime).
- Installs dev‑only node packages in a throw‑away layer and copies only
production modules to the final image.
- Updated `webpack.config.js` to skip copying `resources/maps/**/*`
which never referenced by the client.

Because the current codebase does not cleanly separate dev/prod
requirements, extensive regression testing is necessary; some latent
prod usage of dev‑only modules might surface.

## Please complete the following:
- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I have read and accepted the CLA agreement (only required once).

## Please put your Discord username so you can be contacted if a bug or
regression is found:

aaa4xu

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-07-26 02:36:13 -04:00
evanpelle 0e56213b9a increase worker connections (#1179)
## Description:
Once or twice a week nginx crashes with "768 worker_connections are not
enough while connecting to upstream"
So increase number of allowed connections.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

<DISCORD USERNAME>
2025-06-16 18:32:22 -07:00
Scott Anderson 790b052ca2 Move version and changelog to files (#1109)
## Description:

Move these assets to files so that they can be replaced with generated
assets in the future.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-06-10 10:07:26 -07:00
evanpelle 718eda9888 cloudflare fixed tunnel name (#1096)
## Description:
The binary created a new tunnel on startup, and if the container crashed
looped, then it would generate 100s of tunnels causing us to reach the
1000 tunnel limit.

Now the config is stored on a mounted volume, so if the container
restarts it sees the existing config and does not create a new tunnel.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
2025-06-08 19:38:23 -07:00
evanpelle da93fe05ea fix cloudflare tunnels (#1076)
The Server didn't have correct permissions to create the directory for
the cloudflare config. Have docker do it instead. Also the credentials
file key was incorrect.
2025-06-06 16:13:05 -07:00
Scott Anderson da18f7d4b1 Update dockerfile to node 24 (#814)
## Description:

Update Dockerfile to `node:24-slim` to resolve an error about missing
crypto that is preventing JWT cryptographic verification.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-19 00:13:31 -04:00
Scott Anderson e402687988 Add prettier-plugin-sh (#762)
## Description:

Add prettier-plugin-sh to format shell files.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-05-15 23:09:39 -04:00
evan ef7b7aed7c move dependencies into 'dependencies' layer to speed up build time 2025-05-04 13:45:20 -07:00
evan ee5b7fa1b8 add commit.txt to check commit server was built at 2025-05-04 12:12:39 -07:00
evan e849cbd091 add deployment option to enable basic auth 2025-05-01 12:59:01 -07:00
evanpelle ffc2fadc20 use otel for observability (#635)
## Description:

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

<DISCORD USERNAME>

Co-authored-by: evan <openfrontio@gmail.com>
2025-05-01 11:22:56 -07:00
evanpelle 03f7bade7f Dynamic tunnels (#579)
## Description:

Update deployment:

1. automatically create and configure CF tunnels and point it to
subdomain.domain

2. Send loki logs to remote endpoint

3. create metric-exporter.sh to push prom metrics to remote endpoint

4. update and refactor deployment & env variables

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

<DISCORD USERNAME>

---------

Co-authored-by: Evan Pellegrini <evan@Evans-Air.attlocal.net>
Co-authored-by: evan <openfrontio@gmail.com>
2025-04-20 19:34:17 -07:00
Evan da1b3dbf4b update build script to use regions instead of prod/alt, just single build for docker, remove bun start up 2025-03-17 13:30:48 -07:00
Evan 2c075fc382 Revert "initial bun setup"
This reverts commit 5236f7a212.

bun was causing code 1006 websocket errors
2025-03-16 20:37:04 -07:00
evanpelle 5dc00bc3ab use git commit hash verification when replaying archived games (#204) 2025-03-10 12:40:36 -07:00
evanpelle 3ca4bb4dad switch to multistage docker build to fix docker build (#199) 2025-03-09 20:46:46 -07:00
BeGj 5236f7a212 initial bun setup 2025-03-07 15:45:29 +00:00
Evan caaf37699d fix deployment pass GAME_ENV variable 2025-03-05 13:16:36 -08:00
Evan a7c3c63ec7 use save=dev when building 2025-02-28 08:18:37 -08:00
Evan f540d0302c configure nginx to run in container 2025-02-27 19:21:18 -08:00
Evan 3494c54906 use node cluster to shard server 2025-02-27 10:45:30 -08:00
Evan 2b3c24c398 add preprod, prod & dev config 2024-12-17 14:29:31 -08:00
evanpelle 001722bd59 added deployment 2024-08-13 20:07:20 -07:00
evanpelle 7af66be06d adding docker deployment 2024-08-13 07:34:07 -07:00