Fix Uffizzi sign in bug(#19100)

This commit is contained in:
Aramayis 2023-02-21 01:21:05 +04:00 committed by GitHub
parent a61130eb5e
commit c758272aec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 1 deletions

View file

@ -54,6 +54,7 @@ jobs:
run: |
APP_IMAGE=$(echo ${{ needs.build-application.outputs.tags }})
export APP_IMAGE
export UFFIZZI_URL=\$UFFIZZI_URL
# Render simple template from environment variables.
envsubst < ./uffizzi/docker-compose.uffizzi.yml > docker-compose.rendered.yml
cat docker-compose.rendered.yml

View file

@ -26,7 +26,7 @@ services:
APP_DOMAIN: localhost:3000
APP_PROTOCOL: https://
entrypoint: ["dockerize", "-wait", "tcp://localhost:5432", "-wait", "tcp://localhost:6379", "-wait", "file:///opt/apps/forem/vendor/bundle/.bundle_finished", "-timeout", "5400s"]
command: [ "bash", "-c", "./scripts/entrypoint.sh bootstrap && bundle exec rails server -b 0.0.0.0 -p 3000"]
command: [ "bash", "-c", "./uffizzi/entrypoint.sh bootstrap"]
deploy:
resources:
limits:

57
uffizzi/entrypoint.sh Executable file
View file

@ -0,0 +1,57 @@
#!/usr/bin/env bash
set -e
if [ -f tmp/pids/server.pid ]; then
rm -f tmp/pids/server.pid
fi
export url="$UFFIZZI_URL"
export UFFIZZI_URL_WITH_ESCAPE_CHAR=$(echo $UFFIZZI_DOMAIN | sed "s/\//\\\\\//g")
export APP_DOMAIN="$UFFIZZI_DOMAIN"
sed -i "s/localhost:3000/${UFFIZZI_URL_WITH_ESCAPE_CHAR}/g" /opt/apps/forem/.env
sed -i "s/http:\\/\\//https:\\/\\//g" /opt/apps/forem/.env
export RELEASE_FOOTPRINT=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
if [[ "${RAILS_ENV}" = "development" || "${RAILS_ENV}" = "test" ]]; then
export FOREM_BUILD_DATE=RELEASE_FOOTPRINT
export FOREM_BUILD_SHA=$(git rev-parse --short HEAD)
else
export FOREM_BUILD_DATE=$(cat FOREM_BUILD_DATE)
export FOREM_BUILD_SHA=$(cat FOREM_BUILD_SHA)
fi
case "$@" in
precompile)
echo "Running rake assets:precompile..."
bundle exec rake assets:precompile
;;
clean)
echo "Running rake assets:clean..."
bundle exec rake assets:clean
;;
clobber)
echo "Running rake assets:clobber..."
bundle exec rake assets:clobber
;;
bootstrap)
echo "Running rake app_initializer:setup..."
bundle exec rake app_initializer:setup
;;
*)
echo "Running command:"
echo "$@"
exec "$@"
;;
esac
bundle exec rails server -b 0.0.0.0 -p 3000