summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhanibek Adilbekov2018-11-19 12:01:08 +0600
committerZhanibek Adilbekov2018-11-19 12:24:11 +0600
commite782100d98e31d4a5e1a0587f08ef02da80e440f (patch)
tree1bcdfa7380fe3a863fbc4a5b65f65741ae3e5f68
parentb68900a856ad2f4d226ba68bd4ba5c86e1b351ff (diff)
downloadaur-e782100d98e31d4a5e1a0587f08ef02da80e440f.tar.gz
Fixed: cert auto gen script
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rwxr-xr-xpixelserv-ca-init.sh10
-rw-r--r--pixelserv-tls.install8
4 files changed, 16 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e9ffc97f852..e3b8052f388 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = pixelserv-tls
pkgdesc = A tiny bespoke webserver for adblock with HTTP/1.1 and HTTPS support
pkgver = 2.2.0
- pkgrel = 2
+ pkgrel = 3
url = https://kazoo.ga/pixelserv-tls/
install = pixelserv-tls.install
arch = any
@@ -11,7 +11,7 @@ pkgbase = pixelserv-tls
source = pixelserv-ca-init.sh
source = pixelserv-tls.service
md5sums = fee16251b14fef4509476685e364c360
- md5sums = d53cf6340558d14eeb586a1129a87e9d
+ md5sums = 1bc930094d645b39aadf2861197cdb12
md5sums = 70e0895550f301303e09eb5dfabdde42
pkgname = pixelserv-tls
diff --git a/PKGBUILD b/PKGBUILD
index 652d2e0e64f..3ad0e07c876 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Zhanibek Adilbekov <zhanibek.adilbekov@protornmail.com>
pkgname=pixelserv-tls
pkgver=2.2.0
-pkgrel=2
+pkgrel=4
pkgdesc="A tiny bespoke webserver for adblock with HTTP/1.1 and HTTPS support"
arch=('any')
url="https://kazoo.ga/pixelserv-tls/"
@@ -13,7 +13,7 @@ source=(
"pixelserv-ca-init.sh"
"pixelserv-tls.service")
md5sums=('fee16251b14fef4509476685e364c360'
- 'd53cf6340558d14eeb586a1129a87e9d'
+ 'a1c0b49b4e2e6653dbf96239ecc31c55'
'70e0895550f301303e09eb5dfabdde42')
diff --git a/pixelserv-ca-init.sh b/pixelserv-ca-init.sh
index 2395cc1ea76..74d7066277b 100755
--- a/pixelserv-ca-init.sh
+++ b/pixelserv-ca-init.sh
@@ -1,4 +1,10 @@
#!/bin/sh
-openssl genrsa -out /var/cache/pixelserv/ca.key 1024
-openssl req -key /var/cache/pixelserv/ca.key -new -x509 -days 3650 -sha256 \
+
+# generate cert
+sudo -u nobody openssl genrsa -out /var/cache/pixelserv/ca.key 1024
+sudo -u nobody openssl req -key /var/cache/pixelserv/ca.key -new -x509 -days 3650 -sha256 \
-extensions v3_ca -out /var/cache/pixelserv/ca.crt -subj "/CN=Pixelserv CA"
+
+# trust cert
+sudo cp /var/cache/pixelserv/ca.crt /usr/share/ca-certificates/trust-source/anchors/ca.pixelserv.crt
+sudo trust extract-compat
diff --git a/pixelserv-tls.install b/pixelserv-tls.install
index 0b44aa0e6fe..82b3320854c 100644
--- a/pixelserv-tls.install
+++ b/pixelserv-tls.install
@@ -16,12 +16,12 @@ cat << EOF
2. import CA certificate
- cp /var/cache/pixelserv/ca.crt /usr/share/ca-certificates/trust-source/anchors/ca.pixelserv.crt
- trust extract-compat
+ sudo cp /var/cache/pixelserv/ca.crt /usr/share/ca-certificates/trust-source/anchors/ca.pixelserv.crt
+ sudo trust extract-compat
- ... OR just run script as user "nobody":
+ ... OR just run script (as your current user!):
- sudo -u nobody pixelserv-ca-init
+ pixelserv-ca-init
... THEN start/enable systemd service:
sudo systemctl enable --now pixelserv-tls