4.7 KiB
We host the server at netcup - Germany, a company that offers VPS. The IP address of our server is 37.120.177.0.
Organisation
Access
The following is the access data to access the server through ssh (part of my ~/.ssh/config file):
Host netcup
HostName v2202204173997187481.hotsrv.de
User root
IdentityFile ~/.ssh/netcup_osd_claudio
Setup
Vinnie, Dannick's Friend, helped me with the setup. I leave the bash history and the zsh history files here as a reference. !bash_history_netcup
I have installed zsh and oh-my-zsh to make the interaction easier
in the cli-history files above you can see how the project got updated, but basically update the project files on a local machine, test everything, push it to gitlab. Then access the server, pull the changes, checkout to the correct version and restart the docker container:
docker compose -f docker-compose.dev.yml down docker compose -f docker-compose.dev.yml up -d --build --force-recreate
Structure
The main folder is called osd_apps, which hosts the web-apps that we're running. We use nginx as a reverse proxy to serve the different web-apps and Docker to run the apps in an appropriate container.
We also use certbot (installed through snap) to keep the certifiates up to date.
The OneSec - FlightReview is hosted at the website testlogs.onesec.com. The authentication is done through a nginx configuration. The credentials can be found on the specified article.
6tunnel
6Tunnel is used to create a translation service for Dannicks NAS. Basically the server (which has a static IPV4 address) forwards requests to a IPV6-address (Dannicks NAS). See history files above for the commands. And make sure that the firewall (ufw) allows the correct ports (32400 in Dannicks case).
Nginx
Nginx is used as a reverse proxy server, that checks incoming traffic and routes it to the correct interface on the server. We can configure it, such that any traffic coming from a certain URI (e.g. testlogs.onesec.com) is rerouted to the localhost:5006. And on this interface we are running a docker container, which hosts the web-app. This means that any traffic coming from testlogs.onesec.com is directed towards the web-app and any other traffic (from the IP for instance) is routed to /var/www/http and a static content is served (default nginx stuff). If another app is added we can have an additional port for that as explained in this article.
Certbot
Certbot is a tool that manages certificates for our webserver. It has a really good integration with nginx. Some more info can be found here. Especially the cron-job for the autorenewal is handy. But cerbot also has a automated way of handling this, as can be seen in the instruction set by digital ocean. Compared to the instructions on the blog article, on our server we've used the following command:
sudo certbot --nginx -d testlogs.onesec.com
Docker
Docker is used to isolate multiple web-apps that are running. A few important things are listed here:
- use the
-dor--detachoption to let it run in the background even if the terminal is disconnected. This ensures that the webapp is running when the setup process is finished.
WebApps
PX4 - Flight Review
A customized version of the official PX4 flight review app is hosted there.
How to add a new WebApp?
- Go to namecheap.com, login and add a new A-record.!
you can see that for the subdomain foxglove and testlogs we have an A-Record 1 to forward to our VPS server (37.120.177.0). Once this is done all traffic gets forwarded to our VPS server where we need to handle it. - Access the servers command line through SSH (see instructions above).
Footnotes
-
An A record maps a domain name to the IP address (Version 4) of the computer hosting the domain. An A record uses a domain name to find the IP address of a computer connected to the internet. The A in A record stands for Address. ↩︎