-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup-kojiraconf
executable file
·70 lines (54 loc) · 1.61 KB
/
setup-kojiraconf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh
echo "========================"
echo "=== setup-kojiraconf ==="
echo "========================"
# Attempt to pull in default variable definitions
. `pwd`/defaults
# Check that all the externally defined variables we use in this script are initailized
echo -n "Checking the defaults of the following: "
for i in TOP KOJIRACONF HOSTNAME PKI NOTIFYAS; do
if [ \$$i ]; then
echo -n "$i "
eval n=\$$i
if [ ! $n ]; then
echo
echo "conf error: $i is NOT defined/set in the defaults file. exiting."
exit 1
fi
fi
done
echo " (OK)"
# Note the escape chars.. without these, perl and bash do nasty things
TOPDIR=$TOP/koji
cat > $KOJIRACONF << EOF
[kojira]
; For user/pass authentication
; user=kojira
; password=kojira
; For Kerberos authentication
; the principal to connect with
; principal=koji/[email protected]
; The location of the keytab for the principal above
; keytab=/etc/kojira.keytab
; The URL for the koji hub server
server=http://$HOSTNAME/kojihub
; The directory containing the repos/ directory
topdir=$TOPDIR
; Logfile
logfile=/var/log/kojira.log
; Include srpms in repos? (not needed for normal operation)
with_src=yes
;configuration for SSL athentication
;client certificate
cert = $PKI/kojira.pem
;certificate of the CA that issued the client certificate
ca = $PKI/koji_ca_cert.crt
;certificate of the CA that issued the HTTP server certificate
serverca = $PKI/koji_ca_cert.crt
EOF
# SSL certs are cached by httpd, force it to reload before koji CLI tries talk to httpd
service httpd restart
#service postgresql restart
koji add-user kojira
koji grant-permission repo kojira
service kojira start