-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🐛 Bug Report: api requests going to localhost:3000 when self hosting #6649
Comments
Hi, I'm completely new to open-source so if you could guide me I would like to work on this issue. |
i just followed this guide on the official website and for some reason it doesn't seem to be working |
Please edit your issue description to use a code block for the |
comment this line
clean all the containers and restart using |
@jainpawan21 I am facing the same issue: I directly pass the URL to the container, why should I comment the line?
Many thanks! |
Seems that env variables are not loaded correctly on container is started. Updating the start command of the container will fix the problem. |
Thanks for your reply @bledar, are you using Novu with docker? Thanks! |
@L-U-C-K-Y you can always create a child image that overrides the entry point. |
@ArjixWasTaken @bledar many thanks for your help, it's working! If helpful for other people, I created a PR: #6722 |
try this #!/bin/bash
docker compose up --force-recreate novu-web -d
docker compose exec -T novu-web bash <<'EOF'
sed -i 's|src="/|src="/novu/web/|g; s|href="/|href="/novu/web/|g' build/index.html
# hardcoded for now
export GLOBAL_CONTEXT_PATH="/novu/web"
echo -e "\nGLOBAL_CONTEXT_PATH=" >> .env
./env.sh
mv ./env-config.js ./build/env-config.js
EOF |
@jainpawan21 Would it be possible to consider publishing a new image to address this issue? 🙂 |
This issue should be resolved with this PR merge. Could you pull latest changes as there is one change in docker-compose.yml file? |
📜 Description
hey there
i self hosted novu on a vm from azure but for some reason the api requests are going to localhost:3000 and not to my azure vm ip and hence they are failing
please help
👟 Reproduction steps
my .env file
Secrets
YOU MUST CHANGE THESE BEFORE GOING INTO PRODUCTION
used as a secret to verify the JWT token signature
JWT_SECRET=my-novu-jwt-secret-key
used to encrypt/decrypt the provider credentials
STORE_ENCRYPTION_KEY=3JkvVsN2PA+XyQTt+PEO8JiNFYBywkoK
Host
HOST_NAME=http://20.51.212.149
General
available values 'dev', 'test', 'production', 'ci', 'local'
NODE_ENV=production
MONGO_MAX_POOL_SIZE=200
MONGO_MIN_POOL_SIZE=75
MONGO USER
MONGO_INITDB_ROOT_USERNAME=root
MONGO PASSWORD
MONGO_INITDB_ROOT_PASSWORD=secret
MONGO_URL=mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@mongodb:27017/novu-db?authSource=admin
REDIS_HOST=redis
DOCKER_REDIS_SERVICE_PORT=6379
REDIS_PASSWORD=
REDIS_CACHE_SERVICE_HOST=
AWS
S3_LOCAL_STACK=$HOST_NAME:4566
S3_BUCKET_NAME=novu-local
S3_REGION=us-east-1
AWS_ACCESS_KEY_ID=test
AWS_SECRET_ACCESS_KEY=test
Ports
API_PORT=3000
REDIS_PORT=6379
REDIS_CACHE_SERVICE_PORT=6379
WS_PORT=3002
Root URL
REACT_APP_WS_URL=$HOST_NAME:3002
Uncomment this one when deploying Novu in the local environment
as Web app local Dockerfile will have to load this to be used.
Deployment version doesn't need as we inject it with API_ROOT_URL value.
REACT_APP_API_URL=http://20.51.212.149:3000
API_ROOT_URL=$HOST_NAME:3000
DISABLE_USER_REGISTRATION=false
FRONT_BASE_URL=$HOST_NAME:4200
WIDGET_EMBED_PATH=$HOST_NAME:4701/embed.umd.min.js
WIDGET_URL=$HOST_NAME:4500
Context Paths
Only needed for setups with reverse-proxies
GLOBAL_CONTEXT_PATH=
WEB_CONTEXT_PATH=web
API_CONTEXT_PATH=api
WS_CONTEXT_PATH=ws
WIDGET_CONTEXT_PATH=widget
Analytics
SENTRY_DSN=
change these values
NEW_RELIC_APP_NAME=
NEW_RELIC_LICENSE_KEY=
BROADCAST_QUEUE_CHUNK_SIZE=100
MULTICAST_QUEUE_CHUNK_SIZE=100
👍 Expected behavior
the actual requests should go to my azure VM IP and not to localhost
👎 Actual Behavior with Screenshots
the request should ideally go to my azure VM IP and not to my localhost
Novu version
docker:latest
npm version
docker
node version
docker
📃 Provide any additional context for the Bug.
No response
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Contributing Guidelines?
Are you willing to submit PR?
None
The text was updated successfully, but these errors were encountered: