diff --git a/client/electron/app_paths.ts b/client/electron/app_paths.ts index 4bbc4498bc..8808655647 100644 --- a/client/electron/app_paths.ts +++ b/client/electron/app_paths.ts @@ -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. */ @@ -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. */ diff --git a/client/electron/debian/after_install.sh b/client/electron/debian/after_install.sh new file mode 100644 index 0000000000..f2a785aae1 --- /dev/null +++ b/client/electron/debian/after_install.sh @@ -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 diff --git a/client/electron/electron-builder.json b/client/electron/electron-builder.json index daff0bdff0..af2651b054 100644 --- a/client/electron/electron-builder.json +++ b/client/electron/electron-builder.json @@ -7,6 +7,7 @@ "output": "output/client/electron/build" }, "extraMetadata": { + "name": "outline-client", "main": "output/client/electron/index.js" }, "files": [ @@ -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