function61 / varasto

All your files in one simple, replicated, encrypted place - with built-in backups and configurable ransomware protection.
https://function61.com/varasto
Apache License 2.0
56 stars 5 forks source link

Safety: don't allow built-in client to accidentally communicate with a non-related instance #226

Open joonas-fi opened 1 year ago

joonas-fi commented 1 year ago

Problem

I was wondering why I see in logs my test server instance connecting to my production instance.

The issue is that some server components (e.g. mediascanner) also act as client.

I spun up a test server on the same machine where I have a client configured to connect to the production instance.

Hence my production server accidentally acted as a client not to itself, but to the production server.

Solution

Maybe have some sort of cluster ID which is stored in the client config file. Then when reading the client config file, assert that the server and the client cluster IDs match?

See also: "lineage" in Terraform: https://developer.hashicorp.com/terraform/language/state/backends#manual-state-pull-push