summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge2017-12-22 16:58:37 +0100
committerDavid Runge2017-12-22 16:58:37 +0100
commite7889cf70aa07d63b5198c87ba66ad9ea06ece7d (patch)
tree14eee766d5068d982b5ee0d67be63186d52c1ff0
parent0cc657461b7220674a2a75a01bfbf31873037a32 (diff)
downloadaur-e7889cf70aa07d63b5198c87ba66ad9ea06ece7d.tar.gz
PKGBUILD: Updating to 1.6.2. Switching to static install by using systemd-sysusers, StateDirectory and systemd-tmpfiles.
Removing unneeded scripts and directly running server.js via node. etherpad-lite.service: Moving to user/group etherpad-lite. Adding StateDirectory, CacheDirectory, LogDirectory and security features. etherpad-lite-tmpfiles.conf: Adding configuration for tmpfiles.d for configuration files in /etc/etherpad-lite. etherpad-lite-sysusers.conf: Adding user/group etherpad-lite as DynamicUser. etherpad-lite.install: Removing obsolete install file.
-rw-r--r--.SRCINFO35
-rw-r--r--PKGBUILD145
-rw-r--r--etherpad-lite-sysusers.conf1
-rw-r--r--etherpad-lite-tmpfiles.conf9
-rw-r--r--etherpad-lite.install65
-rw-r--r--etherpad-lite.service17
6 files changed, 142 insertions, 130 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7e37a38465dd..b6e3d88c54e4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,30 +1,35 @@
+# Generated by mksrcinfo v8
+# Fri Dec 22 15:54:30 UTC 2017
pkgbase = etherpad-lite
pkgdesc = Lightweight fork of etherpad based on javascript
- pkgver = 1.6.1
+ pkgver = 1.6.2
pkgrel = 1
epoch = 1
url = http://etherpad.org
- install = etherpad-lite.install
arch = any
- license = GPL2
- depends = curl
- depends = python2
- depends = openssl
+ license = Apache
+ makedepends = npm
depends = nodejs
- depends = npm
- depends = git
- depends = npm
- depends = icu
+ depends = coffeescript
+ depends = gnuplot
optdepends = sqlite: to use sqlite as databse
optdepends = mariadb: to use mariadb as database
optdepends = postgresql: to use postgresql as database
+ optdepends = abiword: advanced import/export of pads
+ optdepends = libreoffice: advanced import/export of pads
+ optdepends = tidy: improve quality of exported pads
conflicts = etherpad-lite-git
- backup = usr/share/webapps/etherpad-lite/settings.json
- backup = etc/webapps/etherpad-lite/settings.json
- source = etherpad-lite-1.6.1.tar.gz::https://github.com/ether/etherpad-lite/archive/1.6.1.tar.gz
+ backup = etc/etherpad-lite/settings.json
+ source = etherpad-lite-1.6.2.tar.gz::https://github.com/ether/etherpad-lite/archive/1.6.2.tar.gz
+ source = jquery.js::https://code.jquery.com/jquery-1.9.1.js
+ source = etherpad-lite-sysusers.conf
+ source = etherpad-lite-tmpfiles.conf
source = etherpad-lite.service
- sha512sums = 183fa403b125cf0203dd6d9e8911d09bf597b815bf52214d1b320e0efd2a64255e25d4233629b1febe6fe11f512bb90db863fe7ef5e4a209dc65ea161237a8eb
- sha512sums = 7b775171da97a3e7ad44a2b1b319970fd307a88e90a171c49bf70d2382767175e98bb21c7054e38ee6c066bd2dfadf94d28a9ff31d4f21145ec4441caa13c4d7
+ sha512sums = 58e996bde1992b9a05d27f2d56b15107c1eadf40164ed5e0645f245fe9040dcd40f6bd78feb842a9e1a8a44a232bbbeb80686e8d1564a8e67f74b44f942c0e55
+ sha512sums = d62700e7a1ff41f9d6326ca024ba2be1d391bc8fbb2aeae0f427d74837899b230940bf7c2df3d193f5300a68bb3686706d4c31328234b5cda026a1bf52ef9e70
+ sha512sums = ca3588610b2d8abc67ef1bd83a079f49e0b980768e1f968869be01721026506ed15cf280cac5a60c26b2bb7a248ffffb78883eced89581e982260efad1af68a3
+ sha512sums = 31a411f8a93ec2bbd854545cce80eaf435b75432f876ac81df0a6d4ba2bc8437a7b9196456cb04b0a5c9b29d013be7f35501f0af48de5c2fe261d12adb3a1895
+ sha512sums = b54ea26a6918c817b58d950fb9afa07e069b8d2e8c343017a9e52cd17221710fcf9c875e1f8089b773df0ed5de419e6db2c379259863fb6f15afe6ca14bec06b
pkgname = etherpad-lite
diff --git a/PKGBUILD b/PKGBUILD
index 930b4a00ebef..a5fef0974e05 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,66 +1,123 @@
-# Contributions by: Timothée Ravier <tim@siosm.fr>, Jonas Heinrich <onny@project-insanity.org>
-# Maintainer: Ruben Kelevra <ruben@freifunk-nrw.de>
+# Maintainer: David Runge <dave@sleepmap.de>
+# Contributor: Ruben Kelevra <ruben@freifunk-nrw.de>
+# Contributor: Timothée Ravier <tim@siosm.fr>
+# Contributor: Jonas Heinrich <onny@project-insanity.org>
+_jqueryver=1.9.1
pkgname=etherpad-lite
-pkgver=1.6.1
+pkgver=1.6.2
pkgrel=1
epoch=1
pkgdesc="Lightweight fork of etherpad based on javascript"
arch=(any)
url="http://etherpad.org"
-_watch=('http://etherpad.org','Documentation <small>v([\d.]*)</small>')
-license=('GPL2')
-depends=('curl' 'python2' 'openssl' 'nodejs' 'npm' 'git' 'npm' 'icu')
+license=('Apache')
+depends=('nodejs' 'coffeescript' 'gnuplot')
+makedepends=('npm')
optdepends=('sqlite: to use sqlite as databse'
'mariadb: to use mariadb as database'
- 'postgresql: to use postgresql as database')
+ 'postgresql: to use postgresql as database'
+ 'abiword: advanced import/export of pads'
+ 'libreoffice: advanced import/export of pads'
+ 'tidy: improve quality of exported pads')
conflicts=('etherpad-lite-git')
-backup=('usr/share/webapps/etherpad-lite/settings.json'
- 'etc/webapps/etherpad-lite/settings.json')
-install='etherpad-lite.install'
+backup=("etc/${pkgname}/settings.json")
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/ether/${pkgname}/archive/${pkgver}.tar.gz"
- "etherpad-lite.service")
-sha512sums=('183fa403b125cf0203dd6d9e8911d09bf597b815bf52214d1b320e0efd2a64255e25d4233629b1febe6fe11f512bb90db863fe7ef5e4a209dc65ea161237a8eb'
- '7b775171da97a3e7ad44a2b1b319970fd307a88e90a171c49bf70d2382767175e98bb21c7054e38ee6c066bd2dfadf94d28a9ff31d4f21145ec4441caa13c4d7')
+ "jquery.js::https://code.jquery.com/jquery-${_jqueryver}.js"
+ "${pkgname}-sysusers.conf"
+ "${pkgname}-tmpfiles.conf"
+ "${pkgname}.service")
+sha512sums=('58e996bde1992b9a05d27f2d56b15107c1eadf40164ed5e0645f245fe9040dcd40f6bd78feb842a9e1a8a44a232bbbeb80686e8d1564a8e67f74b44f942c0e55'
+ 'd62700e7a1ff41f9d6326ca024ba2be1d391bc8fbb2aeae0f427d74837899b230940bf7c2df3d193f5300a68bb3686706d4c31328234b5cda026a1bf52ef9e70'
+ 'ca3588610b2d8abc67ef1bd83a079f49e0b980768e1f968869be01721026506ed15cf280cac5a60c26b2bb7a248ffffb78883eced89581e982260efad1af68a3'
+ '31a411f8a93ec2bbd854545cce80eaf435b75432f876ac81df0a6d4ba2bc8437a7b9196456cb04b0a5c9b29d013be7f35501f0af48de5c2fe261d12adb3a1895'
+ 'b54ea26a6918c817b58d950fb9afa07e069b8d2e8c343017a9e52cd17221710fcf9c875e1f8089b773df0ed5de419e6db2c379259863fb6f15afe6ca14bec06b')
prepare() {
- cd "${srcdir}/${pkgname}-${pkgver}"
+ cd "${pkgname}-${pkgver}"
+ # create needed initializing file
+ touch src/.ep_initialized
+ # create custom js and css from templates
+ cp src/static/custom/js.template src/static/custom/index.js
+ cp src/static/custom/js.template src/static/custom/pad.js
+ cp src/static/custom/js.template src/static/custom/timeslider.js
+ cp src/static/custom/css.template src/static/custom/index.css
+ cp src/static/custom/css.template src/static/custom/pad.css
+ cp src/static/custom/css.template src/static/custom/timeslider.css
-#No patches included
+ # write dirty.db to StateDirectory by default
+ sed -i 's/var\/dirty.db/\/var\/lib\/etherpad-lite\/dirty.db/g' \
+ settings.json.template
-# for s in "${source[@]}"; do
-# case "$s" in (*.patch)
-# cp "../${s}" .
-# patch -p0 < "${s}"
-# rm -f "${s}"
-# esac
-# done
+ # create needed symlink because setup is weird
+ mkdir node_modules && cd node_modules
+ ln -s ../src "ep_${pkgname}"
}
build() {
- cd "$pkgname-$pkgver"
- export PYTHON=python2
- ./bin/installDeps.sh
+ cd "${pkgname}-${pkgver}"
+
+ # generating html documentation
+ node bin/doc/generate doc/index.md --format=html \
+ --template=doc/template.html > documentation.html
+
+ cd src
+ # required node modules
+ npm install --cache "${srcdir}/npm-cache"
}
package() {
- cd "$pkgname-$pkgver"
- echo 'cleaning up unneeded files...'
- rm bin/installOnWindows.bat start.bat bin/buildDebian.sh bin/buildForWindows.sh
- rm -r var bin/deb-src doc tests
- echo 'move files...'
- install -dm 755 "${pkgdir}"/usr/share/webapps/${pkgname}
- cp -a . "${pkgdir}"/usr/share/webapps/${pkgname}
- mkdir -p "${pkgdir}"/etc/webapps/${pkgname}/
- mv "${pkgdir}"/usr/share/webapps/etherpad-lite/settings.json "${pkgdir}"/etc/webapps/${pkgname}/settings.json
- ln -s /etc/webapps/${pkgname}/settings.json "${pkgdir}"/usr/share/webapps/${pkgname}/settings.json
- install -Dm644 "${srcdir}"/${pkgname}.service "${pkgdir}"/usr/lib/systemd/system/${pkgname}.service
- install -D LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
- echo "setting rights..."
- #touch "${pkgdir}"/usr/share/webapps/etherpad-lite/APIKEY.txt
- find "${pkgdir}"/usr/share/webapps/etherpad-lite \
- \( -type f -exec chmod ug+rw,o+r {} \; \) , \
- \( -type d -exec chmod ug+rwxs,o+rx {} \; \)
- chmod u+x "${pkgdir}"/usr/share/webapps/etherpad-lite/bin/run.sh
- chmod u+x "${pkgdir}"/usr/share/webapps/etherpad-lite/bin/installDeps.sh
+ cd "${pkgname}-${pkgver}"
+ # install initialization file
+ install -t "${pkgdir}/usr/share/${pkgname}/src/" -Dm644 \
+ "src/.ep_initialized"
+
+ # node modules
+ mv node_modules "${pkgdir}/usr/share/${pkgname}/"
+
+ # custom js and css templates
+ install -t "${pkgdir}/etc/${pkgname}/custom" -Dm0640 \
+ "src/static/custom/"*.{css,js}
+
+ # move sources
+ mv src/* "${pkgdir}/usr/share/${pkgname}/src/"
+
+ # symlink directory for custom css and js
+ ln -s "/etc/${pkgname}/custom" \
+ "${pkgdir}/usr/share/${pkgname}/src/static/custom"
+
+ # symlink needed files (not yet created)
+ ln -s /var/lib/etherpad-lite/SESSIONKEY.txt \
+ "${pkgdir}/usr/share/${pkgname}/SESSIONKEY.txt"
+ ln -s /var/lib/etherpad-lite/APIKEY.txt \
+ "${pkgdir}/usr/share/${pkgname}/APIKEY.txt"
+
+ #jquery
+ install -Dm0644 "${srcdir}/jquery.js" \
+ "${pkgdir}/usr/share/${pkgname}/src/static/js/jquery.js"
+
+ # configuration
+ install -Dm0644 settings.json.template \
+ "${pkgdir}/etc/${pkgname}/settings.json"
+
+ # systemd service
+ install -Dm0644 "${srcdir}/${pkgname}.service" \
+ "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
+
+ # systemd-sysusers
+ install -Dm0644 "${srcdir}/${pkgname}-sysusers.conf" \
+ "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
+
+ # systemd-tmpfiles
+ install -Dm0644 "${srcdir}/${pkgname}-tmpfiles.conf" \
+ "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
+
+ # documentation
+ install -Dm0644 CHANGELOG.md \
+ "${pkgdir}/usr/share/doc/${pkgname}/CHANGELOG.md"
+ install -Dm0644 CONTRIBUTING.md \
+ "${pkgdir}/usr/share/doc/${pkgname}/CONTRIBUTING.md"
+ install -Dm0644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
+ install -Dm0644 documentation.html \
+ "${pkgdir}/usr/share/doc/${pkgname}/documentation.html"
}
diff --git a/etherpad-lite-sysusers.conf b/etherpad-lite-sysusers.conf
new file mode 100644
index 000000000000..d31716d1a8b3
--- /dev/null
+++ b/etherpad-lite-sysusers.conf
@@ -0,0 +1 @@
+u etherpad-lite - "Etherpad-lite user" /usr/share/etherpad-lite
diff --git a/etherpad-lite-tmpfiles.conf b/etherpad-lite-tmpfiles.conf
new file mode 100644
index 000000000000..a589582e75ff
--- /dev/null
+++ b/etherpad-lite-tmpfiles.conf
@@ -0,0 +1,9 @@
+d /etc/etherpad-lite 0750 etherpad-lite etherpad-lite -
+z /etc/etherpad-lite/settings.json 0640 etherpad-lite etherpad-lite -
+d /etc/etherpad-lite/custom 0750 etherpad-lite etherpad-lite -
+z /etc/etherpad-lite/custom/index.js 0644 etherpad-lite etherpad-lite -
+z /etc/etherpad-lite/custom/pad.js 0644 etherpad-lite etherpad-lite -
+z /etc/etherpad-lite/custom/timeslider.js 0644 etherpad-lite etherpad-lite -
+z /etc/etherpad-lite/custom/index.css 0644 etherpad-lite etherpad-lite -
+z /etc/etherpad-lite/custom/pad.css 0644 etherpad-lite etherpad-lite -
+z /etc/etherpad-lite/custom/timeslider.css 0644 etherpad-lite etherpad-lite -
diff --git a/etherpad-lite.install b/etherpad-lite.install
deleted file mode 100644
index ff06746a0fa6..000000000000
--- a/etherpad-lite.install
+++ /dev/null
@@ -1,65 +0,0 @@
-post_install(){
- getent group etherpad &>/dev/null || groupadd -r etherpad &>/dev/null
- getent passwd etherpad &>/dev/null || \
- useradd -r -s /usr/bin/bash -g etherpad -G etherpad,http -m \
- -d /var/lib/etherpad-lite etherpad >/dev/null
-
- if [ -h "/usr/share/webapps/etherpad-lite/var/etherpad-lite" ]; then #remove old invalid stuff
- rm /usr/share/webapps/etherpad-lite/var/etherpad-lite
- fi
- if [ -d "/usr/share/webapps/etherpad-lite/var" ]; then
- if [ ! -h "/usr/share/webapps/etherpad-lite/var" ]; then
- mkdir -p /var/lib/etherpad-lite #to be sure this exists.
- mv /usr/share/webapps/etherpad-lite/var/* /var/lib/etherpad-lite/
- rmdir /usr/share/webapps/etherpad-lite/var
- if [ $? -ne 0 ]; then
- exit 1
- fi
- fi
- fi
-
- ln -ds /var/lib/etherpad-lite /usr/share/webapps/etherpad-lite/var
- if [ -f "/etherpad" ]; then #removing old invalid file
- rm /etherpad
- fi
-
- find /usr/share/webapps/etherpad-lite \
- \( -type f -exec chmod 655 {} \; \) , \
- \( -type d -exec chmod 755 {} \; \)
- find /var/lib/etherpad-lite \
- \( -type f -exec chmod 655 {} \; \) , \
- \( -type d -exec chmod 755 {} \; \)
-
- chown -R etherpad:etherpad /usr/share/webapps/etherpad-lite
- chown -R etherpad:etherpad /var/lib/etherpad-lite
-
- chmod u+x /usr/share/webapps/etherpad-lite/bin/run.sh
- chmod u+x /usr/share/webapps/etherpad-lite/bin/installDeps.sh
-
- #FIXME do we need this really?
- #systemd-tmpfiles --create etherpad-lite.conf
-
- if [ -f "/usr/share/webapps/etherpad-lite/settings.json" ]; then
- if [ ! -h "/usr/share/webapps/etherpad-lite/settings.json" ]; then
- mkdir -p /etc/webapps/etherpad-lite/
- mv /usr/share/webapps/etherpad-lite/settings.json /etc/webapps/etherpad-lite/settings.json
- ln -s /etc/webapps/etherpad-lite/settings.json /usr/share/webapps/etherpad-lite/settings.json
- fi
- fi
- #fix npm bug, using wrong python instance
- npm config set python /usr/bin/python2 -g
-}
-
-post_upgrade(){
- post_install
-}
-
-pre_remove() {
- systemctl stop etherpad-lite || true
- pkill -u etherpad || true
-}
-
-post_remove() {
- getent passwd etherpad &>/dev/null && userdel etherpad >/dev/null
- getent group etherpad &>/dev/null && groupdel etherpad >/dev/null
-}
diff --git a/etherpad-lite.service b/etherpad-lite.service
index 4732e3086c3c..af4d3d1d4476 100644
--- a/etherpad-lite.service
+++ b/etherpad-lite.service
@@ -1,13 +1,18 @@
[Unit]
-Description=Etherpad-Lite server
+Description=Etherpad-lite
After=syslog.target network.target
[Service]
-Type=simple
-User=etherpad
-Group=etherpad
-WorkingDirectory=/var/lib/etherpad-lite
-ExecStart=/usr/share/webapps/etherpad-lite/bin/run.sh
+User=etherpad-lite
+Group=etherpad-lite
+StateDirectory=etherpad-lite
+CacheDirectory=etherpad-lite
+LogsDirectory=etherpad-lite
+WorkingDirectory=/usr/share/etherpad-lite
+ExecStart=/usr/bin/node /usr/share/etherpad-lite/src/node/server.js --settings /etc/etherpad-lite/settings.json
+PrivateTmp=true
+NoNewPrivileges=true
+PrivateDevices=true
Restart=always
[Install]