mirror of
https://src.koozali.org/infra/smeserver-koji.git
synced 2024-12-22 23:47:00 +01:00
postgres bug
This commit is contained in:
parent
4720cfc95f
commit
0ee9eafc12
@ -78,12 +78,9 @@ EXTERNAL_REPO="http://buildsys.koozali.org/build/7/os/\$arch/"
|
||||
# create the parameter script used by koji scripts
|
||||
cat > $SCRIPT_DIR/koji-parameters.sh <<- EOT
|
||||
#!/bin/bash
|
||||
## Standard locations
|
||||
export POSTGRES_USER=postgres
|
||||
export POSTGRES_DEFAULT_DIR=/var/lib/pgsql
|
||||
## HTTPD settings
|
||||
export HTTPD_USER=apache
|
||||
export HTTPD_DOCUMENT_ROOT=/var/www/html
|
||||
export KOJI_PKI_DIR=/etc/pki/koji
|
||||
## KOJI RPM BUILD AND TRACKER
|
||||
export SCRIPT_GIT=$SCRIPT_GIT
|
||||
export KOJI_DIR=$KOJID_DIR
|
||||
@ -92,6 +89,7 @@ export KOJI_URL=http://"$KOJI_HUB_FQDN"
|
||||
export KOJID_CAPACITY=$KOJID_CAPACITY
|
||||
export TAG_NAME=$TAG_NAME
|
||||
# Use for koji SSL certificates
|
||||
export KOJI_PKI_DIR=/etc/pki/koji
|
||||
export COUNTRY_CODE='$COUNTRY_CODE'
|
||||
export STATE='$STATE'
|
||||
export LOCATION='$LOCATION'
|
||||
@ -105,6 +103,7 @@ export DEBUG_RPM_DIR=$DEBUG_PRM_DIR
|
||||
# Comment the following if supplying all RPMs as an upstream and not a downstream
|
||||
export EXTERNAL_REPO=$EXTERNAL_REPO
|
||||
## POSTGRESQL DATABASE
|
||||
export POSTGRES_USER=postgres
|
||||
export POSTGRES_DIR=/var/lib/pgsql
|
||||
EOT
|
||||
chmod o+x $SCRIPT_DIR/koji-parameters.sh
|
||||
|
@ -134,10 +134,10 @@ mkdir -p /etc/ca-certs/trusted
|
||||
|
||||
# Generate the koji component certificates and the admin certificate and generate a PKCS12 user certificate (for web browser)
|
||||
pushd "$KOJI_PKI_DIR"
|
||||
"$SCRIPT_DIR"/koji-gencert.sh kojiweb "/C=$COUNTRY_CODE/ST=$STATE/L=$LOCATION/O=$ORGANIZATION/OU=kojiweb/CN=$KOJI_HUB_FQDN"
|
||||
"$SCRIPT_DIR"/koji-gencert.sh kojihub "/C=$COUNTRY_CODE/ST=$STATE/L=$LOCATION/O=$ORGANIZATION/OU=kojihub/CN=$KOJI_HUB_FQDN"
|
||||
"$SCRIPT_DIR"/koji-gencert.sh kojiadmin "/C=$COUNTRY_CODE/ST=$STATE/L=$LOCATION/O=$ORGANIZATION/OU=$ORG_UNIT/CN=kojiadmin"
|
||||
"$SCRIPT_DIR"/koji-gencert.sh kojira "/C=$COUNTRY_CODE/ST=$STATE/L=$LOCATION/O=$ORGANIZATION/OU=$ORG_UNIT/CN=kojira"
|
||||
"$SCRIPT_DIR"/koji-gencert.sh kojiweb "/C=$COUNTRY_CODE/ST=$STATE/L=$LOCATION/O=$ORGANIZATION/OU=kojiweb/CN=$KOJI_HUB_FQDN" $DEBUG
|
||||
"$SCRIPT_DIR"/koji-gencert.sh kojihub "/C=$COUNTRY_CODE/ST=$STATE/L=$LOCATION/O=$ORGANIZATION/OU=kojihub/CN=$KOJI_HUB_FQDN" $DEBUG
|
||||
"$SCRIPT_DIR"/koji-gencert.sh kojiadmin "/C=$COUNTRY_CODE/ST=$STATE/L=$LOCATION/O=$ORGANIZATION/OU=$ORG_UNIT/CN=kojiadmin" $DEBUG
|
||||
"$SCRIPT_DIR"/koji-gencert.sh kojira "/C=$COUNTRY_CODE/ST=$STATE/L=$LOCATION/O=$ORGANIZATION/OU=$ORG_UNIT/CN=kojira" $DEBUG
|
||||
popd
|
||||
|
||||
# Copy certificates into ~/.koji for kojiadmin
|
||||
@ -154,15 +154,6 @@ chown -R kojiadmin:kojiadmin "$ADMIN_KOJI_DIR"
|
||||
# Initialize PostgreSQL DB
|
||||
mkdir -p "$POSTGRES_DIR"
|
||||
chown -R "$POSTGRES_USER":"$POSTGRES_USER" "$POSTGRES_DIR"
|
||||
if [[ "$POSTGRES_DIR" != "$POSTGRES_DEFAULT_DIR" ]]; then
|
||||
if [ "$(ls -A "$POSTGRES_DEFAULT_DIR")" ]; then
|
||||
mv "$POSTGRES_DEFAULT_DIR" "$POSTGRES_DEFAULT_DIR".old
|
||||
else
|
||||
rm -rf "$POSTGRES_DEFAULT_DIR"
|
||||
fi
|
||||
ln -sf "$POSTGRES_DIR" "$POSTGRES_DEFAULT_DIR"
|
||||
chown -h "$POSTGRES_USER":"$POSTGRES_USER" "$POSTGRES_DEFAULT_DIR"
|
||||
fi
|
||||
sudo -u "$POSTGRES_USER" initdb --pgdata "$POSTGRES_DEFAULT_DIR"/data
|
||||
systemctl enable --now postgresql
|
||||
|
||||
@ -172,10 +163,10 @@ useradd -r koji
|
||||
# Setup PostgreSQL and populate schema
|
||||
sudo -u "$POSTGRES_USER" createuser --no-superuser --no-createrole --no-createdb koji
|
||||
sudo -u "$POSTGRES_USER" createdb -O koji koji
|
||||
sudo -u koji psql koji koji < /usr/share/doc/koji*/docs/schema.sql
|
||||
sudo -u koji psql koji koji < /usr/share/doc/koji/docs/schema.sql
|
||||
|
||||
# Authorize Koji-web and Koji-hub resources
|
||||
cat > "$POSTGRES_DEFAULT_DIR"/data/pg_hba.conf <<- EOF
|
||||
cat > "$POSTGRES_DIR"/data/pg_hba.conf <<- EOF
|
||||
#TYPE DATABASE USER CIDR-ADDRESS METHOD
|
||||
host koji all 127.0.0.1/32 trust
|
||||
host koji all ::1/128 trust
|
||||
|
@ -1,12 +1,9 @@
|
||||
#!/bin/bash
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
## Standard locations
|
||||
export POSTGRES_USER=postgres
|
||||
export POSTGRES_DEFAULT_DIR=/var/lib/pgsql
|
||||
## HTTPD settings
|
||||
export HTTPD_USER=apache
|
||||
export HTTPD_DOCUMENT_ROOT=/var/www/html
|
||||
export KOJI_PKI_DIR=/etc/pki/koji
|
||||
|
||||
## KOJI RPM BUILD AND TRACKER
|
||||
export KOJI_DIR=/mnt/koji
|
||||
@ -14,6 +11,7 @@ export KOJI_URL=http://"$KOJI_HUB_FQDN"
|
||||
export KOJID_CAPACITY=16
|
||||
export TAG_NAME=sme
|
||||
# Use for koji SSL certificates
|
||||
export KOJI_PKI_DIR=/etc/pki/koji
|
||||
export COUNTRY_CODE='EX'
|
||||
export STATE='Example'
|
||||
export LOCATION='Example'
|
||||
@ -28,6 +26,7 @@ export DEBUG_RPM_DIR=
|
||||
export EXTERNAL_REPO=hhttp://buildsys.koozali.org/build/7/os/\$arch/
|
||||
|
||||
## POSTGRESQL DATABASE
|
||||
export POSTGRES_USER=postgres
|
||||
export POSTGRES_DIR=/var/lib/pgsql
|
||||
|
||||
## GIT REPOSITORIES
|
||||
|
Loading…
Reference in New Issue
Block a user