From 315334cab37d1c112cf15fb48687abe83a41aa1f Mon Sep 17 00:00:00 2001 From: allan Date: Sat, 1 Nov 2025 12:36:10 +0100 Subject: [PATCH] changelog --- README.md | 96 ++++++++++++++++++++++--------------------------------- 1 file changed, 38 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 1dc3aac..8bed17b 100644 --- a/README.md +++ b/README.md @@ -1,80 +1,60 @@ -# Changelog +# Changelog -## 27-10-2025 +### Changelog format: **DD-MM-YYYY** -Woke up in the middle of the night thinking, *“Hang on — I never actually tested the `-h` flag on my MariaDB scripts where MariaDB was a crucial part of the script’s operation.”* -That’s when it hit me: the logic behind my usage output could fail if MariaDB wasn’t running, because the detection happens *after* the usage function. -Simple oversight — but it changes everything when you go from a private toolbox (where you know your own setup) to a public one. +## 01-11-2025 -In my old scripts, I assumed too much. -On my own systems, I *know* MariaDB is running, I *know* socket auth works — but once the code is public, assumptions become landmines. +Again… Every time I think, *“Now that’s it — this is the final version,”* a voice in my head goes, *“Oh, but you forgot…”* Not that I actually have voices in my head — well, probably no more than anyone else. -So here’s the new baseline logic I’m rolling into all web-app installers: +Turned out I assumed too much. Again. I assumed `curl`, `unzip`, and `wget` would always exist on a system. While that’s true for maybe 90 percent of servers out there, it’s not *always* the case. -1. **Check if MariaDB is running.** If not, bail out early with a clear message. -2. **Detect authentication method.** - - If **socket auth** works for `root`, use it. - - If **socket auth** isn’t available, require credentials using `-a ` and `-m `. - - If neither works, bail out. No silent fallbacks, no guessing. - -The important part is that this check happens *before* the usage function. -That avoids empty variables or misleading output when someone just runs `-h` for help. -There’s no reason to re-run the same detection every time a user mistypes a flag. - -Then came the next realization — my PHP-FPM version detection relied on `php -r`, which assumes **php-cli** is installed. -That’s fine on my systems, but not guaranteed elsewhere. - -The fix was cleaner and fully independent of php-cli: - -```bash -phpfpm=$(systemctl list-units --type=service --all | awk '/php[0-9]+\.[0-9]+-fpm/ {print $1; exit}' | sed 's/\.service//') - -if [[ -z "$phpfpm" ]]; then - printf "\nUnable to detect php-fpm version. Is PHP-FPM installed?\n\n" - exit 1 -fi -``` - -This uses **systemd** directly to find the versioned PHP-FPM service, which is reliable across Ubuntu releases. -And the nice side-effect? I could drop the `$phpver` variable entirely — fewer moving parts and simpler Nginx snippets. - ---- - -Going from *private scripts* to *public tools* means changing one’s mindset. -When you look around, you notice how many scripts assume too much about the system they’re running on. -And sure — those assumptions often *work*, but they also make things brittle. - -The idea here isn’t to over-engineer or second-guess everything. -There’s a limit to what you can (and should) check. -At some point, you have to draw the line and say: -> “I’ve verified what I can — let’s not turn this into a Windows installer.” - -That’s the balance I’m aiming for now. -Check what’s reasonable, bail cleanly on failure, and keep the rest simple. -Because if a script starts doing too much “hand-holding,” it usually ends up tripping over its own shoelaces. - -**Keep it simple. Keep it human. And never assume.** +Scripts depending on those tools would break. Now, if they’re missing when needed, they get installed automatically. — Allan --- -## 26-10-2025 +## 29-10-2025 -Added a **Postfix Ubuntu installer script** today — a no-fuzz setup that doesn’t yell at you with a wall of prompts. -It’s been part of my private toolbox for years, but now that it’s public, it’s grown up a bit. +Here I am again. The PHP-FPM version detection relied on `php -r`, which assumes `php-cli` is installed. That’s fine on my systems, but not guaranteed elsewhere. -I had to add some basic safety checks, which I normally skip in private use — I know what runs on my own servers and what’s safe to execute. +Changed it to check the **systemd unit file** instead — no more `php -r`. -Making a script public means thinking a bit differently: it needs to behave predictably, even in environments I don’t control. +The real issue wasn’t that `php -r` didn’t work; it’s that I once again assumed too much about what might be on a user’s system. -Anyway, the script’s out there. It does the job, it’s solid, and it’s free. +It’s a fine line — you can only test so much. At some point, a line has to be drawn. — Allan --- +## 27-10-2025 -### More Information +Order matters. I learned that again today while testing a script that spat out empty variables in the usage function. +Well, I *knew* order matters — but that’s what happens when you commit at 3 a.m. with too much confidence and no testing. + +Moved a few parts around related to the MariaDB socket auth check, and things are behaving as intended now. + +— Allan + +--- + +## 26-10-2025 + +Released a **Postfix installer** — quiet and predictable. It’s been part of my private toolbox for years, but public scripts need to behave differently. + +Private scripts assume trust; public ones assume chaos. + +So I added basic safety checks and made sure it behaves politely in unknown environments. + +No prompts, no nonsense — it just installs, verifies, and gets out of the way. + +It’s not fancy, it doesn’t have to — it just needs to work. + +— Allan + +--- + +### More Information More guides and documentation can be found on [wiki.x-files.dk](https://wiki.x-files.dk)