Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[docs][self-hosting] Clarify S3 endpoint

Manav Rathi2f2a0f5b6c6d
diff --git a/docs/docs/self-hosting/administration/object-storage.md b/docs/docs/self-hosting/administration/object-storage.md
index 5eb5bce5cc..c5523a2100 100644
--- a/docs/docs/self-hosting/administration/object-storage.md
+++ b/docs/docs/self-hosting/administration/object-storage.md
@@ -16,6 +16,30 @@ Compose for quick testing.
This document outlines configuration of S3 buckets and enabling replication for
further usage.
+## Architecture
+
+![Client, Museum, S3](/client-museum-s3.png)
+
+There are three components involved in uploading a file:
+
+1. The client (e.g. the web app or the mobile app)
+2. Ente's server (museum)
+3. The S3-compatible object storage (e.g. MinIO in the default quickstart)
+
+A file upload flows as follows:
+
+1. The client asks museum where it should upload the file to.
+2. Museum creates pre-signed URLs for the configured S3 bucket and returns them.
+3. The client uploads directly to the S3 bucket using those URLs.
+4. The client informs museum that the upload is complete, and museum verifies
+ the object via a `HeadObject` call.
+
+The important consequence is that **both the client and museum must be able to
+reach your S3 bucket at the same address**. Museum embeds the bucket's
+`endpoint` value into every pre-signed URL, so an address that only resolves
+inside the server (for example `localhost:3200`) will fail when handed to a
+phone or another machine on the LAN.
+
## Museum
The S3-compatible buckets have to be configured in `museum.yaml` file.
@@ -89,6 +113,31 @@ b2-eu-cen:
bucket: b2-eu-cen
```
+### Using the mobile app or another device
+
+The quickstart's sample sets `endpoint: localhost:3200`. This works for the
+museum container itself (thanks to the `socat` service in `compose.yaml`), but
+museum also hands this address back to clients as part of pre-signed upload
+URLs. On a phone or any machine other than the server, `localhost` resolves to
+the device itself, so uploads never reach MinIO and fail silently. Museum logs
+`OBJECT_SIZE_FETCH_FAILED: dial tcp …: i/o timeout` on commit.
+
+Set `endpoint` to an address that is reachable **both** from the museum
+container and from your clients. On a LAN, the server's IP works:
+
+```yaml
+b2-eu-cen:
+ key: <key>
+ secret: <secret>
+ endpoint: 192.168.1.100:3200
+ region: eu-central-2
+ bucket: b2-eu-cen
+```
+
+With a reverse proxy, use the external hostname (e.g. `s3.example.com`). The
+`socat` service in `compose.yaml` is only needed when `endpoint` remains
+`localhost:3200`; once you switch to a LAN IP or domain, you can remove it.
+
## CORS (Cross-Origin Resource Sharing)
If you cannot upload a photo due to CORS error, you need to fix the CORS
diff --git a/docs/docs/self-hosting/installation/post-install/index.md b/docs/docs/self-hosting/installation/post-install/index.md
index a323537eb5..0522a18ac9 100644
--- a/docs/docs/self-hosting/installation/post-install/index.md
+++ b/docs/docs/self-hosting/installation/post-install/index.md
@@ -132,9 +132,18 @@ though this poses challenges with respect to object storage (details below).
### Understanding IP address challenges with object storage
-When accessing Ente using an IP address instead of a domain name, you may encounter issues with file uploads and downloads due to **CORS (Cross-Origin Resource Sharing)** browser security policies.
-
-**The issue:** Your browser treats requests between different ports on the same IP as cross-origin requests. For example:
+When accessing Ente using an IP address instead of a domain name, you may encounter two distinct issues with file uploads and downloads.
+
+**Issue 1: S3 endpoint reachability.** Museum embeds the bucket `endpoint`
+value into the pre-signed URLs it hands to clients. The quickstart ships with
+`endpoint: localhost:3200`, which only resolves to MinIO from within the
+server. Uploads from the mobile app or another machine then silently fail
+(museum logs `OBJECT_SIZE_FETCH_FAILED: dial tcp …: i/o timeout`). Set
+`endpoint` in `museum.yaml` to an address reachable from both museum and the
+clients β€” typically the server's LAN IP or a hostname. Learn more in
+[Configuring Object Storage](/self-hosting/administration/object-storage#using-the-mobile-app-or-another-device).
+
+**Issue 2: CORS (Cross-Origin Resource Sharing).** Your browser treats requests between different ports on the same IP as cross-origin requests. For example:
- Ente web app runs on `http://192.168.1.100:3000`
- MinIO object storage runs on `http://192.168.1.100:3200`
diff --git a/docs/docs/self-hosting/troubleshooting/uploads.md b/docs/docs/self-hosting/troubleshooting/uploads.md
index c77b71eece..b8ff1dbd96 100644
--- a/docs/docs/self-hosting/troubleshooting/uploads.md
+++ b/docs/docs/self-hosting/troubleshooting/uploads.md
@@ -45,3 +45,15 @@ The "Mismatch in file size" error mostly occurs in a situation where the client
is re-uploading a file which is already in the bucket with a different file
size. The reason for re-upload could be anything including network issue, sudden
killing of app before the upload is complete and etc.
+
+## Uploads from mobile or another device time out
+
+If uploads from the web app on the same machine work, but uploads from the
+mobile app or another device on your LAN silently fail, and museum logs
+`OBJECT_SIZE_FETCH_FAILED: dial tcp …: i/o timeout`, your bucket `endpoint` is
+set to an address only the server can reach (typically `localhost:3200` from
+the quickstart).
+
+Change `endpoint` in `museum.yaml` to an address reachable from both museum and
+the clients β€” usually the server's LAN IP or a hostname. Learn more in
+[Configuring Object Storage](/self-hosting/administration/object-storage#using-the-mobile-app-or-another-device).
diff --git a/server/RUNNING.md b/server/RUNNING.md
index d39c98922b..f37d99a27f 100644
--- a/server/RUNNING.md
+++ b/server/RUNNING.md
@@ -286,4 +286,4 @@ The keys and values supported by this configuration file are documented in
>
> If your mobile app is able to connect to your self hosted instance but is not
able to view or upload images, see
-[ente.com/help/self-hosting/guides/configuring-s3](https://ente.com/help/self-hosting/guides/configuring-s3).
+[ente.com/help/self-hosting/administration/object-storage](https://ente.com/help/self-hosting/administration/object-storage).