From 80750178505e111785a35268c6ee549e7a44fd36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zolt=C3=A1n=20Felleg?= Date: Wed, 7 Nov 2018 15:13:21 +0100 Subject: [PATCH] Added xfr.pm.f29. --- sources/svc.usr.f29/envvars | 2 +- sources/xfr.pm.f29/config | 20 +++++ sources/xfr.pm.f29/envvars | 4 + .../firstboot/01_setupnetworking.sh | 54 ++++++++++++ .../xfr.pm.f29/firstboot/02_settimezone.sh | 21 +++++ sources/xfr.pm.f29/firstboot/03_setupldap.sh | 10 +++ sources/xfr.pm.f29/firstboot/99_cleanup.sh | 6 ++ .../xfr.pm.f29/postinstall/01_setownership.sh | 7 ++ .../postinstall/02_setpermissions.sh | 5 ++ .../xfr.pm.f29/postinstall/03_installfiles.sh | 15 ++++ .../postinstall/10_setupservices.sh | 7 ++ sources/xfr.pm.f29/postinstall/99_cleanup.sh | 6 ++ .../xfr.pm.f29/postinstall/install/etc/hosts | 4 + .../install/etc/httpd/conf.d/xfr.80.conf | 86 +++++++++++++++++++ 14 files changed, 246 insertions(+), 1 deletion(-) create mode 100644 sources/xfr.pm.f29/config create mode 100644 sources/xfr.pm.f29/envvars create mode 100755 sources/xfr.pm.f29/firstboot/01_setupnetworking.sh create mode 100755 sources/xfr.pm.f29/firstboot/02_settimezone.sh create mode 100755 sources/xfr.pm.f29/firstboot/03_setupldap.sh create mode 100755 sources/xfr.pm.f29/firstboot/99_cleanup.sh create mode 100755 sources/xfr.pm.f29/postinstall/01_setownership.sh create mode 100755 sources/xfr.pm.f29/postinstall/02_setpermissions.sh create mode 100755 sources/xfr.pm.f29/postinstall/03_installfiles.sh create mode 100755 sources/xfr.pm.f29/postinstall/10_setupservices.sh create mode 100755 sources/xfr.pm.f29/postinstall/99_cleanup.sh create mode 100644 sources/xfr.pm.f29/postinstall/install/etc/hosts create mode 100644 sources/xfr.pm.f29/postinstall/install/etc/httpd/conf.d/xfr.80.conf diff --git a/sources/svc.usr.f29/envvars b/sources/svc.usr.f29/envvars index 4a30c21..b96f003 100644 --- a/sources/svc.usr.f29/envvars +++ b/sources/svc.usr.f29/envvars @@ -1,4 +1,4 @@ #BASE_PACKAGES="NetworkManager initscripts openssh-server openssh-clients openssh-ldap rootfiles rsyslog sudo tar vim-minimal" -#SPEC_PACKAGES="authconfig bind bind-utils dhcp openldap-clients nss-pam-ldapd pam_ssh passwd postfix" +#SPEC_PACKAGES="authselect bind bind-utils dhcp openldap-clients nss-pam-ldapd pam_ssh passwd postfix" BASE_PACKAGES="NetworkManager initscripts rootfiles rsyslog tar" SPEC_PACKAGES="bind bind-utils dhcp postfix" diff --git a/sources/xfr.pm.f29/config b/sources/xfr.pm.f29/config new file mode 100644 index 0000000..37708fd --- /dev/null +++ b/sources/xfr.pm.f29/config @@ -0,0 +1,20 @@ +lxc.include = /usr/share/lxc/config/common.conf + +lxc.arch = x86_64 +lxc.uts.name = xfr.pm.user.hu +lxc.rootfs.path = __CONTAINER_PATH__/rootfs +lxc.mount.auto = proc:rw sys:ro +lxc.mount.entry = __CONTAINER_FILESYSTEMS_PATH__/www.xfr var/www.xfr none bind,create=dir 0 0 + +lxc.net.0.type = veth +lxc.net.0.flags = up +lxc.net.0.link = brh +lxc.net.0.hwaddr = 02:0c:18:03:ad:fb + +lxc.autodev = 1 + +lxc.signal.halt = SIGRTMIN+4 + +lxc.start.auto = 1 +lxc.start.order = 21 +lxc.start.delay = 10 diff --git a/sources/xfr.pm.f29/envvars b/sources/xfr.pm.f29/envvars new file mode 100644 index 0000000..5357757 --- /dev/null +++ b/sources/xfr.pm.f29/envvars @@ -0,0 +1,4 @@ +#BASE_PACKAGES="NetworkManager initscripts openssh-server openssh-clients openssh-ldap rootfiles rsyslog sudo tar vim-minimal" +#SPEC_PACKAGES="authselect httpd mod_wsgi openldap-clients nss-pam-ldapd pam_ssh passwd" +BASE_PACKAGES="NetworkManager initscripts rootfiles rsyslog tar" +SPEC_PACKAGES="httpd mod_wsgi" diff --git a/sources/xfr.pm.f29/firstboot/01_setupnetworking.sh b/sources/xfr.pm.f29/firstboot/01_setupnetworking.sh new file mode 100755 index 0000000..0f20011 --- /dev/null +++ b/sources/xfr.pm.f29/firstboot/01_setupnetworking.sh @@ -0,0 +1,54 @@ +#!/bin/sh + + +sleep 1 +systemctl --quiet is-active NetworkManager.service +NM_RC=$? +WAITED=0 +while [ $NM_RC -ne 0 ] +do + echo -n . + sleep 1 + WAITED=1 + systemctl --quiet is-active NetworkManager.service + NM_RC=$? +done +[ $WAITED -ne 0 ] && echo + +CONNECTIONS=$(nmcli connection show | grep -v '^NAME' | wc -l) +if [ $CONNECTIONS -ne 1 ] +then + echo "Number of connections: $CONNECTIONS" >&2 + exit 1 +fi + +CONNECTION_LINE=$(nmcli connection show | grep -v '^NAME') +CONNECTION_TOKENS=$(echo $CONNECTION_LINE | wc -w) +#CONNECTION_NAME_POS=$(( $CONNECTION_TOKENS - 3 )) +CONNECTION_UUID_POS=$(( $CONNECTION_TOKENS - 2 )) +#CONNECTION_TYPE_POS=$(( $CONNECTION_TOKENS - 1 )) +CONNECTION_DEVICE_POS=$CONNECTION_TOKENS +#CONNECTION_NAME=$(echo $CONNECTION_LINE \ +# | cut -f -$CONNECTION_NAME_POS -d ' ') +CONNECTION_UUID=$(echo $CONNECTION_LINE \ + | cut -f $CONNECTION_UUID_POS -d ' ') +#CONNECTION_TYPE=$(echo $CONNECTION_LINE \ +# | cut -f $CONNECTION_TYPE_POS -d ' ') +CONNECTION_DEVICE=$(echo $CONNECTION_LINE \ + | cut -f $CONNECTION_DEVICE_POS -d ' ') + +nmcli connection delete uuid "$CONNECTION_UUID" + +nmcli connection add \ + type 802-3-ethernet \ + ifname $CONNECTION_DEVICE \ + con-name perimeter \ + autoconnect yes \ + save yes \ + ipv4.addresses "192.168.173.251/24" \ + ipv4.dns "192.168.173.174" \ + ipv4.dns-search "pm.user.hu" \ + ipv4.gateway "192.168.173.254" \ + ipv4.method "manual" \ + ipv6.method "ignore" +nmcli connection show diff --git a/sources/xfr.pm.f29/firstboot/02_settimezone.sh b/sources/xfr.pm.f29/firstboot/02_settimezone.sh new file mode 100755 index 0000000..20b2a71 --- /dev/null +++ b/sources/xfr.pm.f29/firstboot/02_settimezone.sh @@ -0,0 +1,21 @@ +#!/bin/sh + + +sleep 1 +systemctl --quiet is-active dbus.service +DBUS_RC=$? +WAITED=0 +while [ $DBUS_RC -ne 0 ] +do + if [ $WAITED -eq 0 ] + then + echo -n "Waiting for dbus.service" + fi + echo -n . + sleep 1 + WAITED=1 + systemctl --quiet is-active dbus.service + DBUS_RC=$? +done +[ $WAITED -ne 0 ] && echo +timedatectl set-timezone Europe/Budapest diff --git a/sources/xfr.pm.f29/firstboot/03_setupldap.sh b/sources/xfr.pm.f29/firstboot/03_setupldap.sh new file mode 100755 index 0000000..4b58626 --- /dev/null +++ b/sources/xfr.pm.f29/firstboot/03_setupldap.sh @@ -0,0 +1,10 @@ +#!/bin/sh + + +exit 0 +authselect select sssd with-mkhomedir --force + +cat >>/etc/openldap/ldap.conf < + ServerName xfr.userrendszerhaz.hu + ServerAdmin webadmin@userrendszerhaz.hu + DocumentRoot "/var/www.xfr/htdocs.80" + + + + Require all granted + + + + + AuthType Basic + AuthName "Avon File Transfer" + AuthUserFile /var/www.xfr/auth/avonxfr.users + Require valid-user + + Options Indexes + + + Alias /avonxfr/download /var/www.xfr/htdocs.80/avonxfr/download + + + Options Indexes + + + + AuthType Basic + AuthName "Erste File Transfer" + AuthUserFile /var/www.xfr/auth/erstexfr.users + Require valid-user + + Options Indexes + + + Alias /erstexfr/download /var/www.xfr/htdocs.80/erstexfr/download + + + Options Indexes + + + + AuthType Basic + AuthName "ONYF File Transfer" + AuthUserFile /var/www.xfr/auth/onyfxfr.users + Require valid-user + + Options Indexes + + + Alias /onyfxfr/download /var/www.xfr/htdocs.80/onyfxfr/download + + + Options Indexes + + + + AuthType Basic + AuthName "UBIS File Transfer" + AuthUserFile /var/www.xfr/auth/ubisxfr.users + Require valid-user + + Options Indexes + + + Alias /ubisxfr/download /var/www.xfr/htdocs.80/ubisxfr/download + + + Options Indexes + + + WSGIDaemonProcess was.80 processes=1 threads=1 maximum-requests=10000 shutdown-timeout=5 + WSGIProcessGroup was.80 + WSGIScriptAlias /avonxfr/upload/do /var/www.xfr/wsgi.80/upload.wsgi + WSGIScriptAlias /erstexfr/upload/do /var/www.xfr/wsgi.80/upload.wsgi + WSGIScriptAlias /onyfxfr/upload/do /var/www.xfr/wsgi.80/upload.wsgi + WSGIScriptAlias /ubisxfr/upload/do /var/www.xfr/wsgi.80/upload.wsgi + + + + Require all granted + + + -- 2.54.0