feat(photos): unlock hidden albums with system login

This commit is contained in:
nvrl committed 2026-11-19 20:55:26 +01:00
1 parent 1e6043d12a
commit cc020bfb54
23 files changed
+175 -129

No files matched your search

+2 -1
View File
@@ -156,6 +156,7 @@ jobs:
cp packaging/io.narl.proton-drive-linux.desktop deb/usr/share/applications/
cp packaging/io.narl.proton-drive-linux-tray.desktop deb/etc/xdg/autostart/
cp packaging/io.narl.proton-drive-linux.svg deb/usr/share/icons/hicolor/scalable/apps/
install -Dm644 packaging/io.narl.proton-drive-linux.policy deb/usr/share/polkit-1/actions/io.narl.proton-drive-linux.policy
cp packaging/proton-drive.service deb/usr/lib/systemd/user/
cp LICENSE deb/usr/share/licenses/proton-drive-linux/
po/build.sh deb/usr/share/locale
@@ -175,7 +176,7 @@ jobs:
Priority: optional
Architecture: amd64
Maintainer: Nils Pukropp <contact@narl.io>
Depends: fuse3, libgtk-4-1 (>= 4.12.0), libadwaita-1-0 (>= 1.5.0), libsecret-1-0, libwebkitgtk-6.0-4, libimage-exiftool-perl
Depends: polkitd, fuse3, libgtk-4-1 (>= 4.12.0), libadwaita-1-0 (>= 1.5.0), libsecret-1-0, libwebkitgtk-6.0-4, libimage-exiftool-perl
Installed-Size: ${INSTALLED_SIZE}
Homepage: https://proton-drive.narl.io
Description: Unofficial Proton Drive client for Linux
Generated
+7 -7
View File
@@ -3611,7 +3611,6 @@ dependencies = [
name = "pdfs-core"
version = "3.9.0"
dependencies = [
"argon2",
"async-trait",
"base64 0.23.1",
"chrono",
@@ -3659,6 +3658,7 @@ dependencies = [
"pg-app",
"pg-core",
"proton-drive-rs",
"rustix",
"serde",
"serde_json",
"sha1 0.11.0",
@@ -3710,8 +3710,8 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "pg-app"
version = "0.2.0"
source = "git+https://github.com/narrrl/proton-gallery.git?rev=b841c37ad57694470f499f575f7a956425c28ade#b841c37ad57694470f499f575f7a956425c28ade"
version = "0.3.0"
source = "git+https://github.com/narrrl/proton-gallery.git?rev=858d2446f71214ec5357eb8b543d6b82abf47386#858d2446f71214ec5357eb8b543d6b82abf47386"
dependencies = [
"async-trait",
"hex",
@@ -3730,8 +3730,8 @@ dependencies = [
[[package]]
name = "pg-core"
version = "0.2.0"
source = "git+https://github.com/narrrl/proton-gallery.git?rev=b841c37ad57694470f499f575f7a956425c28ade#b841c37ad57694470f499f575f7a956425c28ade"
version = "0.3.0"
source = "git+https://github.com/narrrl/proton-gallery.git?rev=858d2446f71214ec5357eb8b543d6b82abf47386#858d2446f71214ec5357eb8b543d6b82abf47386"
dependencies = [
"aes-gcm 0.11.1",
"async-trait",
@@ -3750,8 +3750,8 @@ dependencies = [
[[package]]
name = "pg-drive"
version = "0.2.0"
source = "git+https://github.com/narrrl/proton-gallery.git?rev=b841c37ad57694470f499f575f7a956425c28ade#b841c37ad57694470f499f575f7a956425c28ade"
version = "0.3.0"
source = "git+https://github.com/narrrl/proton-gallery.git?rev=858d2446f71214ec5357eb8b543d6b82abf47386#858d2446f71214ec5357eb8b543d6b82abf47386"
dependencies = [
"async-trait",
"hex",
+2 -2
View File
@@ -17,8 +17,8 @@ categories = ["filesystem", "command-line-utilities"]
[workspace.dependencies]
proton-sdk = { version = "0.12.1" }
proton-drive-rs = { version = "0.12.1" }
pg-app = { git = "https://github.com/narrrl/proton-gallery.git", rev = "b841c37ad57694470f499f575f7a956425c28ade" }
pg-core = { git = "https://github.com/narrrl/proton-gallery.git", rev = "b841c37ad57694470f499f575f7a956425c28ade" }
pg-app = { git = "https://github.com/narrrl/proton-gallery.git", rev = "858d2446f71214ec5357eb8b543d6b82abf47386" }
pg-core = { git = "https://github.com/narrrl/proton-gallery.git", rev = "858d2446f71214ec5357eb8b543d6b82abf47386" }
chrono = { version = "0.4", default-features = false, features = ["std"] }
# Internal crates.
-1
View File
@@ -10,7 +10,6 @@ homepage.workspace = true
description = "Core auth/session/config for the Proton Drive Linux client"
[dependencies]
argon2 = "0.5"
proton-sdk.workspace = true
proton-drive-rs.workspace = true
chrono.workspace = true
-42
View File
@@ -128,48 +128,6 @@ fn with_keyring<T>(op: impl Fn(&Entry) -> keyring_core::Result<T>) -> Result<T>
with_keyring_entry(KEYRING_SERVICE, KEYRING_USER, op)
}
/// Verify the machine-local Gallery passphrase, setting it on first use.
pub fn unlock_gallery(username: &str, passphrase: &str) -> std::result::Result<(), String> {
use argon2::password_hash::{PasswordHash, PasswordHasher, PasswordVerifier, SaltString};
use std::io::Read;
if passphrase.is_empty() || passphrase.len() > 1024 {
return Err("Enter your Gallery passphrase.".into());
}
static VERIFY: parking_lot::Mutex<()> = parking_lot::Mutex::new(());
let _verify = VERIFY.lock();
let service = "io.narl.protongallery";
let user = format!("hidden-albums:{username}");
let argon = argon2::Argon2::default();
match with_keyring_entry(service, &user, Entry::get_password) {
Ok(stored) => {
let hash = PasswordHash::new(&stored)
.map_err(|_| "The saved Gallery passphrase is unreadable.")?;
argon
.verify_password(passphrase.as_bytes(), &hash)
.map_err(|_| "The Gallery passphrase is incorrect.".into())
}
Err(Error::Keyring(keyring_core::Error::NoEntry)) => {
if passphrase.chars().count() < 12 {
return Err("Choose a Gallery passphrase with at least 12 characters.".into());
}
let mut bytes = [0; 16];
std::fs::File::open("/dev/urandom")
.and_then(|mut file| file.read_exact(&mut bytes))
.map_err(|_| "Couldn’t generate the passphrase salt.")?;
let salt = SaltString::encode_b64(&bytes)
.map_err(|_| "Couldn’t generate the passphrase salt.")?;
let hash = argon
.hash_password(passphrase.as_bytes(), &salt)
.map_err(|_| "Couldn’t protect the Gallery passphrase.")?
.to_string();
with_keyring_entry(service, &user, |entry| entry.set_password(&hash))
.map_err(|_| "Couldn’t save the Gallery passphrase in the system keyring.".into())
}
Err(_) => Err("The system keyring is locked or unavailable.".into()),
}
}
/// Run `op` on the entry `service`/`user`, reconnecting once if the Secret
/// Service fails the call.
///
+1 -3
View File
@@ -2019,9 +2019,7 @@ pub struct MappingProgress {
/// Actions on saved Drive folder galleries.
#[derive(Serialize, Deserialize, Debug, Clone)]
pub enum GalleryAction {
Unlock {
passphrase: String,
},
AuthenticateHidden,
Lock,
List {
album: Option<GalleryPlace>,
+1
View File
@@ -27,6 +27,7 @@ tokio.workspace = true
tracing.workspace = true
fuser.workspace = true
libc.workspace = true
rustix = { version = "1", features = ["net", "process"] }
serde.workspace = true
serde_json.workspace = true
base64.workspace = true
+7 -2
View File
@@ -396,8 +396,8 @@ fn touched_topics(request: &CtlRequest) -> &'static [Topic] {
use CtlRequest as R;
match request {
R::Pin { .. } | R::Unpin { .. } => &[Topic::Files],
// Unlock affects private requests only. Publishing the lock notification
// here for Unlock as well could close the view that just opened.
// Only locking invalidates a hidden view. Authentication does not
// change the public catalog and must not emit this notification.
R::DriveGallery {
action: pdfs_core::control::GalleryAction::Lock,
} => &[Topic::GalleryVisibility],
@@ -952,6 +952,11 @@ fn handle_control_conn(core: &Core, username: &str, mountpoint: &Path, stream: U
},
None => CtlResponse::error(CoreError::invalid(format!("bad uid: {uid}"))),
},
Ok(CtlRequest::DriveGallery {
action: pdfs_core::control::GalleryAction::AuthenticateHidden,
}) => core
.authenticate_hidden_gallery(&stream)
.unwrap_or_else(CtlResponse::error),
Ok(CtlRequest::DriveGallery { action }) => core
.drive_gallery(action)
.unwrap_or_else(CtlResponse::error),
+32 -12
View File
@@ -431,20 +431,40 @@ impl Core {
.ok_or_else(|| CoreError::remote("The Gallery session is unavailable"))
}
pub(super) fn authenticate_hidden_gallery(
&self,
stream: &std::os::unix::net::UnixStream,
) -> CoreResult<Response> {
let gallery = self.gallery_host()?;
let access = gallery.access.load(Ordering::SeqCst);
let peer = rustix::net::sockopt::socket_peercred(stream)
.map_err(|_| CoreError::invalid("Couldn’t identify the authentication requester."))?;
if peer.uid != rustix::process::geteuid() {
return Err(CoreError::invalid(
"Use your Linux sign-in to unlock Hidden albums.",
));
}
let subject = pg_app::desktop_auth::Subject::new(
peer.pid.as_raw_nonzero().get() as u32,
peer.uid.as_raw(),
)
.map_err(gallery_error)?;
self.rt
.block_on(subject.authenticate("io.narl.proton-drive-linux.unlock-hidden-albums"))
.map_err(gallery_error)?;
if gallery.cancel.is_cancelled() {
return Err(CoreError::invalid("The Gallery session has ended."));
}
gallery
.access
.compare_exchange(access, access | 1, Ordering::SeqCst, Ordering::SeqCst)
.map_err(|_| CoreError::invalid("Hidden albums were locked"))?;
Ok(done())
}
pub(super) fn drive_gallery(&self, action: GalleryAction) -> CoreResult<Response> {
let gallery = self.gallery_host()?;
let action = match action {
GalleryAction::Unlock { passphrase } => {
let passphrase = zeroize::Zeroizing::new(passphrase);
let access = gallery.access.load(Ordering::SeqCst);
pdfs_core::auth::unlock_gallery(gallery.session.username(), &passphrase)
.map_err(gallery_error)?;
gallery
.access
.compare_exchange(access, access | 1, Ordering::SeqCst, Ordering::SeqCst)
.map_err(|_| CoreError::invalid("Hidden albums were locked"))?;
return Ok(done());
}
GalleryAction::Lock => {
gallery.lock();
return Ok(done());
@@ -457,7 +477,7 @@ impl Core {
.ensure_visibility(self, app, matches!(action, GalleryAction::Refresh))
.await?;
match action {
GalleryAction::Unlock { .. } | GalleryAction::Lock => unreachable!(),
GalleryAction::AuthenticateHidden | GalleryAction::Lock => unreachable!(),
GalleryAction::List {
album,
offset,
@@ -31,6 +31,7 @@ pub(crate) struct Browser {
root_reload: Cell<bool>,
preview: glib::WeakRef<adw::Dialog>,
unlock_pending: Cell<bool>,
unlock_verified: Cell<bool>,
rows: gio::ListStore,
scroll: gtk4::ScrolledWindow,
title: adw::WindowTitle,
@@ -75,7 +76,9 @@ impl Browser {
self.next_request();
self.loading.set(false);
self.total.set(0);
if self.unlocked.replace(false) || self.unlock_pending.get() {
let was_unlocked = self.unlocked.replace(false);
let was_verified = self.unlock_verified.replace(false);
if was_unlocked || was_verified || self.unlock_pending.get() {
self.lock();
}
if let Some(preview) = self.preview.upgrade() {
@@ -120,6 +123,15 @@ impl Browser {
if !self.active() || self.chooser.borrow().is_some() || self.unlock_pending.get() {
return;
}
if self.unlock_verified.get() {
if locked {
self.close();
}
return;
}
if !self.unlocked.get() && self.current().is_none() {
return;
}
if let Some(preview) = self.preview.upgrade() {
preview.force_close();
}
@@ -393,7 +405,6 @@ impl Browser {
}
fn change(self: &Rc<Self>, action: GalleryAction) {
let unlock = matches!(action, GalleryAction::Unlock { .. });
let update_root = matches!(
action,
GalleryAction::Add { .. }
@@ -401,9 +412,6 @@ impl Browser {
| GalleryAction::Refresh
| GalleryAction::Cover { .. }
);
if unlock && self.unlock_pending.replace(true) {
return;
}
self.unlock.set_visible(false);
let generation = self.next_request();
self.status.set_label(&gettext("Updating gallery…"));
@@ -414,25 +422,11 @@ impl Browser {
let browser = self.clone();
glib::spawn_future_local(async move {
let result = rx.recv().await;
if unlock {
browser.unlock_pending.set(false);
browser.unlock.set_visible(
browser.active()
&& browser.generation.get() == generation
&& !matches!(result, Ok(Ok(Response::Ok { .. }))),
);
}
if browser.generation.get() != generation {
if unlock && matches!(result, Ok(Ok(Response::Ok { .. }))) {
browser.lock();
}
return;
}
match result {
Ok(Ok(Response::Ok { .. })) => {
if unlock {
browser.unlocked.set(true);
}
let added = browser.chooser.borrow().is_some();
if update_root {
browser.load_root();
@@ -467,36 +461,58 @@ impl Browser {
}
fn prompt_unlock(self: &Rc<Self>) {
if self.unlock_pending.get() {
if self.unlock_pending.replace(true) {
return;
}
let Some(parent) = ui_window(&self.ui) else {
return;
};
let dialog = adw::AlertDialog::builder()
.heading(gettext("Unlock Hidden Albums"))
.body(gettext("Enter your Gallery passphrase. On first use, choose one with at least 12 characters."))
.build();
let password = gtk4::PasswordEntry::builder().show_peek_icon(true).build();
dialog.set_extra_child(Some(&password));
dialog.add_response("cancel", &gettext("Cancel"));
dialog.add_response("unlock", &gettext("Unlock"));
dialog.set_response_appearance("unlock", adw::ResponseAppearance::Suggested);
dialog.set_default_response(Some("unlock"));
let browser = Rc::downgrade(self);
dialog.connect_response(None, move |_, response| {
let passphrase = password.text().to_string();
password.set_text("");
if response == "unlock"
&& let Some(browser) = browser.upgrade()
{
browser.enter();
browser.more.set_visible(false);
browser.title.set_title(&gettext("Hidden albums"));
browser.change(GalleryAction::Unlock { passphrase });
self.enter();
self.more.set_visible(false);
self.unlock.set_visible(false);
self.title.set_title(&gettext("Hidden albums"));
self.status
.set_label(&gettext("Use your Linux sign-in to unlock Hidden albums."));
let generation = self.next_request();
let rx = spawn_request(
self.ui.dirs.control_socket(),
Request::DriveGallery {
action: GalleryAction::AuthenticateHidden,
},
);
let browser = self.clone();
glib::spawn_future_local(async move {
let result = rx.recv().await;
browser.unlock_pending.set(false);
if browser.generation.get() != generation {
if matches!(result, Ok(Ok(Response::Ok { .. }))) {
browser.lock();
}
return;
}
match result {
Ok(Ok(Response::Ok { .. })) => {
browser.unlock_verified.set(true);
browser.reveal_verified();
}
Ok(Ok(Response::Error { message, .. })) => {
browser.status.set_label(&message);
browser.unlock.set_visible(true);
}
_ => {
browser
.status
.set_label(&gettext("Couldn't reach Proton Drive."));
browser.unlock.set_visible(true);
}
}
});
dialog.present(Some(&parent));
}
fn reveal_verified(self: &Rc<Self>) {
if ui_window(&self.ui).is_some_and(|window| window.is_active())
&& self.unlock_verified.replace(false)
{
self.unlocked.set(true);
self.load(0, 0.0);
}
}
pub(crate) fn back(self: &Rc<Self>) {
@@ -713,6 +729,7 @@ pub(crate) fn wire(
root_loading: Cell::new(false),
preview: glib::WeakRef::new(),
unlock_pending: Cell::new(false),
unlock_verified: Cell::new(false),
rows,
scroll: scroll.clone(),
title,
@@ -737,10 +754,12 @@ pub(crate) fn wire(
*ui.drive_galleries.borrow_mut() = Rc::downgrade(&browser);
let weak = Rc::downgrade(&browser);
window.connect_is_active_notify(move |window| {
if !window.is_active()
&& let Some(browser) = weak.upgrade()
&& (browser.unlocked.get() || browser.unlock_pending.get())
{
let Some(browser) = weak.upgrade() else {
return;
};
if window.is_active() {
browser.reveal_verified();
} else if browser.unlocked.get() {
browser.close();
}
});
+1 -1
View File
@@ -20,7 +20,7 @@ Schema: **46**. Photos adds a local database migration for incremental metadata
- Open **Drive galleries** in Photos → Albums to browse saved My files folders and their
subfolders, choose album covers, and manage public links. Saved galleries and
covers sync with Proton Gallery on desktop and Android.
- Unlock hidden albums from the Albums view with the local Gallery passphrase.
- Unlock hidden albums from the Albums view with your Linux sign-in.
### Changed
+13 -4
View File
@@ -9,10 +9,19 @@ gallery by choosing a folder from **My files**. Opening it or any subfolder
keeps you in Photos. Back or Escape returns to the parent and its scroll
position.
**Hidden albums** opens with the Gallery passphrase stored for this account in
your Linux keyring. It includes hidden Proton albums and hidden Drive gallery
folders, including folders inside public galleries. Leaving Hidden albums or
switching away from the window locks it and closes its previews.
**Hidden albums** opens with your Linux sign-in. The app uses the desktop
polkit prompt, so it needs a running authentication agent and the installed
polkit policy. Existing hidden albums remain hidden after upgrading. This view
includes hidden Proton albums and hidden Drive folders, including folders
inside public galleries. Leaving Hidden albums or switching away from the
window locks it and closes its previews.
For a system package, the policy is installed with the app. For a source build
or a per-user tarball install, have your system administrator install
`packaging/io.narl.proton-drive-linux.policy` (or the corresponding file under the
tarball's `share/polkit-1/actions/`) into the system polkit actions directory.
On NixOS, enable `security.polkit` and install the package system-wide to
register its policy.
GTK pages Timeline, Proton albums, and Places through the Drive daemon's Photos
control requests backed by its SQLite database. Saved Drive galleries come from
+4 -1
View File
@@ -15,7 +15,7 @@ pkgdesc="Unofficial Proton Drive client for Linux: files-on-demand FUSE mount, C
arch=('x86_64')
url="https://proton-drive.narl.io"
license=('MIT')
depends=('fuse3' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'perl-image-exiftool')
depends=('fuse3' 'polkit' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'perl-image-exiftool')
makedepends=('cargo' 'git' 'gettext')
provides=('pdfs')
# Files-on-demand mount + keyring need these at runtime.
@@ -77,6 +77,9 @@ package() {
install -Dm644 "packaging/proton-drive.service" \
"$pkgdir/usr/lib/systemd/user/proton-drive.service"
install -Dm644 "packaging/io.narl.proton-drive-linux.policy" \
"$pkgdir/usr/share/polkit-1/actions/io.narl.proton-drive-linux.policy"
# Translations: compiled from po/ into /usr/share/locale.
po/build.sh "$pkgdir/usr/share/locale"
@@ -7,6 +7,7 @@ pkgbase = proton-drive-for-linux-bin
arch = x86_64
license = MIT
depends = fuse3
depends = polkit
depends = gtk4
depends = libadwaita
depends = webkitgtk-6.0
@@ -8,7 +8,7 @@ arch=('x86_64')
url="https://proton-drive.narl.io"
_repo="https://github.com/narrrl/proton-drive-linux"
license=('MIT')
depends=('fuse3' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'dbus' 'gcc-libs' 'glibc'
depends=('fuse3' 'polkit' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'dbus' 'gcc-libs' 'glibc'
'hicolor-icon-theme')
optdepends=('perl-image-exiftool: thumbnails for camera RAW files'
'ffmpeg: video thumbnails'
@@ -10,6 +10,7 @@ pkgbase = proton-drive-for-linux-git
makedepends = git
makedepends = gettext
depends = fuse3
depends = polkit
depends = gtk4
depends = libadwaita
depends = webkitgtk-6.0
@@ -8,7 +8,7 @@ arch=('x86_64')
url="https://proton-drive.narl.io"
_repo="https://github.com/narrrl/proton-drive-linux"
license=('MIT')
depends=('fuse3' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'dbus' 'gcc-libs' 'glibc'
depends=('fuse3' 'polkit' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'dbus' 'gcc-libs' 'glibc'
'hicolor-icon-theme')
makedepends=('cargo' 'git' 'gettext')
optdepends=('perl-image-exiftool: thumbnails for camera RAW files'
@@ -78,6 +78,9 @@ package() {
install -Dm644 packaging/proton-drive.service \
"$pkgdir/usr/lib/systemd/user/proton-drive.service"
install -Dm644 "packaging/io.narl.proton-drive-linux.policy" \
"$pkgdir/usr/share/polkit-1/actions/io.narl.proton-drive-linux.policy"
# Translations: compiled from po/ into /usr/share/locale.
po/build.sh "$pkgdir/usr/share/locale"
@@ -9,6 +9,7 @@ pkgbase = proton-drive-for-linux
makedepends = cargo
makedepends = gettext
depends = fuse3
depends = polkit
depends = gtk4
depends = libadwaita
depends = webkitgtk-6.0
@@ -8,7 +8,7 @@ arch=('x86_64')
url="https://proton-drive.narl.io"
_repo="https://github.com/narrrl/proton-drive-linux"
license=('MIT')
depends=('fuse3' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'dbus' 'gcc-libs' 'glibc'
depends=('fuse3' 'polkit' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'dbus' 'gcc-libs' 'glibc'
'hicolor-icon-theme')
makedepends=('cargo' 'gettext')
optdepends=('perl-image-exiftool: thumbnails for camera RAW files'
@@ -73,6 +73,9 @@ package() {
install -Dm644 packaging/proton-drive.service \
"$pkgdir/usr/lib/systemd/user/proton-drive.service"
install -Dm644 "packaging/io.narl.proton-drive-linux.policy" \
"$pkgdir/usr/share/polkit-1/actions/io.narl.proton-drive-linux.policy"
# Translations: compiled from po/ into /usr/share/locale.
po/build.sh "$pkgdir/usr/share/locale"
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD polkit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
<policyconfig>
<action id="io.narl.proton-drive-linux.unlock-hidden-albums">
<description>Unlock Hidden albums in Proton Drive</description>
<message>Authenticate to unlock Hidden albums in Proton Drive</message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_self</allow_active>
</defaults>
</action>
</policyconfig>
+5 -1
View File
@@ -15,6 +15,7 @@
webkitgtk_6_0,
libsecret,
dbus,
polkit,
exiftool,
ffmpeg-headless,
withFfmpeg ? true,
@@ -36,6 +37,7 @@ rustPlatform.buildRustPackage {
../../crates
../../po
../../LICENSE
../io.narl.proton-drive-linux.policy
../proton-drive.service
../io.narl.proton-drive-linux.desktop
../io.narl.proton-drive-linux-tray.desktop
@@ -103,6 +105,8 @@ rustPlatform.buildRustPackage {
substituteInPlace $out/etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop \
--replace-fail "Exec=pdfs-tray" "Exec=$out/bin/pdfs-tray"
install -Dm644 packaging/io.narl.proton-drive-linux.policy \
$out/share/polkit-1/actions/io.narl.proton-drive-linux.policy
install -Dm644 packaging/proton-drive.service \
$out/lib/systemd/user/proton-drive.service
substituteInPlace $out/lib/systemd/user/proton-drive.service \
@@ -123,7 +127,7 @@ rustPlatform.buildRustPackage {
# it is the setuid wrapper in /run/wrappers/bin.
preFixup = ''
gappsWrapperArgs+=(--suffix PATH : ${
lib.makeBinPath ([ exiftool ] ++ lib.optional withFfmpeg ffmpeg-headless)
lib.makeBinPath ([ exiftool polkit ] ++ lib.optional withFfmpeg ffmpeg-headless)
})
'';
+4
View File
@@ -39,6 +39,7 @@ BuildRequires: glib2-devel
BuildRequires: webkitgtk6.0-devel
BuildRequires: gettext
Requires: polkit
Requires: fuse3
Requires: gtk4
Requires: libadwaita
@@ -114,6 +115,8 @@ install -D -m0644 %{src}/packaging/io.narl.proton-drive-linux-tray.desktop \
%{buildroot}%{_sysconfdir}/xdg/autostart/io.narl.proton-drive-linux-tray.desktop
install -D -m0644 %{src}/packaging/io.narl.proton-drive-linux.svg \
%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg
install -D -m0644 %{src}/packaging/io.narl.proton-drive-linux.policy \
%{buildroot}/usr/share/polkit-1/actions/io.narl.proton-drive-linux.policy
install -D -m0644 %{src}/packaging/proton-drive.service \
%{buildroot}/usr/lib/systemd/user/proton-drive.service
%{src}/po/build.sh %{buildroot}%{_datadir}/locale
@@ -152,6 +155,7 @@ fi
%{_sysconfdir}/xdg/autostart/io.narl.proton-drive-linux-tray.desktop
%{_datadir}/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg
/usr/lib/systemd/user/proton-drive.service
%{_datadir}/polkit-1/actions/io.narl.proton-drive-linux.policy
%{_datadir}/locale/*/LC_MESSAGES/pdfs.mo
%{_datadir}/bash-completion/completions/pdfs
%{_datadir}/zsh/site-functions/_pdfs
+2
View File
@@ -32,6 +32,8 @@ install -Dm644 "$repo/packaging/io.narl.proton-drive-linux-tray.desktop" \
"$root/etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop"
install -Dm644 "$repo/packaging/io.narl.proton-drive-linux.svg" \
"$root/share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg"
install -Dm644 "$repo/packaging/io.narl.proton-drive-linux.policy" \
"$root/share/polkit-1/actions/io.narl.proton-drive-linux.policy"
install -Dm644 "$repo/packaging/proton-drive.service" \
"$root/lib/systemd/user/proton-drive.service"
install -Dm644 "$repo/LICENSE" "$root/share/licenses/proton-drive-linux/LICENSE"