-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopsi-dev-tool.yml
156 lines (144 loc) · 6.01 KB
/
opsi-dev-tool.yml
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
project:
licenses:
- license: AGPL-3.0
header: |
opsiconfd is part of the desktop management solution opsi http://www.opsi.org
Copyright (c) 2008-{year} uib GmbH <[email protected]>
All rights reserved.
License: {license}
git:
hooks:
pre-push: |
echo "Running ruff..."
poetry run ruff check opsiconfd tests perftest
echo "Running mypy..."
poetry run mypy opsiconfd tests perftest
transifex:
upload_resources:
- organization: opsi-org
project: opsiorg
resource_name: hwaudit.properties
resource_file: opsiconfd_data/etc/hwaudit/locales/hwaudit_en.properties
download_translations:
- organization: opsi-org
project: opsiorg
resource_name: hwaudit.properties
install_dir: opsiconfd_data/etc/hwaudit/locales
min_review_rate: $TRANSIFEX_MIN_REVIEW_RATE
languages:
- de
- fr
pyinstaller:
one_file: no
strip: yes
hidden_imports:
all:
- ipaddress
- colorsys
# UserWarning: You do not have a working installation of the service_identity module: 'No module named 'service_identity''.
# Please install it from <https://pypi.python.org/pypi/service_identity> and make sure all of its dependencies are satisfied.
# Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification.
# Many valid certificate/hostname mappings may be rejected.
- service_identity
- OPSI.Util.WIM
- opsiconfd.application.utils
- opsiconfd.rest
- opsiconfd.utils.fastapi
collect_submodules:
- pydantic_core
- pydantic
- uvicorn
# Collecting both modules so that they can be used depending on the configuration
- mysqldb
- pymysql
# Collecting both modules so that they can be used depending on the configuration
- websockets
- wsproto
scripts:
- script: opsiconfd/__main__.py
binaries:
- opsiconfd
data_files:
- src: opsiconfd_data/**/*
dst: opsiconfd_data
dirname: opsiconfd
after_script: |
rm -r dist/opsiconfd/_internal/tk dist/opsiconfd/_internal/tcl
mkdir dist/opsiconfd/_internal/tk dist/opsiconfd/_internal/tcl
find dist/opsiconfd/_internal -iname "*.c" -delete
find dist/opsiconfd/_internal -iname "*.h" -delete
find dist/opsiconfd/_internal -iname "*.so" -exec chmod -x "{}" \;
find dist/opsiconfd/_internal -iname "*.so.*" -exec chmod -x "{}" \;
package:
name: opsiconfd
type: binary
systemd: yes
depends:
- librsync | librsync2 | librsync1
- pigz
conflicts:
- opsi-server (<< 4.3)
- opsi-server-full (<< 4.3)
- opsi-server-expert (<< 4.3)
source_script: |
mkdir -p ${DST}/rootfs/etc/opsi
mkdir -p ${DST}/rootfs/usr/bin
mkdir -p ${DST}/rootfs/usr/lib/opsiconfd
mkdir -p ${DST}/rootfs/usr/share/opsiconfd
mkdir -p ${DST}/rootfs/var/lib/opsi/depot
mkdir -p ${DST}/rootfs/var/lib/opsi/ntfs-images
mkdir -p ${DST}/rootfs/var/lib/opsi/public
mkdir -p ${DST}/rootfs/var/lib/opsi/repository
mkdir -p ${DST}/rootfs/var/lib/opsi/workbench
mkdir -p ${DST}/rootfs/var/log/opsi/bootimage
mkdir -p ${DST}/rootfs/var/log/opsi/clientconnect
mkdir -p ${DST}/rootfs/var/log/opsi/instlog
mkdir -p ${DST}/rootfs/var/log/opsi/opsiconfd
mkdir -p ${DST}/rootfs/var/log/opsi/userlogin
mkdir -p ${DST}/systemd_units
echo "#!/bin/sh" > ${DST}/rootfs/usr/bin/opsiconfd
echo "exec /usr/lib/opsiconfd/opsiconfd \"\$@\"" >> ${DST}/rootfs/usr/bin/opsiconfd
chmod 755 ${DST}/rootfs/usr/bin/opsiconfd
for arch in amd64 arm64; do
arch_src="${SRC}/opsiconfd-${arch}"
if [ ! -d "$arch_src" ]; then
echo "Skipping $arch. No directory $arch_src found."
continue
fi
arch_dst="${DST}/rootfs-${arch}"
mkdir -p "${arch_dst}/usr/lib"
mkdir -p "${arch_dst}/etc/opsi"
cp -a "${arch_src}" "${arch_dst}/usr/lib/opsiconfd"
install -m 755 "${arch_src}/_internal/opsiconfd_data/opsiconfd-pre-start" "${arch_dst}/usr/lib/opsiconfd/"
cp -a "${arch_src}/_internal/opsiconfd_data/static" ${DST}/rootfs/usr/share/opsiconfd/
cp -a "${arch_src}/_internal/opsiconfd_data/etc/"* ${DST}/rootfs/etc/opsi/
cp -a "${arch_src}/_internal/opsiconfd_data/usr/lib/"* ${DST}/rootfs/usr/lib/opsiconfd/
cp -a "${arch_src}/_internal/opsiconfd_data/usr/share/"* ${DST}/rootfs/usr/share/opsiconfd/
cp -a "${arch_src}/_internal/opsiconfd_data/opsiconfd.service" ${DST}/systemd_units/
done
postinst_script: |
/usr/lib/opsiconfd/opsiconfd-pre-start
# Remove obsolete files
cd /usr/lib/opsiconfd
for file in /usr/lib/opsiconfd/*; do
[[ $file = */_internal ]] || \
[[ $file = */addons ]] || \
[[ $file = */opsiconfd ]] || \
[[ $file = */opsiconfd-pre-start ]] || \
rm -r "$file" || true
done
[ -e /etc/logrotate.d/opsiconfd ] && rm /etc/logrotate.d/opsiconfd || true
rm /etc/rc*/*opsiconfd 2>/dev/null || true
[ -e /etc/init.d/opsiconfd ] && rm /etc/init.d/opsiconfd
[ -e /etc/opsi/systemdTemplates ] && rm -r /etc/opsi/systemdTemplates
[ -e /etc/systemd/system/opsiconfd.service.simple ] && rm /etc/systemd/system/opsiconfd.service.simple
[ -e /etc/systemd/system/opsiconfd.service ] && rm /etc/systemd/system/opsiconfd.service
[ -e /etc/opsi/version ] && rm /etc/opsi/version
systemctl daemon-reload || true
[ -e /var/lib/opsi ] || mkdir -p /var/lib/opsi
[ -e /etc/dhcpd.conf ] && sed -i s'#"dhcpdConfigFile".*#"dhcpdConfigFile": "/etc/dhcpd.conf",#' /etc/opsi/backends/dhcpd.conf
[ -e /etc/dhcpd.conf ] && sed -i s'#linux/pxelinux.0#opsi/pxelinux.0#' /etc/opsi/backends/dhcpd.conf
[ -e /var/lib/opsi/server_commands_custom.conf ] || touch /var/lib/opsi/server_commands_custom.conf
# Setup opsiconfd
grep "run-as-user" /etc/opsi/opsiconfd.conf >/dev/null || echo -e "run-as-user = opsiconfd" >> /etc/opsi/opsiconfd.conf
/usr/bin/opsiconfd setup --non-interactive --log-level=0 --log-level-stderr=0 --log-level-file=0 || true