Add gnu-social bits
authorJohn Dulaney <jdulaney@fedoraproject.org>
Tue, 15 Dec 2015 22:29:20 +0000 (17:29 -0500)
committerJohn Dulaney <jdulaney@fedoraproject.org>
Tue, 15 Dec 2015 22:29:20 +0000 (17:29 -0500)
Signed-off-by: John Dulaney <jdulaney@fedoraproject.org>
class/50-host-classes
scripts/GNUSOCIAL/10_download_gnusocial.sh [new file with mode: 0644]

index 6a05aedf82ed4356647438976b4bb28a70ac00e1..572f74eefb86e1fb64fe9c6693218354aa508b00 100755 (executable)
@@ -69,7 +69,7 @@ case $HOSTNAME in
        echo "FAIBASE WWW CIVICRM SYSADMIN VM MYSQLD"
        ;;
     gnusocial*)
-       echo "FAIBASE WWW SYSADMIN VM MYSQLD"
+       echo "FAIBASE WWW SYSADMIN VM MYSQLD GNUSOCIAL"
        ;;
     nagios*)
        echo "FAIBASE SYSADMIN VM MYSQLD NAGIOS WWW"
diff --git a/scripts/GNUSOCIAL/10_download_gnusocial.sh b/scripts/GNUSOCIAL/10_download_gnusocial.sh
new file mode 100644 (file)
index 0000000..d173de6
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/bash
+
+# Download gnusocial directly from their download source, as it is the recommended route and there is no repo
+if ! $ROOTCMD getent passwd gnusocial ; then
+    $ROOTCMD adduser --system --ingroup www-data --disabled-password --gecos "gnusocial user" gnusocial
+fi
+
+if ! $ROOTCMD test -e /home/gnusocial/.ssh/id_rsa; then
+    $ROOTCMD echo | $ROOTCMD sudo -u gnusocial ssh-keygen -N ''
+fi
+
+if ! $ROOTCMD echo | cd /home/gnusocial/ 
+    git clone https://git.gnu.io/gnu/gnu-social.git /home/gnusocial/gnu-social; then
+    rm -rf /home/gnusocial/gnu-social/.git
+    mv /home/gnusocial/gnu-social/* /var/www/html
+fi