u/CyberJack77

42 post karma · 2,224 comment karma · joined Nov 2011 · moderator

CyberJack77

Yes please!

CyberJack77

LeafWiki with a git sync.

CyberJack77

If any of these 10+ containers becomes unhealthy, a system must automatically detect the failure and restart it immediately without manual human intervention.

Since you mention unhealthy, can we assume there are health checks? If so, you can run https://hub.docker.com/r/modem7/docker-autoheal with the env setting AUTOHEAL_CONTAINER_LABEL=all to auto restart all unhealthy containers.

To be fair... if containers become unhealthy that often, you have a bigger problem and a proper workload orchestrator platform (k3s, k8s, nomad, ...) might be a better solution.

We are strictly not allowed to edit or modify the existing docker-compose.yml files to add labels, configs, or container-level sidecars.

Why not? And if not, are you allowed to add a docker-compose.override.yml file? That can contain labels or health checks the original is missing, without the need of changing the original file. If docker compose sees the docker-compose.override.yml file it is automatically used.

CyberJack77

Nice.

CyberJack77

I have those. Great product, but both the glass and the lid say "made in China".

CyberJack77

what are the boards?

CyberJack77

Delta chat uses email. Cross platform and is encrypted. https://delta.chat/en/

CyberJack77

Depends on who you play with.

With my son (5) the current favorite is Jurassic Snack. Very easy to learn, but challenging enough for him to play regularly. He keeps asking for it.

Otherwise it would be Azul or Patchwork if we want a quick game.

CyberJack77

True. It think they meant server-side encryption so that the provider cannot read the mail. TLS has nothing to do with that.

CyberJack77

I looked at the site, and the scoring of the providers seems strange (or even biased) to me.

Examples:

Encryption reason

  • Soverin scores a 3/5 with one of the reason being "TLS-encrypted, not end-to-end encrypted unlike Proton Mail or Tuta".
  • Mailbox.org scores a 5/5, but it also lacks end-to-end encryption, but that is not mentioned anywhere.

DPA reason

  • Tuta scores a 4/5 with one of the reasons that the DPA is not publicly accessible.
  • Mailbox.org scores a 5/5 and does not have a DPA either.

Sub-processors list reason

  • Soverin scores a 3/5 with one of the reason being "no public sub-processors list"
  • Infomaniak Mail (kSuite) scores a 5/5, but it is also missing a sub-processors list.

This scoring does not make sense to me at all.

CyberJack77

You could/should, but there is a bigger problem with arrays. An array in PHP is missing type hints, has no visibility settings en every part of the application can modify it. So basically you can never blindly trust an array.

If you want to make sure the arrays only contain Game and Loan objects, you can use property hooks, but then you cannot use promotional properties.

You can also use a variadic parameter Loan ...$listeLoan so it accepts multiple loan parameters, but you can only do that for the last parameter in your function, and you have 2 arrays. So this is not an option.

Best thing to do here is to use property hooks, or custom methods that validate both the arrays. But then you cannot use property promotion.

There is a talk by Larry Garfield called Never* Use Arrays. Very interesting to watch. It changed how I use arrays in all my code (never as input, but I use them inside classes and return them when asked)

If you want to make it better, split the library into 2 collections. One for the Games and one for the Loans. That is more SOLID, which is also a good thing to look at when learning OOP.

If you have a class that need both collections, just inject them, but let each collection handle its own data.

CyberJack77

PGP support for the mailer component was merged into the symfony 8.1 branch about 2 months ago (so not the symfony/mailer package): https://github.com/symfony/symfony/pull/59372

CyberJack77

I use these, which both have the option of exporting a non-encrypted version.

CyberJack77

Cascassonne junior, labyrinth junior or Bunny Hop are played often with the 5 year old here.

CyberJack77

Or if you want to keep a snapshot of those numbers every 10 minutes, use atop.

CyberJack77

I use the same, but with a reverse proxy and local domains. No need to remember port numbers anymore.

CyberJack77

$44... Damn. I had to look it up, but it appears I've paid 0.50 EUR back in 2015.

CyberJack77

Same thing happened at work.

We started using Vaultwarden and created a organization that holds all shared passwords. Set everything up with permissions so users could only see the shared passwords they where allowed to and everything worked great.

Then we told everybody they could store their own work related accounts in Vaultwarden (in their personal vault). A lot of colleagues did, but then the first one forgot his password and lost access to his personal passwords. Had to remove his account and invite him again.

That is why I wrote the comment. I hope it prevents others from making the same mistake.

CyberJack77

Dont forget to enforce the single org with reset password policy.

Without it, password recovery is impossible. So, once a team member forgets their password, there is no way to reset it without loosing their personal passwords. You have to remove the account and invite them again.

CyberJack77

So you want an app to use data from external sources, without any control over the data? This does not make sense from a developers point of view. Controlling external data can cause all sorts of issues, so I doubt any developer will ever make this.

For the docker part. You never need docker volumes. Each volume can be replaced with a mount and you control where the data is stored. You cannot control how the data is stored though.

CyberJack77

I don't know why you focus on MVC, but if you look at existing frameworks, Symfony is very minimal. It doesn't ship with a lot of unnecessary or often unused dependencies.

Your application needs a database? Great! install the ORM pack. Need a messenger, just install the messenger pack. This keeps it small and fast.

If you don't want to use an available framework, then Symfony has a guide on how to build your own framework.

It doesn't show you how to build a full MVC framework, but if you understand the basics you can create it using the same components.

CyberJack77

I work on a Symfony project with phpstan level 10. It uses the strict rules, symfony and doctrine addons and we have written some additional rules. The project has no baseline and only a hand full of in-line ignores.

CyberJack77

Tried PiHole and Adguard Home, but landed on blocky

CyberJack77

Same here

CyberJack77

There is a big problem with this code. The iterator_to_array method reads the entire file into memory, so you loose the memory efficiency you had before. The larger the log file, the more memory this method uses.

I think you need 2 loops based on the order, but that would make it a bit illogical. I would prefer 2 different methods. One that reads the file top->down and another to read it in reverse.

It should work by seeking the end of the file and using a for loop with decreasing index. You can use ->seek and ->current methods to set the position and get the current line. This should keep the memory efficiency when reading large log files.

I have not tested this, but it should be something like:

/**
 * @return Generator<stdClass>
 * @throws JsonException
 * @throws LogicException
 * @throws RuntimeException
 */
function getLogLinesReversed(
    string $logFile,
    int $offset = 0,
    int $limit = -1,
): Generator {
    $file = new SplFileObject($logFile);
    if (!$file->isFile() || !$file->isReadable()) {
        throw new RuntimeException('Logfile not found or not readable');
    }

    $file->seek(PHP_INT_MAX);
    $lastIndex = $file->key();

    $start = $lastIndex - max(0, $offset);
    $end = $limit >= 0
        ? $start - $limit + 1
        : 0;

    for ($i = $start; $i >= $end; $i--) {
        $file->seek($i);
        yield json_decode(
            json: $file->current(),
            associative: false,
            flags: JSON_THROW_ON_ERROR,
        ); 
    }
}