Calculate Optimal Setups
Go to file
2024-08-05 14:10:46 +02:00
assets fix #6 2024-08-04 08:46:07 +02:00
components Übersetzung verbessert 2024-08-04 08:33:50 +02:00
consts Übersetzung angepasst 2024-08-05 14:10:46 +02:00
libs Deutsche Übersetzung 2024-08-04 14:22:16 +02:00
pages Titel übersetzt auf Deutsch (löst #2) 2024-08-03 22:05:29 +02:00
public #4 2024-08-04 09:03:20 +02:00
styles noreport 2023-09-04 02:11:46 +08:00
.env.template .env.template hinzugefügt 2024-08-04 09:51:57 +02:00
.eslintrc.json Initial commit 2022-08-26 23:03:37 +00:00
.gitignore sentry 2023-04-21 11:45:13 +08:00
LICENSE Create LICENSE 2022-08-28 12:07:33 +08:00
next.config.js remove @sentry 2024-05-11 17:03:59 +08:00
package.json remove @sentry 2024-05-11 17:03:59 +08:00
README.md README.md aktualisiert 2024-08-04 10:24:24 +02:00

F1 Manager Setup Calculator

The name explains it all.

Official Website: https://f1setup.kmpr.at/

Install

Run the following commands:
apt update && apt install ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=21
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
apt update && apt install nodejs
node --version
cd ~ && git clone https://git.kmpr.at/kamp/F1Manager-Calc.git
cd ~/F1Manager-Calc
npm install
npm run build
npm run start

Install and configure MongoDB for Cloud-Sync

Run the following commands:

curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
   sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \
   --dearmor

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
apt update && apt install -y mongodb-org
systemctl daemon-reload && systemctl start mongod && systemctl enable mongod
cp .env.template .env

Replace the following values in the .env file:
NEXTAUTH_SECRET: Copy-paste the output of openssl rand -base64 32
NEXTAUTH_URL: Change to your FQDN where yout F1 Manager calculator runs
DISCORD_CLIENT_ID: Navigate to: https://discord.com/developers/applications and create new application. In OAuth2 section you get CLIENT ID to fill in here.
DISCORD_CLIENT_SECRET: In the same OAuth2 section described above you also get CLIENT SECRET to fill in here.
Do not change all other variables in the .env file.

Information for Discord App:
You have to enter https://f1setup.yourdomain/api/auth/callback/discord (with the same FQDN as in NEXTAUTH_URL) in the field "Redirects" and select "identify" and "email" in "Scopes" to get it to work.

Run as service

Run the following commands:
nano /etc/systemd/system/f1setup.service

[Unit]  
Description=F1 Setup Manager  
[Service]  
EnvironmentFile=/root/F1Manager-Calc/.env  
WorkingDirectory=/root/F1Manager-Calc  
ExecStart=/usr/bin/npm run start --prefix /root/F1Manager-Calc  
Restart=always  
[Install]  
WantedBy=multi-user.target  

systemctl daemon-reload
systemctl start f1setup
systemctl enable f1setup

Update

Run the following commands:
cd ~/F1Manager-Calc && git pull --force
npm run build && systemctl restart f1setup

Update cron

todo