Cors

Maybe a stupid question…. How do I change the cors setting when using the docker Compose selfhosted install? The info on the website that I saw, was for a traditional install, and the files don’t exists here
33 Replies
Keerthana
Keerthana4mo ago
Hey there, will be helpful if you're sharing info on whether you're using MinIO or external bucket. For external bucket, you can use AWS CLI to set CORS rules as JSON file. For MinIO community edition, there is no bucket CORS support and by default Allowed Origins are set to *
Jarred-Awesome
Jarred-AwesomeOP4mo ago
This just gives me a 404 error I am using the built in minio. but I keep getting the "no corss site traffic" allowed error
Sandelinos
Sandelinos4mo ago
The link works for me. I think the site is somehow broken. It was broken on my computer also when I first found it, but then started working after I navigated to it using the search bar on https://help.ente.io
Home | Ente Help
Introduction to Ente: Products, Community and Support
Keerthana
Keerthana4mo ago
We have revamped our self-hosting documentation, sorry about the link breaking. You can access the same at: https://help.ente.io/self-hosting/administration/object-storage#cors-cross-origin-resource-sharing
Configuring Object Storage - Self-hosting | Ente Help
Configure Object Storage for storing files along with some troubleshooting tips
Keerthana
Keerthana4mo ago
https://help.ente.io/self-hosting/administration/object-storage#minio This section might hold the key for you, if not, please let us know
Configuring Object Storage - Self-hosting | Ente Help
Configure Object Storage for storing files along with some troubleshooting tips
Jarred-Awesome
Jarred-AwesomeOP4mo ago
Thanks! I’ll take a look. I’ve been trying to get this up and running for a few days. I love the concept, I really hope I can get it to work
Ducky
Ducky4mo ago
-# If your issue is resolved, you can use the /solved command to close the thread. If not, use /unsolve to cancel.
Keerthana
Keerthana4mo ago
No worries, it will be great if you are sharing writeups for community guide starting next week so that other self-hosters don't have to face the same trouble 😄
Jarred-Awesome
Jarred-AwesomeOP4mo ago
I have been putting my progress here on the discord. If there is a better place let me know.
Keerthana
Keerthana4mo ago
It will be much better if you contribute a guide by doing a pull request (PR) on GitHub. Here's an example of a PR for community guide for Tailscale: https://github.com/ente-io/ente/pull/5140 Having a single document/writeup will also be helpful for the community if they are stuck with the same issues. Alternately, if you are running this with traditional methods and if you have solved these issues, you can just describe the steps you used for solving them, that way others who stumbled on similar issues get a way to fix it.
GitHub
Create Tailscale.md by A4alli · Pull Request #5140 · ente-io/ente
ente photos with tailscale Description This is a running setup of ente photos with tailscale. Everything work well Tests Kindly review if any changes are required.
Jarred-Awesome
Jarred-AwesomeOP4mo ago
It looks like this has been put on git hub before https://github.com/ente-io/ente/discussions/1847 im doing this on a web server, opposed to a locally run machine. So I can’t set anything as localhost and still reach it from the webapps.
GitHub
selfhost ente photoes cant show images · ente-io ente · Discussio...
I selfhosted a ente docker server by following official guide, I can't upload any images successfully, it stuck when uploading. the network output But I checked the minio server, all images are...
Keerthana
Keerthana4mo ago
Yeah if using remotely, you will have to configure domains and configure reverse proxy
Jarred-Awesome
Jarred-AwesomeOP4mo ago
I tried doing it with a regular domain, and having all my ports available. But I can’t get ssl to work on any port other than 443. So MinIO won’t connect to it. I tried doing reverse proxy, but when it connects to the Min.io service, it tries to connect to a subdomain with the bucket name. Which causes another error.
Keerthana
Keerthana4mo ago
You will have to enable path-style URLs for this. We have updated our documentation, so do check these links: 1. https://help.ente.io/self-hosting/administration/object-storage 2. https://help.ente.io/self-hosting/administration/reverse-proxy
Configuring Object Storage - Self-hosting | Ente Help
Configure Object Storage for storing files along with some troubleshooting tips
Reverse proxy | Ente Help
Documentation and help for Ente's products
Jarred-Awesome
Jarred-AwesomeOP4mo ago
that looks like it's what I need, but it didn't work. here is my museum.yaml file, with the personal information removed
db:
host: postgres
port: 5432
name: [redacted]
user:[redacted]
password: [redacted]

s3:
are_local_buckets: false
s3.use_path_style_urls: true
b2-eu-cen:
key: [redacted]
secret: [redacted]
endpoint: https://enteminio.[mydomain].com
region: eu-central-2
bucket: b2-eu-cen
wasabi-eu-central-2-v3:
key: [redacted]
secret: [redacted]
endpoint: https://enteminio.[mydomain].com
region: eu-central-2
bucket: wasabi-eu-central-2-v3
compliance: false
scw-eu-fr-v3:
key: [redacted]
secret: [redacted]
endpoint: https://enteminio.[mydomain].com
region: eu-central-2
bucket: scw-eu-fr-v3

# Specify the base endpoints for various web apps
apps:
# If you're running a self hosted instance and wish to serve public links,
# set this to the URL where your albums web app is running.
public-albums: http://ente.[mydomain].com:3002
cast: http://localhost:3004
# Set this to the URL where your accounts web app is running, primarily used for
# passkey based 2FA.
accounts: http://ente.[mydomain].com:3001

key:
encryption: [redacted]
hash:[redacted]

jwt:
[redacted]
db:
host: postgres
port: 5432
name: [redacted]
user:[redacted]
password: [redacted]

s3:
are_local_buckets: false
s3.use_path_style_urls: true
b2-eu-cen:
key: [redacted]
secret: [redacted]
endpoint: https://enteminio.[mydomain].com
region: eu-central-2
bucket: b2-eu-cen
wasabi-eu-central-2-v3:
key: [redacted]
secret: [redacted]
endpoint: https://enteminio.[mydomain].com
region: eu-central-2
bucket: wasabi-eu-central-2-v3
compliance: false
scw-eu-fr-v3:
key: [redacted]
secret: [redacted]
endpoint: https://enteminio.[mydomain].com
region: eu-central-2
bucket: scw-eu-fr-v3

# Specify the base endpoints for various web apps
apps:
# If you're running a self hosted instance and wish to serve public links,
# set this to the URL where your albums web app is running.
public-albums: http://ente.[mydomain].com:3002
cast: http://localhost:3004
# Set this to the URL where your accounts web app is running, primarily used for
# passkey based 2FA.
accounts: http://ente.[mydomain].com:3001

key:
encryption: [redacted]
hash:[redacted]

jwt:
[redacted]
the domains are still showing up with the bucket names as sub domains. Was there something I missed? I also tried it with the buckets set up this way: ''' b2-eu-cen: are_local_buckets: false s3.use_path_style_urls: true key: [redacted] secret: [redacted] endpoint: https://enteminio.[mydomain].com region: eu-central-2 bucket: b2-eu-cen wasabi-eu-central-2-v3: are_local_buckets: false s3.use_path_style_urls: true key: [redacted] secret: [redacted] endpoint: https://enteminio.[mydomain].com region: eu-central-2 bucket: wasabi-eu-central-2-v3 compliance: false scw-eu-fr-v3: are_local_buckets: false s3.use_path_style_urls: true key: [redacted] secret: [redacted] endpoint: https://enteminio.[mydomain].com region: eu-central-2 bucket: scw-eu-fr-v3 ''' Still no change
Ducky
Ducky4mo ago
-# If your issue is resolved, you can use the /solved command to close the thread. If not, use /unsolve to cancel.
Keerthana
Keerthana4mo ago
It is not s3.use_path_style_urls. You just put use_path_style_urls in s3 section and the buckets
Jarred-Awesome
Jarred-AwesomeOP4mo ago
Thanks for catching that. I made the change:
s3:

b2-eu-cen:
are_local_buckets: false
use_path_style_urls: true
key: <removed>
secret: <removed>
endpoint: http://enteminio.<removed>.com
region: eu-central-2
bucket: b2-eu-cen
wasabi-eu-central-2-v3:
are_local_buckets: false
use_path_style_urls: true
key: <removed>
secret: <removed>
endpoint: http://enteminio.<removed>.com
region: eu-central-2
bucket: wasabi-eu-central-2-v3
compliance: false
scw-eu-fr-v3:
are_local_buckets: false
use_path_style_urls: true
key: <removed>
secret: <removed>
endpoint: http://enteminio.<removed>.com
region: eu-central-2
bucket: scw-eu-fr-v3
s3:

b2-eu-cen:
are_local_buckets: false
use_path_style_urls: true
key: <removed>
secret: <removed>
endpoint: http://enteminio.<removed>.com
region: eu-central-2
bucket: b2-eu-cen
wasabi-eu-central-2-v3:
are_local_buckets: false
use_path_style_urls: true
key: <removed>
secret: <removed>
endpoint: http://enteminio.<removed>.com
region: eu-central-2
bucket: wasabi-eu-central-2-v3
compliance: false
scw-eu-fr-v3:
are_local_buckets: false
use_path_style_urls: true
key: <removed>
secret: <removed>
endpoint: http://enteminio.<removed>.com
region: eu-central-2
bucket: scw-eu-fr-v3
It's still making the url's with the buckets as subdomains. I also tried clearing the cache, and doing using an alternative browser. It was the same. To REALLY make sure it wasn't either a cache issue, me simply editing the wrong thing, I changed the https:// to a http://, and the change that happened in the api call. so The use_path_style_urls: true doesn't seem to affect anything
Keerthana
Keerthana4mo ago
You're using the same config for all buckets, would advise top level configuration Like
s3:
are_local_buckets: false
use_path_style_urls: true
...
s3:
are_local_buckets: false
use_path_style_urls: true
...
Server images still don't allow bucket level configuration, that should be supported in upcoming build
Jarred-Awesome
Jarred-AwesomeOP4mo ago
Thanks, this seemed to fix the url issue! it shows on the link below that I should put it in each bucket. Where can suggest they update it? https://help.ente.io/self-hosting/administration/object-storage I am still getting the Cors issues. if i add the cors.json to the my-ente dir, will it automatically be added, or do i need to reference it in the compose.yaml?
Configuring Object Storage - Self-hosting | Ente Help
Configure Object Storage for storing files along with some troubleshooting tips
Keerthana
Keerthana4mo ago
You cannot set CORS with cors.json. Please look at MinIO section for more information. I will update the docs by EOD to reflect the change, it will be pushed in PR.
Jarred-Awesome
Jarred-AwesomeOP4mo ago
A lot of the documentation leads to a 404 page. From what I have found, there is an MC command I can enter. Assumably, I need to enter the volume/container using Docker Compose exec I used mc admin config set h0 api cors_allow_origin="*" And I am still getting a cross-origin error. I tried allowing it in the Reverse Proxy using an Apache directive, but it didn’t make a difference
Keerthana
Keerthana4mo ago
This is because the documentation was updated. Kindly search through the documentation website for getting the information you require. It will be helpful if you inspect the network tab and check for the error and send the error responses for me to troubleshoot it effectively. A PR has been made for the docs, thanks for reporting, it should be reflected on the website soon
Jarred-Awesome
Jarred-AwesomeOP4mo ago
Here is my network tab. I blocked out the domain because I'd like to keep that private. The rest is visable. Here is my set up: Installed with the quickstart.sh Used a reverse proxy. 1. Web app is ente.mydomain.com on port/container 3000:3000 2. API is enteapi.mydomain.com on port/container 8081:8080 3. Miniois enteminio.mydomain.com on port/container 3200:3200 on the apache directive I put:
<VirtualHost *:3200>
ServerName enteminio.mydomain.com
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "*"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
</VirtualHost>
<VirtualHost *:3200>
ServerName enteminio.mydomain.com
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "*"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
</VirtualHost>
No description
Keerthana
Keerthana4mo ago
Hey sure. That works too. Sometimes reverse proxy directives could mess up with signature, can you try removing them? Your config seems gtg imo...
Jarred-Awesome
Jarred-AwesomeOP4mo ago
I was going to send it directly to you, but your profile says no direct messages. I only added the directives because it wasn’t working. I also tried turning off ente and making a call using a php file, and it worked fine. Is there somewhere else I could be looking?
Brogio
Brogio4mo ago
Also it's easier if someone else sees this thread and experiences the same issue. So please keep everything in this thread
Jarred-Awesome
Jarred-AwesomeOP4mo ago
If in being 100% honest, the documentation for this project is both lacking, and clearly growing. The only reason I have stuck with so long is I feel ente is offering privacy I can’t get anywhere else. Once I figure out the issue; I was thinking about posting the solution somewhere like on Directadmin forum, or maybe GitHub (I’ve never posted on there before, so I’d have to figure out how) Correction; it offers privacy I think. People are desperately looking for. So I want to figure it out to help others get it
Keerthana
Keerthana4mo ago
I think the mc configuration and removing directives worked whenever I configured clusters. Here's a writeup of mine if you want a reference, it was written back when the documentation was insufficient. https://www.libremusings.dev/posts/self-hosting-ente/
Self-hosting Ente for preserving those special moments
No-gyan approach I used to self-host Ente
Jarred-Awesome
Jarred-AwesomeOP4mo ago
I did the Mc configuration. However, I may have made a mistake. As an alias i used h0; which was already set up by compose. I tried to make a custom alias; but it didn’t work
Keerthana
Keerthana4mo ago
I agree with this and we do intend to fix this soon with upcoming revamps. It will be great if you put the solution on thread. I can take on that and update documentation under troubleshooting.
Jarred-Awesome
Jarred-AwesomeOP4mo ago
Can I send you the url I am dm? Maybe you can see something I can’t? I can make you an account so you can try it out. As mentioned above; with India maybe blocking Proton mail, and the eu requiring E2Ee back doors, I’d like this info to be available Update: I have tried quite a few things. I am looking into it being a docker compose issue. I created an alias called Ente on the MinIO included in the container. I did that by going into my-ente for, and doing the command docker compose exec minio bin/bash then typing mc alias set ente localhost:3000 <minio-user> <minio-secret> Then finally I did mc admin config set ente api cors_allow_origin="*" I follow the directs on the site, and it’s still not working. I think there may have been a mistake in one of two places. 1. I wasn’t supposed to use the exec function to enter the Cors command 2. I used localhost:3000, by my set up uses a reverse proxy. I assumed it was ok to do this because the MinIO sever is in a container. I think MinIO might see it as ‘local’. It didn’t work when I tried the actual url

Did you find this page helpful?