Accessing self-hosted instances via the official Fluxer apps

(#1223) Feature Shipped desktop self-hosting

Problem

Good morning! I've got a brand new Fluxer v2 self-hosted instance running and I'm kicking the tires. That said, I don't see how it's currently possible to access my instance via the Fluxer Windows desktop app or the beta Flutter app on Android. Is it currently not possible or did I miss something? Is there a command line arg that can be passed into the desktop client, maybe?

Proposal

Allow the official apps to optionally log into self-hosted instances.

Notes

Congratulations on v2!

2 comments

Sign in with Fluxer to comment and vote.
Comment by @WatchCollector67
RexSystem 1 vote originally by @WatchCollector67 on GitHub
It already is possible, you can switch instances via the Account Switcher menu, although it is currently broken. I was able to patch a quick fix and get it working.
Patch:

  diff --git a/fluxer_desktop/src/main/IpcHandlers.ts b/fluxer_desktop/src/main/IpcHandlers.ts
  index 62bac2c269..0000000000 100644
  --- a/fluxer_desktop/src/main/IpcHandlers.ts
  +++ b/fluxer_desktop/src/main/IpcHandlers.ts
  @@ -151,6 +151,14 @@ async function assertValidFluxerInstance(instanceOrigin: string): Promise<void> {
        }
   }

  +function getElectronLoadErrorCode(error: unknown): number | null {
  +     const message = error instanceof Error ? error.message : String(error);
  +     const match = /\(([-\d]+)\)/.exec(message);
  +     if (!match) return null;
  +     const value = Number.parseInt(match[1], 10);
  +     return Number.isFinite(value) ? value : null;
  +}
  +
   export function registerIpcHandlers(): void {
        registerVoiceDebugEventSinkPopoutIpcHandlers();
        registerVoiceBackgroundMediaCacheHandlers();
  @@ -168,6 +176,10 @@ export function registerIpcHandlers(): void {
                try {
                        await mainWindow.loadURL(instanceOrigin);
                } catch (error) {
  +                     if (getElectronLoadErrorCode(error) === -3) {
  +                             return;
  +                     }
  +
                        setCustomAppUrl(null);
                        pendingDesktopHandoffCode = null;
                        const detail = error instanceof Error ? error.message : String(error);