• 9 Posts
  • 909 Comments
Joined 3 years ago
cake
Cake day: June 15th, 2023

help-circle
  • lemmyvore@feddit.nltoSelfhosted@lemmy.world•Custom domains and Tailscale
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    1
    ·
    edit-2
    2 days ago

    Can I just buy a personal domain, and have all my services be coolname.com:####

    It’s actually better. If you get a domain and install a reverse proxy on the server (Nginx Proxy Manager is easy to use) it will help you get free SSL certificates and make subdomain “aliases” so you’ll be able to use https://service.coolname.com/ links. And they’ll have the little shield in browsers and everything.

    To get the SSL certificates you’ll need an SSL service with an API and access tokens. Most domain registrars are not this fancy unfortunately, but you can delegate your nameservers to a (free) service that can do that. DeSEC.io is a good choice.

    You only need this DNS provider to verify the ownership of coolname.com. You do NOT need to put any IP in there.

    for both local and Tailscale access? Is that as simple a process as I want it to be?

    The Tailscale access is a bit more involved. Here’s the general steps:

    • Get Tailscale running on the server with all the services and the reverse proxy. Tailscale will create a network interface with a 100.64.x.x IP address.
    • Have the reverse proxy listen on all server interfaces including that 100.64 IP. Generally this should happen automatically. You should be able to see the reverse proxy admin page at http://100.64.x.x:8081 (or whatever the admin port is) as well as at http://[lan ip of the server]:8081.
    • In order to reach the reverse proxy over the LAN when you type service.coolname.com you will need to tell your LAN DNS server to resolve *.coolname.com to the LAN IP of your server.
    • Next you need to install a small DNS server but this one has to listen only on the Tailscale IP. Dnsmasq is a tiny server you can use for this. You want to configure it to resolve *.coolname.com to the Tailscale IP (100.64.x.x).
    • Then you go to the Tailscale admin page under the “DNS” section, click on “Add nameserver”, choose “Custom nameserver”, put in that Tailscale IP, check the “Restrict to domain” box and put “coolname.com” in there.

    After that, when you’re at home but NOT connected to Tailscale you will have coolname.com pointing at the reverse proxy via the LAN IP, and when you ARE connected to Tailscale (whether at home or not) it will be pointing to the Tailscale IP and go through the Tailscale VPN. So you’ll be able to use https://service.coolname.com/ all the time everywhere.


  • The downside to the .ts.net approach is that you need to install multiple TS clients if you want multiple subdomains. Typically one per service.

    There are projects like TSD-Proxy that help with that. It makes it so you only use one Docker container instead of having to make a sidecar container for every service.

    Then you also have to resolve *.tailnet.ts.net on your LAN’s DNS and that’s it. Unless you ever want to use something other than Tailscale, that is.


  • It doesn’t “circumvent firewalls”, it’s helping you. You’re asking it to forward a port from the container’s internal interface, through the bridge to the host, and expose it on all interfaces on the host.

    There’s a small set of people who apparently like to do that by hand(?) but the vast majority prefer Docker to write and maintain all those rules… especially since it also takes them up and down as needed when the container starts and stops, and also updates them with the correct IPs from its internal networks, which can be allocated semi-randomly.

    (Fair warning, gonna be ranting and shaking my fist for the rest of this comment.)

    I’ve never understood what the problem is, I mean why ask it to expose on all interfaces and then complain it’s actually reachable. And how do these people orchestrate their rules anyway? My bet is they write a manual rule opening port 3000 on one IP then leave it up and forget about it. Meanwhile the port is bleeding into all the host interfaces and ends up being exposed to tunnels and all kinds of things it shouldn’t be. But somehow that’s more secure?

    As a rule of thumb, people really shouldn’t be using network rules unless they’re prepared to describe ALL the device’s networking in every detail. The rules should always start with DENY across the board and open things up explicitly.

    Calling them “firewall” has done a great deal of damage and encouraged people to think it’s somehow secure and ok to have ALLOW on everything then slap DENY on one particular public IP and open some ports on it. If you don’t want to expose a service then the first step would be to not run that service, and the second is to only bind it to the interfaces it really needs to be on. Not opening it up to everything then slapping a “firewall” on top.


  • Just give up and let megacorps own all of our mail?

    But there’s no shortage of email providers who aren’t megacorps.

    As long as you own the domain and have an archive of all your mail past and present in your own storage, does it really matter whose server you currently use to send and receive the email?

    I see email as a carrier service, like the broadband line or the mobile service. They move the messages through, it doesn’t matter who they are (privacy withstanding, as with any carrier).


  • lemmyvore@feddit.nltoSelfhosted@lemmy.world•How do you solve email?
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    4 days ago

    TLDR: “How do you self-host email” – that’s the thing, I don’t. I don’t host email sending and receiving myself, just the archive.

    Here’s a starting point for EU-based providers. If you give more details about your needs (how many mailboxes etc.) we can advise or recommend.

    My main criteria is access through regular IMAP/SMTP without any made-up hurdles (cough Proton “email bridge”).

    Based on your need for email + calendar + contacts I’d say mailbox.org is a likely candidate. Please note that you pay separately for each mailbox (distinct login) but you can establish a “family” relation between accounts for sharing data.

    What I do personally:

    • Self-host a CalDAV/CardDAV server (Radicale) for calendar/contacts.
    • Use a regular email provider (Migadu) with my own custom domains.
    • I access the live mailboxes via IMAP from various email clients (desktop, phone etc.)
    • Same for sending, use the provider’s SMTP.
    • I use mbsync aka isync to fetch a copy of all email to my server and delete messages older than 30 days from the live mailboxes.
    • I self-host a private IMAP server and webmail mainly for browsing and searching this mail archive. I don’t send from this webmail (although I could connect it to the live SMTP if I ever wanted).

    If I ever need to switch providers I can do it as fast as I can sign up / pay with someone else and all it takes is updating the IMAP/SMTP server address on the various clients, and the DNS records for my email domains. Nothing else changes about the setup.

    Why Migadu: they have a pricing model where you pay for storage and emails sent/received but can otherwise have unlimited domains, aliases, mailboxes, logins etc. It can become price-efficient very rapidly if you use it for 2+ people and/or have multiple email domains because this is exactly where regular providers corner you – they tax per mailbox, per domain, if you want more than a handful of aliases etc.


  • It’s amazing how some people insist on that.

    I told a buddy I can set him up for his new laptop, nope, had to buy a license. Except it was the weekend and his license had to be activated over the phone, on a business day. And he just HAD TO have it licensed right that minute for some reason. Guess what we ended up using. 🤷





  • You can install the stack in an LXC container and take snapshots instead. Incus makes managing that very easy.

    App stack in a system container + snapshots is a different approach from stack of app containers that you provision/tear-down but it gets you most of the same advantages.

    Bit of time needed to re-learn Docker concepts in another form but I think it’s a good tool to have on your belt. Sometimes apps aren’t available for Docker, or they ship very poorly made images, or you simply feel that a system container that you upgrade in-place is the better fit.

    Oh and Incus can also do VMs (KVM) with the exact same command interface as for LXC so you get that option too at the cost of learning one tool.


  • You can’t use dependencies cross-stack.

    If you know the IP that the gluetun interface is supposed to have you tell the BT client to use that interface as output interface. Usually BT clients have this option, other apps might not.

    Another thing you can do is wrap the client in a script that waits for the interface to be up (respond to ping) before it moves one. Something like (in sh):

    while ! ping -c 1 -q -W 1 "$IP" &>/dev/null ; do
        echo "Waiting for ${IP} to come up..."
        sleep 5
    done
    # run BT client here
    

    Alternatively if the gluetun interface itself doesn’t respond to ping, you can ping something else (like 1.1.1.1) through the interface, and use the -I ${IP} option for ping to bind to it for output.


  • IPP is a universal printer protocol aka “print anywhere”. Some printers support it natively, some need some help from a PC. If that PC runs Linux the most likely method is to run CUPS and connect it to the printer over USB.

    By IPP autodiscovery, do you mean mDNS? If so, does the router needs to install avahi as well for single-network discovery to work? Or just the client?

    Yes the autodiscovery is done with mDNS, which on Linux is done with Avahi.

    Typically Avahi is needed if you consume services over mDNS or provide them.

    So the Linux clients need Avahi. But the router only needs Avahi if the printer is connected to it, or to propagate broadcasts across zones.

    I’ve thought users could just manually input the IP addresses

    You can, but it’s really nice to have the printer available automagically (on any OS).

    BTW one extra potential benefit of solution 3 might be that the “printer” would always appear to be present on the network and accept print jobs, even if the actual printer is off, because the Pi running the print server would actually be on. Otherwise if the printer itself is providing the connectivity and announcement it will not appear in the list when it’s off. Whether you consider this a plus or not depends on how you handle your printers, I turn mine off when not in use, but some people let it go into powersaving mode so it’s always ready to print.


  • TBH it do be like that when you’re a solo developer.

    Branches come in after a certain level of complexity, if you need to do some kind of separate feature and you’re not sure how it would fit into the main project or something like that.

    They can also be useful if you start automating things. Updating a branch can be used to signal that a commit needs testing or deployment.

    And of course branches are super helpful when multiple people are involved.

    [On a side note, it’s interesting we still use the “branch” terminology even though modern source control systems aren’t trees anymore.]


  • If it’s a networked printer it needs to be able to broadcast to the LAN if you want IPP to work – which you probably do, since it’s well supported by all OS and lets you autodiscover the printer and print directly from most of your devices.

    This means you can’t isolate it fully from the LAN, so solution 2 is out.

    Solution 1 is good if you can trust the thing not to change or disguise its MAC address. I’ve heard of devices that have a 3rd dynamic MAC in addition to the wifi and ethernet MACs, that they use to bypass such restrictions. 🤪

    In order to do (1) properly you should create a firewall zone specifically for the printer, and allow that zone access to LAN but deny access to WAN. Then associate that zone with either a wifi access point created specifically for the printer, or with a specific switch plug if connected via Ethernet. This way the printer can’t bypass the restriction because it comes packaged with the only way it has of getting any connectivity.

    However OpenWRT firewall zones also have issues with cross-zone broadcast, but can be bypassed I think by installing and using Avahi on the router. Don’t quote me on that.

    Solution 3 seems best if you want to fully isolate it as well as retain IPP capability. That’s what I did with my printer, I connected it with USB to the server and I run CUPS + Avahi in a docker container that uses an ipvlan network to broadcast.



  • What about Tailscale, can they see http traffic over my Tailscale connection?

    No, they can’t see anything inside node-to-node connections. They are encrypted end-to-end with keys that are only kept on each node and the node clients are open source so you can verify yourself that’s how it works.

    The Tailscale servers only help the nodes find each other and establish connections to each other, they don’t have any access to the connections themselves.

    The only way for Tailscale to intervene would be for them to silently add their own nodes to your tailnet but (1) even then the rogue node would only see connections between itself and other nodes, not connections between other nodes, and (2) at some point they added a setting that requires existing nodes to approve any new node, so you can use that to completely prevent it.



  • It’s not even that hard to imagine, this is exactly what rogue wifi access points do. It’s surprisingly common for wifi access at places like coffee shops to be compromised and used to silently conduct these types of attacks. The people that set them up are not very knowledgeable and also they don’t ever check up on them as long as they keep working.

    This is also why you want to enable HSTS on top of your HTTPS, so that rogue requests to downgrade the connection to plain HTTP are ignored.

    Another good idea is to place all the services that should only be accessed over VPN only in private DNS (home LAN DNS and the VPN’s DNS), never in public DNS. A simple and effective way of doing that is to place them on a deep subdomain like *.private.example.com rather than *.example.com. That way if your VPN drops when you try to resolve those subdomains you don’t get any response anymore and there’s no connection for the rogue wifi to hijack.