Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8e7437210 | ||
|
|
e0364d45df | ||
|
|
bbff586da2 |
@@ -101,6 +101,10 @@ import { identityRosBody } from "./ipsec-ros.js"
|
|||||||
assert.equal(remote.addr, "vpn.example.com")
|
assert.equal(remote.addr, "vpn.example.com")
|
||||||
assert.equal(remote.id, "vpn.example.com")
|
assert.equal(remote.id, "vpn.example.com")
|
||||||
assert.equal(local.p12, "cDEy")
|
assert.equal(local.p12, "cDEy")
|
||||||
|
// ike-proposal/esp-proposal не задаём: верхний регистр strongSwan не парсит,
|
||||||
|
// а его defaults совместимы с профилем MikroTik.
|
||||||
|
assert.equal("ike-proposal" in parsed, false)
|
||||||
|
assert.equal("esp-proposal" in parsed, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -253,7 +253,13 @@ export function findFreePoolIp(range: string, taken: Iterable<string>): string |
|
|||||||
|
|
||||||
// ── клиентские конфиги ──────────────────────────────────────────────────────
|
// ── клиентские конфиги ──────────────────────────────────────────────────────
|
||||||
|
|
||||||
/** strongSwan (Android/iOS) .sswan-профиль с встроенным .p12. */
|
/**
|
||||||
|
* strongSwan Android .sswan-профиль с встроенным .p12.
|
||||||
|
* `ike-proposal`/`esp-proposal` намеренно не задаём: приложение берёт свои defaults,
|
||||||
|
* которые пересекаются с профилем MikroTik (aes256-sha256-modp2048); фиксированный
|
||||||
|
* неполный список лишь сужает совместимость.
|
||||||
|
* @see https://docs.strongswan.org/docs/latest/os/androidVpnClientProfiles.html
|
||||||
|
*/
|
||||||
export function buildSswanConfig(args: {
|
export function buildSswanConfig(args: {
|
||||||
name: string
|
name: string
|
||||||
serverEndpoint: string
|
serverEndpoint: string
|
||||||
@@ -269,8 +275,6 @@ export function buildSswanConfig(args: {
|
|||||||
type: "ikev2-cert",
|
type: "ikev2-cert",
|
||||||
remote: { addr: args.serverEndpoint, id: args.serverId },
|
remote: { addr: args.serverEndpoint, id: args.serverId },
|
||||||
local: { p12: args.p12B64 },
|
local: { p12: args.p12B64 },
|
||||||
"ike-proposal": "AES256-SHA256-MODP2048",
|
|
||||||
"esp-proposal": "AES256-SHA256-MODP2048",
|
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
2,
|
2,
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ function IpsecCertSheet({
|
|||||||
</SheetDescription>
|
</SheetDescription>
|
||||||
</SheetHeader>
|
</SheetHeader>
|
||||||
|
|
||||||
<div className="flex-1 overflow-y-auto px-6 py-5 flex flex-col gap-5">
|
<div className="flex-1 min-w-0 overflow-y-auto overflow-x-hidden px-6 py-5 flex flex-col gap-5">
|
||||||
{!bundle ? (
|
{!bundle ? (
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
Бандл сертификата пуст — перезапустите экспорт с новой парольной фразой.
|
Бандл сертификата пуст — перезапустите экспорт с новой парольной фразой.
|
||||||
@@ -119,7 +119,7 @@ function IpsecCertSheet({
|
|||||||
</div>
|
</div>
|
||||||
</FormField>
|
</FormField>
|
||||||
{bundle.serverEndpoint ? (
|
{bundle.serverEndpoint ? (
|
||||||
<p className="text-xs text-muted-foreground">
|
<p className="text-xs text-muted-foreground break-all">
|
||||||
Сервер: <span className="font-mono">{bundle.serverEndpoint}</span>
|
Сервер: <span className="font-mono">{bundle.serverEndpoint}</span>
|
||||||
</p>
|
</p>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -129,7 +129,7 @@ function IpsecCertSheet({
|
|||||||
<SectionTitle>Файлы</SectionTitle>
|
<SectionTitle>Файлы</SectionTitle>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="justify-start"
|
className="justify-start min-w-0"
|
||||||
disabled={!canDownload}
|
disabled={!canDownload}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!bundle) return
|
if (!bundle) return
|
||||||
@@ -138,12 +138,12 @@ function IpsecCertSheet({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DownloadIcon className="size-4" />
|
<DownloadIcon className="size-4" />
|
||||||
{bundle.filename} (.p12, сертификат + ключ)
|
<span className="truncate">{bundle.filename} (.p12, сертификат + ключ)</span>
|
||||||
</Button>
|
</Button>
|
||||||
{bundle.sswanContent && bundle.sswanFilename ? (
|
{bundle.sswanContent && bundle.sswanFilename ? (
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="justify-start"
|
className="justify-start min-w-0"
|
||||||
disabled={!canDownload}
|
disabled={!canDownload}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!bundle.sswanContent || !bundle.sswanFilename) return
|
if (!bundle.sswanContent || !bundle.sswanFilename) return
|
||||||
@@ -152,7 +152,7 @@ function IpsecCertSheet({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DownloadIcon className="size-4" />
|
<DownloadIcon className="size-4" />
|
||||||
{bundle.sswanFilename} (strongSwan)
|
<span className="truncate">{bundle.sswanFilename} (strongSwan)</span>
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
{bundle.instructions ? (
|
{bundle.instructions ? (
|
||||||
@@ -172,7 +172,7 @@ function IpsecCertSheet({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{bundle.instructions ? (
|
{bundle.instructions ? (
|
||||||
<pre className="max-h-72 overflow-auto rounded-md border bg-muted/40 p-3 text-[11px] leading-relaxed whitespace-pre-wrap">
|
<pre className="max-h-72 overflow-y-auto overflow-x-hidden rounded-md border bg-muted/40 p-3 text-[11px] leading-relaxed whitespace-pre-wrap break-words">
|
||||||
{bundle.instructions}
|
{bundle.instructions}
|
||||||
</pre>
|
</pre>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
Reference in New Issue
Block a user