chore(3p/lieer): Upgrade to lieer 1.3

* rebases the send scope patch
* removes the API key override patch, lieer now has a configuration
  option for this

Change-Id: I198e8b61855f6cdb2b1439a1c8f2d9d69261c1b5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2242
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2020-12-10 11:22:41 +01:00 committed by tazjin
parent 316a4fa1e0
commit a9014203b6
4 changed files with 19 additions and 50 deletions

View file

@ -1,20 +0,0 @@
diff --git a/lieer/remote.py b/lieer/remote.py
index 6e3973a..62728f7 100644
--- a/lieer/remote.py
+++ b/lieer/remote.py
@@ -25,12 +25,12 @@ class Remote:
# * https://stackoverflow.com/questions/19615372/client-secret-in-oauth-2-0?rq=1
#
OAUTH2_CLIENT_SECRET = {
- "client_id":"753933720722-ju82fu305lii0v9rdo6mf9hj40l5juv0.apps.googleusercontent.com",
- "project_id":"capable-pixel-160614",
+ "client_id":"${CLIENT_ID}",
+ "project_id":"${PROJECT_ID}",
"auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
- "client_secret":"8oudEG0Tvb7YI2V0ykp2Pzz9",
+ "client_secret":"${CLIENT_SECRET}",
"redirect_uris":["urn:ietf:wg:oauth:2.0:oob", "http://localhost"]
}

View file

@ -1,44 +1,21 @@
# Lieer is a small tool to synchronise a Gmail account with a local # Lieer is a small tool to synchronise a Gmail account with a local
# maildir. # maildir.
#
# Lieer is packaged in nixpkgs, but as of 2019-12-23 it is an old
# version using the previous branding (gmailieer).
{ pkgs, ... }: { pkgs, ... }:
# For a variety of reasons (specific to my setup), custom OAuth2
# scopes are used.
#
# The below client ID is the default for *@tazj.in and is overridden
# in a private repository for my work account. Publishing it here is
# not a security issue.
{
clientId ? "515965513093-7b4bo4gm0q09ccsmikkuaas9a40j0jcj.apps.googleusercontent.com",
clientSecret ? "3jVbpfT4GmubFD64svctJSdQ",
project ? "tazjins-infrastructure"
}:
with pkgs;
let let
authPatch = runCommand "client_secret.patch" {} '' inherit (pkgs) fetchFromGitHub python3Packages;
export CLIENT_ID='${clientId}'
export CLIENT_SECRET='${clientSecret}'
export PROJECT_ID='${project}'
cat ${./api_client.patch} | ${gettext}/bin/envsubst > $out
'';
in python3Packages.buildPythonApplication rec { in python3Packages.buildPythonApplication rec {
name = "lieer-${version}"; name = "lieer-${version}";
version = "1.0"; version = "1.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "gauteh"; owner = "gauteh";
repo = "lieer"; repo = "lieer";
rev = "v${version}"; rev = "v${version}";
sha256 = "1zzylv8xbcrh34bz0s29dawzcyx39lai8y8wk0bl4x75v1jfynvf"; sha256 = "12sl7d381l1gjaam419xc8gxmsprxf0hgksz1f974qmmijvr02bh";
}; };
patches = [ patches = [
authPatch
./send_scope.patch ./send_scope.patch
]; ];

View file

@ -1,8 +1,18 @@
From ac7be0f9ad212455d833457bc328ee18eb6a5fdf Mon Sep 17 00:00:00 2001
From: Vincent Ambo <tazjin@google.com>
Date: Thu, 10 Dec 2020 11:13:56 +0100
Subject: [PATCH] remoet: Add 'mail.google.com' OAuth scope
Required for sending emails.
---
lieer/remote.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lieer/remote.py b/lieer/remote.py diff --git a/lieer/remote.py b/lieer/remote.py
index 6e3973a..ade1082 100644 index 9f3e871..6f5a71e 100644
--- a/lieer/remote.py --- a/lieer/remote.py
+++ b/lieer/remote.py +++ b/lieer/remote.py
@@ -9,7 +9,7 @@ from oauth2client.file import Storage @@ -26,7 +26,7 @@ from oauth2client.file import Storage
from pathlib import Path from pathlib import Path
class Remote: class Remote:
@ -11,3 +21,6 @@ index 6e3973a..ade1082 100644
APPLICATION_NAME = 'Lieer' APPLICATION_NAME = 'Lieer'
CLIENT_SECRET_FILE = None CLIENT_SECRET_FILE = None
authorized = False authorized = False
--
2.29.2.576.ga3fc446d84-goog

View file

@ -1,12 +1,11 @@
{ depot, lib, ... }: { depot, lib, ... }:
config: let config: let
inherit (depot.third_party) lieer;
nixpkgs = import depot.third_party.nixpkgsSrc { nixpkgs = import depot.third_party.nixpkgsSrc {
config.allowUnfree = true; config.allowUnfree = true;
}; };
lieer = depot.third_party.lieer {};
# add google-c-style here because other machines get it from, eh, # add google-c-style here because other machines get it from, eh,
# elsewhere. # elsewhere.
frogEmacs = (depot.users.tazjin.emacs.overrideEmacs(epkgs: epkgs ++ [ frogEmacs = (depot.users.tazjin.emacs.overrideEmacs(epkgs: epkgs ++ [