From d102f18f917c26aeeefa5a3635978d1e9a766c14 Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Sat, 15 Oct 2022 11:55:19 +0200 Subject: [PATCH] fix: pull repositories from their current branch instead of master --- packages/system-api/src/server.ts | 7 ++++++- scripts/git.sh | 2 +- scripts/system.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/system-api/src/server.ts b/packages/system-api/src/server.ts index a9c4ed16..63b833ab 100644 --- a/packages/system-api/src/server.ts +++ b/packages/system-api/src/server.ts @@ -27,12 +27,16 @@ let corsOptions = { return callback(null, true); } // disallow requests with no origin - if (!origin) return callback(new Error('Not allowed by CORS'), false); + if (!origin) { + logger.error('No origin'); + return callback(new Error('Not allowed by CORS'), false); + } if (getConfig().clientUrls.includes(origin)) { return callback(null, true); } + logger.error(`Origin ${origin} not allowed by CORS`); const message = "The CORS policy for this origin doesn't allow access from the particular origin."; return callback(new Error(message), false); }, @@ -103,6 +107,7 @@ const main = async () => { // Start apps appsService.startAllApps(); logger.info(`Server running on port ${port} 🚀 Production => ${__prod__}`); + logger.info(`Config: ${JSON.stringify(getConfig(), null, 2)}`); }); } catch (error) { logger.error(error); diff --git a/scripts/git.sh b/scripts/git.sh index cbcd42a2..1a34c8dc 100755 --- a/scripts/git.sh +++ b/scripts/git.sh @@ -55,7 +55,7 @@ if [[ "$command" = "update" ]]; then write_log "Updating ${repo} in ${repo_hash}" cd "${repo_dir}" || exit - if ! git pull origin master; then + if ! git pull origin "$(git rev-parse --abbrev-ref HEAD)"; then cd "${ROOT_FOLDER}" || exit write_log "Failed to update repo" exit 1 diff --git a/scripts/system.sh b/scripts/system.sh index 00f6e71a..06aa1e73 100755 --- a/scripts/system.sh +++ b/scripts/system.sh @@ -27,7 +27,7 @@ if [[ "$command" = "update" ]]; then scripts/stop.sh git config --global --add safe.directory "${ROOT_FOLDER}" - git pull origin master + git pull origin "$(git rev-parse --abbrev-ref HEAD)" scripts/start.sh exit fi