🌉 bridged from @tapdattl@lemmy.world by Tidepool
tapdattl
@tapdattl.lemmy.world.ap.tdpl.io
Help with Netbird Networks access to home resources
I have a GLInet travel router that is a peer connected to my Netbird network, I'd like to have any client that connects to my router to have access to the peers the travel router has access to, but still be able to access the regular internet that is being passed through by my router. Is this possible?
Ultimately I'm trying to get the TV at my girlfriend's place to be able to access my Jellyfin instance over Netbird. According to the Netbird documentation, exit nodes and routes are depricated and should not be used, but I'm struggling hard with getting it to work with Networks.
• I've created a group with my GLInet router, my Jellyfin instance, and my home server (Which hosts Jellyfin) all in the group called "Travel". • I've created a Network called "Home" in Netbird • Within the "Home" network I've created a resource called "Jellyfin" with the IP address set to it's Netbird IP address, and an access control group where all members of the "Travel" group have access to all ports of the "Jellyfin" resource. • I've created two routing peers within the network, one is the GLInet router and the other is my home server. Both of these are Netbird peers with Netbird installed on them.
I am very confused overall, and could use a hand if anyone wanted to walk me through what I'm doing wrong.
Hibernation with encrypted root and swap using TPM and secure boot on Fedora 44
I've been trying to set up hibernation on my laptop while also maintaining an encrypted root partition and swap using secure boot and my laptop's TPM. I've documented the steps I've followed below, but I still am unable to enable hibernation. I was under the impression that the only reason you can't normally have both an encrypted harddrive and hibernation was because swap had to be encrypted as well, but if both the root partition and the swap are encrypted, I'm using UEFI secure boot, and they are automatically decrypted at boot using the TPM, shouldn't that relieve those security concerns? After completing the below, entering
systemctl hibernateerrors saying hibernation is not set up for the system. Am I missing something or is it just not possible? I can confirm not needing to enter passwords for my swap or root FS due to the TPM unlock.My personal documentation below:
Drop into root shell
sudo su -Setup LUKS encryption with automatic unlock with TPM
Install necessary components, regenerate initramfs and reboot
dnf install -y clevis clevis-luks clevis-dracut clevis-udisks2 clevis-systemd dracut -fv --regenerate-all && systemctl reboot
Identify swap and root partition devices, names, and luks UUIDs...
lsblk -f cryptsetup luksUUID <UUID>
In my case, my home partition is on
/dev/nvme0n1p4and my swap is/dev/nvme0n1p3# the encrypted home partition clevis luks bind -d /dev/nvme0n1p4 tpm2 '{"pcr_ids":"1,4,5,7"}' # the encrypted swap clevis luks bind -d /dev/nvme0n1p3 tpm2 '{"pcr_ids":"1,4,5,7"}'Set a timeout before the system asks for a password, to allow time for the TPM to load and enter the password for you
systemctl edit systemd-ask-password-plymouth.serviceAdd the below then ctrl+o ctrl+x to save and exit[Service] ExecStartPre=/bin/sleep 10
Create a dracut configuration file to install the systemd-ask-password-plymouth service:
vi /etc/dracut.conf.d/systemd-ask-password-plymouth.confAdd the below, ensure there are spaces inside the quotation marks on either side of the filenameinstall_items+=" /etc/systemd/system/systemd-ask-password-plymouth.service.d/override.conf "
Regenerate initramfs and reboot
dracut -fv ‐‐regenerate-all && systemctl reboot
Edit crypttab file (
/etc/crypttab)to specify decryption of swap file at boot, duplicate the already present line for your root FS crypttab entry and change the UUIDs to reflect the swap file, usecryptsetup luksUUID /dev/nvme0n1p3andcryptsetup luksUUID /dev/nvme0n1p4to get the luks UUIDs for your root and swap partitions.<swap LUKS UUID> UUID=<swap UUID> none x-initrd.attach <root FS LUKS UUID> UUID=<root FS UUID> none x-initrd.attach
Regenerate initramfs and reboot:
dracut -fv --regenerate-all && systemct rebootEdit fstab to include swap, append the following to/etc/fstab:UUID=<swap UUID> none swap defaults,x-systemd.device-timeout=0 1 1
Rebind your home and swap partitions. You will have to do this every time you update the kernel.
# encrypted home partition clevis luks regen -d /dev/nvme0n1... -s 1 # encrypted swap clevis luks regen -d /dev/nvme0n1... -s 1
Go Modules in Local/Private Forgejo Instances
Bit of a newbie question here, but I've set up a local Forgejo server in my homelab that I'm using for personal projects. I've created some modules that I want to be able to reference in other local projects. Trying to run
go get code.mydomainname.com/tapdattl/test
returns
go: downloading code.mydomainname.com/tapdattl/test v1.0.0 go: code.mydomainname.com/tapdattl/test@v1.0.0: verifying module: code.mydomainname.com/tapdattl/test@v1.0.0: reading https://sum.golang.org/lookup/code.mydomainname.com/tapdattl/test@v1.0.0: 404 Not Found server response: not found: code.mydomainname.com/tapdattl/test@v1.0.0: unrecognized import path "code.mydomainname.com/tapdattl/test": https fetch: Get "https://code.mydomainname.com/tapdattl/test?go-get=1": dial tcp <my netbird ip address>:443: connect: connection refusedHowever I know my Forgejo server is up, and I can push to it and clone from it and do all the normal Git workflows. But Go apparently can't talk to it. Can anyone explain what's going on? Thanks!!
Idiomatic Go Question
Given the following short function
go
func example(foo string) error { if bar, err := doSomething(foo); err != nil { return err } else { doSomethingElse(bar) } return nil }Why does the linter recommend I change the if block to
go
var bar whateverType if bar, err = doSomething(foo); err != nil { return err } doSomethingElse(bar) return nil }In my mind the former example restricts the bar variable to the smallest scope that is needed, and more clearly identifies doSomethingElse as something that should only happen if
err != nil. I know it's redundant, but now if I want to change it to anelse if ...chain I don't have to worry about accidentally including or excluding code from that block, I already know exactly what's supposed to be in it. I just feel like it's a safer programming practice. But looking forward to other opinions and discussion. Thanks!