summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/last-git-login40
-rwxr-xr-xbin/pacman-make-keyring2
-rw-r--r--config.mk4
3 files changed, 43 insertions, 3 deletions
diff --git a/bin/last-git-login b/bin/last-git-login
new file mode 100755
index 0000000..c23307a
--- /dev/null
+++ b/bin/last-git-login
@@ -0,0 +1,40 @@
+# ASSERT: this script must be executed with effective group membership in one of:
+# [ adm systemd-journal wheel ]
+
+
+readonly HACKERS_LIB_DIR=/usr/lib/parabola-hackers
+
+
+FindHackerBySshSha() # (hacker_ssh_sha)
+{
+ local hacker_ssh_sha=$1
+ local hacker_login
+
+ for hacker_login in $(${HACKERS_LIB_DIR}/meta-cat --group git | cut -d ',' -f 2)
+ do ${HACKERS_LIB_DIR}/ssh-list-authorized-keys ${hacker_login} | \
+ while read ssh_key
+ do ssh_sha=$(ssh-keygen -l -E sha256 -f - <<<${ssh_key} | cut -d ' ' -f 2)
+
+ [[ "${ssh_sha}" == "${hacker_ssh_sha}" ]] && echo ${hacker_login} && break
+ done && break
+ done
+}
+
+LastHackerLogin()
+{
+ local last_ssh_sha="$(journalctl --unit=sshd.service --since=-24h 2> /dev/null | \
+ grep 'Accepted publickey for git from ' | \
+ tail -n 1 | \
+ sed 's|.*ssh2: .* \(SHA256:.*\)$|\1|' )"
+ local hacker_login=$(FindHackerBySshSha ${last_ssh_sha})
+
+ if [[ -n "${hacker_login}" ]]
+ then echo ${hacker_login}
+ else echo "can not determine the last hacker login" >&2
+ fi
+
+ [[ -n "${this_hacker_login}" ]]
+}
+
+
+LastHackerLogin
diff --git a/bin/pacman-make-keyring b/bin/pacman-make-keyring
index 6f98d2c..8005ef5 100755
--- a/bin/pacman-make-keyring
+++ b/bin/pacman-make-keyring
@@ -110,7 +110,7 @@ $(cachedir)/deps.mk: ${users} $(var)outputdir $(var)cachedir $(var)KEYRING_NAME|
export LANG=C
-KEYSERVER = hkp://pool.sks-keyservers.net
+KEYSERVER = hkp://hkps.pool.sks-keyservers.net
GPG = gpg --quiet --batch --no-tty --no-permission-warning --keyserver ${KEYSERVER} --homedir $(cachedir)/gpghome
diff --git a/config.mk b/config.mk
index 36bd200..00b08c9 100644
--- a/config.mk
+++ b/config.mk
@@ -3,7 +3,7 @@ topoutdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
topsrcdir := $(topoutdir)
PACKAGE = parabola-hackers
-VERSION = 20180426
+VERSION = 20200201
sysusersdir=$(prefix)/lib/sysusers.d
systemunitdir=$(prefix)/lib/systemd/system
@@ -20,7 +20,7 @@ CC = gcc -std=c99
# Go
go_CC = gcc -std=gnu99
-GOCACHE = $(topoutdir)/go/cache
+GOCACHE = $(realpath $(topoutdir)/go/cache)
CGO_ENABLED = 1
endif