Package: freedombox-setup
Version: 0.3
Severity: wishlist
Tags: patch

The next version of Plinth (after v0.4.5) will be able to install and
configure jwchat and ejabberd on its own:
https://github.com/freedombox/Plinth/pull/143

The attached patch will remove jwchat setup and first-run scripts. I
left the jwchat and xmpp-server tests, but added some checks to see if
those tests should be run.
diff --git a/first-run.d/85_jwchat b/first-run.d/85_jwchat
deleted file mode 100755
index ed4dbf8..0000000
--- a/first-run.d/85_jwchat
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-ejabberdctl stop
-service ejabberd stop
-
-# Generate new SSL certificates.
-rm -f /etc/ejabberd/ejabberd.pem
-DEBIAN_FRONTEND=noninteractive dpkg-reconfigure ejabberd
diff --git a/setup.d/85_jwchat b/setup.d/85_jwchat
deleted file mode 100755
index d3fb02c..0000000
--- a/setup.d/85_jwchat
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-#
-# Set up jwchat to work out of the box.
-
-set -e
-
-# Set hostname for ejabberd and jwchat
-echo "ejabberd ejabberd/hostname string `cat /etc/hostname`" | debconf-set-selections
-echo "jwchat jwchat/ApacheServerName string `cat /etc/hostname`" | debconf-set-selections
-
-# An alternative XMPP server is prosody
-apt-get install -y jwchat ejabberd
-
-# setup jwchat apache conf
-cat > /etc/apache2/conf-available/jwchat.conf <<'EOF'
-Alias /jwchat /usr/share/jwchat/www
-
-<Directory /usr/share/jwchat/www>
-    Options +Indexes +Multiviews +FollowSymLinks
-</Directory>
-
-# proxy for BOSH server
-ProxyPass /http-bind/ http://localhost:5280/http-bind/
-ProxyPassReverse /http-bind/ http://localhost:5280/http-bind/
-<Proxy http://localhost:5280/http-bind/*>
-    Allow from all
-</Proxy>
-EOF
-
-a2dissite jwchat
-a2enconf jwchat
-
-# Remove SSL keys from images, will be generated on first boot.
-rm -f /etc/ejabberd/ejabberd.pem
diff --git a/testsuite/jwchat.test b/testsuite/jwchat.test
index 38e24fa..8636f7b 100755
--- a/testsuite/jwchat.test
+++ b/testsuite/jwchat.test
@@ -1,5 +1,10 @@
 #!/bin/sh
 
+if [ ! -e /etc/apache2/conf-enabled/jwchat.conf ] ; then
+    echo "Skipping jwchat tests: jwchat is not enabled."
+    exit 1
+fi
+
 . $(dirname $0)/testsuite-functions
 
 
diff --git a/testsuite/xmpp-server.test b/testsuite/xmpp-server.test
index 61a5e8e..c1c5640 100755
--- a/testsuite/xmpp-server.test
+++ b/testsuite/xmpp-server.test
@@ -1,5 +1,10 @@
 #!/bin/sh
 
+if ! which ejabberdctl ; then
+    echo "Skipping xmpp-server tests: ejabberd is not installed."
+    exit 1
+fi
+
 . $(dirname $0)/testsuite-functions
 
 netstat_check xmpp-client tcp XMPP

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to