Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
cruft
Oct 25, 2007

It seems like there's a need for people to post about doing things the hard way, either inventing wheels that already exist (but mine is rounder!), using old stuff everybody else gave up on a while ago, or just general "why are you even doing this" types of stuff.

If you want to talk about some new solution you invented for weird corner cases, this thread is for you. If you're tenaciously clinging to sysvinit on Linux, or you love FreeBSD, or maybe you want a place to discuss the technical aspects of Plan 9 without a bunch of nazis around, welcome to your thread. I have a group of friends who have restored a PDP-7 and are writing programs for it: I want them to get accounts and tell us what they're doing.

Initially, my only request here is to assume any "why are you doing this" questions are an attempt to clarify what your design constraints are, even if they're just "I like a challenge". There are plenty of other places you can go to have your answers questioned, if that's what you want!

Adbot
ADBOT LOVES YOU

mawarannahr
May 21, 2019

I like this idea.

I have a question for a half baked idea I'm working on for Apptainer/Singularity containers. I'm trying to reduce the download size of an image from 10 GiB to anything lower.

There are a few directories in the image that are used by some but not all people, containing gigabytes of models and compiled libraries. The Apptainer image format uses gzipped squashfs layers. Unfortunately there is no support for xz or zstd.

What if I make squashfs'es of these directories within the container? Is there a way I can configure autofs or something in the container to automatically mount those squashes at said directories on access to them?

cruft
Oct 25, 2007

To kick things off, I'll talk about my homelab, which is running on a Raspberry Pi 4. I've got it strapped to the leg of and end table in the living room.



I set a couple of constraints for myself here: I wanted it to be as quiet as possible, and I wanted to use as little power as possible. Right now I have my family of three and maybe a dozen or so other casual users. It's running the following services:

  • RIPE Atlas Probe (Internet research node for the Dutch Internet research people)
  • CI/CD builder I jury-rigged together so I don't have to give it access to /var/lib/docker link
  • DNS server to deal with my ISP's CGNAT
  • Caddy2 Web server to dispatch requests to various services and maintain my SSL certificates
  • GeneWeb: A Genealogy server, like ancestry.com but way 90s-er
  • Forgejo: a self-hosted gitlab-like thing
  • Ergo IRCd: an IRCv3 server with playback history so clients don't have to run a bouncer, I'm about to be a code contributor to this project too
  • Lidarr/Radarr/Sonarr/Readarr/Prowlarr/Plex which you can find more about in the Plex thread
  • Picoshare: an imgur/pastebin type thing for sharing files that expire
  • PiGallery2: an image hosting thingy for low-resource systems like mine
  • Portal: A landing page for my users that lets you quickly switch between services I offer, and doesn't need its own service, just a static json file. This is the project that started the minor flare-up in the homelab thread leading to this thread: it also includes some JavaScript to parse /proc/cpuinfo and display a browser-rendered CPU usage chart.
  • Samba for local access by Windows and ChromeOS boxen
  • SimpleAuth which provides authentication to my web server using the built-in forward-auth mechanism. I wrote this because I was unhappy with the resources requirements of other things like Authelia.
  • Media Sucker which waits for a CD or DVD and tries to auto-rip it. I wrote this because I couldn't get the Automatic Ripping Machine to work after a full weekend of trying.
  • dufs: a WebDAV server which comes with some JavaScript to make it look more like a real cloud storage option, similar to Google Drive. It allows uploads and downloads, integrates with my existing authentication scheme, and does it all with standard WebDAV so things like PhotoSync work really nicely.

One of the things I noticed right away with this low-power device is that MySQL and Postgres have abysmal performance compared to Sqlite. I don't know if that's an architecture problem (things using MySQL might be written less efficiently because LOL who would use a Raspberry Pi) or if it's some fundamental aspect of these databases, but it's led me to seek out solutions that don't need a database.

I've had to write a fair amount of software to do this, mostly because of the "no relational database server" constraint. Things like Authelia and dufs come with some pretty heavy requirements, and my stuff is tiny by comparison, while still providing a not-terrible user experience. It's not as good as things like Immich and NextCloud, but it's not terrible.

corgski
Feb 6, 2007

Silly goose, you're here forever.

Following this thread for sure. My least practical project is probably running my own email infrastructure.

I'm also building an analog cable headend in my apartment complete with broadcast automation driven by, probably, https://openbroadcaster.com/ after previously building an Internet radio station using icecast and liquidsoap.

If anyone has any questions about how to do these things I'm glad to share my experiences!

corgski fucked around with this message at 23:51 on Jan 14, 2024

cruft
Oct 25, 2007

mawarannahr posted:

I like this idea.

I have a question for a half baked idea I'm working on for Apptainer/Singularity containers. I'm trying to reduce the download size of an image from 10 GiB to anything lower.

There are a few directories in the image that are used by some but not all people, containing gigabytes of models and compiled libraries. The Apptainer image format uses gzipped squashfs layers. Unfortunately there is no support for xz or zstd.

What if I make squashfs'es of these directories within the container? Is there a way I can configure autofs or something in the container to automatically mount those squashes at said directories on access to them?

I don't have a lot of firsthand experience with automount(8) but this seem like the sort of thing it does? My shaky understanding of it is that automountd provides NFS to the kernel, and then when something comes asking for a path, it puts the request on hold, looks the path up in a list, mounts the thing that backs it, and then proxies the request to the newly-mounted filesystem.

But is there a reason not to just always mount the squashfses before starting the main service in the contiainer?

I presume you're on something like a cluster, for whatever reason you need all this data local to each machine, and that you've already considered a network file system :)

cruft fucked around with this message at 23:53 on Jan 14, 2024

cruft
Oct 25, 2007

corgski posted:

I'm also building an analog cable headend complete with broadcast automation driven by, probably, https://openbroadcaster.com/ after previously building an Internet radio station using icecast and liquidsoap.

:swoon: you have to tell us more about both of these. I don't even know what questions to ask. Maybe just start with what problems you encountered that you're most proud of solving?

Aware
Nov 18, 2003
Bookmarked!

I remember running a little internet radio station for a while with oggcast lol.

BlankSystemDaemon
Mar 13, 2009



corgski posted:

Following this thread for sure. My least practical project is probably running my own email infrastructure.

I'm also building an analog cable headend in my apartment complete with broadcast automation driven by, probably, https://openbroadcaster.com/ after previously building an Internet radio station using icecast and liquidsoap.

If anyone has any questions about how to do these things I'm glad to share my experiences!
:same: on both counts.

Speaking of analogue TV and Trinitron PVM I have for my Famicom+DiskSystem, I got inspired by C Lab Retro from a while back:
https://www.youtube.com/watch?v=9kJC4ZaI-T0

I've been trying to source devices, but they're damned difficult to come by on the Danish market.

cruft
Oct 25, 2007

BlankSystemDaemon posted:

:same: on both counts.

Speaking of analogue TV and Trinitron PVM I have for my Famicom+DiskSystem, I got inspired by C Lab Retro from a while back:
https://www.youtube.com/watch?v=9kJC4ZaI-T0

I've been trying to source devices, but they're damned difficult to come by on the Danish market.

LOL this is ridiculous, I love it.

Is the plan to use coax cable, or low-power over the air broadcast?

BlankSystemDaemon
Mar 13, 2009



cruft posted:

LOL this is ridiculous, I love it.

Is the plan to use coax cable, or low-power over the air broadcast?
Coax cable, as I already have an existing installation.

corgski
Feb 6, 2007

Silly goose, you're here forever.

Yeah I've been using some rather cheap Chinese brand agile modulators off of Amazon to prototype but they're extremely noisy. When I have the money I'm gonna grab a whole cabletronix 12 channel rack off ebay with whatever fixed-frequency modulators are cheapest. I expect I can build that part out for like $500.

Yaoi Gagarin
Feb 20, 2014

This is a fantastic thread idea.

The project I've been theorycrafting for a while is a device that can play the call to prayer at exactly the correct time of day. My parents use android apps that try to do this, but they always wait 5-10 minutes after the app plays the sound because for whatever reason these apps just can't seem to get the timing right. Or sometimes it just inexplicably won't play. It's been a problem for them across multiple different apps.

So I want to make an alarm clock, which automatically syncs time using NTP, and has an internal database of astronomical info. So I'll program in my parents home GPS coordinates and it'll know when to play. Yes, knowing the exact coordinates is way overkill, it need only be accurate to within 50-100 miles I think. But given location on the earth and current epoch, you can figure out where the sun is, and from that determine if it's prayer time.

Hardware wise I think this isn't going to be that crazy:
- some kind of microcontroller that can run NTP and play a .wav file
- a speaker
- maybe some kind of amp

The tricky part is finding a cheap and easy to use board that can do what I want. Maybe an Arduino.

Cenodoxus
Mar 29, 2012

while [[ true ]] ; do
    pour()
done


VostokProgram posted:

Hardware wise I think this isn't going to be that crazy:
- some kind of microcontroller that can run NTP and play a .wav file
- a speaker
- maybe some kind of amp

The tricky part is finding a cheap and easy to use board that can do what I want. Maybe an Arduino.

That sounds pretty neat. If you wanted to eliminate the network stack from the equation, you could pull the time from a radio clock service. Or, if you include a GPS module, I think you can also get the precise date/time from the satellites along with the GPS coordinates.

I've always wanted to fart around with GPS-based network time but I'm too lazy to run an antenna, since all my stuff's in the basement.

cruft
Oct 25, 2007

Yeah, that sounds like a really fun project: it's a cool twist that you need to incorporate some astronomy!

I would second adding a GPS doodad and skipping the network connectivity. It absolutely does provide time: many tier 1 (maybe 2? it's been a while) NTP servers are getting their time information from GPS.

I don't know about your parents specifically, but making a doodad that just Does The Right Thing anywhere on earth would be more useful / easier to use than something you have to remember connect to a wireless network first. With GPS, you could even take this thing on a ship crossing the sea and it'd give you the right time.

An arduino will 100% be up to the task. I am super excited for this project and I would love to provide you a list of possible parts to build it, but that might be taking some of the fun away. But do let me know if you'd like a boost, heh. I think I might be able to chase down the microcontroller, audio driver, amplifier, speaker, and maybe even a LiPo battery and a case.

cruft
Oct 25, 2007

BlankSystemDaemon posted:

Coax cable, as I already have an existing installation.

This triggered a memory of my father setting up some sort of serial connection in our house using a pair of wires on the telephone jacks.

I think it ran at 1200 baud and was essentially useless since we only (!) had two computers in the house (that was 2 more than anybody I knew), but I remember him having fun getting it all working.

It was definitely serial and not a token ring. I wonder how he handled having multiple endpoints. I'll have to ask.

BlankSystemDaemon
Mar 13, 2009



cruft posted:

Yeah, that sounds like a really fun project: it's a cool twist that you need to incorporate some astronomy!

I would second adding a GPS doodad and skipping the network connectivity. It absolutely does provide time: many tier 1 (maybe 2? it's been a while) NTP servers are getting their time information from GPS.

I don't know about your parents specifically, but making a doodad that just Does The Right Thing anywhere on earth would be more useful / easier to use than something you have to remember connect to a wireless network first. With GPS, you could even take this thing on a ship crossing the sea and it'd give you the right time.

An arduino will 100% be up to the task. I am super excited for this project and I would love to provide you a list of possible parts to build it, but that might be taking some of the fun away. But do let me know if you'd like a boost, heh. I think I might be able to chase down the microcontroller, audio driver, amplifier, speaker, and maybe even a LiPo battery and a case.
Oh yeah, tangentially related to that, here's an idea I've already done some years ago, but encourage everyone else to do:
Set up a stratum 0 NTP server for your own network, using only a module with a U-Blox ZED F9P that can do centimeter-level accuracy.

This'll let you get into watching continental drift - which is like watching paint dry, except much more extreme.
For example, I can tell you that the European continent has a vector - but you'll have to discover it yourself!
It's not actually that difficult to find, as EU has mandated a standard that's built around avoiding having national cadastras revise measurements all the time, but it's more fun as a project

cruft posted:

This triggered a memory of my father setting up some sort of serial connection in our house using a pair of wires on the telephone jacks.

I think it ran at 1200 baud and was essentially useless since we only (!) had two computers in the house (that was 2 more than anybody I knew), but I remember him having fun getting it all working.

It was definitely serial and not a token ring. I wonder how he handled having multiple endpoints. I'll have to ask.
Serial Line Internet Protocol was quite widely deployed, and I remember seeing it still actively in service not that long ago, in a very old deployment where they didn't need a lot of bandwidth, just a very stable connection to get in if all the other connections broke.

BlankSystemDaemon fucked around with this message at 00:45 on Jan 18, 2024

Yaoi Gagarin
Feb 20, 2014

I didn't even think about using GPS time, but that makes way more sense than NTP. With GPS it would be a zero-config box and that'd be rad.

cruft posted:

An arduino will 100% be up to the task. I am super excited for this project and I would love to provide you a list of possible parts to build it, but that might be taking some of the fun away. But do let me know if you'd like a boost, heh. I think I might be able to chase down the microcontroller, audio driver, amplifier, speaker, and maybe even a LiPo battery and a case.

I'll happily take suggestions for that stuff

cruft
Oct 25, 2007

BlankSystemDaemon posted:

Serial Line Internet Protocol was quite widely deployed, and I remember seeing it still actively in service not that long ago, in a very old deployment where they didn't need a lot of bandwidth, just a very stable connection to get in if all the other connections broke.

Yeah, this thing my dad did was decade(s) before SLIP. I hadn't heard of the Internet when he did it.

I had a SLIP line to my dorm room in college. This was the computer center's early attempt to wire students up with network access, but you (the student) were required to get the point-to-point link working. Prior to them setting up SLIP, there was this kludge where you could log in on the remote machine and run this program that essentially was a TCP proxy, then you handed the serial connection to a local program that did some sort of routing magic to set up a point to point connection.

I think. I didn't really understand it all at that point.

Thinking back on the crap I had to do in college is making me understand what led me to doing everything the hard way. I had to put myself through a crash course in TeX in order to submit papers for my English class. I remember the instructor held my paper up for everybody to laugh at because it used the default margins that Donald Knuth liked, which were, like, to give you a block of text you could put into a pulp paperback. I hadn't yet figured out how to change the margins in time to get the paper submitted: I wasn't finished reading the library's only copy of the TeX book!

Also at that time, slackware installed a broken copy of Metafont, which I had to fix. Metafont is a gigantic shell script. I have no idea how I fixed that, but I did.

This was all because I accidentally installed Linux over my Windows partition.

cruft
Oct 25, 2007

So I've been running an IRC server on my homelab RPi for the last month or so...

I added the ability to upload images (from the web client) and it supports somethingawful smilies.

The previous two weeks, I've been coding up a new IRC client from scratch, because I wasn't happy with how vue.js interacted with the DOM in the current client. It's going pretty well, you can talk, it has multi-channel support, actions, an emoji picker that includes a subset of the SA smilies. I'm going to add history playback using the new IRCv3 extension for that, emoji/smilie reactions to messages, replies to messages, profile avatars, and probably a few other things. The goal is to have it look as much as possible like Mattermost, but it's IRC in the back-end, so if you want to connect with some other client, you can.

IRCv3's message tags are going to make it so I can fold in my morse code relay server (https://vail.woozle.org/) so you can talk morse code in an IRC channel.


It's been a pretty fun February.

cruft fucked around with this message at 17:15 on Feb 15, 2024

Kreeblah
May 17, 2004

INSERT QUACK TO CONTINUE


Taco Defender
FreeBSD user here. I like the philosophy way more than I do that of Linux distributions (though Debian comes closest).

Also, I wrote a guide for setting up a GPS-based time server.

And a bunch of other random poo poo.

Happy to talk about any of it (or anything else on my Github account) if there's any interest.

BlankSystemDaemon
Mar 13, 2009



Kreeblah posted:

FreeBSD user here. I like the philosophy way more than I do that of Linux distributions (though Debian comes closest).

Also, I wrote a guide for setting up a GPS-based time server.

And a bunch of other random poo poo.

Happy to talk about any of it (or anything else on my Github account) if there's any interest.
Did you know that the FreeBSD documentation is written in AsciiDoc, which is basically just an extension of MarkDown to let you do things more complicated forms of mark-up like DocBook?

And have you considered that the GPS-based time server document would make an excellent addition to the list of FreeBSD documentation articles, and that you can learn most of what you'll need to do through the documentation project primer.
Also, it's very possible that someone ITT might be able to help you get it committed.

cruft
Oct 25, 2007

Hey, I don't suppose anyone ITT has some old scripts to detect the insertion of USB storage with a "DCIM" directory, which mounts it, pulls off all the files in that directory, shunts them off into directories based on JPEG date, and then unmounts?

I'm pretty sure I wrote at least one version of this at one point in time, but it's long gone. I now find myself needing it again :\

Aware
Nov 18, 2003
Not sure if it helps butwindows built in photo backup app thing does pretty much exactly that splitting into folders by year/month ? Maybe similar behaviour in a Linux GUI app too. If CLI, I don't got nothing sorry.

Adbot
ADBOT LOVES YOU

cruft
Oct 25, 2007

Here is my effortpost from the self-hosted thread. I am going to tell you about my weekend spent looking for a file server for my family.

:siren: I am using low-powered hardware. I realize this is unusual. I am not asking for basic assistance. I am writing this because it might be interesting to some people in this thread. Some of what I write might be frustrating to read, because I have requirements that you find silly.

The problem

I run a Raspberry Pi 4 with 8GB of RAM. It's comfortably running absolutely everything I need right now, but the user interface for file storage leaves something to be desired. Currently I'm using dufs, which provides WebDAV and a simple JavaScript user interface front-end.

My family uses ChromeOS, Windows, and Android. I run Linux, but I know how to start sshfs, so I don't care about me, really. I am unwilling to replace the ChromeOS boxes with Windows, because the added maintenance burden of Windows is just too great. I do practically zero tech support on the ChromeOS boxes. The one Windows box in the family is the source of at least once a week tech support sessions. Not interested in increasing that.

I am going to assume I don't need to explain to this thread why I want to self-host files.

Yesterday, I finally rolled out MFA SSO (provided by Forgejo) by replacing my aforementioned SimpleAuth with OAuth2-Proxy. Now, the Android users can no longer use their PhotoSync profiles, since it doesn't support the Bearer tokens needed by OIDC. I figured it was as good a time as any to check out what other options exist.

My Ideal Solution

It provides WebDAV, plus some published extensions. The web browser client runs in JavaScript. It integrates into the ChromeOS file manager, and the Windows file manager.

It uses OIDC for authentication, and allows local users to share resources, but will let me issue tokens for PhotoSync.

It uses the filesystem like a filesystem. If I decide to stop using it, all the structure my users have created will persist in a way that is trivial for another app to understand. I can run additional apps at the same time, which use the same file structure in other ways (like, to provide a photo album, or to provide a media server).

It can run on my Raspberry Pi 4 alongside all my other stuff. It doesn't need any supporting services like Redis, MongoDB, PostgreSQL, MariaDB, CouchDB, S3, Ceph, or whatever. I maintain all that crap at work, I don't want to do it at home too.


NextCloud

NextCloud looks so nice, and checks almost all these boxes. But it almost immediately ate up 12GB of memory (8GB RAM + 4GB swap), causing my server to thrash. I managed to kill it, try a couple adjustments to make it calm down: no dice. It ate 12GB again. Could I continue tuning it? Probably. Could I get this giant heap of PHP to play nice in <4GB of RAM? Nextcloud's web site is cagey about their actual recommendations, but the Internet seems to think 4GB is the absolute minimum. I don't think this is the solution for me, unless I want to find someplace in this little house for a big ol' server with big ol' fans (no such place exists).

Also, PHP. I hate PHP so much. They let you run NextCloud with FastCGI, which is cool, but then you have to serve static content out of the application directory, and if you don't exclude two dozen top-level directories, you're serving up configuration and secrets and maybe databases? This is exactly the kind of architecture we try to find during red team exercises. Yuck.

NextCloud also doesn't really mirror the filesystem. You have to tell it to notice when you drop new files. But at least when it writes files, they're named the same on the filesystem as they are in the UI. Unlike...


OwnCloud Infinite Scale

Boy is OCIS nice. It's lightweight, fast, and was dead simple to set up. It provides OIDC, and can use external OIDC. It has an Android client. It provides WebDAV. But... it rewrites your file structure to hashes. admin/02/foo.jpg becomes spaces/e8/2ad85b-f6e1-48ed-9104-5206c8ad39e8/nodes/78/25/ab/87/-ee48-4653-9f86-871205e6cc3a. Want to use photoprism, plex, jellyfin, or literally anything else? The solution, apparently, is to use WebDAV to mount OCIS back into a local filesystem.

OCIS would be just about perfect if they didn't use their decomposed filesystem. I get why they're doing it, but personally I'd rather just use ceph than trying to overlay something like ceph onto a traditional filesystem.


SeaFile

We're getting into questionable territory here. SeaFile is another "free software but you really should pay us" project, like OwnCloud. It looks a lot like a 2006 desktop file manager. They don't provide an ARM build, and this LinuxServer packaging request does not inspire confidence. Next...


FileStash

More "free but pay us". I set this up a few months ago, took about 4 hours to figure out how, and it required running a bunch of commands inside the container: there's not really a configuration file. And I still needed WebDAV on the back-end. Really, it's just a nicer front-end, that also requires its own server to run. It didn't provide enough additional for me to bother going further.


MyDrive

No updates in 2 years? Maybe it was 5? Anyway, nobody's maintaining it.


CozyCloud

"Free but pay us". Wants a database to back it. Apparently I tried this out a year or so ago and decided not to use it: I still have a state directory for it. I don't remember why I didn't like it.


club-1/webdav-drive

Yeah, maybe. But I'm not sure I relish building this, and tracking upstream changes, in addition to a WebDAV server.


sftpgo

I spent about an hour trying to get it to run, and couldn't figure out what I was doing wrong.


dufs

I'm back to what I started with.

I use OAuth2-Proxy as a gateway to access it, and then everybody can see everything. Then I can run whatever photo album software (currently photofield).

It takes almost no resources to run. It lets people download and upload files with a web browser. I can probably jury-rig Caddy to let people in with tokens. Chromebooks can no longer mount WebDAV because Google took away that functionality, so I guess I can provide an SFTP login, which will also fix the situation for PhotoSync.


Summary

This situation honestly hasn't changed much in 20 years. It's why, 20 years ago, I threw my hands in the air and told everybody to just use Google's stuff. They seemed like responsible custodians of our stuff back then.

Even if I had a big beefy server to do this, I'd still have to put up with NextCloud weirdness. Is it pretty easy to admin these days? Maybe that's improved in 20 years. Maybe I should just bite the bullet and have a CPU fan in the dining room or something.

For now, though, it's okay. I guess.

:siren: This post was for your enjoyment. I'm not requesting help with choosing hardware. I know I've made the situation more challenging than it needs to be due to my weird requirements. Thank you for caring./

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply