Underground 2 Revived
Play Need for Speed: Underground 2 (2004) in Chrome and Firefox with WebGPU graphics, Web Audio, up to 120 fps widescreen, controller support, free roam and Online races with friends. Fan project, not
翻譯準備中
RPG system built on top of All Time Wrestling board game.
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
All Time Wrestling (ATW) RPG is a web-based wrestling RPG simulator that allows you to book shows, manage wrestlers, and generate AI-narrated matches.檢視完整 README ↗All Time Wrestling (ATW) RPG is a web-based wrestling RPG simulator that allows you to book shows, manage wrestlers, and generate AI-narrated matches.
To start the application in development mode, import it into your IDE and run the Application class.
You can also start the application from the command line by running:
./mvnw
The application will be available at http://localhost:8080/atw-rpg.
For project-specific startup instructions, see the Application Startup Guide. For instructions on how to add and manage game content (wrestlers, cards, sets), see the Content Management Guide. For general Vaadin information, see the Vaadin Getting Started Guide.
You can now reorder segments within a show and designate one segment as the main event. This provides greater control over the flow and narrative of your shows.
How to use:
AI Narration:
The AI narration service is aware of the segment order and which segment is the main event. It also has access to the results and narration of previous segments. This allows the AI to generate more context-aware and compelling narrations that build on events from earlier in the show.
The ranking system has been updated to provide a more dynamic and inclusive contender pool. Wrestlers are primarily ranked based on their fan count, with higher fan counts generally indicating higher ranks.
Crucially, wrestlers who have surpassed the typical fan cap for a given title's tier are no longer excluded from its rankings. This means a top-tier wrestler (e.g., a Main Eventer) can still appear in the contender list for a mid-card title if they meet the minimum fan requirements for that title, allowing for more diverse and strategic championship pursuits.
Fan acquisition and loss mechanics have been refined to ensure a more balanced and realistic progression for wrestlers:
At the end of each season, you have the option to perform a "soft reset" of your roster's fan standings and tier definitions. This helps keep the game balanced and provides a fresh start for the new season. These actions are available in the Season Settings view.
The fan recalibration process adjusts wrestler fan counts to prepare for the next season:
This process helps to prevent fan counts from becoming excessively inflated over time and ensures that the top tiers of the roster remain competitive.
You can reset the fan count boundaries for each wrestler tier back to their default values. This is useful if you have made adjustments to the tier boundaries during a season and want to revert to the standard configuration for the next season.
This ensures that the progression through the tiers remains consistent from season to season, unless you choose to make specific adjustments.
For a more drastic reset, you can use the "Full Fan Count Reset" option. This will reset all wrestler fan counts to 0 and their tier to ROOKIE. This is useful for starting a completely new game or when you want to level the playing field entirely.
The application features a drama event system that periodically generates random events affecting wrestlers (e.g., backstage incidents, social media drama, injuries).
Configuration:
The drama event scheduler is configured in the application.properties file.
# Enable or disable the drama event scheduler
drama.events.scheduler.enabled=true
# Frequency of event generation in milliseconds (default: 7 days)
drama.events.scheduler.rate=604800000
When enabled, the system will periodically select a random number of wrestlers and generate drama events based on weighted probabilities.
You can now configure segment rules to automatically add bumps to participants. This allows for more granular control over the physical toll that different types of matches have on wrestlers.
How to use:
When a segment with the configured rule is adjudicated, bumps will be added to the participants according to the selected option.
This section contains information for developers contributing to the project.
To build the application in production mode, run:
./mvnw -Pproduction package
This will produce an executable JAR in the target/ directory.
The application can be run directly as a standalone executable JAR. This is the recommended way for most users as it includes an embedded Tomcat server.
./mvnw clean package -DskipTests
java -jar target/all-time-wrestling-rpg-*.jar
The application will be available at http://localhost:8080/atw-rpg.
For non-technical users, you can generate native installers (DMG for macOS, DEB for Linux, MSI for Windows) that bundle a minimal Java runtime and include system tray integration and automatic browser launching.
./mvnw clean package -Pproduction,desktop -DskipTests
target/dist/.If you don't want to install the game, you can use the portable ZIP distribution.
./mvnw clean package -Pproduction,portable -DskipTests
target/ and run start-windows.bat, start-macos.sh, or start-linux.sh.For the fastest startup and lowest memory usage, you can build a native executable.
./mvnw clean package -Pproduction,native -DskipTests
Note: Requires GraalVM JDK with native-image installed.This project can be built and run using Docker.
Build the project using Maven:
./mvnw clean install -DskipTests
Build the Docker image:
docker build -t all-time-wrestling-rpg .
To run the application using Docker, you need to provide the required environment variables and mount a volume to persist the database.
Run the Docker container:
docker run -p 9090:9090 \
-v /path/to/your/data:/data \
-e AI_GEMINI_API_KEY="your_gemini_key" \
-e AI_OPENAI_API_KEY="your_openai_key" \
-e AI_CLAUDE_API_KEY="your_claude_key" \
all-time-wrestling-rpg
-p 9090:9090: Maps the container's port 9090 to the host's port 9090.-v /path/to/your/data:/data: Mounts a directory from your host machine to the /data directory inside the container. This is where the H2 database file will be stored, ensuring data persistence. Replace /path/to/your/data with the absolute path on your host machine.-e: Sets the environment variables required for the AI services. Mandatory Security Note: Sensitive values (API keys, tokens) are not stored in the Docker image and must be provided at runtime using this flag or an --env-file.The following environment variables can be used to configure AI services:
AI_TIMEOUT: Request timeout in seconds (default: 300).AI_PROVIDER_AUTO: Automatically select the first available provider (default: true).AI_OPENAI_ENABLED: Enable OpenAI (default: false).AI_OPENAI_API_KEY: Your OpenAI API key.AI_CLAUDE_ENABLED: Enable Claude (default: false).AI_CLAUDE_API_KEY: Your Claude API key.AI_GEMINI_ENABLED: Enable Gemini (default: false).AI_GEMINI_API_KEY: Your Gemini API key.See the Startup Guide for a full list of available environment variables.
The application will be accessible at `http://localhost:9090/atw-rpg`.
You can also deploy the application to a standalone Tomcat server.
Build the .war file:
./mvnw clean package -Pproduction,war -DskipTests
Deploy the .war file:
You have two options to get the .war file:
target/all-time-wrestling-rpg-*.war file to the webapps directory of your Tomcat installation.all-time-wrestling-rpg-*.war from GitHub Releases and copy it to the webapps directory of your Tomcat installation.In either case, rename the .war file to atw-rpg.war.
Configure Environment Variables:
Create a setenv.sh (for Linux/macOS) or setenv.bat (for Windows) file to define the required environment variables.
Important (Homebrew on macOS): To prevent your settings and deployed applications from being overwritten during a brew upgrade, do not use the default Tomcat directories. Instead, create persistent locations and symlink them:
# 1. Create persistent config and webapps directories
sudo mkdir -p /opt/homebrew/etc/tomcat/webapps
# 2. Create the setenv.sh file
cat <<EOF > /opt/homebrew/etc/tomcat/setenv.sh
export SPRING_DATASOURCE_URL="jdbc:mysql://localhost:3306/atw" export SPRING_DATASOURCE_USERNAME="root" export SPRING_DATASOURCE_PASSWORD="your_password" export SPRING_FLYWAY_LOCATIONS="classpath:db/migration/mysql" export SPRING_PROFILES_ACTIVE="mysql,prod" export TOMCAT_USERNAME="your_manager_user" export TOMCAT_PASSWORD="your_manager_password" export CATALINA_OPTS="$CATALINA_OPTS -Xms512m -Xmx2g" EOF chmod +x /opt/homebrew/etc/tomcat/setenv.sh
# 3. Create the relink script to handle upgrades automatically
# It must be idempotent: if you wire it to a launchd WatchPath on
# /opt/homebrew/opt/tomcat, the path fires on ANY file change in that tree
# (even transient app temp files), so only restart when a symlink changed.
cat <<EOF > /opt/homebrew/etc/tomcat/relink.sh
#!/bin/bash
setenv_link=/opt/homebrew/opt/tomcat/libexec/bin/setenv.sh webapps_link=/opt/homebrew/opt/tomcat/libexec/webapps changed=0
if [ "$(readlink "$setenv_link" 2>/dev/null)" != "/opt/homebrew/etc/tomcat/setenv.sh" ]; then ln -sf /opt/homebrew/etc/tomcat/setenv.sh "$setenv_link" changed=1 fi
if [ ! -L "$webapps_link" ]; then rm -rf "$webapps_link" fi if [ "$(readlink "$webapps_link" 2>/dev/null)" != "/opt/homebrew/etc/tomcat/webapps" ]; then ln -sfn /opt/homebrew/etc/tomcat/webapps "$webapps_link" changed=1 fi
if [ "$changed" -eq 1 ]; then /opt/homebrew/bin/brew services restart tomcat fi EOF chmod +x /opt/homebrew/etc/tomcat/relink.sh
# 4. Run the relink script for the first time
/opt/homebrew/etc/tomcat/relink.sh
```
**Note (Automating Homebrew Updates):** To automatically re-establish the symlinks and restart Tomcat whenever Homebrew updates the server, you can set up a background LaunchAgent:
```bash
printf '<?xml version="1.0" encoding="UTF-8"?>
launchctl load ~/Library/LaunchAgents/com.atwrpg.relink-tomcat.plist
```
4. Increase Upload Limits and Timeouts (Optional):
By default, Tomcat's Manager application limits uploads to 50 MiB and has a short connection timeout. If your `.war` file exceeds this size (e.g., the 180+ MiB full build), you must increase these limits:
1. Open the Manager app's `web.xml` file:
- **Homebrew**: `/opt/homebrew/opt/tomcat/libexec/webapps/manager/WEB-INF/web.xml`
- **Standard**: `webapps/manager/WEB-INF/web.xml`
2. Locate the `<multipart-config>` section and update the following values (e.g., to 500 MiB):
```xml
<multipart-config>
<!-- 500 MiB max -->
<max-file-size>524288000</max-file-size>
<max-request-size>524288000</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config>
```
3. Open the `server.xml` file in your Tomcat `conf` directory and increase the `connectionTimeout` and `maxPostSize` for the HTTP Connector:
```xml
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="300000"
maxPostSize="524288000"
maxSwallowSize="524288000"
redirectPort="8443" />
```
4. Restart Tomcat to apply the changes.
5. Start Tomcat:
Run `startup.sh` or `startup.bat` from the `bin` directory of your Tomcat installation, or use Homebrew:
```bash
brew services restart tomcat
```
If you have set up the Caddy reverse proxy (see [HTTPS over LAN with Caddy](#https-over-lan-with-caddy-qr-code-sharing)), the `relink.sh` script starts Caddy automatically. To start both manually:
```bash
brew services restart tomcat && caddy start --config /opt/homebrew/etc/tomcat/Caddyfile
```
The application will be accessible at http://localhost:8080/atw-rpg (or https://<your-lan-ip>/atw-rpg if Caddy is running).
The production profile for this application enforces HTTPS. If you are deploying to a standalone Tomcat server, you must configure it to handle HTTPS traffic.
Generate a Keystore: A keystore is a file that contains a certificate used by the server to enable HTTPS. For development, you can generate a self-signed certificate.
Navigate to the conf directory of your Tomcat installation and run the following command:
keytool -genkeypair -alias tomcat -keyalg RSA -keysize 2048 -storetype JKS -keystore localhost-rsa.jks -validity 36500
You will be prompted for several pieces of information:
changeit and confirm it. This password must match the one in the server configuration.localhost. This is the "Common Name" and should match the domain you are using to access the server.yes to confirm.This will create a localhost-rsa.jks file in the conf directory, valid for 100 years.
Edit server.xml:
Open the server.xml file located in your Tomcat conf directory and ensure the connectors are configured correctly. You need one connector for HTTP that redirects to HTTPS, and another for HTTPS itself.
Find and replace the existing <Connector> configurations with the following:
<!-- Define a non-SSL/TLS HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 -->
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
certificateKeystorePassword="changeit" type="RSA" />
</SSLHostConfig>
</Connector>
This configuration sets up an HTTP listener on port 8080 that automatically redirects to the HTTPS port 8443.
Restart Tomcat:
After saving the changes to server.xml, restart your Tomcat server.
The application will now be accessible at https://localhost:8443/atw-rpg. Accessing the http://localhost:8080 address will automatically redirect you to the secure HTTPS address.
Note on Browser Warnings: When using a self-signed certificate, your browser will display a security warning. This is expected. You can safely bypass this warning for development by clicking "Advanced" and then "Proceed to localhost (unsafe)". For a public-facing production server, you should obtain a certificate from a trusted Certificate Authority (CA) like Let's Encrypt.
The Share QR Code feature generates a scannable QR code so players can open a match on their phones. For phones to reach the server, the app must be accessible via a LAN IP address over HTTPS. Caddy handles this with zero certificate management: it terminates HTTPS on port 443, proxies to Tomcat on port 8080, and forwards the real host/protocol via headers so the QR code URL is correct.
Note: Both the server and the scanning device must be on the same Wi-Fi network. Disable any work VPN on the server machine before sharing, as VPN interfaces can interfere with LAN routing.
brew install caddy on macOS)Find your LAN IP:
ipconfig getifaddr en0
Note the IP (e.g. 192.168.4.47).
Update the Caddyfile in the project root — replace 192.168.4.47 with your actual LAN IP if it has changed:
https://192.168.4.47:443 {
reverse_proxy localhost:8080 {
header_up X-Forwarded-Proto https
header_up X-Forwarded-For {remote_host}
header_up X-Forwarded-Host {host}
}
}
Install Caddy's local CA so your Mac trusts the certificate:
caddy trust
Trust the cert on each phone (one-time per device):
Export the CA certificate:
ls ~/Library/Application\ Support/Caddy/pki/authorities/local/
# root.crt is in that directory — AirDrop it to the phone
The Caddyfile is stored at /opt/homebrew/etc/tomcat/Caddyfile alongside the Tomcat config, so it survives upgrades. The relink.sh script starts Caddy automatically when Tomcat is restarted. To start it manually:
caddy start --config /opt/homebrew/etc/tomcat/Caddyfile
The app is then reachable at:
https://localhost/atw-rpg — from this machinehttps://<your-lan-ip>/atw-rpg — from phones on the same networkThis project maintains a 90% code coverage goal using JaCoCo:
# Run tests with coverage (requires Java 25)
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-25.jdk/Contents/Home mvn clean verify
# View coverage report
open target/site/jacoco/index.html
For detailed coverage guidelines, see CONTRIBUTING.md.
# Apply code formatting
mvn spotless:apply
This project includes a comprehensive security implementation based on Spring Security to ensure that data is protected and users can only perform actions they are authorized for.
For a detailed guide on account management and user roles, see the User Guide.
For technical details on the security implementation, see the Developer Security Guide.
For details on automated database backups and other maintenance tasks, see the Database Maintenance Guide.
admin / admin123booker / booker123player / player123viewer / viewer123⚠️ Important: Change default passwords in a production environment!
To improve OWASP Dependency Check performance and avoid long update times, configure an NVD API key:
export NVD_API_KEY=your-api-key-heremvn dependency-check:check -Denv.NVD_API_KEY=your-api-key-hereWithout an API key, dependency checks may take significantly longer due to rate limiting.
This is a public repository with full GitHub Advanced Security features:
# Run OWASP dependency check
mvn org.owasp:dependency-check-maven:check
# Check for dependency updates
mvn versions:display-dependency-updates
# Generate detailed security report
mvn org.owasp:dependency-check-maven:check -Dformats=HTML,JSON,SARIF
This repository uses automated pull request labeling based on changed files:
frontend, backend, database, configurationdocumentation, tests, securitywrestling, ai, dependenciesmajor, minor, patchRun the label setup script to create all necessary labels:
./scripts/setup-labels.sh