Skip to content

Commit

Permalink
[docs] Add a FAQ for album sharing on self hosted instances (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnvr authored Apr 12, 2024
2 parents 997debf + 3e9bbac commit b4a8968
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/docs/.vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ export const sidebar = [
text: "Verification code",
link: "/self-hosting/faq/otp",
},
{
text: "Shared albums",
link: "/self-hosting/faq/sharing",
},
],
},
{
Expand Down
43 changes: 43 additions & 0 deletions docs/docs/self-hosting/faq/sharing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Album sharing
description: Getting album sharing to work using an self-hosted Ente
---

# Is public sharing available for self-hosted instances?

Yes.

You'll need to run two instances of the web app, one is regular web app, but
another one is the same code but running on a different origin (i.e. on a
different hostname or different port).

Then, you need to tell the regular web app to use your second instance to
service public links. You can do this by setting the
`NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT` to point to your second instance when running
or building the regular web app.

For more details, see
[.env](https://github.com/ente-io/ente/blob/main/web/apps/photos/.env) and
[.env.development](https://github.com/ente-io/ente/blob/main/web/apps/photos/.env.development).

As a concrete example, assuming we have a Ente server running on
`localhost:8080`, we can start two instances of the web app, passing them
`NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT` that points to the origin
("scheme://host[:port]") of the second "albums" instance.

The first one, the normal web app

```sh
NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8080 \
NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=http://localhost:3002 \
yarn dev:photos
```

The second one, the same code but acting as the "albums" app (the only
difference is the port it is running on):

```sh
NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8080 \
NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=http://localhost:3002 \
yarn dev:albums
```
8 changes: 7 additions & 1 deletion web/apps/photos/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
#NEXT_PUBLIC_ENTE_ENDPOINT = http://localhost:8080

# If you wish to preview how the shared albums work, you can use `yarn
# dev:albums`. The equivalent CLI command using env vars would be
# dev:albums`. You'll need to run two instances.

# The equivalent CLI commands using env vars would be:
#
# # For the normal web app
# NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8080 NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=http://localhost:3002 yarn dev:photos
#
# # For the albums app
# NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8080 NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT=http://localhost:3002 yarn dev:albums

#NEXT_PUBLIC_ENTE_ALBUMS_ENDPOINT = http://localhost:3002

0 comments on commit b4a8968

Please sign in to comment.