vegetaaaaaaa
@vegetaaaaaaa@lemmy.world
- Submitted 6 days ago to selfhosted@lemmy.world | 33 comments
- Comment on An idiots guide? 1 week ago:
Data loss is not a problem specific to self-hosting.
Whenever you administrate a system that contains valuable data (a self-hosted network service/application, you personal computer, phone…), think about a backup and recovery strategy for common (and less common) data loss cases:
- you delete a valuable file by accident
- a bad actor deletes or encrypts the data (ransomware)
- the device gets stolen, or destroyed (hardware failure, power surge, fire, flood, hosting provider closing your account)
- anything you can think of
For these different scenarios try to find a working backup/restore strategy. For me they go like
- Automatic, daily local backups (anything on my server gets backed up once a day to a
backups
directory usingrsnapshot
). Note that file sync like nextcloud won’t protect you against this risk, if you delete a file on the nextcloud client it’s also gone on the Nextcloud server (though there is a recycle bin). Local backups are quick and easy to restore after a simple mistake like this. They wont protect you against 2 and 3. - Assuming an attacker gains access to your machine they will also destroy or encrypt your local backups. My strategy against this is to pull a copy of the latest local backup, weekly, to a USB drive, through another computer, using
rsync/rsnapshot
. Then I unplug the USB drive, store it somewhere safe outside my home, and plug in a second USB drive. I rotate the drives every week (or every 2 weeks when I’m lazy - I have set up a notification to nag me to rotate the drive every saturday, but I sometimes ignore it) - The USB strategy also protects me against 3. If both my server and main computer burn down, the second drive is still out there, safely encrypted. It’s the worst case scenario, I’d probably spend quite some time setting up everything again (though most of the setup is automated), and at this point I’d have bigger problems like, you know, burned down house. But I’d still have my data.
There are other strategies, tools, etc, this one works for me. It’s cheap (the USB drives are a one-time investment), the only manual step is to rotate the drives every week or so.
- Comment on Looking for a good RSS Reader 1 week ago:
If you’re interested I wrote a quick HOWTO to migrate TT-RSS data from Mysql to Postgres a while ago. Ctrl+F search for
Migrating tt-rss data to Postgresql from a MySQL-based installation
hereI still use that same migrated database 4 years later
- Comment on How do you keep track of vulnerabilities? 4 weeks ago:
- distribution packages: unattended-upgrades
- third party software: subscribe to the releases RSS feed (in tt-rss or rss2email), read release notes, bump version number in my ansible playbook, run playbook, done.
- Comment on Any nice playbook or tutorial to host a static website from home? 5 weeks ago:
Sometimes you need to understand the basics first. The points I listed are sysadmin 101. If you don’t understand these very basic concepts, there is no chance you will be able to keep any kind of server running, understand how it works, debug certificate problems and so on. Once you’re comfortable with that? Sure, use something “simpler” (a.k.a. another abstraction layer), Caddy is nice. The same point was made in the past about Apache (“just use nginx, it’s simpler”). Meanwhile I still use apache, but if needed I’m able to configure any kind of web server because i taught me the fundamentals.
At some point we have to refuse the temptation to go the “easy” way when working with complex systems - IT and networking are complex. Just try the hard way first, read the docs, and if it’s too complex/overwhelming/time-consuming, only then go for a more “noob-friendly” solution (I mean we’re on c/selfhosted, why not just buy a commercial NAS or use a hosted service instead? It’s easier). I use firewalld but I learned the basics of iptables a while ago. I don’t build apache from source when I need to upgrade, but I would know how to get 75% there - the docs would teach me the rest.
- Comment on Any nice playbook or tutorial to host a static website from home? 5 weeks ago:
By default nginx will serve the contents of
/var/www/html
(a.k.a documentroot) directory regardless of what domain is used to access it. So you could put yourindex.html
and all other files directly under that directory, and access your sever at https://ip_address and have your static site served like that.Step 2 is to automate the process of rebuilding your site and placing the files under the correct directory with the correct ownership and permissions. A basic shell script will do it.
Step 3 is to point your domain (DNS record) at your server’s public IP address and forwarding public port 80 to your server’s port 80. From there you will be able to access the site from the internet at mydomain.org
Step 3 is to configure nginx for proper virtualhost handling (that is, direct requests made for
mydomain.org
to your site under the/var/www/html/
directory, and all other requests like http://public_ip to a default, blank virtualhost. You may as well use and empty/var/www/html
for the default site and move your static site to a dedicated directory.) This is not a requirement but will help in case you need to host multiple sites, and is a requirement for the following step.Step 4 is to setup SSL/TLS certificates to serve your site at https://my_domain (HTTPS). Nowadays this is mostly done using an automatic certificate generation service such as Let’s Encrypt or any other ACME provider.
certbot
is the most well-known tool to do this (but not necessarily the simplest).Step 5 is what you should have done at step 1: harden your server, setup a firewall, fail2ban, SSH keys and anything you can find to make it harder for an attacker to gain write access to your server, or read access to places they shouldn’t be able to read.
Step 6 is to destroy everything and do it again from scratch. You’ve documented or scripted all the steps, right?
As for the question “how do I actually implement all this? Which config files and what do I put in them?”, the answer is the same old one: RTFM. Yes, even the boring nginx docs, manpages and 1990’s Linux stuff. Reading guides can still be a good start for a quick and dirty setup, and will at least show you what can be done. After a few months of practice you will be able to do all that in less than 10 minutes.
- Comment on Landing page for all my services 1 month ago:
I wrote my own, using plain HTML/CSS. Actually the final .html file gets templated by ansible depending on what’s installed on the server, but you can easily pick just the parts you need from the j2 template
- Comment on What are some self hosted services that you think are essential? 4 months ago:
Please not these posts again This thread is pinned for a reason: lemmy.world/post/60585
- Comment on Podman or rootless docker? 4 months ago:
Podman
- rootless by default
- daemonless
- integration with systemd, made even easier by
podman-generate-systemd
- no third-party APT repository required, follows the same lifecycle as my LTS (Debian) distro
podman
anddocker
command-line are 100% compatible for my use cases
- Comment on Static site generator for an idiot who doesn't want to learn a new templating language just to have a blog? 5 months ago:
www.sphinx-doc.org + pradyunsg.me/furo/ theme + myst-parser.readthedocs.io markdown parser + sphinx-design.readthedocs.io extensions.
Just drop all your markdown files in a directory and run
sphinx-build
. Highly customizable but also works out of the box - Comment on Excluding shorts from Youtube RSS feeds in FreshRSS, regardless of #shorts in the title 5 months ago:
You just have to find the channel_id buried in the page source
I use this Firefox addon for that: addons.mozilla.org/en-US/…/youtube-rss-finder/ - really useful
- Comment on Store (and access) old emails 5 months ago:
I wrote this ansible role to setup dovecot IMAP server. Once a year I move all mail from the previous year from various mailboxes to my dovecot server (using thunderbird).
- Comment on Results comparison 8B parameter LLM x Gemini 5 months ago:
Interesting post, but what does this have to do with selfhosting? This is not /c/llm