This repository contains the source code for my website. The website is written in Rust using the frontend framework Yew. Trunk is used to compile the the code to WebAssembly. Github actions is used to test and deploy the code. Pushing to main automatically triggers a build which will be deployed to my server hosting the website.
-
Dependencies
-
Build
trunk serve
Nginx docker container is used to host the website. The docker compose file and ngnix.conf
needs to be copied to the server hosting the website. Then start the docker container using
docker compose up -d
Then we need to copy the files over to the server. First compile to wasm using:
trunk build --release
Copy contents of dist/ directory into torborve_web
in folder used to start the docker container.
I use Let's Encrypt for my SSL certificates:
sudo certbot certonly --standalone -d torborve.no -d xn--brs-ula.no
This will create certificates. They need to be updated every 90 days. I am not sure if this is done automatically.
The docker container needs permission to read the certificates. This can be done by running:
sudo chown -R www-data:www-data /etc/letsencrypt/live/ /etc/letsencrypt/archive/
sudo chmod -R 755 /etc/letsencrypt/