Skip to content

Commit

Permalink
feat(client/linux): generate Debian package (#2255)
Browse files Browse the repository at this point in the history
Adds support for generating a Debian package (.deb) for Linux Outline Client.

This allows users to install Outline Client via sudo apt install Outline-Client.deb. The package installs the client to `/opt/Outline/`, it also creates a launch shortcut.
  • Loading branch information
jyyi1 authored Nov 4, 2024
1 parent 08678fd commit 5f20056
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
2 changes: 2 additions & 0 deletions client/electron/app_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const isWindows = os.platform() === 'win32';
/**
* Get the unpacked asar folder path.
* - For AppImage, `/tmp/.mount_OutlinXXXXXX/resources/app.asar.unpacked/`
* - For Debian, `/opt/Outline/resources/app.asar.unpacked`
* - For Windows, `C:\Program Files (x86)\Outline\`
* @returns A string representing the path of the unpacked asar folder.
*/
Expand All @@ -32,6 +33,7 @@ function unpackedAppPath() {
/**
* Get the parent directory path of the current application binary.
* - For AppImage, `/tmp/.mount_OutlinXXXXX/resources/app.asar`
* - For Debian, `/opt/Outline/resources/app.asar`
* - For Windows, `C:\Program Files (x86)\Outline\`
* @returns A string representing the path of the application directory.
*/
Expand Down
25 changes: 25 additions & 0 deletions client/electron/debian/after_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Copyright 2024 The Outline Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Dependencies:
# - libcap2-bin: setcap

set -eux

# Grant specific capabilities so Outline can run without root permisssion
# - cap_net_admin: configure network interfaces, set up routing tables, etc.
# - cap_dac_override: modify network configuration files owned by root
/usr/sbin/setcap cap_net_admin,cap_dac_override+eip /opt/Outline/Outline
19 changes: 17 additions & 2 deletions client/electron/electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"output": "output/client/electron/build"
},
"extraMetadata": {
"name": "outline-client",
"main": "output/client/electron/index.js"
},
"files": [
Expand All @@ -15,21 +16,35 @@
"output/client/electron",
"!output/client/electron/build"
],

"deb": {
"depends": [
"gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3",
"libcap2-bin"
],
"afterInstall": "client/electron/debian/after_install.sh"
},
"linux": {
"category": "Network",
"executableName": "Outline",
"files": [
"client/electron/linux_proxy_controller/dist",
"client/electron/icons/png",
"client/output/build/linux"
],
"icon": "client/electron/icons/png",
"target": {
"maintainer": "Jigsaw LLC",
"target": [{
"arch": [
"x64"
],
"target": "AppImage"
}
}, {
"arch": "x64",
"target": "deb"
}]
},

"nsis": {
"include": "client/electron/custom_install_steps.nsh",
"perMachine": true
Expand Down

0 comments on commit 5f20056

Please sign in to comment.