Da meine Collide-Installation auf meinem neuen Server jetzt schon recht stabil läuft, möchte Ich hier die dazugehörigen Konfigurationen bloggen. Collide ist eine kollaborative WebIDE die vor nicht allzu langer Zeit von Google opensourced wurde. Im Gegensatz zu Etherpad Lite, besitzt Collide einen integrierten FileBrowser, Autocompletion, Syntax Higlightning und Echtzeit-IO auf die Projektdateien, die auf dem Server bearbeitet werden. Bei mehr als 3 Teilnehmern kann es aktuell aber noch zu abstürzen des Programmes kommen, das jedoch aber keinen Dateiverlust zur folge hat. Obwohl Debian Squeeze Packete ohne Backport-Repos ziemlich “veraltet” sind, lässt sich Collide trotzdem benutzen:

Installieren der Abhängigkeiten:

aptitude install openjdk-6-jdk openjdk-6-jre an

Download Google Collide from Google Code

cd /usr/local
mkdir collide
wget http://collide.googlecode.com/files/collide-dist-2012-07-07.tar.bz2
tar xvf -C collide collide-dist-2012-07-07.tar.bz2
ln -s collide/collide /usr/bin/collide
echo -e '#!/bin/bash\n/opt/collide/collide \$@' > /usr/bin/collide
chmod a+x /usr/bin/collide

Anlegen der Initscript-Datei:

#!/bin/bash
### BEGIN INIT INFO
# Provides:          collide
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts collide server
# Description:       starts collide server using start-stop-daemon
### END INIT INFO
# configuration
COLLIDE_BIN="/usr/bin/collide"
COLLIDE_OPTS=""
COLLIDE_LOG="/var/log/collide.log"
COLLIDE_PROJECTPATH="/home/tetamuve/projects"
USER="tetamuve"
# commands
CMD_ECHO="/bin/echo"
CMD_GREP="/bin/grep"
CMD_SLEEP="/bin/sleep"
CMD_KILLALL="/usr/bin/killall"
collide_start() {
        $CMD_ECHO "Starting Collide..."
        start-stop-daemon --quiet --start --background --chuid "$USER" --chdir "$COLLIDE_PROJECTPATH" --exec $COLLIDE_BIN >> $COLLIDE_LOG
}
collide_stop() {
        $CMD_ECHO "Stopping Collide..."
        # CAUTIONÂ : maybe you kill something important in your server
        $CMD_KILLALL java
}
case $1 in
        start)
                collide_start
                ;;
        stop)
                collide_stop
                ;;
        restart)
                collide_stop
                $CMD_SLEEP 5
                collide_start
                ;;
        *)
                $CMD_ECHO "Use: $0 {start|stop|restart}"
                exit 1
                ;;
esac
exit 0

Collide automatisch beim Hochfahren des Servers starten:

chmod +x /etc/init.d/collide
update-rc.d collide defaults 95

Nginx Konfiguration für z.B. collide.example.com:

server {
        server_name collide.example.com;

        access_log /var/log/nginx/collide.example.com.access.log;
        error_log  /var/log/nginx/collide.example.com.error.log info;

        location / {
                auth_basic            "Restricted";
                auth_basic_user_file  security/etherpad_htpasswd;
                proxy_pass         http://127.0.0.1:8080/;
                proxy_redirect     off;

                proxy_set_header   Host             $host;
                proxy_set_header   X-Real-IP        $remote_addr;
                proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
                proxy_buffering off;
        }

}

Das ganze noch starten :)

/etc/init.d/collide start
ln -s /etc/nginx/sites-available/collide.example.com /etc/nginx/sites-enabled/
/etc/init.d/nginx restart

Et voilà: 

Achja, ein ziemlich schickes Buildscript hab Ich auch noch im ArchLinux User Repository (AUR) hochgeladen: http://aur.archlinux.org/packages.php?ID=60577

Enjoy!

💬 Are you interested in our work or have some questions? Join us in our public Signal chat pi crew 👋
🪙 If you like our work or want to supprot us, you can donate MobileCoins to our address.