Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

Format server Markdown

Manav Rathiaa84f82b28ba
diff --git a/server/README.md b/server/README.md
index 9d8e589547..e0416a673c 100644
--- a/server/README.md
+++ b/server/README.md
@@ -4,131 +4,90 @@ API server for [ente.com](https://ente.com)
![Museum's role in Ente's architecture](scripts/images/museum.png)
-We named our server _museum_ because for us and our customers, personal photos
-are worth more than any other piece of art.
+We named our server _museum_ because for us and our customers, personal photos are worth more than any other piece of art.
-Both Ente Photos and Ente Auth use the same server (intentionally). This allows
-users to use the same credentials to store different types of end-to-end
-encrypted data without needing to create new accounts. We plan on building more
-apps using the same server – this is easy, because the server is already data
-agnostic (since the data is end-to-end encrypted).
+Both Ente Photos and Ente Auth use the same server (intentionally). This allows users to use the same credentials to store different types of end-to-end encrypted data without needing to create new accounts. We plan on building more apps using the same server – this is easy, because the server is already data agnostic (since the data is end-to-end encrypted).
## Getting started
Start a local cluster
- docker compose up --build
+```sh
+docker compose up --build
+```
And that's it!
You can now make API requests to localhost, for example
- curl http://localhost:8080/ping
+```sh
+curl http://localhost:8080/ping
+```
-Let's try changing the message to get the hang of things. Open `healthcheck.go`,
-change `"pong"` to `"kong"`, stop the currently running cluster (`Ctrl-c`), and
-then rerun it
+Let's try changing the message to get the hang of things. Open `healthcheck.go`, change `"pong"` to `"kong"`, stop the currently running cluster (`Ctrl-c`), and then rerun it
- docker compose up --build
+```sh
+docker compose up --build
+```
And ping again
- curl http://localhost:8080/ping
+```sh
+curl http://localhost:8080/ping
+```
This time you'll see the updated message.
> [!TIP]
>
-> You can also use pre-built Docker images to directly start a cluster without
-> needing to clone this repository - see
-> [docs/quickstart.md](docs/quickstart.md).
+> You can also use pre-built Docker images to directly start a cluster without needing to clone this repository - see [docs/quickstart.md](docs/quickstart.md).
-For more details about how to get museum up and running, see
-[RUNNING.md](RUNNING.md).
+For more details about how to get museum up and running, see [RUNNING.md](RUNNING.md).
## Architecture
-With the mechanics of running museum out of the way, let us revisit the diagram
-we saw earlier.
+With the mechanics of running museum out of the way, let us revisit the diagram we saw earlier.
-It is a long term goal of ours to make museum redundant. The beauty of an
-end-to-end encrypted architecture is that the service provider has no special
-conceptual role. The user has full ownership of the data at all points, and
-using suitably advanced clients the cloud storage and replication can be
-abstracted away, or be handled in a completely decentralized manner.
+It is a long term goal of ours to make museum redundant. The beauty of an end-to-end encrypted architecture is that the service provider has no special conceptual role. The user has full ownership of the data at all points, and using suitably advanced clients the cloud storage and replication can be abstracted away, or be handled in a completely decentralized manner.
-Until we get there, museum serves as an assistant for various housekeeping
-chores.
+Until we get there, museum serves as an assistant for various housekeeping chores.
-* Clients ([mobile](../mobile), [web](../web) and [desktop](../desktop)) connect
- to museum on the user's behalf. Museum then proxies data access (after adding
- yet another layer of authentication on top of the user's master password),
- performs billing related functions, and triggers replication of encrypted user
- data.
+- Clients ([mobile](../mobile), [web](../web) and [desktop](../desktop)) connect to museum on the user's behalf. Museum then proxies data access (after adding yet another layer of authentication on top of the user's master password), performs billing related functions, and triggers replication of encrypted user data.
-* The end-to-end encrypted cryptography that powers all this is [documented
- here](https://ente.com/architecture)
+- The end-to-end encrypted cryptography that powers all this is [documented here](https://ente.com/architecture)
-* Details about the 3 (yes 3!) clouds where the encrypted data and database are
- replicated to are [documented here](https://ente.com/reliability)
+- Details about the 3 (yes 3!) clouds where the encrypted data and database are replicated to are [documented here](https://ente.com/reliability)
-Museum's architecture is generic enough to support arbitrary end-to-end
-encrypted storage. While we're currently focusing on building a great photo
-storage and sharing experience, that's not a limit. For example, we already use
-museum to also provide an [end-to-end encrypted open source 2FA app with cloud
-backups](../auth).
+Museum's architecture is generic enough to support arbitrary end-to-end encrypted storage. While we're currently focusing on building a great photo storage and sharing experience, that's not a limit. For example, we already use museum to also provide an [end-to-end encrypted open source 2FA app with cloud backups](../auth).
## Self hosting
Museum is a single self-contained Docker image that is easy to self-host.
-When we write code for museum, the guiding light is simplicity and robustness.
-But this also extends to how we approach hosting. Museum is a single statically
-compiled binary that can be put anywhere and directly run.
+When we write code for museum, the guiding light is simplicity and robustness. But this also extends to how we approach hosting. Museum is a single statically compiled binary that can be put anywhere and directly run.
-And it is built with containerization in mind - both during development and
-deployment. Just use the provided Dockerfile, configure to taste and you're off
-to the races.
+And it is built with containerization in mind - both during development and deployment. Just use the provided Dockerfile, configure to taste and you're off to the races.
Overall, there are [three approaches](RUNNING.md) you can take:
-* Run using Docker using a pre-built Docker image
-* Run using Docker but build an image from source
-* Run without Docker
+- Run using Docker using a pre-built Docker image
+- Run using Docker but build an image from source
+- Run without Docker
-Everything that you might needed to run museum is all in here, since this is the
-code we ourselves use in production.
+Everything that you might needed to run museum is all in here, since this is the code we ourselves use in production.
> [!TIP]
>
-> On our production servers, we wrap museum in a [systemd
-> service](scripts/deploy/museum.service). Our production machines are vanilla
-> Ubuntu images, with Docker and Promtail installed. We then plonk in this
-> systemd service, and use `systemctl start|stop|status museum` to herd it
-> around.
-
-Some people new to Docker/Go/Postgres might have general questions though.
-Unfortunately, because of limited engineering bandwidth **we will currently not
-be able to prioritize support queries related to self hosting**, and we request
-you to please not open issues around self hosting for the time being (feel free
-to create discussions though). The best way to summarize the status of self
-hosting is – **everything you need is here, but it is perhaps not readily
-documented, or flexible enough.**
-
-That said, we hope community members help each other out, e.g. in this
-repository's [Discussions](https://github.com/ente-io/ente/discussions), or on
-[our Discord](https://discord.gg/z2YVKkycX3). And whenever time permits, we will
-try to clarify, and also document such FAQs. Please feel free to open
-documentation PRs around this too.
+> On our production servers, we wrap museum in a [systemd service](scripts/deploy/museum.service). Our production machines are vanilla Ubuntu images, with Docker and Promtail installed. We then plonk in this systemd service, and use `systemctl start|stop|status museum` to herd it around.
+
+Some people new to Docker/Go/Postgres might have general questions though. Unfortunately, because of limited engineering bandwidth **we will currently not be able to prioritize support queries related to self hosting**, and we request you to please not open issues around self hosting for the time being (feel free to create discussions though). The best way to summarize the status of self hosting is – **everything you need is here, but it is perhaps not readily documented, or flexible enough.**
+
+That said, we hope community members help each other out, e.g. in this repository's [Discussions](https://github.com/ente-io/ente/discussions), or on [our Discord](https://discord.gg/z2YVKkycX3). And whenever time permits, we will try to clarify, and also document such FAQs. Please feel free to open documentation PRs around this too.
> [!TIP]
>
-> For more documentation around self-hosting, see
-> **[ente.com/help/self-hosting](https://ente.com/help/self-hosting)**.
+> For more documentation around self-hosting, see **[ente.com/help/self-hosting](https://ente.com/help/self-hosting)**.
## Thanks ❤️
-We've had great fun with this combination (Golang + Postgres + Docker), and we
-hope you also have fun tinkering with it too. A big thank you to all the people
-who've put in decades of work behind these great technologies. Truly, on the
-shoulders of giants we stand.
+We've had great fun with this combination (Golang + Postgres + Docker), and we hope you also have fun tinkering with it too. A big thank you to all the people who've put in decades of work behind these great technologies. Truly, on the shoulders of giants we stand.
diff --git a/server/RUNNING.md b/server/RUNNING.md
index f37d99a27f..c7a0a2ecd6 100644
--- a/server/RUNNING.md
+++ b/server/RUNNING.md
@@ -1,21 +1,16 @@
# Running Museum
-You can run a Docker compose cluster containing museum, the web app, and the
-essential auxiliary services it requires (database and object storage). This is
-the easiest and simplest way to get started, and also provides an isolated
-environment that doesn't clutter your machine.
+You can run a Docker compose cluster containing museum, the web app, and the essential auxiliary services it requires (database and object storage). This is the easiest and simplest way to get started, and also provides an isolated environment that doesn't clutter your machine.
-You can also run museum directly on your machine if you wish - it is a single
-static go binary.
+You can also run museum directly on your machine if you wish - it is a single static go binary.
-This document describes these different approaches (you can choose any one), and
-also outlines configuration.
+This document describes these different approaches (you can choose any one), and also outlines configuration.
-- [Run using pre-built Docker images](quickstart/README.md)
-- [Run using Docker, building image from source](#build-and-run-using-docker)
-- [Run with Docker, à la carte](#pre-built-images)
-- [Run without Docker](#running-without-docker)
-- [Configuration](#configuration)
+- [Run using pre-built Docker images](quickstart/README.md)
+- [Run using Docker, building image from source](#build-and-run-using-docker)
+- [Run with Docker, à la carte](#pre-built-images)
+- [Run without Docker](#running-without-docker)
+- [Configuration](#configuration)
## Run using pre-built Docker images
@@ -29,74 +24,74 @@ For more details, see [docs/quickstart.md](docs/quickstart.md).
Start the cluster (in the `ente/server` directory)
- docker compose up --build
+```sh
+docker compose up --build
+```
Once the cluster has started, you should be able to do call museum
- curl http://localhost:8080/ping
+```sh
+curl http://localhost:8080/ping
+```
Or connect from the [web app](../web)
- NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8080 yarn dev
+```sh
+NEXT_PUBLIC_ENTE_ENDPOINT=http://localhost:8080 yarn dev
+```
Or connect from the [mobile app](../mobile)
- flutter run --dart-define=endpoint=http://localhost:8080
+```sh
+flutter run --dart-define=endpoint=http://localhost:8080
+```
Or interact with the other services in the cluster, e.g. connect to the DB
- docker compose exec postgres env PGPASSWORD=pgpass psql -U pguser -d ente_db
+```sh
+docker compose exec postgres env PGPASSWORD=pgpass psql -U pguser -d ente_db
+```
Or interact with the MinIO S3 API
- AWS_ACCESS_KEY_ID=changeme AWS_SECRET_ACCESS_KEY=changeme1234 \
- aws s3 --endpoint-url http://localhost:3200 ls s3://b2-eu-cen
+```sh
+AWS_ACCESS_KEY_ID=changeme AWS_SECRET_ACCESS_KEY=changeme1234 \
+ aws s3 --endpoint-url http://localhost:3200 ls s3://b2-eu-cen
+```
Or open the MinIO dashboard at http://localhost:3201
> [!NOTE]
>
-> To avoid exposing unnecessary services, this port is not exposed by default.
-> You'll need to uncomment the corresponding port in your `compose.yaml` first.
+> To avoid exposing unnecessary services, this port is not exposed by default. You'll need to uncomment the corresponding port in your `compose.yaml` first.
> [!WARNING]
>
-> The default credentials are user changeme / password changeme1234. Goes
-> without saying, but remember to change them!
+> The default credentials are user changeme / password changeme1234. Goes without saying, but remember to change them!
> [!NOTE]
>
-> While we've provided a MinIO based Docker compose file to make it easy for
-> people to get started, if you're running it in production we recommend using
-> an external S3.
+> While we've provided a MinIO based Docker compose file to make it easy for people to get started, if you're running it in production we recommend using an external S3.
### Cleanup
-Persistent data is stored in Docker volumes and will persist across container
-restarts. The volume can be saved / inspected using the `docker volumes`
-command.
+Persistent data is stored in Docker volumes and will persist across container restarts. The volume can be saved / inspected using the `docker volumes` command.
-To remove stopped containers, use `docker compose rm`. To also remove volumes,
-use `docker compose down -v`.
+To remove stopped containers, use `docker compose rm`. To also remove volumes, use `docker compose down -v`.
### Multiple clusters
-You can spin up independent clusters, each with its own volumes, by using the
-`-p` Docker Compose flag to specify different project names for each one.
+You can spin up independent clusters, each with its own volumes, by using the `-p` Docker Compose flag to specify different project names for each one.
### Pruning images
-Each time museum gets rebuilt from source, a new image gets created but the old
-one is retained as a dangling image. You can use `docker image prune --force`,
-or `docker system prune` if that's fine with you, to remove these.
+Each time museum gets rebuilt from source, a new image gets created but the old one is retained as a dangling image. You can use `docker image prune --force`, or `docker system prune` if that's fine with you, to remove these.
## Pre-built images
## server
-If you have setup the database and object storage externally and only want to
-run Ente's server, you can just pull and run the image from
-**`ghcr.io/ente-io/server`**.
+If you have setup the database and object storage externally and only want to run Ente's server, you can just pull and run the image from **`ghcr.io/ente-io/server`**.
```sh
docker pull ghcr.io/ente-io/server
@@ -104,21 +99,17 @@ docker pull ghcr.io/ente-io/server
## web
-Similarly, there is a pre-built Docker image containing all the web apps which
-you can just pull and run the from **`ghcr.io/ente-io/web`**.
+Similarly, there is a pre-built Docker image containing all the web apps which you can just pull and run the from **`ghcr.io/ente-io/web`**.
```sh
docker pull ghcr.io/ente-io/web
```
-For details about configuring the web image, see
-[web/docs/docker.md](../web/docs/docker.md).
+For details about configuring the web image, see [web/docs/docker.md](../web/docs/docker.md).
## Running without Docker
-The museum binary can be run by using `go run cmd/museum/main.go`. But first,
-you'll need to prepare your machine for development. Here we give the steps,
-with examples that work for macOS (please adapt to your OS).
+The museum binary can be run by using `go run cmd/museum/main.go`. But first, you'll need to prepare your machine for development. Here we give the steps, with examples that work for macOS (please adapt to your OS).
### Install [Go](https://golang.org/dl/)
@@ -134,9 +125,7 @@ brew install postgresql@15
> [!NOTE]
>
-> Here we install same major version of Postgres as our production database to
-> avoid surprises, but if you're using a newer Postgres that should work fine
-> too.
+> Here we install same major version of Postgres as our production database to avoid surprises, but if you're using a newer Postgres that should work fine too.
Run the service:
@@ -206,20 +195,20 @@ Create `museum.yaml` in `ente/server`.
```yaml
db:
- host: localhost
- port: 5432
- name: ente_db
- user: pguser
- password: pgpass
+ host: localhost
+ port: 5432
+ name: ente_db
+ user: pguser
+ password: pgpass
s3:
- are_local_buckets: true
- b2-eu-cen:
- key: minioadmin
- secret: minioadmin
- endpoint: localhost:9000
- region: eu-central-2
- bucket: b2-eu-cen
+ are_local_buckets: true
+ b2-eu-cen:
+ key: minioadmin
+ secret: minioadmin
+ endpoint: localhost:9000
+ region: eu-central-2
+ bucket: b2-eu-cen
```
### Start museum
@@ -230,9 +219,7 @@ From `ente/server`,
go run cmd/museum/main.go
```
-For live reloads, install [air](https://github.com/cosmtrek/air#installation).
-Then you can just call `air` after declaring the required environment variables.
-For example,
+For live reloads, install [air](https://github.com/cosmtrek/air#installation). Then you can just call `air` after declaring the required environment variables. For example,
```sh
air
@@ -240,8 +227,7 @@ air
### Testing
-Set up a local database for testing. This is not required for running the server.
-Create a test database with the following name and credentials:
+Set up a local database for testing. This is not required for running the server. Create a test database with the following name and credentials:
```sql
$ psql -U postgres
@@ -257,8 +243,7 @@ ENV="test" go test -v ./pkg/...
go clean -testcache && ENV="test" go test -v ./pkg/...
```
-To run the full `server/` Go test suite inside Docker instead of relying on a
-host Postgres setup, use:
+To run the full `server/` Go test suite inside Docker instead of relying on a host Postgres setup, use:
```sh
./scripts/test-in-docker.sh
@@ -267,23 +252,14 @@ host Postgres setup, use:
## Configuration
-Now that you have museum running (either inside Docker or standalone), we can
-talk about configuring it.
+Now that you have museum running (either inside Docker or standalone), we can talk about configuring it.
-By default, museum runs in the "local" configuration using values specified in
-`local.yaml`.
+By default, museum runs in the "local" configuration using values specified in `local.yaml`.
-To override these values, you can create a file named `museum.yaml` in the
-current directory. This path is git-ignored for convenience. Note that if you
-run the Docker compose cluster without creating this file, Docker will create an
-empty directory named `museum.yaml` which you can `rmdir` if you need to provide
-a config file later on.
+To override these values, you can create a file named `museum.yaml` in the current directory. This path is git-ignored for convenience. Note that if you run the Docker compose cluster without creating this file, Docker will create an empty directory named `museum.yaml` which you can `rmdir` if you need to provide a config file later on.
-The keys and values supported by this configuration file are documented in
-[configurations/local.yaml](configurations/local.yaml).
+The keys and values supported by this configuration file are documented in [configurations/local.yaml](configurations/local.yaml).
> [!TIP]
>
-> 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/administration/object-storage](https://ente.com/help/self-hosting/administration/object-storage).
+> 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/administration/object-storage](https://ente.com/help/self-hosting/administration/object-storage).
diff --git a/server/docs/collections/collections-architecture.md b/server/docs/collections/collections-architecture.md
index ce20df90fa..4f9c52270c 100644
--- a/server/docs/collections/collections-architecture.md
+++ b/server/docs/collections/collections-architecture.md
@@ -127,7 +127,7 @@ When a user removes their own files from a collection they own:
- Table: `collection_actions(id, user_id, actor_user_id, collection_id, file_id, data JSONB, action, is_pending, created_at, updated_at)`.
- ID uses nanoid (server/ente/base/id.go).
- `GET /collection-actions/pending-remove?sinceTime=<int64>` returns `REMOVE` actions for the authenticated owner so clients can guide the shared-collection workflow. Response: `{ "actions": [...], "hasMore": boolean }`.
- - `GET /collection-actions/delete-suggestions?sinceTime=<int64>` returns `DELETE_SUGGESTED` actions; the server double-checks ownership and marks as resolved any entries whose files already exist as non-restored trash rows (either still in trash or already permanently deleted). Response: `{ "actions": [...], "hasMore": boolean }`.
+- `GET /collection-actions/delete-suggestions?sinceTime=<int64>` returns `DELETE_SUGGESTED` actions; the server double-checks ownership and marks as resolved any entries whose files already exist as non-restored trash rows (either still in trash or already permanently deleted). Response: `{ "actions": [...], "hasMore": boolean }`.
- `POST /collection-actions/reject-delete-suggestions` accepts a list of file IDs and marks the matching pending delete suggestions as resolved for the caller.
- Clients act on these locally:
- Owner processes `REMOVE` by ensuring file remains in at least one owned collection, then can finalize server-side removal.
diff --git a/server/docs/publish.md b/server/docs/publish.md
index b425da750f..866db8f943 100644
--- a/server/docs/publish.md
+++ b/server/docs/publish.md
@@ -4,40 +4,26 @@ There are two different images we publish - internal and external.
## Internal
-The internal images can be built and run by triggering the "Server (release)"
-workflow. You can trigger it either from GitHub's UI on the Actions tab, or use
-the following command:
+The internal images can be built and run by triggering the "Server (release)" workflow. You can trigger it either from GitHub's UI on the Actions tab, or use the following command:
- gh workflow run server-release.yml
+```sh
+gh workflow run server-release.yml
+```
-This will take the latest main, package it into a Docker image, and publish it
-to our Scaleway registry. From there, we can update our production instances to
-use this new image (see [deploy/README](../scripts/deploy/README.md)).
+This will take the latest main, package it into a Docker image, and publish it to our Scaleway registry. From there, we can update our production instances to use this new image (see [deploy/README](../scripts/deploy/README.md)).
## External
-Periodically, we republish a new image from an existing known-to-be-good
-commit to the GitHub Container Registry (GHCR) so that it can be used by folks
-without needing to clone our repository just for building an image. For more
-details about the use case, see [docker.md](docker.md).
+Periodically, we republish a new image from an existing known-to-be-good commit to the GitHub Container Registry (GHCR) so that it can be used by folks without needing to clone our repository just for building an image. For more details about the use case, see [docker.md](docker.md).
-These images are published automatically by the "Publish (server)" workflow on
-the 15th of every month. If needed, the workflow can also be manually triggered
-invoked to publish out of schedule. It can be triggered on the GitHub UI, or by
+These images are published automatically by the "Publish (server)" workflow on the 15th of every month. If needed, the workflow can also be manually triggered invoked to publish out of schedule. It can be triggered on the GitHub UI, or by
```sh
gh workflow run server-publish.yml
```
-> It uses the commit that is deployed on production museum instances. We can
-> publish from any arbitrary commit really, but by using the commit that's
-> already seen production, we avoid externally publishing images with issues.
+> It uses the commit that is deployed on production museum instances. We can publish from any arbitrary commit really, but by using the commit that's already seen production, we avoid externally publishing images with issues.
-Once the workflow completes, the resultant image will be available at
-`ghcr.io/ente-io/server`. The image will be tagged by the commit SHA. The latest
-image will also be tagged, well, "latest".
+Once the workflow completes, the resultant image will be available at `ghcr.io/ente-io/server`. The image will be tagged by the commit SHA. The latest image will also be tagged, well, "latest".
-The workflow will also update the branch `ghcr/server` to point to the commit it
-used to build the image. This branch will be overwritten on each publish; thus
-`ghcr/server` will always points to the code from which the most recent ghcr
-docker image for museum has been built.
+The workflow will also update the branch `ghcr/server` to point to the commit it used to build the image. This branch will be overwritten on each publish; thus `ghcr/server` will always points to the code from which the most recent ghcr docker image for museum has been built.
diff --git a/server/docs/quickstart.md b/server/docs/quickstart.md
index 8999f88bb2..5e67942a37 100644
--- a/server/docs/quickstart.md
+++ b/server/docs/quickstart.md
@@ -1,12 +1,8 @@
# quickstart.sh
-The quickstart.sh script creates a Docker compose file that does not require
-cloning the repository, and uses pre-built images instead. It is meant to
-provide an easy way for people to get started with self hosting Ente without
-needing to build museum or the web app from source.
+The quickstart.sh script creates a Docker compose file that does not require cloning the repository, and uses pre-built images instead. It is meant to provide an easy way for people to get started with self hosting Ente without needing to build museum or the web app from source.
-The easiest way to run the script is to copy paste the following command into
-your terminal:
+The easiest way to run the script is to copy paste the following command into your terminal:
```sh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ente-io/ente/main/server/quickstart.sh)"
@@ -14,26 +10,19 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ente-io/ente/main/server/q
> [!TIP]
>
-> If you don't want to run via curl, you can alternatively download
-> [quickstart.sh](https://github.com/ente-io/ente/blob/main/server/quickstart.sh),
-> make it executable and run the script.
+> If you don't want to run via curl, you can alternatively download [quickstart.sh](https://github.com/ente-io/ente/blob/main/server/quickstart.sh), make it executable and run the script.
>
-> ``` shell
+> ```sh
> curl -o quickstart.sh https://raw.githubusercontent.com/ente-io/ente/main/server/quickstart.sh
> chmod +x quickstart.sh
> ./quickstart.sh
> ```
-After the Docker compose cluster starts, you can open Ente web app at
-http://localhost:3000. Public album links are served from
-http://localhost:3002.
+After the Docker compose cluster starts, you can open Ente web app at http://localhost:3000. Public album links are served from http://localhost:3002.
> [!TIP]
>
-> The verification code when you try to create an account can be seen in the
-> logs (See [self hosting
-> docs](https://ente.com/help/self-hosting/faq/otp#verification-code) for more
-> ways to get it)
+> The verification code when you try to create an account can be seen in the logs (See [self hosting docs](https://ente.com/help/self-hosting/faq/otp#verification-code) for more ways to get it)
## Details
@@ -43,23 +32,19 @@ The script first creates a directory named `my-ente` and changes to it.
> [!TIP]
>
-> "Ente" (pronounced _en-tay_) means "mine" in Malayalam, our Founder's mother
-> tongue (the product literally thus means "My Photos"), so our quickstart
-> directory name `my-ente` means "my-my".
+> "Ente" (pronounced _en-tay_) means "mine" in Malayalam, our Founder's mother tongue (the product literally thus means "My Photos"), so our quickstart directory name `my-ente` means "my-my".
-Then it creates a Docker compose file (`compose.yaml`) from a template, and a
-`museum.yaml` with fresh autogenerated credentials.
+Then it creates a Docker compose file (`compose.yaml`) from a template, and a `museum.yaml` with fresh autogenerated credentials.
-Finally, it starts the Docker compose cluster running the following services on
-4 open ports:
+Finally, it starts the Docker compose cluster running the following services on 4 open ports:
-| Service | Port | Notes |
-| ----------- | -------- | ----------------------- |
-| museum | `:8080` | Ente's API server |
-| web | `:3000` | Ente Photos web app |
-| web | `:3002` | Ente public albums app |
-| postgres | | DB |
-| minio | `:3200` | S3 |
+| Service | Port | Notes |
+| -------- | ------- | ---------------------- |
+| museum | `:8080` | Ente's API server |
+| web | `:3000` | Ente Photos web app |
+| web | `:3002` | Ente public albums app |
+| postgres | | DB |
+| minio | `:3200` | S3 |
For each of these, it'll use the latest published Docker image.
@@ -69,22 +54,18 @@ You can do a quick smoke test by pinging the API:
curl localhost:8080/ping
```
-Or directly start using the web app by opening http://localhost:3000 in your
-browser.
+Or directly start using the web app by opening http://localhost:3000 in your browser.
-The first time around, the cluster will keep running as long as the
-`quickstart.sh` script is running (you can stop it by using `Ctrl-C`).
+The first time around, the cluster will keep running as long as the `quickstart.sh` script is running (you can stop it by using `Ctrl-C`).
-Subsequently, whenever you want to start the cluster, you can go back to the
-same directory and run `docker compose up` again.
+Subsequently, whenever you want to start the cluster, you can go back to the same directory and run `docker compose up` again.
```sh
cd /path/to/my-ente # Where you ran the quickstart script originally
docker compose up
```
-If you want to keep it running in the background, you can pass the `-d` flag to
-the `docker compose up` command:
+If you want to keep it running in the background, you can pass the `-d` flag to the `docker compose up` command:
```sh
cd /path/to/my-ente
@@ -98,54 +79,35 @@ cd /path/to/my-ente
docker compose down
```
-Apart from this `my-ente` directory, the script does not install anything else
-on your system. Settings and credentials are saved in `my-ente`, while other
-persistent data is saved in volumes managed by Docker.
+Apart from this `my-ente` directory, the script does not install anything else on your system. Settings and credentials are saved in `my-ente`, while other persistent data is saved in volumes managed by Docker.
> [!IMPORTANT]
>
-> The `museum.yaml` contains your (unique) autogenerated museum, DB and S3
-> credentials, without which the data on your volumes will not be accessible.
+> The `museum.yaml` contains your (unique) autogenerated museum, DB and S3 credentials, without which the data on your volumes will not be accessible.
> [!CAUTION]
>
-> If you delete the `my-ente` folder, the volumes will still persist. So if you
-> want to recreate everything from scratch, you can clear these volumes by
+> If you delete the `my-ente` folder, the volumes will still persist. So if you want to recreate everything from scratch, you can clear these volumes by
>
> ```sh
> cd /path/to/my-ente
> docker compose down --volumes
> ```
>
-> **Be careful** when doing so, making sure you run the command in the correct
-> directory as the volumes will be permanently removed, including any photos you
-> added to your self hosted instance.
+> **Be careful** when doing so, making sure you run the command in the correct directory as the volumes will be permanently removed, including any photos you added to your self hosted instance.
> [!TIP]
>
-> If you're getting errors like `pq: password authentication failed` when
-> starting museum, one possibility is that you're recreating the `my-ente`
-> folder but still have leftover volumes (`my-ente_postgres-data` and
-> `my-ente_minio-data` from a previous attempt).
+> If you're getting errors like `pq: password authentication failed` when starting museum, one possibility is that you're recreating the `my-ente` folder but still have leftover volumes (`my-ente_postgres-data` and `my-ente_minio-data` from a previous attempt).
### Caveat
-This sample setup is only intended to make it easy for people to get started. If
-you're intending to use your self hosted instance for serious purposes, we
-strongly recommend understanding all the moving parts, and consider if you
-should use an external S3 (/ DB) instead of the quickstart samples.
+This sample setup is only intended to make it easy for people to get started. If you're intending to use your self hosted instance for serious purposes, we strongly recommend understanding all the moving parts, and consider if you should use an external S3 (/ DB) instead of the quickstart samples.
> [!IMPORTANT]
>
-> Keep a plaintext backup of your photos until you are sure of what you are
-> doing and have a [backup
-> strategy](https://ente.com/help/self-hosting/faq/backup) worked out.
+> Keep a plaintext backup of your photos until you are sure of what you are doing and have a [backup strategy](https://ente.com/help/self-hosting/faq/backup) worked out.
## Next steps
-See **[ente.com/help/self-hosting](https://ente.com/help/self-hosting)** for
-guides on connecting to your self hosted instance [using your mobile
-app](https://ente.com/help/self-hosting/guides/custom-server/), modifying your
-setup to allow
-[uploading](https://ente.com/help/self-hosting/guides/configuring-s3) from your
-mobile app, and other customizations.
+See **[ente.com/help/self-hosting](https://ente.com/help/self-hosting)** for guides on connecting to your self hosted instance [using your mobile app](https://ente.com/help/self-hosting/guides/custom-server/), modifying your setup to allow [uploading](https://ente.com/help/self-hosting/guides/configuring-s3) from your mobile app, and other customizations.
diff --git a/server/scripts/deploy/README.md b/server/scripts/deploy/README.md
index b44f77f64f..9433872934 100644
--- a/server/scripts/deploy/README.md
+++ b/server/scripts/deploy/README.md
@@ -1,99 +1,91 @@
# Production Deployments
-This document outlines how we ourselves deploy museum. Note that this is very
-specific to our use case, and while this might be useful as an example, this is
-likely overkill for simple self hosted deployments.
+This document outlines how we ourselves deploy museum. Note that this is very specific to our use case, and while this might be useful as an example, this is likely overkill for simple self hosted deployments.
## Overview
-We use museum's Dockerfile to build images which we then run on vanilla Ubuntu
-servers (+ Docker installed). For ease of administration, we wrap Docker
-commands to start/stop/update it in a systemd service.
+We use museum's Dockerfile to build images which we then run on vanilla Ubuntu servers (+ Docker installed). For ease of administration, we wrap Docker commands to start/stop/update it in a systemd service.
-* The production machines are vanilla Ubuntu instances, with Docker and Promtail
-installed.
+- The production machines are vanilla Ubuntu instances, with Docker and Promtail installed.
-* There is a [GitHub action](../../../.github/workflows/server-release.yml) to
- build museum Docker images using its Dockerfile.
+- There is a [GitHub action](../../../.github/workflows/server-release.yml) to build museum Docker images using its Dockerfile.
-* We wrap the commands to start and stop containers using these images in a
- systemd service.
+- We wrap the commands to start and stop containers using these images in a systemd service.
-* We call this general concept of standalone Docker images that are managed
-using systemd as "services". More examples and details
-[here](../../../infra/services/README.md).
+- We call this general concept of standalone Docker images that are managed using systemd as "services". More examples and details [here](../../../infra/services/README.md).
-* So museum is a "service". You can see its systemd unit definition in
- [museum.service](museum.service)
+- So museum is a "service". You can see its systemd unit definition in [museum.service](museum.service)
-* On the running instance, we use `systemctl start|stop|status museum` to manage
- it.
+- On the running instance, we use `systemctl start|stop|status museum` to manage it.
-* The service automatically updates itself on each start. There's also a
- convenience [script](update-and-restart-museum.sh) that pre-downloads the
- latest image to further reduce the delay during a restart.
+- The service automatically updates itself on each start. There's also a convenience [script](update-and-restart-museum.sh) that pre-downloads the latest image to further reduce the delay during a restart.
-* Optionally and alternatively, museum can also be run behind an Nginx. This
- option has a separate service definition.
+- Optionally and alternatively, museum can also be run behind an Nginx. This option has a separate service definition.
## Installation
To bring up an additional museum node:
-* Prepare the instance to run our services
+- Prepare the instance to run our services
-* Setup [promtail](../../../infra/services/promtail/README.md), [prometheus and
- node-exporter](../../../infra/services/prometheus/README.md) services
+- Setup [promtail](../../../infra/services/promtail/README.md), [prometheus and node-exporter](../../../infra/services/prometheus/README.md) services
-* If running behind Nginx, install the
- [nginx](../../../infra/services/nginx/README.md) service.
+- If running behind Nginx, install the [nginx](../../../infra/services/nginx/README.md) service.
-* Add credentials
+- Add credentials
- sudo mkdir -p /root/museum/credentials
- sudo tee /root/museum/credentials/pst-service-account.json
- sudo tee /root/museum/credentials/fcm-service-account.json
- sudo tee /root/museum/credentials.yaml
+ ```sh
+ sudo mkdir -p /root/museum/credentials
+ sudo tee /root/museum/credentials/pst-service-account.json
+ sudo tee /root/museum/credentials/fcm-service-account.json
+ sudo tee /root/museum/credentials.yaml
+ ```
-* Add billing data
+- Add billing data
- scp /path/to/billing/*.json <instance>:
+ ```sh
+ scp /path/to/billing/*.json <instance>:
- sudo mkdir -p /root/museum/data/billing
- sudo mv *.json /root/museum/data/billing/
+ sudo mkdir -p /root/museum/data/billing
+ sudo mv *.json /root/museum/data/billing/
+ ```
-* If not running behind Nginx, add the TLS credentials (otherwise add them to
- Nginx)
+- If not running behind Nginx, add the TLS credentials (otherwise add them to Nginx)
- sudo tee /root/museum/credentials/tls.cert
- sudo tee /root/museum/credentials/tls.key
+ ```sh
+ sudo tee /root/museum/credentials/tls.cert
+ sudo tee /root/museum/credentials/tls.key
+ ```
-* Copy the service definition and restart script to the new instance. The
- restart script can remain in the ente user's home directory. Move the service
- definition to its proper place.
+- Copy the service definition and restart script to the new instance. The restart script can remain in the ente user's home directory. Move the service definition to its proper place.
- # If using nginx
- scp scripts/deploy/museum.nginx.service <instance>:museum.service
- # otherwise
- scp scripts/deploy/museum.service <instance>:
+ ```sh
+ # If using nginx
+ scp scripts/deploy/museum.nginx.service <instance>:museum.service
+ # otherwise
+ scp scripts/deploy/museum.service <instance>:
- scp scripts/deploy/update-and-restart-museum.sh <instance>:
+ scp scripts/deploy/update-and-restart-museum.sh <instance>:
- sudo mv museum.service /etc/systemd/system
- sudo systemctl daemon-reload
+ sudo mv museum.service /etc/systemd/system
+ sudo systemctl daemon-reload
+ ```
-* If running behind Nginx, tell it about museum
+- If running behind Nginx, tell it about museum
- scp scripts/deploy/museum.nginx.conf <instance>:
+ ```sh
+ scp scripts/deploy/museum.nginx.conf <instance>:
- sudo mv museum.nginx.conf /root/nginx/conf.d
- sudo systemctl reload nginx
+ sudo mv museum.nginx.conf /root/nginx/conf.d
+ sudo systemctl reload nginx
+ ```
## Starting
SSH into the instance, and run
- ./update-and-restart-museum.sh
+```sh
+./update-and-restart-museum.sh
+```
-This'll ask for sudo credentials, pull the latest Docker image, restart the
-museum service and start tailing the logs (as a sanity check).
+This'll ask for sudo credentials, pull the latest Docker image, restart the museum service and start tailing the logs (as a sanity check).
diff --git a/server/tools/abort-unfinished-multipart-uploads/README.md b/server/tools/abort-unfinished-multipart-uploads/README.md
index 3211bfadc9..f2d45a0fc1 100644
--- a/server/tools/abort-unfinished-multipart-uploads/README.md
+++ b/server/tools/abort-unfinished-multipart-uploads/README.md
@@ -1,19 +1,19 @@
-Find all pending multipart uploads, and abort any of them that are older than x
-days.
+Find all pending multipart uploads, and abort any of them that are older than x days.
-This shouldn't be needed in practice since we already track and clear
-temp_objects. However, in rare cases it might happen that museum gets restarted
-in the middle of a multipart replication. This tool can be used to list and
-clean up such stale replication attempts.
+This shouldn't be needed in practice since we already track and clear temp_objects. However, in rare cases it might happen that museum gets restarted in the middle of a multipart replication. This tool can be used to list and clean up such stale replication attempts.
## Running
- go run tools/abort-unfinished-multipart-uploads/main.go \
- --profile my-profile --endpoint-url https://s3.example.org --bucket my-bucket
+```sh
+go run tools/abort-unfinished-multipart-uploads/main.go \
+ --profile my-profile --endpoint-url https://s3.example.org --bucket my-bucket
+```
For more details, see `ParseAndCreateSession`.
To see all the uploads which'll get aborted, you can
- go run tools/abort-unfinished-multipart-uploads/main.go \
- --profile p --endpoint-url e --bucket b | grep 'Dry run:'
+```sh
+go run tools/abort-unfinished-multipart-uploads/main.go \
+ --profile p --endpoint-url e --bucket b | grep 'Dry run:'
+```
diff --git a/server/tools/gen-random-keys/README.md b/server/tools/gen-random-keys/README.md
index 0cfcbf051e..df4440379b 100644
--- a/server/tools/gen-random-keys/README.md
+++ b/server/tools/gen-random-keys/README.md
@@ -2,8 +2,8 @@ Generate random keys that can be used in the museum configuration file.
## Details
-This tool can be used to generate new random values for various cryptographic
-secrets that should be overridden in `configuration/local.yaml` when running a
-new instance of museum.
+This tool can be used to generate new random values for various cryptographic secrets that should be overridden in `configuration/local.yaml` when running a new instance of museum.
- go run tools/gen-random-keys/main.go
+```sh
+go run tools/gen-random-keys/main.go
+```
diff --git a/server/tools/test-wasabi-compliance/README.md b/server/tools/test-wasabi-compliance/README.md
index 97862a2f97..eec9305fce 100644
--- a/server/tools/test-wasabi-compliance/README.md
+++ b/server/tools/test-wasabi-compliance/README.md
@@ -1,6 +1,4 @@
-Run through the process of using [Wasabi's compliance
-feature](https://wasabi.com/wp-content/themes/wasabi/docs/API_Guide/index.html#t=topics%2FCompliance.htm&rhsyns=%20)
-to ensure that it does indeed behave the way we expect it to.
+Run through the process of using [Wasabi's compliance feature](https://wasabi.com/wp-content/themes/wasabi/docs/API_Guide/index.html#t=topics%2FCompliance.htm&rhsyns=%20) to ensure that it does indeed behave the way we expect it to.
Also acts as a test for the code in `pkg/external/wasabi`.
@@ -8,23 +6,18 @@ Also acts as a test for the code in `pkg/external/wasabi`.
The command runs through the two checklist:
-* First checklist is for enabling compliance on the bucket, adding a new object,
- and then disabling the conditional hold on that object (See `Sequence 1` for
- the full sequence that'll be run through).
+- First checklist is for enabling compliance on the bucket, adding a new object, and then disabling the conditional hold on that object (See `Sequence 1` for the full sequence that'll be run through).
-* Second checklist is for deleting the object. This checklist can be executed by
- running the command with the `--only-delete` flag (See `Sequence 2` for the
- full sequence).
+- Second checklist is for deleting the object. This checklist can be executed by running the command with the `--only-delete` flag (See `Sequence 2` for the full sequence).
-Since the minimum retention duration is 1 day, these two checklists need to be
-manually run through after the requisite gap.
+Since the minimum retention duration is 1 day, these two checklists need to be manually run through after the requisite gap.
## Running
-Use the `--profile` flag (or set the `AWS_PROFILE` environment variable) to
-specify which AWS config and credentials to use:
+Use the `--profile` flag (or set the `AWS_PROFILE` environment variable) to specify which AWS config and credentials to use:
- go run tools/test-wasabi-compliance/main.go --profile my-test-profile
+```sh
+go run tools/test-wasabi-compliance/main.go --profile my-test-profile
+```
-For more details about how to profiles work, or alternative ways to provide
-credentials, see the documentation for `ParseAndCreateSession`.
+For more details about how to profiles work, or alternative ways to provide credentials, see the documentation for `ParseAndCreateSession`.