Publicly Available Installations -- out of date #41
Replies: 3 comments 25 replies
-
The information above mostly still applies to BirdNET-Pi, but has been simplified a bit. Please comment here if there is any uncertainty on how to adjust the information above to apply to the BirdNET-Pi installation. |
Beta Was this translation helpful? Give feedback.
-
This is now a bit outdated. To share your BirdNET-Pi installation, edit the birdnet.conf after installation to the domain you own as the variable "BIRDNETPI_URL", and for the "BIRDNETLOG_URL" and "EXTRACTIONLOG_URL" variables, if you have two more (sub)domains. Only the BIRDNETPI_URL is needed to have most features work -- the log view will now work without addresses for those variables. After updating the birdnet.conf file, run "Update BirdNET-Pi" from the web interface's "Tools" page. When the update is complete, your installation should be reachable at your domain. Please don't hesitate to comment here or in the issues section for help getting this working! My best, |
Beta Was this translation helpful? Give feedback.
-
This is the most elegant solution to the dynamic dns problem -- and it provides a free domain name for all users! NoIP.comI will provide screenshot step-by-step guides for this, but will ultimately tuck this into an optional service (since it's just an executable and only supports init and not systemd).
That's it!! Now, the Dynamic Update Client (on the BirdNET-Pi) will update the DDNS (NoIP) that it has a new IP address, and the A record (the public IP address associated with the free No-IP hostname). This is basically what AnyDesk does to keep its clients updated with its servers. Diagram:
When the ISP/LTE Carrier issues a new public IP address to the Modem/Router, the DUC running on the BirdNET-Pi sends an update to the DDNS that it has a new IP address. The DDNS updates its A record so that requests to "http://birdnetpi.ddns.net" resolve to the newly updated IP address. |
Beta Was this translation helpful? Give feedback.
-
Out of date -- see comment from October 21st, 2021
So you have the BirdNET-system up and running and you want to show it off, eh? That's great! BirdNET-system was built with sharing data in mind. Follow along here to learn how the web services are handled and change them to be reachable at your personal domain.
Before we make any changes, I want to explain a bit about the process so that you know what you're doing and why. But if you don't care, you can skip down to the Prerequisites To Sharing BirdNET-system section.
The main idea
BirdNET-system uses Caddy as its web server, alongside 3 small GoTTY web servers. In spite of having 4 separate web servers, Caddy actually manages them all. Take a quick look at the default Caddyfile:
(Note: This is the current default, and may change in the future, but the main idea is the same.)
Each "site-block" is separated by a blank new-line for readability.
You can see that there are 5 site-blocks, the first 2 of which look a little redundant at the moment:
Notice that each site address is http only. This disables a great little feature that is build into Caddy: automatic handling of TLS/SSL certificates. These certificates are what add the "s" to your https and encrypt the traffic that flows between the server and its clients.
If we were to simply add the "s" to the http addresses here, and restart Caddy, Caddy would automatically reach out to Certificate Authorities (CAs) to determine whether BirdNET-system actually owns https://raspberrypi.local. Since it is impossible to own a domain outside of the acceptable Top Level Domain options (e.g., .com, .org, .gov, .edu, .xyz, .io), Caddy would fail trying to prove that BirdNET-system owns http://raspberrypi.local.
If, however, we were to replace "http://raspberrypi.local" with a domain we actually do own, say "https://pmcgui.xyz" and then restart Caddy, Caddy would automatically reach out to CAs to find without error that this BirdNET-system does in fact own that domain. After that handshake, the BirdNET-system is reachable at "https://pmcgui.xyz"!!
Prerequisites To Sharing BirdNET-system
If you want to share your BirdNET-system Extractions over the internet, you will need to own a Top Level Domain name. The domain name will need to be registered with a DNS service provider to point to the public IP address of the network on which your BirdNET-system resides (DNS A records). Most domain name providers also provide access to setting up DNS A records and instructions on how to do so. And lastly, be sure ports 80 and 443 are forwarded to the BirdNET-system host IP address through the router or switch. (Advanced users may also consider using subdomains to access different pages at different URLs.)
To test if you have met the prerequisites, do the following:
Sharing BirdNET-system
In order to have Caddy handle the SSL/TLS certificates to encrypt the traffic between our BirdNET-system and any users who want to connect to it, we will need to alter the default Caddyfile.
This file is not editable as the regular pi user, so we'll need to edit this in the terminal using
sudo
andnano
.sudo nano /etc/caddy/Caddyfile
to open a terminal text editor you can use to alter the URLs beginning each site-block.http://raspberrypi.local
, add your domain name. See the before and after example below that shows the changes needed to make the first site-block accessible at your domain. The example will be making the BirdNET-system available at "https://mybirdnetsystem.com".Before:
After:
Once you've made the change to the Caddyfile, you can restart the service with
sudo systemctl restart caddy
. Caddy typically takes about a minute to properly fetch and validate its new certificates.After a minute or so, you should be able to reach your BirdNET-system at https://mybirdnetsystem.com!!
-- Note that some home networks do not route requests to themselves very gracefully, e.g., you may try https://mybirdnetsystem.com from the same WiFi the BirdNET-system is using, only to be redirected to your router's login page. If this is the case, that doesn't mean it is not working, it simply is a router (or ISP provider) quirk. Test the website from your phone's LTE connection.
Please let me know if anyone has trouble with this or needs more information. I will likely be changing the basic BirdNET-system Extractions page to also include links to the web logs so that you only need to change one site-block in order to have full access to all of your web services from one domain address.
Best of luck!
Patrick
Beta Was this translation helpful? Give feedback.
All reactions