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

Firecamp Desktop App #164

Merged
merged 78 commits into from Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
b000709
feat: tauri setup completed and @firecamp/desktop app initialised
Nishchit14 Aug 31, 2023
39d7568
feat: firecamp.dev tauri wrapper poc created
Nishchit14 Sep 1, 2023
3a030cc
feat: dev certificates are generated and desktop app is now being ope…
Nishchit14 Sep 1, 2023
b95a7d8
feat: electron basic setup completed
Nishchit14 Oct 26, 2023
a156ea7
chore: tsconfig configured for desktop app
Nishchit14 Oct 26, 2023
aefa434
chore: loadURL tried with local path
Nishchit14 Oct 28, 2023
e0ca14b
chore: folder renamed to firecamp-tauri
Nishchit14 Oct 28, 2023
b7f6485
chore: temp commit
Nishchit14 Oct 28, 2023
5c01b50
Merge branch 'main' into feat/62-desktop
Nishchit14 Oct 28, 2023
bfb6048
chore: pnpm.lock updated
Nishchit14 Oct 28, 2023
d6b0276
feat: tauri http config added and response json created
Nishchit14 Oct 28, 2023
7103045
feat: axios adapter creared for tauri native http api
Nishchit14 Oct 30, 2023
aff5574
Merge branch 'main' into feat/62-desktop
Nishchit14 Oct 30, 2023
b01bf8b
chore: firecamp-electron branch merged
Nishchit14 Oct 30, 2023
28bc8f7
feat: app window behaviour for darwin configured
Nishchit14 Oct 30, 2023
b49b5f7
feat: desktop app fullscreen window set
Nishchit14 Oct 30, 2023
d28a2e2
feat: ipc channel integration in progress for rest execution
Nishchit14 Oct 30, 2023
b84b82a
chore: unused deps removed
Nishchit14 Oct 30, 2023
a881484
feat: rest executor flow implemented between ipcMain and ipcRenderer …
Nishchit14 Oct 31, 2023
814b84d
feat: auth:github ipc event implemented to handle the github auth
Nishchit14 Nov 3, 2023
2eea4ef
feat: github auth flow is improved, architectureal improvement for d…
Nishchit14 Nov 4, 2023
c3dd441
feat: auth modal close on github auth success flow improved
Nishchit14 Nov 6, 2023
4021d43
feat: GitHub OAuth redirect flow improved #145
Nishchit14 Nov 6, 2023
b80c0e9
chore: identity.html removed in favour of #145
Nishchit14 Nov 6, 2023
22a153a
feat: multipart file upload flow implemented for desktop/node/electro…
Nishchit14 Nov 7, 2023
f286053
feat: preload script improved to handle invocation of multipart rest …
Nishchit14 Nov 7, 2023
e52d82a
fix: electron axios error ipc issue fixed
Nishchit14 Nov 8, 2023
aada322
feat: electron-builder implemented and icons are set
Nishchit14 Nov 10, 2023
27863d3
feat: desktop app local pack logic implemented
Nishchit14 Nov 11, 2023
d042147
feat: relese channel configured
Nishchit14 Nov 11, 2023
187dc41
chore: electron updater and log installed
Nishchit14 Nov 11, 2023
9282154
feat: app updater initiated
Nishchit14 Nov 11, 2023
0c1d529
chore: app publish config set
Nishchit14 Nov 25, 2023
c792e53
chore: entitelments file added
Nishchit14 Nov 25, 2023
ec3fc22
feat: notarization script added
Nishchit14 Nov 25, 2023
63f5048
feat: desktop artifact build issue fixed with productName set and ski…
Nishchit14 Nov 26, 2023
63bdba7
feat: desktop app icons are created
Nishchit14 Nov 26, 2023
8a1ebf1
feat: image improvements
Nishchit14 Nov 26, 2023
145e356
chore: ssl disabled temporary
Nishchit14 Dec 27, 2023
fd3957b
feat: eciesjs installed
Nishchit14 Dec 28, 2023
988b7a2
feat: eciesjs and idb-keyval installed
Nishchit14 Dec 28, 2023
121f1bf
feat: idb service developed
Nishchit14 Dec 28, 2023
65cd349
feat: ecies encryption service created
Nishchit14 Dec 28, 2023
d10e9b3
chore
Nishchit14 Dec 29, 2023
6968bb7
feat: token encryption, decryption and set headers on signin/signout …
Nishchit14 Dec 29, 2023
d9b8cbf
chore: valut updated
Nishchit14 Jan 1, 2024
61dad6f
feat: mac app build and publish configuration has been setup #62
Nishchit14 Jan 2, 2024
fdf0e43
feat: win logo added and builder config updates
Nishchit14 Jan 4, 2024
a163e03
feat: icns set and updater in progress
Nishchit14 Jan 4, 2024
70f5775
feat: updater and dialog services are improved
Nishchit14 Jan 4, 2024
f096713
feat: app menus are set and auto updater has been optomised and teste…
Nishchit14 Jan 5, 2024
5484fa2
feat: pacakge upgraded
Nishchit14 Jan 8, 2024
87e2236
feat: rotate token implemented
Nishchit14 Jan 8, 2024
0ffcd98
chore: rest playground, default tab set to param
Nishchit14 Jan 9, 2024
4cc98c3
chore: console commented
Nishchit14 Jan 9, 2024
23d34f3
feat: firecamp desktop is ready to rock
Nishchit14 Jan 9, 2024
d2165e7
chore: package upgraded
Nishchit14 Jan 9, 2024
1c6429a
Merge branch 'main' into feat/62-desktop
Nishchit14 Jan 23, 2024
1237e60
feat: win nsis build added in release
Nishchit14 Feb 20, 2024
e9fb328
feat: ws electron issue fixed
Nishchit14 Feb 29, 2024
4dbfacb
feat: ws electron issue fixed
Nishchit14 Feb 29, 2024
47ed474
feat: ws headers are enabled
Nishchit14 Feb 29, 2024
ac652be
feat: socket-io issue fixed with desktop 3.1 beta
Nishchit14 Feb 29, 2024
6a13919
Merge branch 'main' into feat/62-desktop
Nishchit14 Feb 29, 2024
349b1ac
fix: spell allowed tauri
Nishchit14 Mar 4, 2024
869b4fd
Merge branch 'feat/62-desktop' of https://github.com/firecamp-dev/fir…
Nishchit14 Mar 4, 2024
50e0204
fix: spell allowed
Nishchit14 Mar 4, 2024
8232dad
faet: 3.3.0-beta.2 released
Nishchit14 Mar 4, 2024
778b6e6
chore: deprecated files removed
Nishchit14 Mar 4, 2024
e13e2b5
chore: electronbuilder upgraded
Nishchit14 Mar 4, 2024
a29ab6c
chore: frozen lock file fix
Nishchit14 Mar 4, 2024
4c0453e
chore: message improved
Nishchit14 Mar 4, 2024
db67bb3
chore: message improved
Nishchit14 Mar 4, 2024
64e38c3
chore: message improved
Nishchit14 Mar 4, 2024
37aa3b8
spelling: typescript
jsoref Mar 4, 2024
576a35c
chore: delete stray log files
jsoref Mar 4, 2024
aeb400e
ci: update check-spelling
jsoref Mar 4, 2024
ae5f7b4
Merge pull request #189 from jsoref/feat/62-desktop-check-spelling
Nishchit14 Mar 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion .env.vault
Expand Up @@ -2,7 +2,6 @@
#/ cloud-agnostic vaulting standard /
#/ [how it works](https://dotenv.org/env-vault) /
#/--------------------------------------------------/
DOTENV_VAULT=vlt_a7698f74e5365a7834b9f3a62cc555169343e436f2cde5d317afa8c4adfa4eda

# development
DOTENV_VAULT_DEVELOPMENT="Yhme4DuEh1lu1ysCEEfwHtP+Qbxfa8RWkV3lTacXbO9PYbAVGm3jKDTt5i7D/xNp17s18Vqe4S8iqa3mdE0odWBpUuZG8JhvdCw2elMoLFq2uKU0zeeWIP2camdOogxKa6hmCJni58Re3d0OfIMDpCew28MzrSRSnGYLDqEKadhDkf8k5Ei06V/yUy4NQZ6Xj9wzKWRTC6eU4i9O/+puWHJCg0HUrx6eb2/m8tb1A0WSuaMIIjmk7zpzpeviyD+9J+4jlzxRkGP43W2mmBpHyQveBBe13OYIxH3rjL1a13fn2nHLvrOk3N6LLak/ITLekw3NeHakuMv7BmL8l+J5Msua89wqJuMIN8DxXaUJYFysxMBfuWQYcVOBnWoEW/XCZwptOgV/xK3EpcanAH+YdjNa1LALVxrlGNICNflfvzmKbVtp6yCiimaHKHy50Z+mCV2FGBHYKR1R+LONWvftKBOgOvlMhaqTDGAsGMe7ocyBYKYocr5NwBwwSbUXsTWhV6G2mRwQ/V7D7nvHot8QLBNbW6aPUjroUkQkcUjvmeKtZkmGIWMw0i1cdSwQjpiGTgKYqu0p6i5gb3Dgf6ffLI3ZuMg+URNvpOyVFIEBfR24s5Q6cw7tVsJv6FyH52KJJNQf9A3MiiHTLhh51NaQNSso/FG8v+rKKhU64fhKLw0Xlx+wuIPS7WoygbdtjAQ0IwwsMsGOmrCAcWo20NUe6s2x6BXHqiuvyY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kzaRyaRXRB9FF29HlJBF70af7ymOLgO9WnWE+RwPacxEPc3zEuEHNtOMXsDM2cpCZQmwFduoyCvelyULjaQK/MjW058DvvsT3Lw02yXiE1nWluLcSDe2j/QXx+s5Lr395i4LhHW9f/qlEhZVD3fJNr610UuAYe5OH9XOXW1/0g9VwEbHJ7I1hL6MLFx8h5c/JkuI62CnQYPVMKnQmR44jwR3cRseXRi/MJ44BjFxwLijEGu3cNgG4UIUH3X5VpvDZkjMiJ47hn2e8vpn1u/XNOTWeY1PruVlwhmXOVe8vVZybOARXm/1q9DT0fcHB5OQ=="
DOTENV_VAULT_PRODUCTION_VERSION=13

#/----------------settings/metadata-----------------/
DOTENV_VAULT="vlt_a7698f74e5365a7834b9f3a62cc555169343e436f2cde5d317afa8c4adfa4eda"
DOTENV_API_URL="https://vault.dotenv.org"
DOTENV_CLI="npx dotenv-vault@latest"
24 changes: 24 additions & 0 deletions .github/actions/spelling/allow.txt
Expand Up @@ -3,3 +3,27 @@ https
ssh
ubuntu
workarounds
tauri
portpicker
Avenir
osx
serde
Enume
OPPT
Yirfjyjaujc
heroku
nel
tne
cloudflare
vegur
nosniff
ratelimit
icns
notarisation
Ecies
ecies
pbk
encryptio
keyval
fce

4 changes: 4 additions & 0 deletions .github/actions/spelling/expect.txt
@@ -1,6 +1,7 @@
abksi
adpcm
ajv
APPIMAGE
applixware
arraybufferview
asds
Expand Down Expand Up @@ -52,6 +53,7 @@ dssc
dts
duplicat
eamodio
eciesjs
ecmascript
edt
EGraph
Expand Down Expand Up @@ -229,6 +231,7 @@ ROfb
Rpbjpvc
rsd
rtls
rustc
saf
salesforce
salesforcecli
Expand Down Expand Up @@ -268,6 +271,7 @@ timestamptz
TItem
tocstop
TODOs
togglefullscreen
Tokenfrom
TOODs
tooltiptext
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -21,6 +21,7 @@ cypress/videos
*.zip
*.crx
*.pem
!x-dev-certs/**/*.pem
update.xml
.idea
package-lock.json
Expand Down
2 changes: 1 addition & 1 deletion packages/firecamp-agent-manager/src/chrome.ts
Expand Up @@ -2,7 +2,7 @@

import { IRest, IRestResponse, TId } from '@firecamp/types';
import { _misc } from '@firecamp/utils';
import RestExecutor from '@firecamp/rest-executor/dist/esm';
import RestExecutor from '@firecamp/rest-executor';

// Holds the rest executors instance to handle
const restExecutors: { [key: TId]: RestExecutor } = {};
Expand Down
19 changes: 11 additions & 8 deletions packages/firecamp-agent-manager/src/index.ts
Expand Up @@ -30,15 +30,19 @@ export const send = async (
testResult: any;
scriptErrors: any[];
}> => {
const requestId = request.__ref.id;
let res: any;
switch (firecampAgent) {
case EFirecampAgent.Desktop:
return window.fc.restExecutor.send(request, variables);
//@ts-ignore
return await window.__electron__.http.send(request, variables);
case EFirecampAgent.Extension:
return extension.send(request, variables);
case EFirecampAgent.Web:
restExecutors[request.__ref.id] = new RestExecutor();
//@ts-ignore
return await restExecutors[request.__ref.id].send(request, variables);
res = restExecutors[request.__ref.id].send(request, variables);
delete restExecutors[requestId];
return res;
case EFirecampAgent.Cloud:
if (request.body?.type == ERestBodyTypes.FormData) {
const body = await parseBody(request.body);
Expand Down Expand Up @@ -76,14 +80,13 @@ export const cancel = async (
): Promise<void> => {
switch (firecampAgent) {
case EFirecampAgent.Desktop:
return window.fc.restExecutor.cancel(requestId);
case EFirecampAgent.Extension:
return extension.cancel(requestId);
/** @ts-ignore */
return window.__electron__.http.stop(requestId);
// case EFirecampAgent.Extension:
// return extension.cancel(requestId);
case EFirecampAgent.Web:
restExecutors[requestId].cancel();

delete restExecutors[requestId];

return;
case EFirecampAgent.Cloud:
const response = await axios.get(
Expand Down
11 changes: 11 additions & 0 deletions packages/firecamp-electron/.gitignore
@@ -0,0 +1,11 @@
.idea/*
.nyc_output
.vscode
build
node_modules
test
src/**.js
coverage
*.log
!src/declarations.d.ts
dev-app-update.yml
1 change: 1 addition & 0 deletions packages/firecamp-electron/.npmrc
@@ -0,0 +1 @@
shamefully-hoist=true
10 changes: 10 additions & 0 deletions packages/firecamp-electron/assets/entitlements.mac.plist
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
</dict>
</plist>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/firecamp-electron/assets/icons/mac/64.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
151 changes: 151 additions & 0 deletions packages/firecamp-electron/package.json
@@ -0,0 +1,151 @@
{
"name": "@firecamp/electron",
"productName": "Firecamp",
"version": "3.3.0-beta.2",
"description": "The Firecamp Desktop Application",
"main": "build/main.js",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/firecamp-dev/firecamp.git",
"directory": "packages/firecamp-electron"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "pnpm build && electron .",
"build": "tsc",
"release": "pnpm build && electron-builder -mlw --publish always",
"pack": "pnpm build && electron-builder --dir -c.compression=store -c.mac.identity=null",
"postinstall": "electron-builder install-app-deps"
},
"keywords": [],
"author": "",
"license": "AGPLv3",
"dependencies": {
"@firecamp/rest-executor": "workspace:*",
"@firecamp/scripts": "workspace:*",
"@firecamp/socket.io-executor": "workspace:*",
"@firecamp/ws-executor": "workspace:*",
"electron-is-dev": "^2.0.0",
"electron-log": "^5.0.0",
"electron-notarize": "^1.2.2",
"electron-updater": "^6.1.4",
"react-fast-compare": "^3.2.2"
},
"devDependencies": {
"@types/node": "^20.8.9",
"electron": "^27.1.2",
"electron-builder": "^24.13.3"
},
"build": {
"appId": "com.firecamp.electron",
"generateUpdatesFilesForAllChannels": true,
"productName": "Firecamp",
"afterSign": "scripts/notarize.js",
"files": [
"./build/**/*",
"package.json",
{
"from": "../../build/production",
"to": "app"
}
],
"directories": {
"buildResources": "assets"
},
"dmg": {
"sign": false
},
"mac": {
"artifactName": "Firecamp-${version}.${arch}.${ext}",
"executableName": "Firecamp",
"type": "distribution",
"target": {
"target": "default",
"arch": [
"x64",
"arm64"
]
},
"category": "public.app-category.developer-tools",
"entitlements": "assets/entitlements.mac.plist",
"entitlementsInherit": "assets/entitlements.mac.plist",
"icon": "icons/mac/512.png",
"hardenedRuntime": true,
"gatekeeperAssess": false,
"publish": [
{
"provider": "github",
"owner": "firecamp-dev",
"repo": "firecamp"
},
{
"provider": "spaces",
"name": "firecamp",
"region": "ams3",
"channel": "latest",
"path": "/electron-apps/mac",
"acl": "public-read"
}
]
},
"linux": {
"artifactName": "Firecamp-${version}.${arch}.${ext}",
"executableName": "Firecamp",
"icon": "icons/mac/512.png",
"category": "Development",
"target": {
"target": "AppImage",
"arch": [
"x64"
]
},
"publish": [
{
"provider": "github",
"owner": "firecamp-dev",
"repo": "firecamp"
},
{
"provider": "spaces",
"name": "firecamp",
"region": "ams3",
"channel": "latest",
"path": "/electron-apps/linux",
"acl": "public-read"
}
]
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true
},
"win": {
"artifactName": "Firecamp-${version}.${arch}.${ext}",
"executableName": "Firecamp",
"icon": "icons/win/logo.ico",
"target": {
"target": "nsis",
"arch": [
"x64"
]
},
"verifyUpdateCodeSignature": false,
"publish": [
{
"provider": "github",
"owner": "firecamp-dev",
"repo": "firecamp"
},
{
"provider": "spaces",
"name": "firecamp",
"region": "ams3",
"channel": "latest",
"path": "/electron-apps/win",
"acl": "public-read"
}
]
}
}
}
29 changes: 29 additions & 0 deletions packages/firecamp-electron/scripts/notarize.js
@@ -0,0 +1,29 @@
const { notarize } = require('electron-notarize');

exports.default = async function notarizing(context) {
console.log('notarisation started manually.');
const { electronPlatformName, appOutDir } = context;
if (
electronPlatformName !== 'darwin' ||
!process.env.AID ||
!process.env.APASS
) {
console.log(
'not running notarize. platform is not macos or environment not set up.'
);
return;
}

const appName = context.packager.appInfo.productFilename;

try {
return await notarize({
appBundleId: process.env.appBundleId,
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.AID,
appleIdPassword: process.env.APASS,
});
} catch (e) {
console.log('notarize error', e);
}
};
33 changes: 33 additions & 0 deletions packages/firecamp-electron/src/icon.ts
@@ -0,0 +1,33 @@
const path = require('path');
const isDev = require('electron-is-dev');

let trayIcon: string;
let appIcon: string;

// dev environment tray icon paths
if (isDev) {
if (process.platform === 'linux')
trayIcon = path.join(__dirname, '../assets/icons/mac/64.png'); //22x22
else if (process.platform === 'darwin')
trayIcon = path.join(__dirname, '../assets/icons/mac/64.png'); // 16x16
else if (process.platform === 'win32')
trayIcon = path.join(__dirname, '.../assets/icons/mac/64.png'); //32x32
} else if (process.platform === 'linux')
// prod. environment tray icon paths
trayIcon = path.join(process.resourcesPath, 'assets/icons/mac/64.png');
// 22x22
else if (process.platform === 'darwin')
trayIcon = path.join(process.resourcesPath, 'assets/icons/images/16x16.png');
// 16x16
else if (process.platform === 'win32')
trayIcon = path.join(process.resourcesPath, 'assets/icons/mac/64.png'); // 32x32

// App icon paths
if (process.platform === 'linux')
appIcon = path.join(__dirname, '../assets/icons/mac/512x512.png');
else if (process.platform === 'darwin')
appIcon = path.join(__dirname, '../assets/mac/icon.icns');
else if (process.platform === 'win32')
appIcon = path.join(__dirname, '../assets/icons/win/icon.ico');

export { appIcon, trayIcon };