assets | ||
components | ||
consts | ||
libs | ||
pages | ||
public | ||
styles | ||
.env.template | ||
.eslintrc.json | ||
.gitignore | ||
LICENSE | ||
next.config.js | ||
package.json | ||
README.md |
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