惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
MongoDB | Blog
MongoDB | Blog
博客园_首页
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
B
Blog RSS Feed
D
Docker
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
V
V2EX
量子位
雷峰网
雷峰网
月光博客
月光博客
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog

Null's blog

Switching to harper-ls Switching to harper-ls Thinking long term; A weird story Thinking long term; A weird story The case against WebUsb The case against WebUsb Why Wayland is the future. Why Wayland is the future. Debugging a crashed kernel on opensuse Debugging a crashed kernel on opensuse Envisioning a future python Envisioning a future python server update, A new name, comments via firefish and lightmode server update, A new name, comments via firefish and lightmode A look back at the webserver A look back at the webserver Webserver Updates Webserver Updates Migrating to a custom blogging backend Migrating to a custom blogging backend Nixops to Deploy-rs Nixops to Deploy-rs Archlinux with secureboot on a nvidia machine Archlinux with secureboot on a nvidia machine Nixops the future of deploying applications? Nixops the future of deploying applications? Installing NixOS on a Running Install of Arch Linux Installing NixOS on a Running Install of Arch Linux Why you should use Neovim Why you should use Neovim
Flatpaking Github Desktop Pt2: GPG
nullrequest · 2021-10-12 · via Null's blog

Hello, hello, hello. This post is going to continue on what I went through maintaining github desktop and ensuring everything works. This will mainly focus on GnuPG since that was where majority of my work focused on.

What is GnuPG?

GnuPG often refereed to as GPG is the GNU foundations open source implementation of the OpenPGP standard. It is used for cartographical signing and encryption, git uses GPG to signing commits to allow one to verify who made a commit.

The problems with GnuPG

After I published the flatpak github user tommytran732 brought it to my attention that GPG did not work. Initially I thought this would be an easy fix, simply adding GPG to the flatpak should have been enough in my mind. Oh how I was wrong. I ran into multiple issues with gpg spitting out ioctl errors.

ioctl errors, if you have run into them before, are really cryptic. I ended up adding some permissions to the flatpak: --filesysystem=~/.gnupg:ro. This would create a fix for the issue when running gpg from a command line but it wouldn't work if run from git. At this point running out of ideas, I reached out the the flatpak matrix looking for advice. I was given a link to the Gnome Mail flatpak.

Gnome Mail used GPG for some functionality and hence used it in the flatpak, I attempted to model the flatapk around it using gpg-agent and pinentry in the flatpak to interact with the host, at this point I didn't know about the issues I would face using this model. Right away one of the issues that stood out was if the key had a password it would not work.

For many weeks I pondered on the solution, until one day while being utterly confused about it in the flatpak matrix (I highly encourage anyone facing issues flatpaking an app to ask for help on the flatpak matrix). Github user tommytran732 pointed out that adding --filesystem=xdg-run/gnupg:ro and dropping pinentry from the flatpak fixed the issues.

Breaking down the fix, this permission allows gpg to interact with the hosts gpg-agent daemon/instance. When the daemon receives a request for the GPG key registered for git commit signing, if the key is already unlocked it just hands over the required data. If the key is not unlocked it will use pinentry to unlock it for you.

If by any chance you use a Yubikey for 2FA with GPG, it won't work. Why? ¯\_(ツ)_/¯. I've gotten myself a Yubikey (Thank you Tommy for the kind donation!) and hopefully once I figure out how to set it up I can get to work trying to figure out why it won't work. There will probably be a part 3 once I fix 2FA with GPG.

-- signing off

Nullrequest