changelog

This commit is contained in:
2025-11-01 12:36:10 +01:00
parent 904dc827ab
commit 315334cab3

View File

@@ -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 scripts operation.”*
Thats when it hit me: the logic behind my usage output could fail if MariaDB wasnt 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 thats 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 heres the new baseline logic Im 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 thats true for maybe 90 percent of servers out there, its 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** isnt available, require credentials using `-a <admin>` and `-m <password>`.
- 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.
Theres 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.
Thats 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 ones mindset.
When you look around, you notice how many scripts assume too much about the system theyre running on.
And sure — those assumptions often *work*, but they also make things brittle.
The idea here isnt to over-engineer or second-guess everything.
Theres a limit to what you can (and should) check.
At some point, you have to draw the line and say:
> “Ive verified what I can — lets not turn this into a Windows installer.”
Thats the balance Im aiming for now.
Check whats 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 theyre 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 doesnt yell at you with a wall of prompts.
Its been part of my private toolbox for years, but now that its public, its grown up a bit.
Here I am again. The PHP-FPM version detection relied on `php -r`, which assumes `php-cli` is installed. Thats 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 whats 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 dont control.
The real issue wasnt that `php -r` didnt work; its that I once again assumed too much about what might be on a users system.
Anyway, the scripts out there. It does the job, its solid, and its free.
Its 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 thats 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. Its 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.
Its not fancy, it doesnt 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)