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

feat(updater): Add .deb Package Support to Linux Updater #1991

Merged
merged 45 commits into from
Nov 26, 2024

Conversation

jLynx
Copy link
Contributor

@jLynx jLynx commented Nov 1, 2024

Description

This PR extends the Linux updater functionality to support .deb package updates alongside the existing AppImage support. The implementation includes multiple authentication methods for package installation, providing a user-friendly update experience for Debian-based distributions.

Note: This PR relies on tauri-apps/tauri#11562

Key Features

  • Support for both .deb packages and AppImage updates
  • Multiple privilege escalation methods:
  1. pkexec (primary, graphical)
  2. zenity for GUI password prompt
  3. Terminal-based sudo as fallback
  • Automatic detection of installation type (AppImage vs .deb)
  • Secure handling of authentication and package installation

Technical Details

  • Added new error types for authentication and installation failures
  • Implemented .deb package extraction from both direct files and tar.gz archives
  • Added helper methods for privilege escalation and authentication
  • Maintained backward compatibility with existing AppImage functionality

Expected Archive Structures

├── [AppName]_[version]_amd64.AppImage.tar.gz
   └──[AppName]_[version]_amd64.AppImage
├── [AppName]_[version]_amd64.deb
└── ...

Testing

  • Tested on Debian-based distributions
  • Verified both .deb and AppImage update paths
  • Tested various authentication scenarios

Notes

  • Requires zenity for graphical password prompt (optional)
  • Falls back to terminal-based authentication if graphical methods fail
  • Maintains security by properly handling sensitive authentication data

@jLynx jLynx requested a review from a team as a code owner November 1, 2024 03:12
@jLynx jLynx changed the title Add .deb Package Support to Linux Updater feat(updater): Add .deb Package Support to Linux Updater Nov 1, 2024
@jLynx
Copy link
Contributor Author

jLynx commented Nov 3, 2024

Copy link
Contributor

github-actions bot commented Nov 4, 2024

Package Changes Through ce46dd5

There are 17 changes which include upload with minor, upload-js with minor, updater with minor, deep-link with patch, deep-link-js with patch, fs with minor, persisted-scope with minor, log-plugin with patch, log-js with patch, fs-js with patch, http with patch, localhost with minor, opener with major, opener-js with major, positioner-js with minor, positioner with minor, sql with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.5 2.0.6
api-example-js 2.0.2 2.0.3
deep-link-example-js 2.0.0 2.0.1
deep-link 2.0.1 2.0.2
deep-link-js 2.0.0 2.0.1
fs 2.0.3 2.1.0
fs-js 2.0.2 2.0.3
dialog 2.0.3 2.0.4
opener 1.0.0 2.0.0
opener-js 1.0.0 2.0.0
http 2.0.3 2.0.4
localhost 2.0.1 2.1.0
log-plugin 2.0.2 2.0.3
log-js 2.0.0 2.0.1
persisted-scope 2.0.3 2.1.0
positioner 2.0.2 2.1.0
positioner-js 2.0.1 2.1.0
single-instance 2.0.1 2.0.2
sql 2.0.2 2.0.3
updater 2.0.2 2.1.0
upload 2.1.0 2.2.0
upload-js 2.1.0 2.2.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@jLynx jLynx requested a review from amrbashir November 7, 2024 21:10
plugins/updater/src/updater.rs Outdated Show resolved Hide resolved
plugins/updater/src/updater.rs Outdated Show resolved Hide resolved
plugins/updater/src/updater.rs Show resolved Hide resolved
plugins/updater/src/updater.rs Outdated Show resolved Hide resolved
plugins/updater/src/updater.rs Outdated Show resolved Hide resolved
plugins/updater/src/updater.rs Show resolved Hide resolved
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you also need to add a change file in .changes directory

plugins/updater/src/updater.rs Outdated Show resolved Hide resolved
@jLynx
Copy link
Contributor Author

jLynx commented Nov 12, 2024

Will jump on your requested changes tomorrow morning as its EOD for me (NZ Timezone)

@jLynx jLynx requested a review from amrbashir November 13, 2024 21:41
@amrbashir
Copy link
Member

amrbashir commented Nov 24, 2024

@jLynx let's revert the updater test changes, I will merge the PR and add the test later in #2060 as I can't figure how to get MSI test to pass yet and I don't want to hold this PR for that.

@jLynx
Copy link
Contributor Author

jLynx commented Nov 24, 2024

ok cool, I will jump onto this in the next couple of hours

@jLynx jLynx requested a review from amrbashir November 24, 2024 21:05
@jLynx
Copy link
Contributor Author

jLynx commented Nov 24, 2024

Removed the tests, so should be good to go @amrbashir

@jLynx
Copy link
Contributor Author

jLynx commented Nov 24, 2024

Fixed the formatting @amrbashir

@amrbashir amrbashir merged commit f8f2eef into tauri-apps:v2 Nov 26, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants