Updated wiki.in (converted to the new c3d format).
authorZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Fri, 20 Jan 2023 18:11:54 +0000 (19:11 +0100)
committerZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Fri, 20 Jan 2023 18:11:54 +0000 (19:11 +0100)
20 files changed:
sources/wiki.in/c3d/firstboot/scripts/01_setupnetworking.sh [moved from sources/wiki.in/firstboot/01_setupnetworking.sh with 62% similarity]
sources/wiki.in/c3d/firstboot/scripts/02_settimezone.sh [moved from sources/wiki.in/firstboot/02_settimezone.sh with 100% similarity]
sources/wiki.in/c3d/firstboot/scripts/90_setupservices.sh [moved from sources/wiki.in/postinstall/10_setupservices.sh with 53% similarity]
sources/wiki.in/c3d/mode.txt [new file with mode: 0644]
sources/wiki.in/c3d/owner.txt [new file with mode: 0644]
sources/wiki.in/c3d/postinstall/install-data/etc/dokuwiki/local.php [moved from sources/wiki.in/postinstall/install/etc/dokuwiki/local.php with 100% similarity]
sources/wiki.in/c3d/postinstall/install-data/etc/dokuwiki/users.auth.php [moved from sources/wiki.in/postinstall/install/etc/dokuwiki/users.auth.php with 100% similarity]
sources/wiki.in/c3d/postinstall/install-data/etc/httpd/conf.d/dokuwiki.conf [moved from sources/wiki.in/postinstall/install/etc/httpd/conf.d/dokuwiki.conf with 100% similarity]
sources/wiki.in/c3d/postinstall/scripts/10_setupservices.sh [new file with mode: 0755]
sources/wiki.in/c3d/postinstall/scripts/20_setupdokuwiki.sh [new file with mode: 0755]
sources/wiki.in/envvars
sources/wiki.in/firstboot/03_setupldap.sh [deleted file]
sources/wiki.in/firstboot/10_certbot.sh [deleted file]
sources/wiki.in/firstboot/99_cleanup.sh [deleted file]
sources/wiki.in/postinstall/01_setownership.sh [deleted file]
sources/wiki.in/postinstall/02_setpermissions.sh [deleted file]
sources/wiki.in/postinstall/03_setdate.sh [deleted file]
sources/wiki.in/postinstall/04_installfiles.sh [deleted file]
sources/wiki.in/postinstall/99_cleanup.sh [deleted file]
sources/wiki.in/postinstall/copy.list [deleted file]

similarity index 62%
rename from sources/wiki.in/firstboot/01_setupnetworking.sh
rename to sources/wiki.in/c3d/firstboot/scripts/01_setupnetworking.sh
index c2e9701c203ee2c4be752d077e41d7f54ca7735c..3d6d32ffd6c1f2e441fb0cc384b8a70ade17b4fa 100755 (executable)
@@ -1,37 +1,52 @@
 #!/bin/sh
 
 
+export PAGER=
+
+
 sleep 1
 systemctl --quiet is-active NetworkManager.service
 NM_RC=$?
-WAITED=0
+CYCLES_WAITED=0
 while [ $NM_RC -ne 0 ]
 do
+    if [ $CYCLES_WAITED -ge 10 ]
+    then
+        exit 1
+    fi
     echo -n .
     sleep 1
-    WAITED=1
+    CYCLES_WAITED=$(( $CYCLES_WAITED + 1 ))
     systemctl --quiet is-active NetworkManager.service
     NM_RC=$?
 done
-[ $WAITED -eq 1 ] && echo
+[ $CYCLES_WAITED -gt 0 ] && echo
 
-CONNECTIONS=$(nmcli --terse connection show | wc -l)
-while [ $CONNECTIONS -ne 1 ]
+# wait for one/the network connection to come up
+CONNECTION_DEVICES_UP=$(nmcli --terse connection show \
+                            | grep --invert-match ':$' | wc -l)
+CYCLES_WAITED=0
+while [ $CONNECTION_DEVICES_UP -lt 1 ]
 do
-    echo "Number of connections: $CONNECTIONS" >&2
+    if [ $CYCLES_WAITED -ge 10 ]
+    then
+        nmcli connection show
+        exit 1
+    fi
+    echo -n .
     sleep 1
-    CONNECTIONS=$(nmcli --terse connection show | wc -l)
+    CYCLES_WAITED=$(( $CYCLES_WAITED + 1 ))
+    CONNECTION_DEVICES_UP=$(nmcli --terse connection show \
+                                | grep --invert-match ':$' | wc -l)
 done
+[ $CYCLES_WAITED -gt 0 ] && echo
 
-nmcli --terse connection show | grep ':$' >/dev/null
-ALL_CONNECTION_DEVICES_KNOWN=$?
-while [ $ALL_CONNECTION_DEVICES_KNOWN -eq 0 ]
-do
-    echo "Not all connection devices are known yet" >&2
-    sleep 1
-    nmcli --terse connection show | grep ':$' >/dev/null
-    ALL_CONNECTION_DEVICES_KNOWN=$?
-done
+CONNECTIONS=$(nmcli --terse connection show | wc -l)
+if [ $CONNECTIONS -ne 1 ]
+then
+    echo "Number of connections: $CONNECTIONS" >&2
+    exit 1
+fi
 
 CONNECTION_LINE=$(nmcli --terse connection show)
 CONNECTION_UUID=$(echo $CONNECTION_LINE | cut -f 2 -d ':')
similarity index 53%
rename from sources/wiki.in/postinstall/10_setupservices.sh
rename to sources/wiki.in/c3d/firstboot/scripts/90_setupservices.sh
index d786dbc7ca41b78e9ddf20c5b023aad2eea8056f..4853c4e8aee58c293e60889d79de3248960327a7 100755 (executable)
@@ -2,7 +2,10 @@
 
 
 systemctl enable httpd.service
-
+systemctl start httpd.service
 systemctl enable NetworkManager-wait-online.service
+systemctl start NetworkManager-wait-online.service
 
 systemctl enable logrotate.timer
+systemctl start logrotate.timer
+
diff --git a/sources/wiki.in/c3d/mode.txt b/sources/wiki.in/c3d/mode.txt
new file mode 100644 (file)
index 0000000..f6932c9
--- /dev/null
@@ -0,0 +1,4 @@
+# mode file (relative to /c3d)
+755 firstboot/scripts/*.sh
+755 postinstall/scripts/*.sh
+
diff --git a/sources/wiki.in/c3d/owner.txt b/sources/wiki.in/c3d/owner.txt
new file mode 100644 (file)
index 0000000..6fb584b
--- /dev/null
@@ -0,0 +1,2 @@
+# owner file (relative to /c3d)
+apache:apache postinstall/install-data/etc/dokuwiki/*
diff --git a/sources/wiki.in/c3d/postinstall/scripts/10_setupservices.sh b/sources/wiki.in/c3d/postinstall/scripts/10_setupservices.sh
new file mode 100755 (executable)
index 0000000..4cec25f
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+
+systemctl disable httpd.service
+systemctl disable NetworkManager-wait-online.service
+
+systemctl disable logrotate.timer
diff --git a/sources/wiki.in/c3d/postinstall/scripts/20_setupdokuwiki.sh b/sources/wiki.in/c3d/postinstall/scripts/20_setupdokuwiki.sh
new file mode 100755 (executable)
index 0000000..0f9cc73
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+
+touch /etc/dokuwiki/local.php
index ef5b8a5f824203103892e40482c8f31fcc964e36..48a1b9985a1fd331cd995357db4e553dbbc9dc56 100644 (file)
@@ -1,5 +1,3 @@
 DISTRIBUTION=Fedora
 DISTRIBUTION_VERSION=37
-ROOT_PACKAGES="hostname initscripts iproute rootfiles systemd-udev"
-BASE_PACKAGES="NetworkManager iputils logrotate rsyslog tar vim-minimal"
-SPEC_PACKAGES="dokuwiki httpd mod_ssl php-ldap python3-certbot-apache"
+SPEC_PACKAGES="dokuwiki httpd php php-fpm php-ldap"
diff --git a/sources/wiki.in/firstboot/03_setupldap.sh b/sources/wiki.in/firstboot/03_setupldap.sh
deleted file mode 100755 (executable)
index 415d6db..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-
-exit 0
-authselect select sssd with-mkhomedir --force
-
-cat >>/etc/openldap/ldap.conf <<EOF
-BASE dc=user,dc=hu
-URI ldap://ldap.in.useribm.hu
-EOF
diff --git a/sources/wiki.in/firstboot/10_certbot.sh b/sources/wiki.in/firstboot/10_certbot.sh
deleted file mode 100755 (executable)
index 7015757..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-exit 0
-
-
-for f in /etc/httpd/conf.d/*.le
-do
-    cf=$(echo $f | sed 's/^\(.*\).le$/\1/')
-    mv $f $cf
-done
-/usr/bin/cp \
-    --archive \
-    /usr/lib/python3.10/site-packages/certbot_apache/_internal/tls_configs/current-options-ssl-apache.conf \
-    /etc/letsencrypt/options-ssl-apache.conf
-systemctl enable httpd.service
-systemctl start httpd.service
diff --git a/sources/wiki.in/firstboot/99_cleanup.sh b/sources/wiki.in/firstboot/99_cleanup.sh
deleted file mode 100755 (executable)
index b87f2f4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-
-echo rm -Rf $REAL_PATH
diff --git a/sources/wiki.in/postinstall/01_setownership.sh b/sources/wiki.in/postinstall/01_setownership.sh
deleted file mode 100755 (executable)
index f2e6b94..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-SOURCE_PATH=$REAL_PATH/install
-
-chown -R root.root $SOURCE_PATH/*
diff --git a/sources/wiki.in/postinstall/02_setpermissions.sh b/sources/wiki.in/postinstall/02_setpermissions.sh
deleted file mode 100755 (executable)
index ae5578a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-SOURCE_PATH=$REAL_PATH/install
-
-chown apache.apache $SOURCE_PATH/etc/dokuwiki/*
diff --git a/sources/wiki.in/postinstall/03_setdate.sh b/sources/wiki.in/postinstall/03_setdate.sh
deleted file mode 100755 (executable)
index 46d35e9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-SOURCE_PATH=$REAL_PATH/install
-
-touch $SOURCE_PATH/etc/dokuwiki/local.php
diff --git a/sources/wiki.in/postinstall/04_installfiles.sh b/sources/wiki.in/postinstall/04_installfiles.sh
deleted file mode 100755 (executable)
index e4ee7ff..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-
-tar --create \
-    --directory=$REAL_PATH \
-    --exclude=.placeholder \
-    --to-stdout \
-    install \
-    | tar --extract \
-          --backup \
-          --directory=/ \
-          --no-overwrite-dir \
-          --strip-components=1 \
-          --suffix=.orig
diff --git a/sources/wiki.in/postinstall/99_cleanup.sh b/sources/wiki.in/postinstall/99_cleanup.sh
deleted file mode 100755 (executable)
index b87f2f4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-
-REAL_PATH=$(dirname $(realpath $0))
-
-echo rm -Rf $REAL_PATH
diff --git a/sources/wiki.in/postinstall/copy.list b/sources/wiki.in/postinstall/copy.list
deleted file mode 100644 (file)
index 2bbc234..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ws.pm.useribm.hu /etc/letsencrypt etc