Skip to content
Snippets Groups Projects
Select Git revision
  • ce11d76a8e2d7b16a2ae4736574150f4fcb4307e
  • collabora/main default protected
  • last-combined-container protected
  • wip/ritesh/move-hostname-ip.collabora/master protected
  • wip/docker-stuff protected
  • andrewsh/email-lookup protected
  • collabora/packaging protected
  • wip/collabora/main protected
  • wip/andrewsh/sso-base protected
  • wip/andrewsh/patch-queue/sso-test protected
  • collabora/master protected
  • fix-css protected
  • wip/andrewsh/upstream-backports protected
  • pristine-lfs protected
  • wip/ritesh/fix-changelog protected
  • wip-t13997 protected
  • revert-b2545e01 protected
  • debian/master protected
  • collabora/2.7.1-10 protected
  • pristine-tar protected
  • upstream/2.7.x protected
  • collabora/2.7.4-3co3 protected
  • collabora/2.7.4-3co2 protected
  • collabora/2.7.4-3co1 protected
  • collabora/2.7.1-10co6 protected
  • debian/2.7.4-1 protected
  • upstream/2.7.4 protected
  • collabora/2.7.1-10co4 protected
  • collabora/2.7.1-10co3 protected
  • collabora/2.7.1-10co2 protected
  • collabora/2.7.1-10co1 protected
  • debian/2.7.1-10 protected
  • debian/2.7.1-9 protected
  • debian/2.7.1-8 protected
  • debian/2.7.1-7 protected
  • debian/2.7.1-6 protected
  • debian/2.7.1-5 protected
  • debian/2.7.1-4 protected
  • debian/2.7.1-3 protected
  • debian/2.7.1-2 protected
  • debian/2.7.1-1 protected
41 results

backend-docker-entrypoint.sh

Blame
  • backend-docker-entrypoint.sh 1.38 KiB
    #!/bin/sh
    
    if [ -z "$OBS_FRONTEND_HOST" ]; then
        echo >&2 'error: OBS server frontend is unavailable and hostname option'
        echo >&2 'is not specified '
        echo >&2 '  You need to specify OBS_FRONTEND_HOST'
        exit 1
    fi
    
    HOSTNAME=$(hostname)
    
    if [ "$(stat -c %U /srv/obs/run)" != obsrun ]
    then
        echo "OBS files owned by the wrong user $(stat -c %U /srv/obs/run), re-owning..."
        time chown obsrun:obsrun -R /srv/obs
    fi
    
    if [ ! -f /etc/obs/BSConfig.pm ]
    then
        echo "OBS backend configuration not found, starting from scratch"
        cp /usr/lib/obs/server/BSConfig.pm.template /etc/obs/BSConfig.pm
    fi
    
    echo "Configure OBS backend host: ${HOSTNAME}"
    sed -i "s/hostname = .*/hostname = '${HOSTNAME}';/g" /etc/obs/BSConfig.pm
    
    echo "Configure OBS frontend host: ${OBS_FRONTEND_HOST}"
    sed -i "s/frontend = undef/frontend = '${OBS_FRONTEND_HOST}'/g" /etc/obs/BSConfig.pm
    
    for arch in ${OBS_ARCHES:-amd64 i686 armhf arm64}
    do
        obsarch=$(/opt/deb-arch-to-obs-arch "$arch")
        if [ -z "$obsarch" ]
        then
            echo Failed to enable unsupported architecture $arch >&2
            continue
        fi
        for template in /opt/services/backend/*@.conf.in
        do
            conf=$(echo $(basename $template) | sed -e "s|@|@$arch|" -e 's|.in$||')
            sed -e "s|@ARCH@|$obsarch|g" $template > /etc/supervisor/conf.d/$conf
        done
    done
    
    mkdir -p /srv/obs/log
    chmod ug=rwxt /srv/obs/run
    
    /usr/bin/supervisord -n