diff options
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rwxr-xr-x | pixelserv-ca-init.sh | 7 | ||||
-rw-r--r-- | pixelserv-tls.install | 30 |
4 files changed, 35 insertions, 14 deletions
@@ -1,18 +1,18 @@ pkgbase = pixelserv-tls pkgdesc = A tiny bespoke webserver for adblock with HTTP/1.1 and HTTPS support pkgver = 2.4 - pkgrel = 2 + pkgrel = 3 url = https://github.com/kvic-z/pixelserv-tls install = pixelserv-tls.install arch = any - license = GPL3 + license = LGPL-3.0-only depends = openssl>=1.0.2 source = pixelserv-tls-2.4.tar.gz::https://github.com/kvic-z/pixelserv-tls/archive/2.4.tar.gz source = pixelserv-ca-init.sh source = pixelserv-tls.service source = build-fix.patch b2sums = cec2a713c21b98083c5f00b05a49dae50d5f16f6b1014f0635558ce26d29c11e64a1178fc687234810d33267b5d30d1bea2ce0be9407d102a7b44f4501d92eaa - b2sums = ee9bb5c257105424398b7478b291094be02bd7d0b410470395da76d23cc02abe85b4c4a6511989b8e2526288a413a79118db8977064a4187d542c2e575c31c2a + b2sums = df250241026b758470b3477e089b54552d74b3ee7b138675349a0c3ab2e76fbe5b09c2e6b7cf3cec40318866b28dbd44cc70dc7707c075dcaceb28803097aa88 b2sums = d5a7f2c193de9685e8daffedee45619d08b3192c53152302fcd9d97d75338a9906030c3511131872f4d4c7946e1d6e9e5dbb1d9918e3d6c011c0b6278e8b1118 b2sums = 2a9c40c6749a3c72b87267a6e6c0d076378a756176aad5fe964202d6a6fb21150b9a54564ec4259103b35223e2cdaf855c886648368be2ca7c2dd504bf58f6e1 @@ -1,11 +1,11 @@ # Maintainer: Zhanibek Adilbekov <zhanibek.adilbekov@proton.me> pkgname=pixelserv-tls pkgver=2.4 -pkgrel=2 +pkgrel=3 pkgdesc="A tiny bespoke webserver for adblock with HTTP/1.1 and HTTPS support" arch=('any') url="https://github.com/kvic-z/pixelserv-tls" -license=('GPL3') +license=('LGPL-3.0-only') depends=('openssl>=1.0.2') install=$pkgname.install source=( @@ -14,7 +14,7 @@ source=( "pixelserv-tls.service" "build-fix.patch") b2sums=('cec2a713c21b98083c5f00b05a49dae50d5f16f6b1014f0635558ce26d29c11e64a1178fc687234810d33267b5d30d1bea2ce0be9407d102a7b44f4501d92eaa' - 'ee9bb5c257105424398b7478b291094be02bd7d0b410470395da76d23cc02abe85b4c4a6511989b8e2526288a413a79118db8977064a4187d542c2e575c31c2a' + 'df250241026b758470b3477e089b54552d74b3ee7b138675349a0c3ab2e76fbe5b09c2e6b7cf3cec40318866b28dbd44cc70dc7707c075dcaceb28803097aa88' 'd5a7f2c193de9685e8daffedee45619d08b3192c53152302fcd9d97d75338a9906030c3511131872f4d4c7946e1d6e9e5dbb1d9918e3d6c011c0b6278e8b1118' '2a9c40c6749a3c72b87267a6e6c0d076378a756176aad5fe964202d6a6fb21150b9a54564ec4259103b35223e2cdaf855c886648368be2ca7c2dd504bf58f6e1') diff --git a/pixelserv-ca-init.sh b/pixelserv-ca-init.sh index d978948e2be6..bdd15161be0e 100755 --- a/pixelserv-ca-init.sh +++ b/pixelserv-ca-init.sh @@ -12,7 +12,12 @@ fi # check the ownership of the directory if [[ "$(stat -c '%U' "$TARGET_DIR")" != 'nobody' ]]; then - sudo chown -v nobody:nobody "$TARGET_DIR" + sudo chown -vR nobody:root "$TARGET_DIR" +fi + +# check directory permissions +if [[ "$(stat -c '%A' "$TARGET_DIR")" =~ '---$' ]]; then + sudo chmod -vR o-rwx "$TARGET_DIR" fi # generate cert diff --git a/pixelserv-tls.install b/pixelserv-tls.install index 82b3320854cd..07299d03f394 100644 --- a/pixelserv-tls.install +++ b/pixelserv-tls.install @@ -1,11 +1,26 @@ # arg 1: the new package version post_install() { - if [ ! -d /var/cache/pixelserv ]; then - /bin/mkdir /var/cache/pixelserv + # target directory + TARGET_DIR='/var/cache/pixelserv' + + # ensure the target directory exists + if [[ -d "$TARGET_DIR" ]]; then + echo "$TARGET_DIR already exists. Consider to remove it before generating new certificates" + else + sudo mkdir -pv "$TARGET_DIR" + fi + + # check the ownership of the directory + if [[ "$(stat -c '%U' "$TARGET_DIR")" != 'nobody' ]]; then + sudo chown -vR nobody:root "$TARGET_DIR" fi - /bin/chown -R nobody:root /var/cache/pixelserv - /bin/chmod -R 755 /var/cache/pixelserv -cat << EOF + + # check directory permissions + if [[ "$(stat -c '%A' "$TARGET_DIR")" =~ '---$' ]]; then + sudo chmod -vR o-rwx "$TARGET_DIR" + fi + + cat <<EOF In order to use pixelserv-tls you need to: 1. create root CA certificate https://git.io/vNuoH @@ -37,7 +52,8 @@ post_upgrade() { # arg 1: the old package version post_remove() { -cat << EOF + TARGET_DIR='/var/cache/pixelserv' + cat <<EOF If you won't use pixelserv-tls anymore you may remove "Pixelserv CA" certificate and pixelserv-tls's cert folder using: @@ -45,7 +61,7 @@ cat << EOF rm /usr/share/ca-certificates/trust-source/anchors/ca.pixelserv.crt trust extract-compat - rm -rf /var/cache/pixelserv + rm -rf $TARGET_DIR EOF } |