makeplane / makeplane/plane

[bug]: USE_MINIO and AWS_S3_CUSTOM_DOMAIN do not align semantically when using external Minio / S3

Open
#6,740 6 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

🐛bug
Dominant language
TypeScript
Stars
59.6k
Forks
5.8k
Avg merge
1d 22h
Merged PRs (30d)
49

Description

Is there an existing issue for this?
  • I have searched the existing issues
Current behavior

When setting USE_MINIO to 1 while using an external instance at another domain, omitting the route through the Plane web proxy, asset URLs are malformed. This stops them from being loaded.

This is due to assuming an external S3 endpoint would always be served behind the Plane web proxy. For decoupling the two services in a distributed system, it would be preferred being able to differentiate between these cases:

  • USE_MINIO / USE_INTERNAL_MINIO
  • USE_EXTERNAL_S3

It appears USE_MINIO actually means USE_INTERNAL_MINIO. It's naming is further complicated, since setting the variable is required to use other S3 providers as well.

https://github.com/makeplane/plane/blob/9ee1d8cb03dc3ee061534e7a0acb18c6e1ae31d3/apiserver/plane/settings/common.py#L230-L233

The common settings always assumes we deploy a non-AWS S3 behind the Plane web proxy

This works when AWS_S3_ENDPOINT_URL points to the internal http://plane-minio:9000. It fails when setting it to https://s3.example.com.

https://github.com/makeplane/plane/blob/9ee1d8cb03dc3ee061534e7a0acb18c6e1ae31d3/apiserver/plane/app/views/project/base.py#L603-L609

The cover image endpoint only recognises the AWS_S3_ENDPOINT_URL when USE_MINIO is set.

This leaves out the case where we want to set a custom AWS_S3_ENDPOINT_URL, but do not want to serve the bucket behind the same load balancer, e.g. via another host. This is useful for independently scaling out application and backing services.

There is a PR which only partially resolves this situation, by allowing to configure the Minio URL in the web proxy:

In the cover image example below, we receive this URL:

While we would like to see this:

The URLs are generated in:

https://github.com/makeplane/plane/blob/9ee1d8cb03dc3ee061534e7a0acb18c6e1ae31d3/apiserver/plane/bgtasks/export_task.py#L92-L99

The wrong assumption in common.py about AWS_S3_CUSTOM_DOMAIN is, that we always want to serve Minio/other S3 providers that are not AWS behind the Plane load balancer. This assumption is also present in the proposed partial fix https://github.com/makeplane/plane/pull/3278.

There should be cases possible in which we do not replace the AWS_S3_CUSTOM_DOMAIN, even when USE_MINIO is set.

Related issues:

Steps to reproduce
  1. Upload a cover image to a new project
  2. Save the project
  3. Find a 404 GET request in the browser console.
Environment

Production

Browser

Mozilla Firefox

Variant

Self-hosted

Version

v0.25.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.