Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a GNOME Shell Extension #6712

Merged
merged 25 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
010b181
First stab at adding a GNOME Shell Extension, and the necessary logic…
nathandyer Dec 14, 2022
5e1f0ff
Fix broken commands, have Tails load extension with network hook, and…
nathandyer Dec 15, 2022
d2fb2f3
Don't run gnome-extensions command with elevated privileges (without …
nathandyer Dec 20, 2022
4c03686
Remove trailing spaces to appease the linter
nathandyer Dec 22, 2022
88e9241
Don't show admin-related menu items if it's on a journalist workstation.
nathandyer Jan 11, 2023
b295733
Switch to checking for tor_v3_keys.json to determine between Journali…
nathandyer Jan 18, 2023
0896be7
Use explicit length checks and validate the URL contains .onion
nathandyer Jan 18, 2023
4ac0c28
Show update option, even on Journalist workstation.
nathandyer Jan 18, 2023
b022871
Copy files to running system in addition to Persistent volume
nathandyer Jan 20, 2023
5edcfc4
Load app and mon hostnames dynamically
nathandyer Jan 20, 2023
1220dbd
Fix a couple bugs recently introduced that prevent the extension from…
nathandyer Jan 23, 2023
c223858
empty commit to rerun ci after setting up circle ci project for fork
zekehuntergreen Dec 5, 2022
768943d
Switch to using an Ansible template.
nathandyer Jan 25, 2023
0a01b41
Use a SecureDrop icon in the Shell extension
nathandyer Feb 27, 2023
d185eed
Add a button to open a file browser.
nathandyer Mar 2, 2023
7704a5a
Make symbolic icon white instead of black so it's visible in the menu.
nathandyer Mar 3, 2023
a945055
Enable translations for the SecureDrop Extension
nathandyer Mar 14, 2023
eb4d085
Fix the icon appearance, set the position in the menu, and fix a bug …
nathandyer Mar 17, 2023
1ffac83
Appease the linter.
nathandyer Mar 21, 2023
a68d4d4
Add support for gnome-shell 3.38 and fix translations.
nathandyer May 24, 2023
5db2cb4
Prompt user for a reboot and remove logic to install to running system
nathandyer May 25, 2023
821a2c7
Only show one message to the user at end of the run, and refer to the…
nathandyer May 30, 2023
76f3ade
build(gettext): extend the "translate-desktop" command to cover the G…
cfm May 30, 2023
ab015f1
deploy(tails-config): expect "messages" domain in "locale" directory
cfm May 31, 2023
85b722c
Adding placeholder locale files
zenmonkeykstop Jun 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ coverage.xml
.hypothesis/
.mypy_cache/

# Translations
*.mo
# Translations compiled during packaging:
securedrop/translations/**/*.mo

# Flask stuff:
instance/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ tails_config_desktop_icon_directories:
- "{{ tails_config_amnesia_home }}/.local/share/applications"
- "{{ tails_config_live_dotfiles }}/.local/share/applications"

# Destination directories for storing the SecureDrop GNOME Shell extension
tails_config_extension_directories:
- "{{ tails_config_live_dotfiles }}/.local/share/gnome-shell/extensions/[email protected]/"

# Path for storing site-specific ATHS info for connecting to Journalist Interface.
tails_config_torrc_additions: "{{ tails_config_securedrop_dotfiles }}/torrc_additions"

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "SecureDrop",
"description": "SecureDrop Utility Menu",
"uuid": "[email protected]",
"shell-version": [
"3.38",
"40",
"41",
"42",
"43"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Add your custom extension styling here */
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
if is_tails:
zenmonkeykstop marked this conversation as resolved.
Show resolved Hide resolved
subprocess.call(["gnome-shell-extension-tool", "-r", "desktop-icons@csoriano"], env=env)

# enable the GNOME Shell Extension
subprocess.call(["gnome-extensions", "enable", "[email protected]"], env=env)

# reacquire uid0 and notify the user
os.setresuid(0, 0, -1)
os.setresgid(0, 0, -1)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
---
- name: Check for v3 Source Interface file
stat:
path: app-sourcev3-ths
register: v3_source_file

- name: Check for v3 Journalist Interface file
stat:
path: app-journalist.auth_private
register: v3_journalist_file

- name: Check for site specific file
stat:
path: group_vars/all/site-specific
register: site_specific_file

- name: Look up v3 Source Interface URL.
command: grep -Po '.{56}\.onion' app-sourcev3-ths
changed_when: false
register: sourcev3_interface_lookup_result
when: v3_source_file.stat.exists == true

- name: Look up v3 Journalist Interface URL.
command: awk -F ':' '{print $1 ".onion"}' app-journalist.auth_private
changed_when: false
register: journalistv3_interface_lookup_result
when: v3_source_file.stat.exists == true

- name: Look up app server hostname
command: "awk -v FS='app_hostname: ' 'NF>1{print $2}' group_vars/all/site-specific"
changed_when: false
register: app_server_lookup_result
when: site_specific_file.stat.exists == true

- name: Look up mon server hostname
command: "awk -v FS='monitor_hostname: ' 'NF>1{print $2}' /home/amnesia/Persistent/securedrop/install_files/ansible-base/group_vars/all/site-specific"
changed_when: false
register: mon_server_lookup_result
when: site_specific_file.stat.exists == true

- name: Create the SecureDrop GNOME Shell Extension directories
file:
state: directory
path: "{{ item }}"
with_items: "{{ tails_config_extension_directories }}"

- name: Set normal user ownership on subset of directories.
become: yes
file:
state: directory
path: "{{ item }}"
owner: amnesia
group: amnesia
# Only set normal user ownership for files in ~amnesia.
when: item.startswith(tails_config_amnesia_home)
with_items: "{{ tails_config_extension_directories }}"

- name: Copy the extension metadata to the extension directory in Persistent Storage
become: yes
copy:
src: [email protected]/metadata.json
dest: "{{ tails_config_live_dotfiles }}/.local/share/gnome-shell/extensions/[email protected]/"
owner: amnesia
group: amnesia

- name: Copy the extension CSS to the extension directory in Persistent Storage
become: yes
copy:
src: [email protected]/stylesheet.css
dest: "{{ tails_config_live_dotfiles }}/.local/share/gnome-shell/extensions/[email protected]/"
owner: amnesia
group: amnesia

- name: Copy the symbolic icon used for the shell extension in Persistent Storage
become: yes
copy:
src: securedrop-symbolic.png
dest: "{{ tails_config_live_dotfiles }}/.local/share/gnome-shell/extensions/[email protected]/icons/"
owner: amnesia
group: amnesia

- name: Set the right variable for source
set_fact:
source_iface: "{{ sourcev3_interface_lookup_result }}"

- name: Set the right variable for journalist
set_fact:
journalist_iface: "{{ journalistv3_interface_lookup_result }}"

- name: Set the right variable for app server hostname
set_fact:
app_hostname: "{{ app_server_lookup_result }}"

- name: Set the right variable for app server hostname
set_fact:
mon_hostname: "{{ mon_server_lookup_result }}"

- name: Assemble interface information for extension
set_fact:
_securedrop_extension_info:
- src: extension.js.in
filename: extension.js
source_interface_address: "{{ source_iface.stdout }}"
journalist_interface_address: "{{ journalist_iface.stdout }}"
app_hostname: "{{ app_hostname.stdout }}"
mon_hostname: "{{ mon_hostname.stdout }}"

- name: Create SecureDrop extension
become: yes
template:
src: "{{ item.0.src }}"
dest: "{{ item.1 }}/{{ item.0.filename }}"
owner: amnesia
group: amnesia
mode: "0700"
with_nested:
- "{{ _securedrop_extension_info }}"
- "{{ tails_config_extension_directories }}"

- name: Add extension translations in Persistent Storage
zenmonkeykstop marked this conversation as resolved.
Show resolved Hide resolved
synchronize:
src: roles/tails-config/templates/locale/
dest: "{{ tails_config_live_dotfiles }}/.local/share/gnome-shell/extensions/[email protected]/locale/"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

- include: create_desktop_shortcuts.yml

- include: install_shell_extension.yml

- include: configure_network_hook.yml

- name: Check that we are on an admin workstation
Expand Down
21 changes: 21 additions & 0 deletions install_files/ansible-base/roles/tails-config/templates/ar.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ msgstr ""
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
"X-Generator: Weblate 2.20\n"

msgid "Launch Source Interface"
msgstr ""

msgid "Launch Journalist Interface"
msgstr ""

msgid "Check for SecureDrop Updates"
msgstr ""

msgid "SSH into the App Server"
msgstr ""

msgid "SSH into the Monitor Server"
msgstr ""

msgid "Open KeePassXC Password Vault"
msgstr ""

msgid "Open File Browser"
msgstr ""

#: desktop-journalist-icon.j2.in:10
msgid "SecureDrop Journalist Interface"
msgstr "واجهة SecureDrop للصحفيين"
Expand Down
21 changes: 21 additions & 0 deletions install_files/ansible-base/roles/tails-config/templates/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 3.4\n"

msgid "Launch Source Interface"
msgstr ""

msgid "Launch Journalist Interface"
msgstr ""

msgid "Check for SecureDrop Updates"
msgstr ""

msgid "SSH into the App Server"
msgstr ""

msgid "SSH into the Monitor Server"
msgstr ""

msgid "Open KeePassXC Password Vault"
msgstr ""

msgid "Open File Browser"
msgstr ""

#: desktop-journalist-icon.j2.in:10
msgid "SecureDrop Journalist Interface"
msgstr "Interfície de periodista del SecureDrop"
Expand Down
21 changes: 21 additions & 0 deletions install_files/ansible-base/roles/tails-config/templates/cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Weblate 3.7.1\n"

msgid "Launch Source Interface"
msgstr ""

msgid "Launch Journalist Interface"
msgstr ""

msgid "Check for SecureDrop Updates"
msgstr ""

msgid "SSH into the App Server"
msgstr ""

msgid "SSH into the Monitor Server"
msgstr ""

msgid "Open KeePassXC Password Vault"
msgstr ""

msgid "Open File Browser"
msgstr ""

#: desktop-journalist-icon.j2.in:10
msgid "SecureDrop Journalist Interface"
msgstr "SecureDrop rozhraní novináře"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2.17.1\n"

msgid "Launch Source Interface"
msgstr ""

msgid "Launch Journalist Interface"
msgstr ""

msgid "Check for SecureDrop Updates"
msgstr ""

msgid "SSH into the App Server"
msgstr ""

msgid "SSH into the Monitor Server"
msgstr ""

msgid "Open KeePassXC Password Vault"
msgstr ""

msgid "Open File Browser"
msgstr ""

#: desktop-journalist-icon.j2.in:10
msgid "SecureDrop Journalist Interface"
msgstr "Journalistenschnittstelle für SecureDrop"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,30 @@ msgstr ""
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "Launch Source Interface"
msgstr ""

msgid "Launch Journalist Interface"
msgstr ""

msgid "Check for SecureDrop Updates"
msgstr ""

msgid "SSH into the App Server"
msgstr ""

msgid "SSH into the Monitor Server"
msgstr ""

msgid "Open KeePassXC Password Vault"
msgstr ""

msgid "Open File Browser"
msgstr ""

#: desktop-journalist-icon.j2.in:10
msgid "SecureDrop Journalist Interface"
msgstr ""
Expand Down
21 changes: 21 additions & 0 deletions install_files/ansible-base/roles/tails-config/templates/el.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2.20\n"

msgid "Launch Source Interface"
msgstr ""

msgid "Launch Journalist Interface"
msgstr ""

msgid "Check for SecureDrop Updates"
msgstr ""

msgid "SSH into the App Server"
msgstr ""

msgid "SSH into the Monitor Server"
msgstr ""

msgid "Open KeePassXC Password Vault"
msgstr ""

msgid "Open File Browser"
msgstr ""

#: desktop-journalist-icon.j2.in:10
msgid "SecureDrop Journalist Interface"
msgstr "Διεπαφή δημοσιογράφου του SecureDrop"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2.20\n"

msgid "Launch Source Interface"
msgstr ""

msgid "Launch Journalist Interface"
msgstr ""

msgid "Check for SecureDrop Updates"
msgstr ""

msgid "SSH into the App Server"
msgstr ""

msgid "SSH into the Monitor Server"
msgstr ""

msgid "Open KeePassXC Password Vault"
msgstr ""

msgid "Open File Browser"
msgstr ""

#: desktop-journalist-icon.j2.in:10
msgid "SecureDrop Journalist Interface"
msgstr "Interfaz de periodista de SecureDrop"
Expand Down
Loading