-
Notifications
You must be signed in to change notification settings - Fork 3
/
33univention-portal.inst
executable file
·365 lines (327 loc) · 16.7 KB
/
33univention-portal.inst
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
#!/bin/bash
# -*- coding: utf-8 -*-
#
# Univention Portal
# join script
#
# Like what you see? Join us!
# https://www.univention.com/about-us/careers/vacancies/
#
# Copyright 2016-2024 Univention GmbH
#
# https://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero General Public License version 3
# (GNU AGPL V3) as published by the Free Software Foundation.
#
# Binary versions of this program provided by Univention to you as
# well as other copyrighted, protected or trademarked materials like
# Logos, graphics, fonts, specific documentations and configurations,
# cryptographic keys etc. are subject to a license agreement between
# you and Univention and not subject to the GNU AGPL V3.
#
# In the case you use this program under the terms of the GNU AGPL V3,
# the program is provided in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public
# License with the Debian GNU/Linux or Univention distribution in file
# /usr/share/common-licenses/AGPL-3; if not, see
# <https://www.gnu.org/licenses/>.
## joinscript api: bindpwdfile
# shellcheck disable=SC2034
VERSION=39
. /usr/share/univention-join/joinscripthelper.lib
. /usr/share/univention-lib/umc.sh
. /usr/share/univention-lib/ldap.sh
joinscript_init
umc_init
ldap_master="$(ucr get ldap/master)"
ldap_master_port="$(ucr get ldap/master/port)"
if ! nc -z "$ldap_master" "${ldap_master_port:-7389}"; then
false || die "LDAP Primary Directory Node is not available. Please try again later."
fi
ucs_registerLDAPExtension "$@" \
--ucsversionstart 4.4-1 \
--ucsversionend 5.99-0 \
--schema /usr/lib/univention-portal/schema/univention-portal.schema \
--acl /usr/lib/univention-portal/acl/62univention-portal.acl \
--udm_syntax /usr/lib/univention-portal/syntax/univention-portal.py || die
ucs_registerLDAPExtension "$@" \
--ucsversionstart 5.0-0 \
--ucsversionend 5.99-0 \
--udm_module /usr/lib/univention-portal/udm/portal.py \
--messagecatalog /usr/lib/univention-portal/udm/de.mo \
--umcregistration /usr/lib/univention-portal/umc/univention-portal.xml || die
ucs_registerLDAPExtension "$@" \
--ucsversionstart 5.0-0 \
--ucsversionend 5.99-0 \
--udm_module /usr/lib/univention-portal/udm/category.py || die
ucs_registerLDAPExtension "$@" \
--ucsversionstart 5.0-0 \
--ucsversionend 5.99-0 \
--udm_module /usr/lib/univention-portal/udm/entry.py || die
ucs_registerLDAPExtension "$@" \
--ucsversionstart 5.0-0 \
--ucsversionend 5.99-0 \
--udm_module /usr/lib/univention-portal/udm/folder.py || die
ucs_registerLDAPExtension "$@" \
--ucsversionstart 5.0-0 \
--ucsversionend 5.99-0 \
--udm_module /usr/lib/univention-portal/udm/announcement.py || die
ucs_registerLDAPExtension "$@" \
--ucsversionstart 5.0-0 \
--ucsversionend 5.99-0 \
--udm_module /usr/lib/univention-portal/udm/all.py || die
umc_operation_create "udm-new-portal" "UDM - Portal" "portals/all" \
"udm/*:objectType=portals/*" "udm/types" "udm/get" "udm/put" "udm/properties" "udm/values"
ldap_base="$(ucr get ldap/base)"
# create container for portal objects and portal entries
univention-directory-manager container/cn create "$@" --ignore_exists \
--position "cn=univention,$ldap_base" \
--set name=portals || die
univention-directory-manager container/cn create "$@" --ignore_exists \
--position "cn=portals,cn=univention,$ldap_base" \
--set name=portal || die
univention-directory-manager container/cn create "$@" --ignore_exists \
--position "cn=portals,cn=univention,$ldap_base" \
--set name=category || die
univention-directory-manager container/cn create "$@" --ignore_exists \
--position "cn=portals,cn=univention,$ldap_base" \
--set name=entry || die
univention-directory-manager container/cn create "$@" --ignore_exists \
--position "cn=portals,cn=univention,$ldap_base" \
--set name=folder || die
univention-directory-manager container/cn create "$@" --ignore_exists \
--position "cn=portals,cn=univention,$ldap_base" \
--set name=config || die
univention-directory-manager container/cn create "$@" --ignore_exists \
--position "cn=portals,cn=univention,$ldap_base" \
--set name=announcement || die
if [ "$JS_LAST_EXECUTED_VERSION" -lt 8 ]; then
/usr/lib/univention-portal/migrate-to-new-portal "$@"
fi
role="$(ucr get server/role)"
# the following UDM objects need to be created only initially
if [ "$role" = "domaincontroller_master" ]; then
## USER SUBMENU
univention-directory-manager portals/entry create "$@" --ignore_exists \
--position "cn=entry,cn=portals,cn=univention,$ldap_base" \
--set name=self-service-password-change \
--append displayName='"en_US" "Change your password"' \
--append displayName='"de_DE" "Ihr Passwort ändern"' \
--append description='"en_US" "Change your password"' \
--append description='"de_DE" "Ihr Passwort ändern"' \
--append link='"en_US" "#/selfservice/passwordchange"' \
--append allowedGroups="cn=Domain Users,cn=groups,$ldap_base" \
--set icon="$(base64 /usr/share/univention-portal/key.svg)" \
--set linkTarget=samewindow || die
## HELP SUBMENU
univention-directory-manager portals/entry create "$@" --ignore_exists \
--position "cn=entry,cn=portals,cn=univention,$ldap_base" \
--set name=univentionforum \
--append displayName="\"en_US\" \"Univention Forum (Help)\"" \
--append displayName="\"de_DE\" \"Univention Forum (Hilfe)\"" \
--append displayName="\"fr_FR\" \"Forum Univention (Aide)\"" \
--append description="\"en_US\" \"Univention Forum (Help)\"" \
--append description="\"de_DE\" \"Univention Forum (Hilfe)\"" \
--append description="\"fr_FR\" \"Forum Univention (Aide)\"" \
--append link='"en_US" "https://help.univention.com"' \
--set linkTarget=newwindow || die
univention-directory-manager portals/entry create "$@" --ignore_exists \
--position "cn=entry,cn=portals,cn=univention,$ldap_base" \
--set name=univentionfeedback \
--append displayName="\"en_US\" \"Feedback\"" \
--append displayName="\"de_DE\" \"Feedback\"" \
--append displayName="\"fr_FR\" \"Impressions\"" \
--append description="\"en_US\" \"Feedback\"" \
--append description="\"de_DE\" \"Feedback\"" \
--append description="\"fr_FR\" \"Impressions\"" \
--append link='"en_US" "https://www.univention.com/feedback/?umc=portal"' \
--append link='"de_DE" "https://www.univention.de/produkt-feedback/?umc=portal"' \
--set linkTarget=newwindow || die
univention-directory-manager portals/entry create "$@" --ignore_exists \
--position "cn=entry,cn=portals,cn=univention,$ldap_base" \
--set name=univentionblog \
--append displayName="\"en_US\" \"Univention Blog\"" \
--append displayName="\"de_DE\" \"Univention Blog\"" \
--append displayName="\"fr_FR\" \"Univention Blog\"" \
--append description="\"en_US\" \"News, tips and best practices\"" \
--append description="\"de_DE\" \"News, Tipps und Best Practices\"" \
--append description="\"fr_FR\" \"Nouvelles, conseils et bonne pratique\"" \
--append link='"en_US" "https://www.univention.com/news/blog-en"' \
--append link='"de_DE" "https://www.univention.de/news/blog-de"' \
--set icon="$(base64 /usr/share/univention-portal/univention-blog.png)" \
--set linkTarget=newwindow || die
univention-directory-manager portals/entry create "$@" --ignore_exists \
--position "cn=entry,cn=portals,cn=univention,$ldap_base" \
--set name=univentionwebsite \
--append displayName="\"en_US\" \"Univention Website\"" \
--append displayName="\"de_DE\" \"Univention Webseite\"" \
--append displayName="\"fr_FR\" \"Site Internet Univention\"" \
--append description="\"en_US\" \"Univention Website\"" \
--append description="\"de_DE\" \"Univention Webseite\"" \
--append description="\"fr_FR\" \"Site Internet Univention\"" \
--append link='"en_US" "https://www.univention.com"' \
--append link='"de_DE" "https://www.univention.de"' \
--set linkTarget=newwindow || die
univention-directory-manager portals/folder create "$@" --ignore_exists \
--position "cn=folder,cn=portals,cn=univention,$ldap_base" \
--set name=help \
--append entries="cn=univentionforum,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append entries="cn=univentionfeedback,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append entries="cn=univentionblog,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append entries="cn=univentionwebsite,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append displayName='"en_US" "Help"' \
--append displayName='"de_DE" "Hilfe"' \
--append displayName='"fr_FR" "Aide"' || die
# create link to UMC for domain-wide portal object
univention-directory-manager portals/entry create "$@" --ignore_exists \
--position "cn=entry,cn=portals,cn=univention,$ldap_base" \
--set name=umc-domain \
--append displayName="\"en_US\" \"System and domain settings\"" \
--append displayName="\"de_DE\" \"System- und Domäneneinstellungen\"" \
--append displayName="\"fr_FR\" \"Réglages du système et du domaine\"" \
--append description="\"en_US\" \"Univention Management Console for administrating the UCS domain and the local system\"" \
--append description="\"de_DE\" \"Univention Management Console zur Verwaltung der UCS-Domäne und des lokalen Systems\"" \
--append description="\"fr_FR\" \"Console de gestion Univention pour administrer le domaine UCS et le système local\"" \
--append link='"en_US" "/univention/umc/"' \
--set anonymous=TRUE \
--set linkTarget=newwindow \
--set icon="$(base64 /usr/share/univention-portal/univention-management-console.svg)" || die
# create login tiles (one for umc login, one for saml login
univention-directory-manager portals/entry create "$@" --ignore_exists \
--position "cn=entry,cn=portals,cn=univention,$ldap_base" \
--set name=login-ucs \
--append displayName="\"en_US\" \"Login\"" \
--append displayName="\"de_DE\" \"Anmelden\"" \
--append displayName="\"fr_FR\" \"Connexion\"" \
--append description="\"en_US\" \"Log in to the portal\"" \
--append description="\"de_DE\" \"Am Portal anmelden\"" \
--append description="\"fr_FR\" \"Connectez-vous au portail\"" \
--append link='"en_US" "/univention/login/?location=/univention/portal/"' \
--set anonymous=TRUE \
--set linkTarget=samewindow \
--set icon="$(base64 /usr/share/univention-portal/login.svg)" || die
univention-directory-manager portals/entry create "$@" --ignore_exists \
--position "cn=entry,cn=portals,cn=univention,$ldap_base" \
--set name=login-saml \
--append displayName="\"en_US\" \"Login (Single sign-on)\"" \
--append displayName="\"de_DE\" \"Anmelden (Single Sign-on)\"" \
--append displayName="\"fr_FR\" \"Connexion (authentification unique)\"" \
--append description="\"en_US\" \"Log in to the portal\"" \
--append description="\"de_DE\" \"Am Portal anmelden\"" \
--append description="\"fr_FR\" \"Connectez-vous au portail\"" \
--append link='"en_US" "/univention/saml/?location=/univention/portal/"' \
--set anonymous=TRUE \
--set activated=FALSE \
--set linkTarget=samewindow \
--set icon="$(base64 /usr/share/univention-portal/login.svg)" || die
# create applications category
univention-directory-manager portals/category create "$@" --ignore_exists \
--position "cn=category,cn=portals,cn=univention,$ldap_base" \
--set name=domain-service \
--append entries="cn=login-ucs,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append entries="cn=login-saml,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append displayName='"en_US" "Applications"' \
--append displayName='"de_DE" "Applikationen"' \
--append displayName='"fr_FR" "Applications"' || die
# create admin category
univention-directory-manager portals/category create "$@" --ignore_exists \
--position "cn=category,cn=portals,cn=univention,$ldap_base" \
--set name=domain-admin \
--append entries="cn=umc-domain,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append displayName='"en_US" "Administration"' \
--append displayName='"de_DE" "Verwaltung"' \
--append displayName='"fr_FR" "Administration"' || die
## CERTIFICATE SUBMENU
univention-directory-manager portals/entry create "$@" --ignore_exists \
--position "cn=entry,cn=portals,cn=univention,$ldap_base" \
--set name=root-cert \
--append displayName="\"en_US\" \"Root certificate\"" \
--append displayName="\"de_DE\" \"Wurzelzertifikat\"" \
--append displayName="\"fr_FR\" \"Certificat racine\"" \
--append description="\"en_US\" \"Root certificate\"" \
--append description="\"de_DE\" \"Wurzelzertifikat\"" \
--append description="\"fr_FR\" \"Certificat racine\"" \
--append link='"en_US" "/ucs-root-ca.crt"' \
--set linkTarget=samewindow || die
univention-directory-manager portals/entry create "$@" --ignore_exists \
--position "cn=entry,cn=portals,cn=univention,$ldap_base" \
--set name=certificate-revocation \
--append displayName="\"en_US\" \"Certificate revocation list\"" \
--append displayName="\"de_DE\" \"Zertifikat-Sperrliste\"" \
--append displayName="\"fr_FR\" \"Liste de révocation de certificats\"" \
--append description="\"en_US\" \"Certificate revocation list\"" \
--append description="\"de_DE\" \"Zertifikat-Sperrliste\"" \
--append description="\"fr_FR\" \"Liste de révocation de certificats\"" \
--append link='"en_US" "/ucsCA.crl"' \
--set linkTarget=samewindow || die
univention-directory-manager portals/folder create "$@" --ignore_exists \
--position "cn=folder,cn=portals,cn=univention,$ldap_base" \
--set name=certificates \
--append entries="cn=root-cert,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append entries="cn=certificate-revocation,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append displayName='"en_US" "Certificates"' \
--append displayName='"de_DE" "Zertifikate"' \
--append displayName='"fr_FR" "Certificats"' || die
# create domain-wide portal object for Primary/Backup Directory Node systems
univention-directory-manager portals/portal create "$@" --ignore_exists \
--position "cn=portal,cn=portals,cn=univention,$ldap_base" \
--set name=domain \
--append userLinks="cn=self-service-password-change,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append menuLinks="cn=certificates,cn=folder,cn=portals,cn=univention,$ldap_base" \
--append menuLinks="cn=help,cn=folder,cn=portals,cn=univention,$ldap_base" \
--append categories="cn=domain-service,cn=category,cn=portals,cn=univention,$ldap_base" \
--append categories="cn=domain-admin,cn=category,cn=portals,cn=univention,$ldap_base" \
--append displayName='"en_US" "Univention Portal"' \
--append displayName='"de_DE" "Univention Portal"' \
--append displayName='"fr_FR" "Portail Univention"' \
--set showUmc=TRUE || die
if [ "$JS_LAST_EXECUTED_VERSION" -lt 8 ]; then
# again, coming from ucs 4.4. migration happened earlier
# but some default behaviour has to be added
univention-directory-manager portals/entry modify "$@" --ignore_not_exists \
--dn "cn=umc-domain,cn=entry,cn=portals,cn=univention,$ldap_base" \
--remove link='"en_US" "/univention/management/"' \
--append link='"en_US" "/univention/umc/"' \
--set linkTarget=newwindow \
--set anonymous=TRUE || die
univention-directory-manager portals/category modify "$@" --ignore_not_exists \
--dn "cn=domain-service,cn=category,cn=portals,cn=univention,$ldap_base" \
--append entries="cn=login-ucs,cn=entry,cn=portals,cn=univention,$ldap_base" \
--append entries="cn=login-saml,cn=entry,cn=portals,cn=univention,$ldap_base" || die
univention-directory-manager portals/portal modify "$@" --ignore_not_exists \
--dn "cn=domain,cn=portal,cn=portals,cn=univention,$ldap_base" \
--append menuLinks="cn=certificates,cn=folder,cn=portals,cn=univention,$ldap_base" \
--append menuLinks="cn=help,cn=folder,cn=portals,cn=univention,$ldap_base" \
--append categories="cn=domain-service,cn=category,cn=portals,cn=univention,$ldap_base" \
--set showUmc=TRUE || die
fi
fi
# Reset old UCR variables otherwise the UCR handler is not executed
if [ "$JS_LAST_EXECUTED_VERSION" = 0 ]; then
ucr search --brief "ucs/web/overview/entries/(admin|service)/.*/link" | awk '{print $1}' | while read -r k; do
key="${k%:}"
value="$(ucr get "$key")"
if [ -n "$value" ]; then
ucr set "$key"="$value"
fi
done
fi
univention-portal add-default
univention-portal update
systemctl restart univention-portal-server
# One time action: Copy example custom css file
if [ "$JS_LAST_EXECUTED_VERSION" -lt 8 ]; then
# older custom.css are most definitely broken now
[ -e /usr/share/univention-portal/custom.css ] && cp /usr/share/univention-portal/custom.css /usr/share/univention-portal/custom.css.bak
touch /usr/share/univention-portal/custom.css
fi
joinscript_save_current_version
exit 0