Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f3dbc7b
Register and handle cyd:// URLs
micahflee Jan 20, 2025
ac59b88
Switch from protocol to deep links
micahflee Jan 20, 2025
8b21e22
Handle deep links for both Mac and Windows/Linux
micahflee Jan 20, 2025
ab385f1
Queue cyd:// links and process them after that app is ready
micahflee Jan 20, 2025
c0fd8bc
Open the app with cyd:// path /
micahflee Jan 20, 2025
61582ab
Update packaging to support cyd:// and cyd-dev:// URLs
micahflee Jan 20, 2025
7cd8530
Move logging to the top of main.ts
micahflee Jan 20, 2025
5a2d45e
Actually, move logging to below loading config and setting the app name
micahflee Jan 20, 2025
29b255e
Add a debug log
micahflee Jan 20, 2025
c7ac8f2
Automatically log to disk when running not prod
micahflee Jan 20, 2025
fcd78d4
Add Cyd URLs to queue from both open-url event (macOS) and second-ins…
micahflee Jan 20, 2025
5287dbe
If the last arg is cyd:// URL, pass it into app.setAsDefaultProtocolC…
micahflee Jan 20, 2025
edc21d7
Try manually calling initial openCydURL in Windows and Linux if necce…
micahflee Jan 20, 2025
2742eb9
Try adding protocol.registerSchemesAsPrivileged to see if Windows wil…
micahflee Jan 20, 2025
a3e61c9
Remove protocol.registerSchemesAsPrivileged because it does not help …
micahflee Jan 21, 2025
0bcf611
Fix lint
micahflee Jan 21, 2025
a1fa1cc
Set logging to debug for everything but prod
micahflee Jan 21, 2025
0a78539
Update src/main.ts
micahflee Jan 21, 2025
77b1416
Skip code signing when making a macOS build that will not be published
micahflee Jan 21, 2025
9acc031
Support the two Cyd URLs cyd://open/ and cyd://social.cyd.api/atproto…
micahflee Jan 21, 2025
1e41e2e
Merge branch '370-protocol-handler' of github.com:lockdown-systems/cy…
micahflee Jan 21, 2025
d8e8e6c
Merge branch 'main' into 370-protocol-handler
micahflee Jan 23, 2025
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
30 changes: 15 additions & 15 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,30 +93,30 @@ const openCydURL = async (cydURL: string) => {
await createWindow();
}

// Validate the hostname
const validHostname = config.mode == "prod" ? 'social.cyd.api' : 'social.cyd.dev-api';
if (url.hostname != validHostname) {
dialog.showMessageBoxSync({
title: "Cyd",
message: `Invalid hostname in URL ${url.toString()}. I'm expecting "${validHostname}" as the hostname.`,
type: 'info',
});
// If hostname is "open", this just means open Cyd
if (url.hostname == "open") {
// Success!
return;
}

// Handle / (which just opens the app)
if (url.pathname == "/") {
// Supported! Do nothing, since the app should now be opened
}
// For all other paths, show an error
else {
// Check for Bluesky OAuth redirect
const blueskyHostname = config.mode == "prod" ? 'social.cyd.api' : 'social.cyd.dev-api';
if (url.hostname == blueskyHostname && url.pathname == "/atproto-oauth-callback") {
dialog.showMessageBoxSync({
title: "Cyd",
message: `Invalid Cyd URL: ${url.toString()}.`,
message: `Bluesky OAuth is not implemented yet.`,
type: 'info',
});
return;
}

// For all other paths, show an error
dialog.showMessageBoxSync({
title: "Cyd",
message: `Invalid Cyd URL: ${url.toString()}.`,
type: 'info',
});
return;
}

// Register the cyd:// (or cyd-dev://) protocol
Expand Down