This contains the code/container for wotnlbeclans.eu. On this site you can see all Dutch & Belgium clans ranked.
Item | Used |
---|---|
Backend | Rust |
Frondend | Preact |
- Make sure you have installed docker in production and in development make sure you have rust and nodejs
git clone git@github.com:mjarkk/wotnlclans.git && cd wotnlclans
- Configure
config.json
{
"allowedWords": [], // Clan descriptions get checked for these words
"disallowedWords": [], // These words should not appear in the description
"blockedClans": [], // A list of strings with as content clan IDs
"extraClans": [], // A list of extra clans that might not be autodetected
"wargamingKey": "7e5ce7007256737daa79dbec35f4f072", // Your wargaming key
"discordAuthToken": "", // Optional discord token for discord bot
"discordAuthUrl": "", // If discord auth token is provided this is the auth url used to authenticated
"webserverLocation": "localhost:8282", // Where should the webserver be ran
"webAnalytics": "", // Spyware scripts :)
"title": "Wot NL/BE clans", // Site title
"community": [ // Posts on community tab
{
"text": "Join the WOT NL/BE\nclans Facebook community",
"background": {
"text": "FACE\nBOOK",
"color": "#4c4fef",
"image": ""
},
"link": {
"url": "https://www.facebook.com/groups/wotbelgium/",
"text": "Go To"
},
"info": "",
"requirements": []
},
]
}
- Generate a new application here: https://discordapp.com/developers/applications/
- Set a icon and after that go to the Bot tab
- Click the copy button NOTE: The community tab has a static discord bot invite link that is from the production build
If the rust binary fails to build on the last step you might need more ram, a easy fix for this is to add some extra swap if your server doesn't have any: https://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/ In my case my serer has 2GB of ram and i added 2GB of swap.
docker build -t wotclans:latest .
- Run:
docker run \
--restart always \
--name wotclans \
-d \
-p 8282:8282 \
wotclans:latest
- Configure
config.json
- Read web_static/README.md
- Run
cargo run -- --dev
(usecargo run -- --help
for the argument options)
- For development just restart the webpack server and api
- For production rebuild the container then remove the container if running and start it again