mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-22 20:26:50 +00:00
Update electron builds
This commit is contained in:
29
electron/scripts/add-debian-apt-repo.sh
Normal file
29
electron/scripts/add-debian-apt-repo.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Make necessary config and add Qortal Hub apt repo
|
||||
|
||||
# SCript to run HUB without sandbox
|
||||
echo \'/opt/${productFilename}/qortal-hub\' --no-sandbox > '/opt/${productFilename}/run-hub'
|
||||
chmod +x '/opt/${productFilename}/run-hub'
|
||||
|
||||
# Link to run-ui
|
||||
ln -sf '/opt/${productFilename}/run-hub' '/usr/bin/${executable}'
|
||||
|
||||
# SUID chrome-sandbox for Electron 5+
|
||||
sudo chown root '/opt/${productFilename}/chrome-sandbox' || true
|
||||
sudo chmod 4755 '/opt/${productFilename}/chrome-sandbox' || true
|
||||
|
||||
update-mime-database /usr/share/mime || true
|
||||
update-desktop-database /usr/share/applications || true
|
||||
|
||||
# Install curl if not installed on the system
|
||||
if ! which curl; then sudo apt-get --yes install curl; fi
|
||||
|
||||
# Install apt repository source list if it does not exist
|
||||
if ! grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep qortal-hub.list; then
|
||||
curl -sS https://update.qortal-hub.org/qortal-hub.gpg | sudo apt-key add -
|
||||
sudo rm -rf /usr/share/keyrings/qortal-hub.gpg
|
||||
sudo apt-key export E191E7C3 | sudo gpg --dearmour -o /usr/share/keyrings/qortal-hub.gpg
|
||||
sudo rm -rf /etc/apt/sources.list.d/qortal-hub.list
|
||||
echo 'deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/qortal-hub.gpg] https://update.qortal-hub.org/ ./ ' | sudo tee /etc/apt/sources.list.d/qortal-hub.list
|
||||
fi
|
39
electron/scripts/afterPack.js
Normal file
39
electron/scripts/afterPack.js
Normal file
@@ -0,0 +1,39 @@
|
||||
const path = require('path')
|
||||
const shell = require("shelljs")
|
||||
|
||||
const runShellCommand = (appOutDir) => {
|
||||
shell.exec(
|
||||
`chmod 4755 ${path.join(appOutDir, "chrome-sandbox")}`,
|
||||
|
||||
function (code, stdout, stderr) {
|
||||
console.log('runShellCommand ==> Exit code:', code)
|
||||
if (stderr) {
|
||||
console.log('runShellCommand ==> Program stderr:', stderr)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
async function doLinux(context) {
|
||||
console.log("Running doLinux ==> ")
|
||||
|
||||
const { targets, appOutDir } = context
|
||||
|
||||
targets.forEach(async target => {
|
||||
if (!["appimage", "snap"].includes(target.name.toLowerCase())) {
|
||||
await runShellCommand(appOutDir)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async function afterPack(context) {
|
||||
console.log("Running AfterPack")
|
||||
|
||||
const electronPlatformName = context.electronPlatformName.toLowerCase()
|
||||
|
||||
if (electronPlatformName.includes("linux")) {
|
||||
await doLinux(context)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = afterPack
|
21
electron/scripts/notarize.js
Normal file
21
electron/scripts/notarize.js
Normal file
@@ -0,0 +1,21 @@
|
||||
require('dotenv').config()
|
||||
const { notarize } = require('@electron/notarize')
|
||||
|
||||
exports.default = async function notarizing(context) {
|
||||
const { electronPlatformName, appOutDir } = context
|
||||
|
||||
if (electronPlatformName !== 'darwin') {
|
||||
return
|
||||
}
|
||||
|
||||
const appName = context.packager.appInfo.productFilename
|
||||
|
||||
return await notarize({
|
||||
appBundleId: 'org.qortal.Qortal-Hub',
|
||||
appPath: `${appOutDir}/${appName}.app`,
|
||||
tool: "notarytool",
|
||||
teamId: process.env.APPLETEAMID,
|
||||
appleId: process.env.APPLEID,
|
||||
appleIdPassword: process.env.APPLEIDPASS
|
||||
})
|
||||
}
|
34
electron/scripts/uninstall-debian-conf.sh
Normal file
34
electron/scripts/uninstall-debian-conf.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Remove all conf made by Qortal Hub
|
||||
|
||||
# Remove apt repository source list when user uninstalls app
|
||||
if grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep qortal-hub.list; then
|
||||
sudo rm /etc/apt/sources.list.d/qortal-hub.list;
|
||||
fi
|
||||
|
||||
# Get the root user
|
||||
if [ $SUDO_USER ];
|
||||
then getSudoUser=$SUDO_USER;
|
||||
else getSudoUser=`whoami`;
|
||||
fi
|
||||
|
||||
getDesktopEntry=/home/$getSudoUser/.config/autostart/qortal-hub.desktop;
|
||||
|
||||
# Remove desktop entry if exists
|
||||
if [ -f $getDesktopEntry ]; then
|
||||
sudo rm $getDesktopEntry;
|
||||
fi
|
||||
|
||||
# App directory which contains all the config and settings files
|
||||
appDirectory=/home/$getSudoUser/.config/qortal-hub/;
|
||||
|
||||
if [ -d $appDirectory ]; then
|
||||
sudo rm -rf $appDirectory;
|
||||
fi
|
||||
|
||||
# Delete the link to the binary
|
||||
rm -f '/usr/bin/${executable}'
|
||||
|
||||
# Delete run-hub
|
||||
rm -f '/opt/${productFilename}/run-hub'
|
Reference in New Issue
Block a user