Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Mercure + Digitalocean app platform #923

Open
TouchForDiffusion opened this issue Jul 3, 2024 · 1 comment
Open

Setup Mercure + Digitalocean app platform #923

TouchForDiffusion opened this issue Jul 3, 2024 · 1 comment

Comments

@TouchForDiffusion
Copy link

Bonjour,

Je souhaite installer mercure via l'image docker dunglas/mercure sur Digitalocean.
J'ai le HTTP Port sur 80.
image

Mes variables d'environnements au niveau du composants :

MERCURE_SUBSCRIBER_JWT_KEY=xxxxx
MERCURE_PUBLISHER_JWT_KEY=xxxxx
SERVER_NAME=:80
MERCURE_EXTRA_DIRECTIVES="cors_origins *
anonymous true
use_forwarded_headers true
publish_origins *"

Dans le navigateur hub tout semble ok.
Mais l'appel est bloqué sur pending sur le site source.
image

Dans les logs, je retrouve des 401 :
[dunglas-mercure] [2024-07-03 18:04:04] {"level":"info","ts":1720029844.8332176,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"xxx","remote_port":"41456","client_ip":"xxx","proto":"HTTP/1.1","method":"POST","host":"mercure-bdor-kavyg.ondigitalocean.app","uri":"/.well-known/mercure","headers":{"Cdn-Loop":["cloudflare"],"Accept-Encoding":["gzip, br"],"Content-Length":["2063"],"X-Forwarded-Proto":["https"],"Content-Type":["application/x-www-form-urlencoded"],"Authorization":["REDACTED"],"Accept":["/"],"User-Agent":["Symfony HttpClient/Curl"],"Do-Connecting-Ip":["185.66.235.178"],"X-Forwarded-For":["185.66.235.178,141.101.68.31"]}},"bytes_read":0,"user_id":"","duration":0.000092478,"size":13,"status":401,"resp_headers":{"X-Xss-Protection":["1; mode=block"],"Content-Type":["text/plain; charset=utf-8"],"Server":["Caddy"],"Content-Security-Policy":["default-src 'self'"],"X-Frame-Options":["DENY"],"X-Content-Type-Options":["nosniff"]}}

[dunglas-mercure] [2024-07-03 18:07:04] {"level":"info","ts":1720030024.3872056,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"xxx","remote_port":"46566","client_ip":"xxx","proto":"HTTP/1.1","method":"POST","host":"mercure-bdor-kavyg.ondigitalocean.app","uri":"/.well-known/mercure","headers":{"Authorization":["REDACTED"],"X-Forwarded-For":["185.66.235.178,172.69.222.108"],"Content-Length":["2063"],"Content-Type":["application/x-www-form-urlencoded"],"Accept":["/"],"Cdn-Loop":["cloudflare"],"Accept-Encoding":["gzip, br"],"X-Forwarded-Proto":["https"],"User-Agent":["Symfony HttpClient/Curl"],"Do-Connecting-Ip":["185.66.235.178"]}},"bytes_read":0,"user_id":"","duration":0.000086638,"size":13,"status":401,"resp_headers":{"X-Xss-Protection":["1; mode=block"],"Content-Security-Policy":["default-src 'self'"],"Content-Type":["text/plain; charset=utf-8"],"Server":["Caddy"],"X-Frame-Options":["DENY"],"X-Content-Type-Options":["nosniff"]}}

Quelqu'un a-t-il déjà rencontré ce problème ?

Bien cordialement,

@jeandanyel
Copy link

Bonjour,

Ça ressemble beaucoup au problème que j'avais sur un de mes projets qui roule sur DO App Platform.

#842

Malheureusement, selon mes recherches, les requêtes SSE (Server-Sent Event) ne sont pas supportées dans un environnement App Platform.

Voici deux articles à ce sujet:
https://www.digitalocean.com/community/questions/does-app-platform-support-sse-server-sent-events-application
https://ideas.digitalocean.com/app-platform/p/http-response-streaming-in-app-platform-for-sse-support

Pour contourner le problème, j'ai créé un droplet dédié à l'exécution de Mercure. J'ai ensuite créé un sous-domaine qui pointe vers le droplet afin d'éviter des problèmes de CORS. Par exemple, si mon domaine app-domain.com pointe vers mon application, le domaine hub.app-domain.com pointe vers le droplet où roule Mercure.

J'espère avoir répondu à tes questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants