merge develop into release

This commit is contained in:
2026-07-15 14:07:50 +09:00
9 changed files with 1582 additions and 24 deletions
+29
View File
@@ -5,6 +5,7 @@ import { get as httpGet } from 'http'
import { get as httpsGet } from 'https'
import { spawn, exec, execFile, ChildProcess } from 'child_process'
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import { LmsWebBridge } from './lms-web-bridge'
protocol.registerSchemesAsPrivileged([
{ scheme: 'appdocs', privileges: { secure: true, standard: true, supportFetchAPI: true, corsEnabled: true } }
@@ -12,6 +13,7 @@ protocol.registerSchemesAsPrivileged([
let splash: BrowserWindow | null = null
let pendingGoogleOAuthPayload: { loginToken?: string; error?: string } | null = null
const lmsWebBridge = new LmsWebBridge()
type CommandResult = {
ok: boolean
@@ -954,6 +956,29 @@ function createWindow(): void {
ipcMain.handle('get-launcher-cache-status', () => getLauncherCacheStatus())
ipcMain.handle('clear-launcher-cache', () => clearLauncherCache())
ipcMain.handle('start-google-login', (_, url: string) => shell.openExternal(url))
ipcMain.handle('launch-web-app', async (_event, payload: { appName?: string; url?: string }) => {
const rawUrl = payload.url?.trim()
if (!rawUrl) throw new Error('웹 실행 주소가 없습니다.')
try {
const url = new URL(rawUrl)
if (url.protocol !== 'https:' && url.protocol !== 'http:') {
throw new Error('웹 실행 주소 형식이 올바르지 않습니다.')
}
if (payload.appName?.trim().toLowerCase() === 'lms') {
const bridge = await lmsWebBridge.createSession(url.origin)
const hash = new URLSearchParams(url.hash.replace(/^#/, ''))
hash.set('bridgeUrl', bridge.url)
hash.set('bridgeToken', bridge.token)
url.hash = hash.toString()
}
await shell.openExternal(url.toString())
mainWindow.minimize()
return { ok: true }
} catch (error) {
throw new Error(error instanceof Error ? error.message : '웹 브라우저를 열지 못했습니다.')
}
})
ipcMain.handle('launcher-tailscale-status', () => readTailscaleStatus())
ipcMain.handle('launcher-tailscale-install', () => installTailscale())
ipcMain.handle('launcher-ssh-key-ensure', () => ensureLauncherSshKey())
@@ -1220,4 +1245,8 @@ if (!gotSingleInstanceLock) {
app.quit()
}
})
app.on('will-quit', () => {
void lmsWebBridge.stop()
})
}