Enable CORS for custom port

This commit is contained in:
Nicolas Meienberger 2022-05-18 20:33:57 +02:00
parent 7edc6d4f60
commit eac3b9d6e1
4 changed files with 10 additions and 4 deletions

View file

@ -29,6 +29,7 @@ services:
- TIPI_VERSION=${TIPI_VERSION}
- JWT_SECRET=${JWT_SECRET}
- ROOT_FOLDER_HOST=${ROOT_FOLDER_HOST}
- NGINX_PORT=${NGINX_PORT}
networks:
- tipi_main_network

View file

@ -11,13 +11,13 @@ interface IConfig {
dotenv.config();
const { NODE_ENV = 'development', JWT_SECRET = '', INTERNAL_IP = '', TIPI_VERSION = '', ROOT_FOLDER_HOST = '' } = process.env;
const { NODE_ENV = 'development', JWT_SECRET = '', INTERNAL_IP = '', TIPI_VERSION = '', ROOT_FOLDER_HOST = '', NGINX_PORT = '80' } = process.env;
const config: IConfig = {
NODE_ENV,
ROOT_FOLDER: '/tipi',
JWT_SECRET,
CLIENT_URLS: ['http://localhost:3000', `http://${INTERNAL_IP}`, `http://${INTERNAL_IP}:3000`],
CLIENT_URLS: ['http://localhost:3000', `http://${INTERNAL_IP}`, `http://${INTERNAL_IP}:${NGINX_PORT}`, `http://${INTERNAL_IP}:3000`],
VERSION: TIPI_VERSION,
ROOT_FOLDER_HOST,
};

View file

@ -1 +0,0 @@
ansible

View file

@ -217,6 +217,12 @@ cat <<"EOF"
| {__)
()`
EOF
port_display=""
if [[ $NGINX_PORT != "80" ]]; then
port_display=":${NGINX_PORT}"
fi
echo ""
echo "Visit http://${INTERNAL_IP}/ to view the dashboard"
echo "Visit http://${INTERNAL_IP}${port_display}/ to view the dashboard"
echo ""