Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions electron-build/entitlements.mac.inherit.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.device.serial</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>



27 changes: 27 additions & 0 deletions electron-build/entitlements.mac.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.device.serial</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>



8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@
"target": [
"dmg"
],
"icon": "electron-build/icon.icns"
"icon": "electron-build/icon.icns",
"entitlements": "electron-build/entitlements.mac.plist",
"entitlementsInherit": "electron-build/entitlements.mac.inherit.plist",
"hardenedRuntime": true,
"gatekeeperAssess": false
},
"dmg": {
"background": "electron-build/background.png",
Expand Down Expand Up @@ -490,4 +494,4 @@
}
},
"packageManager": "[email protected]"
}
}
20 changes: 20 additions & 0 deletions src/app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect } from 'react';
import { Provider as ReduxProvider } from 'react-redux';
import { HashRouter } from 'react-router';
import isElectron from 'is-electron';

import { store as reduxStore } from 'app/store/redux';
import rootSaga from 'app/store/redux/sagas';
Expand All @@ -9,6 +10,7 @@ import store from 'app/store';
import * as user from 'app/lib/user';
import controller from 'app/lib/controller';
import ConfirmationDialog from 'app/components/ConfirmationDialog/ConfirmationDialog';
import { initializeGlobalCameraService } from 'app/lib/camera/globalCameraService';

import { Toaster } from './components/shadcn/Sonner';
import { ReactRoutes } from './react-routes';
Expand All @@ -28,6 +30,24 @@ function App() {
query: 'token=' + token,
};
controller.connect(host, options);

// Initialize camera service after controller connection (only on main client)
controller.addListener('connect', () => {
// Main client check: Either Electron app OR localhost browser
// Remote clients are browser-based connections to external servers
const isMainClient = isElectron() ||
window.location.hostname === 'localhost' ||
window.location.hostname === '127.0.0.1' ||
window.location.hostname === '0.0.0.0';

if (isMainClient) {
console.log('[App] Initializing camera service on main client');
initializeGlobalCameraService().catch((error) => {
console.error('Failed to initialize camera service:', error);
});
}
});

return;
} else {
console.log('no auth');
Expand Down
Loading