summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO25
-rw-r--r--PKGBUILD63
-rw-r--r--prosody.install9
-rw-r--r--prosody.service64
-rw-r--r--prosody.tmpfile.d4
5 files changed, 106 insertions, 59 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d1759e5122c6..77d8c9e767e8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = prosody-hg
pkgdesc = Lightweight and extensible Jabber/XMPP server written in Lua (development build from trunk-branch)
- pkgver = r9606+.cb684a0ded2a+
+ pkgver = r11977+.10cdfb94f1cc+
pkgrel = 1
url = https://prosody.im/
install = prosody.install
@@ -10,16 +10,16 @@ pkgbase = prosody-hg
license = MIT
checkdepends = luacheck
checkdepends = shellcheck
+ checkdepends = lua-posix
+ checkdepends = lua-sec
makedepends = mercurial
- depends = lua52
- depends = lua52-socket
- depends = lua52-expat
- depends = lua52-filesystem
- depends = libidn
- depends = openssl
- optdepends = lua52-sec: TLS encryption support
- optdepends = lua52-bitop: websocket support
- optdepends = lua52-event: libevent support
+ depends = icu
+ depends = lua
+ depends = lua-socket
+ depends = lua-expat
+ depends = lua-filesystem
+ depends = lua-sec
+ optdepends = lua-event: libevent support
provides = prosody
conflicts = prosody
backup = etc/prosody/prosody.cfg.lua
@@ -28,9 +28,8 @@ pkgbase = prosody-hg
source = sysuser.conf
source = prosody.service
sha256sums = SKIP
- sha256sums = 343d7c61ee1c105d760480e9ba6a0655da6bd1a58335f4264a289ade96cffa4c
+ sha256sums = fb025d8d0608dc9fd5be2fde8528bc4fa10d9e38874a98eaa5c56ca9ae048302
sha256sums = e5c30ffbb066f0ed3444475b3313490c535d8c9df018726f6cecf9e3ddfd2e48
- sha256sums = af4ce76ae0a8773429eac53c72f1b87c8fa59c63acf003450f75dcb73131a21c
+ sha256sums = 40ea4a388ba69568daedde69b636d54747be1452e9d485fe19ee23320e66ada2
pkgname = prosody-hg
-
diff --git a/PKGBUILD b/PKGBUILD
index aec3eee27f73..38ae94a928d4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,26 +9,24 @@
pkgname=prosody-hg
pkgrel=1
-pkgver=r9637+.b8301ba2c437+
-pkgver() {
- cd "$srcdir/$pkgname"
- printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)"
-}
+pkgver=r11977+.10cdfb94f1cc+
pkgdesc="Lightweight and extensible Jabber/XMPP server written in Lua (development build from trunk-branch)"
arch=('i686' 'x86_64' 'armv7h')
url="https://prosody.im/"
license=('MIT')
-depends=('lua51' 'lua51-socket' 'lua51-expat' 'lua51-filesystem' 'libidn'
- 'openssl')
+depends=(
+ 'icu'
+ 'lua'
+ 'lua-socket'
+ 'lua-expat'
+ 'lua-filesystem'
+ 'lua-sec')
makedepends=('mercurial')
-checkdepends=('luacheck' 'shellcheck' 'lua52-posix' 'lua52-sec')
+checkdepends=('luacheck' 'shellcheck' 'lua-posix' 'lua-sec')
conflicts=('prosody')
provides=('prosody')
optdepends=(
-'lua51-sec: TLS encryption support'
-'lua51-bitop: websocket support'
-'lua51-event: libevent support'
-)
+ 'lua-event: libevent support')
install=prosody.install
backup=('etc/prosody/prosody.cfg.lua')
source=("prosody-hg::hg+https://hg.prosody.im/trunk"
@@ -36,42 +34,35 @@ source=("prosody-hg::hg+https://hg.prosody.im/trunk"
'sysuser.conf'
'prosody.service')
+pkgver() {
+ cd "$srcdir/$pkgname"
+ printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)"
+}
+
prepare() {
cd ${pkgname}
# disable logging to output and activate syslog
- sed -i s/"info = "/"-- info = "/g prosody.cfg.lua.dist
- sed -i s/"error = "/"-- error = "/g prosody.cfg.lua.dist
- sed -i s/"--\ \"\*syslog\"\;"/"\"*syslog\"\;"/g prosody.cfg.lua.dist
+ sed -i s/"info = "/"-- info = "/g prosody.cfg.lua.dist
+ sed -i s/"error = "/"-- error = "/g prosody.cfg.lua.dist
+ sed -i s/"--\ \"\*syslog\"\;"/"\"*syslog\"\;"/g prosody.cfg.lua.dist
-
- # add pidfile and daemonize
- # daemonize is important for systemd!
- mv prosody.cfg.lua.dist prosody.cfg.lua.old
-
- echo --Important for systemd >> prosody.cfg.lua.dist
- echo -- daemonize is important for systemd. if you set this to false the systemd startup will freeze. >> prosody.cfg.lua.dist
- echo daemonize = true >> prosody.cfg.lua.dist
- echo 'pidfile = "/run/prosody/prosody.pid"'>> prosody.cfg.lua.dist
- echo "" >> prosody.cfg.lua.dist
- cat prosody.cfg.lua.old >> prosody.cfg.lua.dist
- rm prosody.cfg.lua.old
+ ./configure --ostype=linux --prefix=/usr --sysconfdir=/etc/prosody \
+ --datadir=/var/lib/prosody --with-lua-include=/usr/include \
+ --cflags="${CFLAGS} -fPIC -Wall -Wextra -D_GNU_SOURCE" \
+ --ldflags="${LDFLAGS} -shared" --no-example-certs \
+ --runwith=lua \
+ --lua-version=5.4 \
+ --idn-library=icu
}
build() {
cd ${pkgname}
- ./configure --ostype=linux --prefix=/usr --sysconfdir=/etc/prosody \
- --datadir=/var/lib/prosody --with-lua-include=/usr/include/lua5.1 \
- --cflags="${CFLAGS} -fPIC -Wall -Wextra -D_GNU_SOURCE" \
- --ldflags="${LDFLAGS} -shared" --no-example-certs \
- --runwith=lua5.1 \
- --lua-version=5.1
make
}
check() {
cd ${pkgname}
-
make lint
}
@@ -94,6 +85,6 @@ package() {
# vim: ft=sh syn=sh ts=2 sw=2
sha256sums=('SKIP'
- '343d7c61ee1c105d760480e9ba6a0655da6bd1a58335f4264a289ade96cffa4c'
+ 'fb025d8d0608dc9fd5be2fde8528bc4fa10d9e38874a98eaa5c56ca9ae048302'
'e5c30ffbb066f0ed3444475b3313490c535d8c9df018726f6cecf9e3ddfd2e48'
- 'af4ce76ae0a8773429eac53c72f1b87c8fa59c63acf003450f75dcb73131a21c')
+ '40ea4a388ba69568daedde69b636d54747be1452e9d485fe19ee23320e66ada2')
diff --git a/prosody.install b/prosody.install
index d94d5431620e..842a5f470980 100644
--- a/prosody.install
+++ b/prosody.install
@@ -1,11 +1,8 @@
post_install() {
- systemd-sysusers prosody.conf
- systemd-tmpfiles --create prosody.conf
-
- chown prosody:jabber var/lib/prosody
- [ -d var/log/prosody ] && chown prosody:jabber var/log/prosody
-
echo ">> Documentation: https://wiki.archlinux.org/index.php/Prosody"
+ echo
+ echo ">> The unit file has been changed to Type=simple. "
+ echo ">> You need to change the configuration back to daemonize=false (prosody default)."
}
post_upgrade() {
diff --git a/prosody.service b/prosody.service
index ba78f64bc9e5..cd2192564eda 100644
--- a/prosody.service
+++ b/prosody.service
@@ -1,15 +1,73 @@
[Unit]
Description=XMPP (Jabber) Server
+Documentation=https://prosody.im/doc
After=network.target
[Service]
-Type=forking
+### See man systemd.service ###
+# With this configuration, systemd takes care of daemonization
+# so Prosody should be configured with daemonize = false
+Type=simple
+
+# Not sure if this is needed for 'simple'
PIDFile=/run/prosody/prosody.pid
-ExecStart=/usr/bin/prosodyctl start
-ExecStop=/usr/bin/prosodyctl stop
+
+# Start by executing the main executable
+ExecStart=/usr/bin/prosody
+
ExecReload=/bin/kill -HUP $MAINPID
+# Restart on crashes
+Restart=on-abnormal
+
+# Set O_NONBLOCK flag on sockets passed via socket activation
+NonBlocking=true
+
+### See man systemd.exec ###
+
+WorkingDirectory=/var/lib/prosody
+
+User=prosody
+Group=jabber
+
+UMask=0027
+
+# Nice=0
+
+# Set stdin to /dev/null since Prosody does not need it
+StandardInput=null
+
+# Direct stdout/-err to journald for use with log = "*stdout"
StandardOutput=journal
+StandardError=inherit
+
+# This usually defaults to 4k or so
+# LimitNOFILE=1M
+
+## Interesting protection methods
+# Finding a useful combo of these settings would be nice
+#
+# Needs read access to /etc/prosody for config
+# Needs write access to /var/lib/prosody for storing data (for internal storage)
+# Needs write access to /var/log/prosody for writing logs (depending on config)
+# Needs read access to code and libraries loaded
+
+# ReadWriteDirectories=/var/lib/prosody /var/log/prosody
+# InaccessibleDirectories=/boot /home /media /mnt /root /srv
+# ReadOnlyDirectories=/usr /etc/prosody
+
+# PrivateTmp=true
+# PrivateDevices=true
+# PrivateNetwork=false
+
+# ProtectSystem=full
+# ProtectHome=true
+# ProtectKernelTunables=true
+# ProtectControlGroups=true
+# SystemCallFilter=
+
+# This should break LuaJIT
+# MemoryDenyWriteExecute=true
[Install]
WantedBy=multi-user.target
diff --git a/prosody.tmpfile.d b/prosody.tmpfile.d
index 786fa9e96d0e..c4dc6e364f69 100644
--- a/prosody.tmpfile.d
+++ b/prosody.tmpfile.d
@@ -1 +1,3 @@
-d /run/prosody 0755 prosody jabber -
+d %t/prosody 0750 prosody jabber -
+d %S/prosody 0750 prosody jabber -
+d %L/prosody 0750 prosody jabber -