[gbm-web] Update to 20.04, add GPGME-based heartbeat
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gbm-web] Update to 20.04, add GPGME-based heartbeat
- Date: Wed, 16 Sep 2020 10:03:56 +0000 (UTC)
commit cb0ba20b814540496cf3cbdd4c9834b8032b0add
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Wed Sep 16 12:01:58 2020 +0200
Update to 20.04, add GPGME-based heartbeat
flat-manager/Dockerfile | 6 ++--
flat-manager/Dockerfile.builder | 7 ++--
flat-manager/gpg-heartbeat.c | 42 ++++++++++++++++++++++++
flat-manager/heartbeat | 6 ----
flat-manager/ppa_alexlarsson_flatpak_bionic.list | 1 -
flat-manager/ppa_alexlarsson_flatpak_focal.list | 1 +
6 files changed, 51 insertions(+), 12 deletions(-)
---
diff --git a/flat-manager/Dockerfile b/flat-manager/Dockerfile
index 3be898d..e084e8b 100644
--- a/flat-manager/Dockerfile
+++ b/flat-manager/Dockerfile
@@ -1,13 +1,13 @@
-FROM ubuntu:18.04
+FROM ubuntu:20.04
RUN apt-get update && apt-get install -y gnupg2
-ADD ppa_alexlarsson_flatpak_bionic.list /etc/apt/sources.list.d/
+ADD ppa_alexlarsson_flatpak_focal.list /etc/apt/sources.list.d/
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C793BFA2FA577F07 && \
apt-get update && apt-get install -y flatpak ostree libpq5 ca-certificates && \
rm -rf /var/lib/apt/lists/*
ADD flat-manager /usr/local/bin/flat-manager
-ADD heartbeat /heartbeat
+ADD gpg-heartbeat /usr/local/bin/gpg-heartbeat
ENV HOME /srv/gnome-build-meta
EXPOSE 8080
diff --git a/flat-manager/Dockerfile.builder b/flat-manager/Dockerfile.builder
index d89f05e..695fa5b 100644
--- a/flat-manager/Dockerfile.builder
+++ b/flat-manager/Dockerfile.builder
@@ -1,9 +1,12 @@
-FROM ubuntu:18.04
+FROM ubuntu:20.04
-RUN apt-get update && apt-get install -y git libpq-dev curl build-essential
+RUN apt-get update && apt-get install -y git libpq-dev curl build-essential libgpgme-dev
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
sh rustup.sh -y -q
RUN git clone https://github.com/flatpak/flat-manager.git && cd flat-manager && \
git checkout 0.3.7 && /root/.cargo/bin/cargo fetch
RUN cd flat-manager && /root/.cargo/bin/cargo build --release
+
+ADD gpg-heartbeat.c /gpg-heartbeat.c
+RUN gcc -s /gpg-heartbeat.c $(gpgme-config --libs --cflags) -o /gpg-heartbeat
diff --git a/flat-manager/gpg-heartbeat.c b/flat-manager/gpg-heartbeat.c
new file mode 100644
index 0000000..370abd3
--- /dev/null
+++ b/flat-manager/gpg-heartbeat.c
@@ -0,0 +1,42 @@
+#include <gpgme.h>
+
+int main (int argc, char **argv) {
+ char *homedir, *key_id;
+ gpgme_ctx_t context = NULL;
+ gpgme_engine_info_t info;
+ gpgme_key_t key = NULL;
+
+ if (argc != 3) {
+ printf("Usage: %s homedir key_id\n", argv[0]);
+ return 1;
+ }
+
+ homedir = argv[1];
+ key_id = argv[2];
+
+ gpgme_check_version (NULL);
+
+ if (gpgme_new (&context) != GPG_ERR_NO_ERROR)
+ {
+ fprintf (stderr, "Unable to create gpg context\n");
+ return 1;
+ }
+
+
+ info = gpgme_ctx_get_engine_info (context);
+
+ if (gpgme_ctx_set_engine_info (context, info->protocol, NULL, homedir) != GPG_ERR_NO_ERROR)
+ {
+ fprintf (stderr, "Unable to set gpg homedir to '%s'", homedir);
+ return 1;
+ }
+
+
+ if (gpgme_get_key (context, key_id, &key, 1) != GPG_ERR_NO_ERROR)
+ {
+ fprintf (stderr, "Unable to lookup key ID %s", key_id);
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/flat-manager/ppa_alexlarsson_flatpak_focal.list b/flat-manager/ppa_alexlarsson_flatpak_focal.list
new file mode 100644
index 0000000..7b51c98
--- /dev/null
+++ b/flat-manager/ppa_alexlarsson_flatpak_focal.list
@@ -0,0 +1 @@
+deb http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu focal main
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]