From 5ed8555b4368fcb33665a9516628f5c2cd8a18f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Sat, 4 Feb 2017 13:01:05 +0100 Subject: [PATCH 1/2] Attempt to keep speakers e-mail in a single place Introduce a basic crypto wrapper to help the Clermont'ech team with managing this file. --- .gitignore | 1 + email-recipients | 1 + email.asc | 17 +++++++++++++++++ sync-email.sh | 11 +++++++++++ 4 files changed, 30 insertions(+) create mode 100644 email-recipients create mode 100644 email.asc create mode 100755 sync-email.sh diff --git a/.gitignore b/.gitignore index 22a69dea..79abfa17 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ _site/* .sass-cache/* .idea Gemfile.lock +email *.css.map diff --git a/email-recipients b/email-recipients new file mode 100644 index 00000000..c6cb88a3 --- /dev/null +++ b/email-recipients @@ -0,0 +1 @@ +0x82349A78E7C0B8070B5980FFBA4D1D955112336F diff --git a/email.asc b/email.asc new file mode 100644 index 00000000..d09862d8 --- /dev/null +++ b/email.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP MESSAGE----- + +hQGMA7twmRLBsrZWAQv8CG7kJSKn/zoDUEXlitP9l5+n2gfpsDNa8Kh2eq3I/ulE +b0fWl93RqVCALF8zn7oxWekYPW3UlboC9cnRe6d4YbNVsJzJnQ3LU5R7Z07WyGDq +jxXC9iAPa4FG5uvPmqEzntW2GeQ7om0KISuKHPCcbkDe8ac8iMfL4c94/BU8kFtE +E3hw8bljJ83RHo9pw8+6wLNS28OYepwOSTYiDS9OQJllwZZFwFBxgfXH4m7Yr9Jw +xg+Ty7KSxFY3+3qpIEd2LjBHG1Oy1HkUYTA5PJdFG+Pi1RwV/n9dknxrYlD9lJoj +W+LswlUlJO2vpM7yWuN2goNPOIHp7RuJvOwUj+qAuWaGTh7iIPhJo4oNXdZtkCMN +15SHYLuQW6twanYRruitwt5Q0uu0q6x04IuE3HnA6nz4S3vhaskjUYcs9jrH7ndA +/btl1D0/H86z5rLMsN90ltyBknzdW6xcM9T9xTE2RhgKlR+JZVtAcATyWfLXlk5U +vxybHBs07e3Moh8V8q7G0rUB/iisnCxxyQnkBZOatmllZ6RWQoPIsjP3noRMqDme +G1fHLR7nmk1IQio7iTXzj8wncWJukt9r7oNBqxQbXSKiLbrcEn9PlT/5fcPDPmm0 +xrv7iGC23SCx5A9wW9QLENcrIzyWO7KD3uJwITNBD3y3S6aPxBpVkLmuY/r+p23Y +7VqEtVsR/T7tEaAA6qKe45hCII7p5TWrJZryF8he2WBvQhwp8XkehD8uL62AwXLw +9TqnyM8h +=QnFm +-----END PGP MESSAGE----- diff --git a/sync-email.sh b/sync-email.sh new file mode 100755 index 00000000..c6b89056 --- /dev/null +++ b/sync-email.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ ! -f email -o email -ot email.asc ]; then + gpg --decrypt email.asc > email + touch -r email.asc email +elif [ ! -f email.asc -o email -nt email.asc -o email-recipients -nt email.asc ]; then + gpg --encrypt `sed -e 's/^/--recipient /' email-recipients` --armor email + touch -r email email.asc +else + echo 'Everything is fine!' +fi From 9b15dc433017939ca49c7540dbde10d3c64fcf2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Sat, 4 Feb 2017 13:22:47 +0100 Subject: [PATCH 2/2] Add instructions on top of the encrypted file --- email.asc | 8 ++++++++ sync-email.sh | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/email.asc b/email.asc index d09862d8..b70f65d3 100644 --- a/email.asc +++ b/email.asc @@ -1,3 +1,11 @@ +This file contains the e-mail address of our speakers. + +It is intended for internal use of the Clermont'ech team, and it's +content has been encrypted with the GPG keys listed in the +email-recipients file. + +Use the sync-email.sh script to encrypt/decrypt this content. + -----BEGIN PGP MESSAGE----- hQGMA7twmRLBsrZWAQv8CG7kJSKn/zoDUEXlitP9l5+n2gfpsDNa8Kh2eq3I/ulE diff --git a/sync-email.sh b/sync-email.sh index c6b89056..803c89c6 100755 --- a/sync-email.sh +++ b/sync-email.sh @@ -1,10 +1,14 @@ #!/bin/sh if [ ! -f email -o email -ot email.asc ]; then - gpg --decrypt email.asc > email + gpg --decrypt --output email email.asc touch -r email.asc email elif [ ! -f email.asc -o email -nt email.asc -o email-recipients -nt email.asc ]; then - gpg --encrypt `sed -e 's/^/--recipient /' email-recipients` --armor email + enc_email=`mktemp` + sed -e '/^-----BEGIN PGP MESSAGE-----$/,$d' email.asc > "$enc_email" + gpg --encrypt `sed -e 's/^/--recipient /' email-recipients` --armor --output - email >> "$enc_email" + mv "$enc_email" email.asc + touch -r email email.asc else echo 'Everything is fine!'