mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-04-23 19:37:52 +00:00
Merge pull request #5 from AlphaX-Qortal/feature/initial-conversion
Update electron builds
This commit is contained in:
commit
ac614cba66
@ -1,8 +1,8 @@
|
|||||||
import type { CapacitorConfig } from '@capacitor/cli';
|
import type { CapacitorConfig } from '@capacitor/cli';
|
||||||
|
|
||||||
const config: CapacitorConfig = {
|
const config: CapacitorConfig = {
|
||||||
appId: 'com.example.app',
|
appId: 'org.Qortal.Qortal-Hub',
|
||||||
appName: 'Qortal ',
|
appName: 'Qortal-Hub',
|
||||||
webDir: 'dist',
|
webDir: 'dist',
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"LocalNotifications": {
|
"LocalNotifications": {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import type { CapacitorConfig } from '@capacitor/cli';
|
import type { CapacitorConfig } from '@capacitor/cli';
|
||||||
|
|
||||||
const config: CapacitorConfig = {
|
const config: CapacitorConfig = {
|
||||||
appId: 'com.example.app',
|
appId: 'org.Qortal.Qortal-Hub',
|
||||||
appName: 'Qortal ',
|
appName: 'Qortal-Hub',
|
||||||
webDir: 'dist',
|
webDir: 'dist',
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"LocalNotifications": {
|
"LocalNotifications": {
|
||||||
|
46
electron/electron-builder.config.arm.json
Normal file
46
electron/electron-builder.config.arm.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"appId": "org.qortal.Qortal-Hub",
|
||||||
|
"productName": "Qortal Hub",
|
||||||
|
"copyright": "Copyright © 2021 - 2025 Qortal",
|
||||||
|
"compression": "normal",
|
||||||
|
"asar": "true",
|
||||||
|
"afterPack": "scripts/afterPack.js",
|
||||||
|
"files": [
|
||||||
|
"assets/**/*",
|
||||||
|
"build/**/*",
|
||||||
|
"capacitor.config.*",
|
||||||
|
"app/**/*"
|
||||||
|
],
|
||||||
|
"linux": {
|
||||||
|
"target": [
|
||||||
|
"AppImage",
|
||||||
|
"deb"
|
||||||
|
],
|
||||||
|
"category": "Network",
|
||||||
|
"packageCategory": "Network",
|
||||||
|
"desktop": {
|
||||||
|
"StartupWMClass": "qortal-hub"
|
||||||
|
},
|
||||||
|
"executableName": "Qortal Hub",
|
||||||
|
"icon": "assets/png"
|
||||||
|
},
|
||||||
|
"appImage": {
|
||||||
|
"artifactName": "Qortal-Hub-Setup-arm64_${version}.${ext}"
|
||||||
|
},
|
||||||
|
"deb": {
|
||||||
|
"artifactName": "Qortal-Hub-Setup-arm64_${version}.${ext}",
|
||||||
|
"synopsis": "Qortal Hub for Linux"
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"output": "dist",
|
||||||
|
"buildResources": "resources"
|
||||||
|
},
|
||||||
|
"publish": [
|
||||||
|
{
|
||||||
|
"provider": "github",
|
||||||
|
"owner": "Qortal",
|
||||||
|
"repo": "Qortal-Hub",
|
||||||
|
"releaseType": "draft"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"appId": "com.github.Qortal.Qortal-Hub",
|
"appId": "org.Qortal.Qortal-Hub",
|
||||||
"directories": {
|
"directories": {
|
||||||
"buildResources": "resources"
|
"buildResources": "resources"
|
||||||
},
|
},
|
||||||
@ -27,7 +27,7 @@
|
|||||||
"category": "Network",
|
"category": "Network",
|
||||||
"packageCategory": "Network",
|
"packageCategory": "Network",
|
||||||
"desktop": {
|
"desktop": {
|
||||||
"StartupWMClass": "qortal-ui"
|
"StartupWMClass": "qortal-hub"
|
||||||
},
|
},
|
||||||
"executableName": "Qortal-Hub",
|
"executableName": "Qortal-Hub",
|
||||||
"icon": "assets/png",
|
"icon": "assets/png",
|
||||||
|
56
electron/electron-builder.config.lin.json
Normal file
56
electron/electron-builder.config.lin.json
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"appId": "org.qortal.Qortal-Hub",
|
||||||
|
"productName": "Qortal Hub",
|
||||||
|
"copyright": "Copyright © 2021 - 2025 Qortal",
|
||||||
|
"compression": "normal",
|
||||||
|
"asar": "true",
|
||||||
|
"afterPack": "scripts/afterPack.js",
|
||||||
|
"files": [
|
||||||
|
"assets/**/*",
|
||||||
|
"build/**/*",
|
||||||
|
"capacitor.config.*",
|
||||||
|
"app/**/*"
|
||||||
|
],
|
||||||
|
"linux": {
|
||||||
|
"target": [
|
||||||
|
"AppImage",
|
||||||
|
"deb",
|
||||||
|
"snap",
|
||||||
|
"rpm"
|
||||||
|
],
|
||||||
|
"category": "Network",
|
||||||
|
"packageCategory": "Network",
|
||||||
|
"desktop": {
|
||||||
|
"StartupWMClass": "qortal-hub"
|
||||||
|
},
|
||||||
|
"executableName": "Qortal Hub",
|
||||||
|
"icon": "assets/png"
|
||||||
|
},
|
||||||
|
"appImage": {
|
||||||
|
"artifactName": "Qortal-Hub_${version}.${ext}"
|
||||||
|
},
|
||||||
|
"deb": {
|
||||||
|
"artifactName": "Qortal-Hub-Setup_${version}.${ext}",
|
||||||
|
"synopsis": "Qortal Hub for Linux"
|
||||||
|
},
|
||||||
|
"snap": {
|
||||||
|
"artifactName": "Qortal-Hub-Setup_${version}.${ext}",
|
||||||
|
"synopsis": "Qortal Hub for Linux"
|
||||||
|
},
|
||||||
|
"rpm": {
|
||||||
|
"artifactName": "Qortal-Hub-Setup_${version}.${ext}",
|
||||||
|
"synopsis": "Qortal Hub for Linux"
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"output": "dist",
|
||||||
|
"buildResources": "resources"
|
||||||
|
},
|
||||||
|
"publish": [
|
||||||
|
{
|
||||||
|
"provider": "github",
|
||||||
|
"owner": "Qortal",
|
||||||
|
"repo": "Qortal-Hub",
|
||||||
|
"releaseType": "draft"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
44
electron/electron-builder.config.win.json
Normal file
44
electron/electron-builder.config.win.json
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
{
|
||||||
|
"appId": "org.qortal.Qortal-Hub",
|
||||||
|
"productName": "Qortal Hub",
|
||||||
|
"copyright": "Copyright © 2021 - 2025 Qortal",
|
||||||
|
"compression": "normal",
|
||||||
|
"asar": "true",
|
||||||
|
"files": [
|
||||||
|
"assets/**/*",
|
||||||
|
"build/**/*",
|
||||||
|
"capacitor.config.*",
|
||||||
|
"app/**/*"
|
||||||
|
],
|
||||||
|
"win": {
|
||||||
|
"legalTrademarks": "QORTAL.ORG",
|
||||||
|
"icon": "assets/appIcon.ico",
|
||||||
|
"target": [
|
||||||
|
"nsis",
|
||||||
|
"portable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nsis": {
|
||||||
|
"artifactName": "Qortal-Hub-Setup-win64_${version}.${ext}",
|
||||||
|
"allowElevation": true,
|
||||||
|
"oneClick": false,
|
||||||
|
"allowToChangeInstallationDirectory": true,
|
||||||
|
"perMachine": true,
|
||||||
|
"runAfterFinish": true,
|
||||||
|
"deleteAppDataOnUninstall": true,
|
||||||
|
"createDesktopShortcut": true,
|
||||||
|
"createStartMenuShortcut": true
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"output": "dist",
|
||||||
|
"buildResources": "resources"
|
||||||
|
},
|
||||||
|
"publish": [
|
||||||
|
{
|
||||||
|
"provider": "github",
|
||||||
|
"owner": "Qortal",
|
||||||
|
"repo": "Qortal-Hub",
|
||||||
|
"releaseType": "draft"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
948
electron/package-lock.json
generated
948
electron/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -9,10 +9,10 @@
|
|||||||
"homepage": "https://qortal.dev",
|
"homepage": "https://qortal.dev",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": ""
|
"url": "git+https://github.com/Qortal/Qortal-Hub.git"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "com.github.Qortal.Qortal-Hub",
|
"appId": "org.Qortal.Qortal-Hub",
|
||||||
"publish": [
|
"publish": [
|
||||||
{
|
{
|
||||||
"provider": "github",
|
"provider": "github",
|
||||||
@ -29,7 +29,11 @@
|
|||||||
"electron:start": "npm run build && electron --inspect=5858 ./",
|
"electron:start": "npm run build && electron --inspect=5858 ./",
|
||||||
"electron:pack": "npm run build && electron-builder build --dir -c ./electron-builder.config.json",
|
"electron:pack": "npm run build && electron-builder build --dir -c ./electron-builder.config.json",
|
||||||
"electron:make": "npm run build && electron-builder build -c ./electron-builder.config.json -p always",
|
"electron:make": "npm run build && electron-builder build -c ./electron-builder.config.json -p always",
|
||||||
"electron:make-local": "npm run build && electron-builder build -c ./electron-builder.config.json --publish=never"
|
"electron:make-local": "npm run build && electron-builder build -c ./electron-builder.config.json --publish=never",
|
||||||
|
"electron:make-lin": "npm run build && electron-builder build -c ./electron-builder.config.lin.json --publish=never -l",
|
||||||
|
"electron:make-win": "npm run build && electron-builder build -c ./electron-builder.config.win.json --publish=never -w",
|
||||||
|
"electron:make-arm": "npm run build && electron-builder build -c ./electron-builder.config.arm.json --publish=never --linux --arm64",
|
||||||
|
"electron:make-all": "npm run build && electron-builder build -c ./electron-builder.config.win.json --publish=never -w && electron-builder build -c ./electron-builder.config.lin.json --publish=never -l && electron-builder build -c ./electron-builder.config.arm.json --publish=never --linux --arm64"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capacitor-community/electron": "^5.0.0",
|
"@capacitor-community/electron": "^5.0.0",
|
||||||
@ -42,10 +46,12 @@
|
|||||||
"electron-window-state": "^5.0.3"
|
"electron-window-state": "^5.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "^26.2.2",
|
"electron": "^33.2.1",
|
||||||
"electron-builder": "~23.6.0",
|
"electron-builder": "~23.6.0",
|
||||||
"electron-rebuild": "^3.2.9",
|
"@electron/rebuild": "^3.2.10",
|
||||||
"typescript": "^5.0.4"
|
"@electron/notarize": "^2.5.0",
|
||||||
|
"typescript": "^5.0.4",
|
||||||
|
"shelljs": "^0.8.5"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"capacitor",
|
"capacitor",
|
||||||
|
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'
|
Loading…
x
Reference in New Issue
Block a user