From 9a375421581061d5945b643a6f8b40424687c1ef Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 5 Sep 2024 09:59:32 +0530 Subject: [PATCH 1/2] [server] Load museum.yaml after configuration.yaml Since museum.yaml is gitignored, loading it the last makes it easier to do ad-hoc configuration changes without marking the git tree dirty. --- server/configurations/local.yaml | 11 ++++++----- server/pkg/utils/config/config.go | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/server/configurations/local.yaml b/server/configurations/local.yaml index bca362b838..3775d6158a 100644 --- a/server/configurations/local.yaml +++ b/server/configurations/local.yaml @@ -5,12 +5,13 @@ # load one of the files from the `configurations/` directory. If not present, # then by default `local.yaml` (this file) will get loaded. # -# 2. Then, museum will look for a file named `museum.yaml` in the current -# working directory. If found, this file will also be loaded, and entries -# specified therein will override the defaults specified here. +# 2. If the "credentials-file" config option is set then museum will look for +# that file. If found, that file will also be loaded, and entries specified +# therein will override the defaults specified here. # -# 3. If the "credentials-file" config option is set, then museum will also load -# that and merge it in. +# 3. Then, museum will look for a file named `museum.yaml` (gitignored) in the +# current working directory. If found, this file will also be loaded and +# merged. # # 4. Config can be overridden with via environment variables (details below). # diff --git a/server/pkg/utils/config/config.go b/server/pkg/utils/config/config.go index 1bbd3707ac..b78d89b908 100644 --- a/server/pkg/utils/config/config.go +++ b/server/pkg/utils/config/config.go @@ -47,11 +47,6 @@ func ConfigureViper(environment string) error { return err } - err = mergeConfigFileIfExists("museum.yaml") - if err != nil { - return err - } - credentialsFile := viper.GetString("credentials-file") if credentialsFile == "" { credentialsFile = "credentials.yaml" @@ -61,6 +56,11 @@ func ConfigureViper(environment string) error { return err } + err = mergeConfigFileIfExists("museum.yaml") + if err != nil { + return err + } + return nil } From bd94e27af6fdf42178b29f42ba43da894354071a Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 5 Sep 2024 10:23:20 +0530 Subject: [PATCH 2/2] Add an example --- docs/docs/self-hosting/guides/configuring-s3.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/docs/self-hosting/guides/configuring-s3.md b/docs/docs/self-hosting/guides/configuring-s3.md index 3ab3828dae..dd228741de 100644 --- a/docs/docs/self-hosting/guides/configuring-s3.md +++ b/docs/docs/self-hosting/guides/configuring-s3.md @@ -81,6 +81,22 @@ Set the S3 bucket `endpoint` in `credentials.yaml` to a `yourserverip:3200` or some such IP/hostname that accessible from both where you are running the Ente clients (e.g. the mobile app) and also from within the Docker compose cluster. +### Example + +An example `museum.yaml` when you're trying to connect to museum running on your computer from your +phone on the same WiFi network: + +``` +s3: + are_local_buckets: true + b2-eu-cen: + key: test + secret: testtest + endpoint: http://:3200 + region: eu-central-2 + bucket: b2-eu-cen +``` + ### 403 Forbidden If museum (`2`) is able to make a network connection to your S3 bucket (`3`) but