There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

@TCB13@lemmy.world cover

This profile is from a federated server and may be incomplete. Browse more on the original instance.

TCB13 , (edited ) to selfhosted in The "safest" way of self hosting
@TCB13@lemmy.world avatar

Your basic requirements are:

  • Some kind of domain / subdomain payed or free;
  • Preferably Home ISP that has provides public IP addresses - no CGNAT BS;
  • Ideally a static IP at home, but you can do just fine with a dynamic DNS service such as freedns.afraid.org.

Quick setup guide and checklist:

  1. Create your subdomain for the dynamic DNS service freedns.afraid.org and install the daemon on the server - will update your domain with your dynamic IP when it changes;
  2. List what ports you need remote access to;
  3. Isolate the server from your main network as much as possible. If possible have then on a different public IP either using a VLAN or better yet with an entire physical network just for that - avoids VLAN hopping attacks and DDoS attacks to the server that will also take your internet down;
  4. If you’re using VLANs then configure your switch properly. Decent switches allows you to restrict the WebUI to a certain VLAN / physical port - this will make sure if your server is hacked they won’t be able to access the Switch’s UI and reconfigure their own port to access the entire network. Note that cheap TP-Link switches usually don’t have a way to specify this;
  5. Configure your ISP router to assign a static local IP to the server and port forward what’s supposed to be exposed to the internet to the server;
  6. Only expose required services (nginx, game server, program x) to the Internet us. Everything else such as SSH, configuration interfaces and whatnot can be moved to another private network and/or a WireGuard VPN you can connect to when you want to manage the server;
  7. Use custom ports with 5 digits for everything - something like 23901 (up to 65535) to make your service(s) harder to find;
  8. Disable IPv6? Might be easier than dealing with a dual stack firewall and/or other complexities;
  9. Use nftables / iptables / another firewall and set it to drop everything but those ports you need for services and management VPN access to work - 10 minute guide;
  10. Configure nftables to only allow traffic coming from public IP addresses (IPs outside your home network IP / VPN range) to the Wireguard or required services port - this will protect your server if by some mistake the router starts forwarding more traffic from the internet to the server than it should;
  11. Configure nftables to restrict what countries are allowed to access your server. Most likely you only need to allow incoming connections from your country and more details here.

Realistically speaking if you’re doing this just for a few friends why not require them to access the server through WireGuard VPN? This will reduce the risk a LOT and won’t probably impact the performance. Here a decent setup guide and you might use this GUI to add/remove clients easily.

Don’t be afraid to expose the Wireguard port because if someone tried to connect and they don’t authenticate with the right key the server will silently drop the packets.

Now if your ISP doesn’t provide you with a public IP / port forwarding abilities you may want to read this in order to find why you should avoid Cloudflare tunnels and how to setup and alternative / more private solution.

TCB13 , (edited ) to selfhosted in External email server vs port forwarding/vpn
@TCB13@lemmy.world avatar

You can selfhost the email server wherever you want. But you’ve to use some external system to deliver the email or you’ll end up in spam because your residential IP is most likely dynamic and already flagged by most email providers.

One way to do it is to get a VPS somewhere and setup Wireguard on it. Then configure your local system to bind to the Wireguard interface and IP so all email send and received using the tunnel. Dovecot doesn’t care what interface it is running on, Postfix has specific options that you can change in master.cf to accommodate the fact that it will be binding to the VPN IP and the real IP is the VPS public IP.

  1. Setup a install of Dovecot / Postfix / Rspamd on your local server: workaround.org/ispmail-bookworm/
  2. Start by setting up a Wireguard tunnel between your local server and the VPS: digitalocean.com/…/how-to-set-up-wireguard-on-ubu…
  3. Create a outgoing transport for the email that uses the WG tunnel and is aware of the VPS public IP:

<span style="color:#323232;">out-wg      unix  -       -       n       -       -       smtp
</span><span style="color:#323232;"> -o proxy_interfaces=188.xxx.xxx.xxx # the real public IP of the VPS
</span><span style="color:#323232;"> -o smtp_bind_address=10.0.0.2 # the IP that your local server has on the WG interface
</span><span style="color:#323232;"> -o inet_interfaces=10.0.0.2 # same as above
</span><span style="color:#323232;"> -o myhostname=server.example.org # should match the PTR / reverse DNS entry on the VPS IP
</span><span style="color:#323232;"> -o smtp_helo_name=server.example.org # should match the PTR / reverse DNS entry on the VPS IP
</span><span style="color:#323232;"> -o syslog_name=smtp-wg
</span>
  1. Set your VPS firewall to NAT/forward incoming traffic on port 25, 587, 465 and 993 to the local server (wireguard client 10.0.0.2);
  2. Change main.cf to use the transport by adding: default_transport = out-wg.

That’s everything you need to get it going. Use www.mail-tester.com to debug if DKIM and everything else is properly setup at the end.

TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
@TCB13@lemmy.world avatar

This isn’t reasonable at all, 700MB of ram + 10GB of storage for a simple webui that charts sensor data and only keeps it for 10 days.

TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
@TCB13@lemmy.world avatar

I’m not upset, just wondering / looking for way to keep the potato from growing further and/or alternatives.

TCB13 , to science in I wasn't worried about climate change. Now I am.
@TCB13@lemmy.world avatar

deleted_by_moderator

  • Loading...
  • TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
    @TCB13@lemmy.world avatar

    Thank you for clarifying this. I was aware I could flash devices on my computer (I did a few times because a few of my boards ESP32-S2-Mini have to be flashed once by the Flash Download Tool from espressif). Maybe I’ll run the ESPHome WebUI on my computer or use the cli, I’ll see.

    I’ll proceed to install the HA Core + HACS on a LXC container and see how it goes.

    TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
    @TCB13@lemmy.world avatar

    What is weird is having to waste almost 700MB of ram + 10GB of storage for a simple webui that charts sensor data and only keeps it for 10 days. As a comparison my NAS container runs Samba4, FileBrowser, Syncthing, Transmission, and a few others under 300MB of RAM with pontual spikes on operations.

    TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
    @TCB13@lemmy.world avatar

    Yes.

    TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
    @TCB13@lemmy.world avatar

    It’s not needed,

    For what exactly? Can I still add the ESPHome devices to HA without the addon installed, is the addon only for flashing the devices?

    Thanks.

    TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
    @TCB13@lemmy.world avatar

    And how do I go about that?

    TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
    @TCB13@lemmy.world avatar

    I’ve been doing this. I’m running HA under LXD (VM) and it works.

    
    <span style="color:#323232;">$ lxc info havm
    </span><span style="color:#323232;">Name: havm
    </span><span style="color:#323232;">Status: RUNNING
    </span><span style="color:#323232;">Type: virtual-machine
    </span><span style="color:#323232;">Architecture: x86_64
    </span><span style="color:#323232;">PID: 541921
    </span><span style="color:#323232;">Created: 2023/12/05 14:14 WET
    </span><span style="color:#323232;">Last Used: 2024/01/28 13:35 WET
    </span>
    

    While it works great and it was very easy to get the VM running I would rather move to something lighter like a container. About the storage I just see it growing everyday and from what I read it should be keeping for 10 days however it keeps growing. Almost 10GB for a web interface and logs from a couple of sensors, wtf?

    I would be very happy with HA, really no need to move other stuff as long as things were a bit less opaque than a ready to go VM that runs 32434 daemons and containers inside it.

    TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
    @TCB13@lemmy.world avatar

    Hmm… that’s interesting. I’ll have to explore further. Thanks.

    TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
    @TCB13@lemmy.world avatar

    Tiny you say… answer to what you asked: lemmy.world/comment/7101252

    TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
    @TCB13@lemmy.world avatar

    I’m not using any other integration. Isn’t this a resource monster?

    https://lemmy.world/pictrs/image/d26476df-d1b5-4afd-84ac-a4f737c4846d.png

    I just don’t want to keep running an entire VM with their image. Something more simple that could be used on a LXC / systemd-nspawn container or directly on a base system would be nicer.

    TCB13 OP , to selfhosted in Alternative to Home Assistant for ESPHome Devices
    @TCB13@lemmy.world avatar

    I was trying to go that route with LXC actually and while it seems great what about the ESPHome addon? I’m not even sure if that thing is required to use ESPHome devices or not.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • lifeLocal
  • goranko
  • All magazines