deploy: prepare permanent HTTPS MetaBloom API
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
# URL publique HTTPS de l'API. Ne jamais placer de secret dans ce fichier Expo.
|
||||||
|
EXPO_PUBLIC_API_URL=https://api.metabloom.vicode.agency
|
||||||
@@ -898,7 +898,7 @@ function Coach({ journey }: any) {
|
|||||||
|
|
||||||
function PegChat({ journey }: { journey: string }) {
|
function PegChat({ journey }: { journey: string }) {
|
||||||
const apiBase = (
|
const apiBase = (
|
||||||
process.env.EXPO_PUBLIC_API_URL || "http://localhost:8000"
|
process.env.EXPO_PUBLIC_API_URL || "https://api.metabloom.vicode.agency"
|
||||||
).replace(/\/$/, "");
|
).replace(/\/$/, "");
|
||||||
const [messages, setMessages] = useState<ChatMessage[]>([
|
const [messages, setMessages] = useState<ChatMessage[]>([
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ Pour connecter l’application à l’API :
|
|||||||
EXPO_PUBLIC_API_URL=http://localhost:8000 npm run web
|
EXPO_PUBLIC_API_URL=http://localhost:8000 npm run web
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Les builds distribués utilisent `https://api.metabloom.vicode.agency` par défaut. Cette URL doit pointer vers le proxy HTTPS public, lui-même relié au conteneur FastAPI permanent. Le Compose d'exemple active `restart: unless-stopped`; un exemple de virtual host OpenResty est fourni dans `server/openresty.metabloom.conf.example`.
|
||||||
|
|
||||||
Au premier message, l’application crée une session invitée pseudonyme et conserve son jeton sous `metabloom-auth-token`. Le moteur, le modèle et l’URL IA sont configurés uniquement côté serveur. Aucun secret ne doit être placé dans l’application.
|
Au premier message, l’application crée une session invitée pseudonyme et conserve son jeton sous `metabloom-auth-token`. Le moteur, le modèle et l’URL IA sont configurés uniquement côté serveur. Aucun secret ne doit être placé dans l’application.
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
api:
|
api:
|
||||||
build: .
|
build: .
|
||||||
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: postgresql+psycopg://metabloom:${POSTGRES_PASSWORD}@db:5432/metabloom
|
DATABASE_URL: postgresql+psycopg://metabloom:${POSTGRES_PASSWORD}@db:5432/metabloom
|
||||||
JWT_SECRET: ${JWT_SECRET}
|
JWT_SECRET: ${JWT_SECRET}
|
||||||
@@ -17,6 +18,7 @@ services:
|
|||||||
networks: [default, ai-company]
|
networks: [default, ai-company]
|
||||||
db:
|
db:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: metabloom
|
POSTGRES_DB: metabloom
|
||||||
POSTGRES_USER: metabloom
|
POSTGRES_USER: metabloom
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# À intégrer au serveur OpenResty public après création du DNS et du certificat TLS.
|
||||||
|
server {
|
||||||
|
listen 443 ssl http2;
|
||||||
|
server_name api.metabloom.vicode.agency;
|
||||||
|
|
||||||
|
# Les directives ssl_certificate sont gérées par l'infrastructure existante.
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:8000;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
proxy_connect_timeout 5s;
|
||||||
|
proxy_read_timeout 120s;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user