Skip to content

Commit 21e36f6

Browse files
authored
Merge pull request #164 from firecamp-dev/feat/62-desktop #62
Firecamp Desktop Apps
2 parents 83f80a7 + ae5f7b4 commit 21e36f6

File tree

101 files changed

+3804
-732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+3804
-732
lines changed

.env.vault

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#/ cloud-agnostic vaulting standard /
33
#/ [how it works](https://dotenv.org/env-vault) /
44
#/--------------------------------------------------/
5-
DOTENV_VAULT=vlt_a7698f74e5365a7834b9f3a62cc555169343e436f2cde5d317afa8c4adfa4eda
65

76
# development
87
DOTENV_VAULT_DEVELOPMENT="Yhme4DuEh1lu1ysCEEfwHtP+Qbxfa8RWkV3lTacXbO9PYbAVGm3jKDTt5i7D/xNp17s18Vqe4S8iqa3mdE0odWBpUuZG8JhvdCw2elMoLFq2uKU0zeeWIP2camdOogxKa6hmCJni58Re3d0OfIMDpCew28MzrSRSnGYLDqEKadhDkf8k5Ei06V/yUy4NQZ6Xj9wzKWRTC6eU4i9O/+puWHJCg0HUrx6eb2/m8tb1A0WSuaMIIjmk7zpzpeviyD+9J+4jlzxRkGP43W2mmBpHyQveBBe13OYIxH3rjL1a13fn2nHLvrOk3N6LLak/ITLekw3NeHakuMv7BmL8l+J5Msua89wqJuMIN8DxXaUJYFysxMBfuWQYcVOBnWoEW/XCZwptOgV/xK3EpcanAH+YdjNa1LALVxrlGNICNflfvzmKbVtp6yCiimaHKHy50Z+mCV2FGBHYKR1R+LONWvftKBOgOvlMhaqTDGAsGMe7ocyBYKYocr5NwBwwSbUXsTWhV6G2mRwQ/V7D7nvHot8QLBNbW6aPUjroUkQkcUjvmeKtZkmGIWMw0i1cdSwQjpiGTgKYqu0p6i5gb3Dgf6ffLI3ZuMg+URNvpOyVFIEBfR24s5Q6cw7tVsJv6FyH52KJJNQf9A3MiiHTLhh51NaQNSso/FG8v+rKKhU64fhKLw0X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F8CdtiQF23xVlOw0ZFybhB2yPhLH8EAk1voAyo5KrHgv59o/e3keqzJIPIIkzaRyaRXRB9FF29HlJBF70af7ymOLgO9WnWE+RwPacxEPc3zEuEHNtOMXsDM2cpCZQmwFduoyCvelyULjaQK/MjW058DvvsT3Lw02yXiE1nWluLcSDe2j/QXx+s5Lr395i4LhHW9f/qlEhZVD3fJNr610UuAYe5OH9XOXW1/0g9VwEbHJ7I1hL6MLFx8h5c/JkuI62CnQYPVMKnQmR44jwR3cRseXRi/MJ44BjFxwLijEGu3cNgG4UIUH3X5VpvDZkjMiJ47hn2e8vpn1u/XNOTWeY1PruVlwhmXOVe8vVZybOARXm/1q9DT0fcHB5OQ=="
2120
DOTENV_VAULT_PRODUCTION_VERSION=13
21+
22+
#/----------------settings/metadata-----------------/
23+
DOTENV_VAULT="vlt_a7698f74e5365a7834b9f3a62cc555169343e436f2cde5d317afa8c4adfa4eda"
24+
DOTENV_API_URL="https://vault.dotenv.org"
25+
DOTENV_CLI="npx dotenv-vault@latest"

.github/actions/spelling/allow.txt

+24
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,27 @@ https
33
ssh
44
ubuntu
55
workarounds
6+
tauri
7+
portpicker
8+
Avenir
9+
osx
10+
serde
11+
Enume
12+
OPPT
13+
Yirfjyjaujc
14+
heroku
15+
nel
16+
tne
17+
cloudflare
18+
vegur
19+
nosniff
20+
ratelimit
21+
icns
22+
notarisation
23+
Ecies
24+
ecies
25+
pbk
26+
encryptio
27+
keyval
28+
fce
29+

.github/actions/spelling/expect.txt

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
abksi
22
adpcm
33
ajv
4+
APPIMAGE
45
applixware
56
arraybufferview
67
asds
@@ -52,6 +53,7 @@ dssc
5253
dts
5354
duplicat
5455
eamodio
56+
eciesjs
5557
ecmascript
5658
edt
5759
EGraph
@@ -229,6 +231,7 @@ ROfb
229231
Rpbjpvc
230232
rsd
231233
rtls
234+
rustc
232235
saf
233236
salesforce
234237
salesforcecli
@@ -268,6 +271,7 @@ timestamptz
268271
TItem
269272
tocstop
270273
TODOs
274+
togglefullscreen
271275
Tokenfrom
272276
TOODs
273277
tooltiptext

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ cypress/videos
2121
*.zip
2222
*.crx
2323
*.pem
24+
!x-dev-certs/**/*.pem
2425
update.xml
2526
.idea
2627
package-lock.json

packages/firecamp-agent-manager/src/chrome.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

77
// Holds the rest executors instance to handle
88
const restExecutors: { [key: TId]: RestExecutor } = {};

packages/firecamp-agent-manager/src/index.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@ export const send = async (
3030
testResult: any;
3131
scriptErrors: any[];
3232
}> => {
33+
const requestId = request.__ref.id;
34+
let res: any;
3335
switch (firecampAgent) {
3436
case EFirecampAgent.Desktop:
35-
return window.fc.restExecutor.send(request, variables);
37+
//@ts-ignore
38+
return await window.__electron__.http.send(request, variables);
3639
case EFirecampAgent.Extension:
37-
return extension.send(request, variables);
3840
case EFirecampAgent.Web:
3941
restExecutors[request.__ref.id] = new RestExecutor();
4042
//@ts-ignore
41-
return await restExecutors[request.__ref.id].send(request, variables);
43+
res = restExecutors[request.__ref.id].send(request, variables);
44+
delete restExecutors[requestId];
45+
return res;
4246
case EFirecampAgent.Cloud:
4347
if (request.body?.type == ERestBodyTypes.FormData) {
4448
const body = await parseBody(request.body);
@@ -76,14 +80,13 @@ export const cancel = async (
7680
): Promise<void> => {
7781
switch (firecampAgent) {
7882
case EFirecampAgent.Desktop:
79-
return window.fc.restExecutor.cancel(requestId);
80-
case EFirecampAgent.Extension:
81-
return extension.cancel(requestId);
83+
/** @ts-ignore */
84+
return window.__electron__.http.stop(requestId);
85+
// case EFirecampAgent.Extension:
86+
// return extension.cancel(requestId);
8287
case EFirecampAgent.Web:
8388
restExecutors[requestId].cancel();
84-
8589
delete restExecutors[requestId];
86-
8790
return;
8891
case EFirecampAgent.Cloud:
8992
const response = await axios.get(

packages/firecamp-electron/.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.idea/*
2+
.nyc_output
3+
.vscode
4+
build
5+
node_modules
6+
test
7+
src/**.js
8+
coverage
9+
*.log
10+
!src/declarations.d.ts
11+
dev-app-update.yml

packages/firecamp-electron/.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
6+
<true/>
7+
<key>com.apple.security.cs.allow-jit</key>
8+
<true/>
9+
</dict>
10+
</plist>
Loading
Loading
Loading
975 Bytes
Loading
Binary file not shown.
Binary file not shown.
+151
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
{
2+
"name": "@firecamp/electron",
3+
"productName": "Firecamp",
4+
"version": "3.3.0-beta.2",
5+
"description": "The Firecamp Desktop Application",
6+
"main": "build/main.js",
7+
"private": true,
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/firecamp-dev/firecamp.git",
11+
"directory": "packages/firecamp-electron"
12+
},
13+
"scripts": {
14+
"test": "echo \"Error: no test specified\" && exit 1",
15+
"start": "pnpm build && electron .",
16+
"build": "tsc",
17+
"release": "pnpm build && electron-builder -mlw --publish always",
18+
"pack": "pnpm build && electron-builder --dir -c.compression=store -c.mac.identity=null",
19+
"postinstall": "electron-builder install-app-deps"
20+
},
21+
"keywords": [],
22+
"author": "",
23+
"license": "AGPLv3",
24+
"dependencies": {
25+
"@firecamp/rest-executor": "workspace:*",
26+
"@firecamp/scripts": "workspace:*",
27+
"@firecamp/socket.io-executor": "workspace:*",
28+
"@firecamp/ws-executor": "workspace:*",
29+
"electron-is-dev": "^2.0.0",
30+
"electron-log": "^5.0.0",
31+
"electron-notarize": "^1.2.2",
32+
"electron-updater": "^6.1.4",
33+
"react-fast-compare": "^3.2.2"
34+
},
35+
"devDependencies": {
36+
"@types/node": "^20.8.9",
37+
"electron": "^27.1.2",
38+
"electron-builder": "^24.13.3"
39+
},
40+
"build": {
41+
"appId": "com.firecamp.electron",
42+
"generateUpdatesFilesForAllChannels": true,
43+
"productName": "Firecamp",
44+
"afterSign": "scripts/notarize.js",
45+
"files": [
46+
"./build/**/*",
47+
"package.json",
48+
{
49+
"from": "../../build/production",
50+
"to": "app"
51+
}
52+
],
53+
"directories": {
54+
"buildResources": "assets"
55+
},
56+
"dmg": {
57+
"sign": false
58+
},
59+
"mac": {
60+
"artifactName": "Firecamp-${version}.${arch}.${ext}",
61+
"executableName": "Firecamp",
62+
"type": "distribution",
63+
"target": {
64+
"target": "default",
65+
"arch": [
66+
"x64",
67+
"arm64"
68+
]
69+
},
70+
"category": "public.app-category.developer-tools",
71+
"entitlements": "assets/entitlements.mac.plist",
72+
"entitlementsInherit": "assets/entitlements.mac.plist",
73+
"icon": "icons/mac/512.png",
74+
"hardenedRuntime": true,
75+
"gatekeeperAssess": false,
76+
"publish": [
77+
{
78+
"provider": "github",
79+
"owner": "firecamp-dev",
80+
"repo": "firecamp"
81+
},
82+
{
83+
"provider": "spaces",
84+
"name": "firecamp",
85+
"region": "ams3",
86+
"channel": "latest",
87+
"path": "/electron-apps/mac",
88+
"acl": "public-read"
89+
}
90+
]
91+
},
92+
"linux": {
93+
"artifactName": "Firecamp-${version}.${arch}.${ext}",
94+
"executableName": "Firecamp",
95+
"icon": "icons/mac/512.png",
96+
"category": "Development",
97+
"target": {
98+
"target": "AppImage",
99+
"arch": [
100+
"x64"
101+
]
102+
},
103+
"publish": [
104+
{
105+
"provider": "github",
106+
"owner": "firecamp-dev",
107+
"repo": "firecamp"
108+
},
109+
{
110+
"provider": "spaces",
111+
"name": "firecamp",
112+
"region": "ams3",
113+
"channel": "latest",
114+
"path": "/electron-apps/linux",
115+
"acl": "public-read"
116+
}
117+
]
118+
},
119+
"nsis": {
120+
"oneClick": false,
121+
"allowToChangeInstallationDirectory": true
122+
},
123+
"win": {
124+
"artifactName": "Firecamp-${version}.${arch}.${ext}",
125+
"executableName": "Firecamp",
126+
"icon": "icons/win/logo.ico",
127+
"target": {
128+
"target": "nsis",
129+
"arch": [
130+
"x64"
131+
]
132+
},
133+
"verifyUpdateCodeSignature": false,
134+
"publish": [
135+
{
136+
"provider": "github",
137+
"owner": "firecamp-dev",
138+
"repo": "firecamp"
139+
},
140+
{
141+
"provider": "spaces",
142+
"name": "firecamp",
143+
"region": "ams3",
144+
"channel": "latest",
145+
"path": "/electron-apps/win",
146+
"acl": "public-read"
147+
}
148+
]
149+
}
150+
}
151+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const { notarize } = require('electron-notarize');
2+
3+
exports.default = async function notarizing(context) {
4+
console.log('notarisation started manually.');
5+
const { electronPlatformName, appOutDir } = context;
6+
if (
7+
electronPlatformName !== 'darwin' ||
8+
!process.env.AID ||
9+
!process.env.APASS
10+
) {
11+
console.log(
12+
'not running notarize. platform is not macos or environment not set up.'
13+
);
14+
return;
15+
}
16+
17+
const appName = context.packager.appInfo.productFilename;
18+
19+
try {
20+
return await notarize({
21+
appBundleId: process.env.appBundleId,
22+
appPath: `${appOutDir}/${appName}.app`,
23+
appleId: process.env.AID,
24+
appleIdPassword: process.env.APASS,
25+
});
26+
} catch (e) {
27+
console.log('notarize error', e);
28+
}
29+
};
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const path = require('path');
2+
const isDev = require('electron-is-dev');
3+
4+
let trayIcon: string;
5+
let appIcon: string;
6+
7+
// dev environment tray icon paths
8+
if (isDev) {
9+
if (process.platform === 'linux')
10+
trayIcon = path.join(__dirname, '../assets/icons/mac/64.png'); //22x22
11+
else if (process.platform === 'darwin')
12+
trayIcon = path.join(__dirname, '../assets/icons/mac/64.png'); // 16x16
13+
else if (process.platform === 'win32')
14+
trayIcon = path.join(__dirname, '.../assets/icons/mac/64.png'); //32x32
15+
} else if (process.platform === 'linux')
16+
// prod. environment tray icon paths
17+
trayIcon = path.join(process.resourcesPath, 'assets/icons/mac/64.png');
18+
// 22x22
19+
else if (process.platform === 'darwin')
20+
trayIcon = path.join(process.resourcesPath, 'assets/icons/images/16x16.png');
21+
// 16x16
22+
else if (process.platform === 'win32')
23+
trayIcon = path.join(process.resourcesPath, 'assets/icons/mac/64.png'); // 32x32
24+
25+
// App icon paths
26+
if (process.platform === 'linux')
27+
appIcon = path.join(__dirname, '../assets/icons/mac/512x512.png');
28+
else if (process.platform === 'darwin')
29+
appIcon = path.join(__dirname, '../assets/mac/icon.icns');
30+
else if (process.platform === 'win32')
31+
appIcon = path.join(__dirname, '../assets/icons/win/icon.ico');
32+
33+
export { appIcon, trayIcon };

0 commit comments

Comments
 (0)