Added git.pm.
authorZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Mon, 7 Mar 2022 13:50:02 +0000 (14:50 +0100)
committerZoltán Felleg <zoltan.felleg@userrendszerhaz.hu>
Mon, 7 Mar 2022 13:50:02 +0000 (14:50 +0100)
sources/git.pm/c3d/firstboot/scripts/01_setupnetworking.sh [new file with mode: 0755]
sources/git.pm/c3d/firstboot/scripts/02_settimezone.sh [new file with mode: 0755]
sources/git.pm/c3d/firstboot/scripts/90_setupservices.sh [new file with mode: 0755]
sources/git.pm/c3d/mode.txt [new file with mode: 0644]
sources/git.pm/c3d/postinstall/install-data/etc/httpd/conf.d/git.conf [new file with mode: 0644]
sources/git.pm/c3d/postinstall/scripts/10_setupservices.sh [new file with mode: 0755]
sources/git.pm/config [new file with mode: 0644]
sources/git.pm/envvars [new file with mode: 0644]
sources/start-order.txt

diff --git a/sources/git.pm/c3d/firstboot/scripts/01_setupnetworking.sh b/sources/git.pm/c3d/firstboot/scripts/01_setupnetworking.sh
new file mode 100755 (executable)
index 0000000..701a5a5
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+
+sleep 1
+systemctl --quiet is-active NetworkManager.service
+NM_RC=$?
+CYCLES_WAITED=0
+while [ $NM_RC -ne 0 ]
+do
+    if [ $CYCLES_WAITED -ge 10 ]
+    then
+        exit 1
+    fi
+    echo -n .
+    sleep 1
+    CYCLES_WAITED=$(( $CYCLES_WAITED + 1 ))
+    systemctl --quiet is-active NetworkManager.service
+    NM_RC=$?
+done
+[ $CYCLES_WAITED -gt 0 ] && echo
+
+# 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
+    if [ $CYCLES_WAITED -ge 10 ]
+    then
+        nmcli connection show
+        exit 1
+    fi
+    echo -n .
+    sleep 1
+    CYCLES_WAITED=$(( $CYCLES_WAITED + 1 ))
+    CONNECTION_DEVICES_UP=$(nmcli --terse connection show \
+                                | grep --invert-match ':$' | wc -l)
+done
+[ $CYCLES_WAITED -gt 0 ] && echo
+
+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 ':')
+CONNECTION_DEVICE=$(echo $CONNECTION_LINE | cut -f 4 -d ':')
+
+nmcli connection delete uuid "$CONNECTION_UUID"
+
+nmcli connection add \
+    connection.autoconnect yes \
+    connection.id perimeter \
+    connection.interface-name $CONNECTION_DEVICE \
+    connection.type 802-3-ethernet \
+    ipv4.addresses "192.168.173.79/24" \
+    ipv4.dns "192.168.173.174" \
+    ipv4.dns-search "pm.useribm.hu" \
+    ipv4.gateway "192.168.173.254" \
+    ipv4.method "manual" \
+    ipv4.routes "10.228.0.0/16 192.168.173.1" \
+    ipv6.addresses "2a02:d400:0000:f2ad:000c:18ff:fe03:ad4f/64" \
+    ipv6.dns "2a02:d400:0000:f2ad:000c:18ff:fe03:adae" \
+    ipv6.dns-search "pm.useribm.hu" \
+    ipv6.gateway "2a02:d400:0000:f2ad:000c:18ff:fe03:adfe" \
+    ipv6.routes "2a02:d400:0000:f268::/64 2a02:d400:0000:f2ad:000c:18ff:fe03:ad01" \
+    ipv6.method "manual" \
+    save yes
+
+nmcli connection show
diff --git a/sources/git.pm/c3d/firstboot/scripts/02_settimezone.sh b/sources/git.pm/c3d/firstboot/scripts/02_settimezone.sh
new file mode 100755 (executable)
index 0000000..20b2a71
--- /dev/null
@@ -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/git.pm/c3d/firstboot/scripts/90_setupservices.sh b/sources/git.pm/c3d/firstboot/scripts/90_setupservices.sh
new file mode 100755 (executable)
index 0000000..c8815a0
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+
+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/git.pm/c3d/mode.txt b/sources/git.pm/c3d/mode.txt
new file mode 100644 (file)
index 0000000..d0ff0b1
--- /dev/null
@@ -0,0 +1,3 @@
+# mode file (relative to /c3d)
+755 firstboot/scripts/*.sh
+755 postinstall/scripts/*.sh
diff --git a/sources/git.pm/c3d/postinstall/install-data/etc/httpd/conf.d/git.conf b/sources/git.pm/c3d/postinstall/install-data/etc/httpd/conf.d/git.conf
new file mode 100644 (file)
index 0000000..d8bd2bd
--- /dev/null
@@ -0,0 +1,29 @@
+<VirtualHost *:80>
+    ServerName git.pm.useribm.hu
+    ServerAdmin siteadmin@useribm.hu
+
+    SetEnv GIT_PROJECT_ROOT /git
+    SetEnv GIT_HTTP_EXPORT_ALL
+
+    DocumentRoot /git
+    ScriptAlias / /usr/libexec/git-core/git-http-backend/
+
+    <Directory "/usr/libexec/git-core">
+        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+        AllowOverride None
+        Require all granted
+    </Directory>
+
+    <Directory "/git">
+        AuthName "Git"
+        AuthType Digest
+        AuthDigestProvider file
+        AuthUserFile /git/auth.htdigest
+        Require valid-user
+
+        Dav On
+        Options Indexes FollowSymLinks
+        AllowOverride None
+        Require all granted
+    </Directory>
+</VirtualHost>
diff --git a/sources/git.pm/c3d/postinstall/scripts/10_setupservices.sh b/sources/git.pm/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/git.pm/config b/sources/git.pm/config
new file mode 100644 (file)
index 0000000..aad5606
--- /dev/null
@@ -0,0 +1,22 @@
+lxc.include = /usr/share/lxc/config/common.conf
+
+lxc.arch = x86_64
+lxc.uts.name = git.pm.useribm.hu
+lxc.rootfs.path = __CONTAINER_PATH__/rootfs
+lxc.mount.auto = proc:rw sys:ro
+lxc.mount.entry = __CONTAINER_FILESYSTEMS_PATH__ git none bind,create=dir 0 0
+
+lxc.net.0.type = veth
+lxc.net.0.flags = up
+lxc.net.0.link = brch-dev
+lxc.net.0.hwaddr = 02:0c:18:03:ad:4f
+
+lxc.autodev = 1
+
+lxc.cgroup2.devices.allow = a
+
+lxc.signal.halt = SIGRTMIN+4
+
+lxc.start.auto = 1
+lxc.start.order = __CONTAINER_START_ORDER__
+lxc.start.delay = 5
diff --git a/sources/git.pm/envvars b/sources/git.pm/envvars
new file mode 100644 (file)
index 0000000..30a7bb0
--- /dev/null
@@ -0,0 +1,3 @@
+DISTRIBUTION=Fedora
+DISTRIBUTION_VERSION=35
+SPEC_PACKAGES="cronie git-all httpd"
index 8a9343cebbbee225348dd59e29435a28287b4e85..a144514e4f28cd3094947c4832046b2d56b6473f 100644 (file)
@@ -30,5 +30,10 @@ group 6:
   wiki.in      55
 
 group 7:
-  dhsvn.in     61
-  pastry.in    62
+  git.pm       61
+  hg.pm                62
+  svn.pm       63
+
+group 8:
+  dhsvn.in     71
+  pastry.in    72