flayer.vpn_project¶
flayer.vpn_project ¶
Private local VPN projects composed with owned Yandex lifecycle and trusted guest provisioning.
PROJECT_TEMPLATE
module-attribute
¶
PROJECT_TEMPLATE = '# Edit the folder, image, management address, and Reality target before preparation.\n# Project files contain private keys and must remain outside Git and shared directories.\nschema_version = 1\n\n[identity]\nproject = "my-vpn"\nstack = "gateway"\nprovider = "yandex-cloud"\nscope_id = "replace-with-folder-id"\nowner_id = "my-team"\n\n[cloud]\nyc_profile = "default"\nzone_id = "ru-central1-a"\nimage_id = "replace-with-ubuntu-2404-amd64-image-id"\nsubnet_cidr = "10.42.0.0/24"\nmanagement_cidrs = ["198.51.100.42/32"] # Replace with your current public IPv4 address.\n\n# Optional explicit sizing: uncomment the entire block before prepare.\n# Confirm regional availability and image minimum disk size first.\n# [resources]\n# platform_id = "standard-v3"\n# cores = 2\n# core_fraction = 50\n# memory_gib = 2\n# disk_size_gib = 10\n# disk_type = "network-hdd"\n\n[routes]\nmode = "full"\nipv4_cidrs = ["0.0.0.0/0"]\ndns_servers = ["1.1.1.1"]\nipv6_policy = "disabled" # Disable client IPv6 to prevent traffic bypass.\n\n[[devices]]\ndevice_id = "laptop"\nipv4_address = "10.66.0.2"\n\n[amneziawg]\nport = 51820\ntunnel_cidr = "10.66.0.0/24"\n\n[vless]\nport = 443\n# Example only: choose an accessible TLS 1.3 / HTTP/2 site for your server location.\ntarget_host = "www.microsoft.com"\nserver_name = "www.microsoft.com"\n'
CloudPlacement
dataclass
¶
CloudPlacement(yc_profile: str, zone_id: str, image_id: str, subnet_cidr: str, management_cidrs: tuple[str, ...])
Public placement and narrowly scoped administrator ingress for one Ubuntu guest.
VpnResources
dataclass
¶
VpnResources(platform_id: str, cores: int, core_fraction: int, memory_gib: int, disk_size_gib: int, disk_type: str)
Explicit initial server sizing; absence preserves the legacy project contract.
VpnProject
dataclass
¶
VpnProject(root: Path, vpn: VpnProfile, cloud: CloudPlacement, amneziawg: AmneziaWgSettings, vless: VlessRealitySettings, ssh_public_key: str, resources: VpnResources | None = None)
Validated public project intent with explicit private local storage references.
Artifacts
property
¶
Artifacts: Path
Locate the existing private owned-artifact store within this project.
Fingerprint ¶
Fingerprint() -> str
Bind prepared material to all public project settings without persisting secrets.
Source code in installed/flayer/vpn_project.py
231 232 233 234 235 236 237 238 239 240 241 242 243 | |
VpnProjectReport
dataclass
¶
VpnProjectReport(action: str, status: str, cloud_status: str = 'not-requested', guest_status: str = 'not-requested', client_exports: tuple[str, ...] = (), recovery_required: bool = False, details: str = '', connectivity_status: str = 'not-verified')
Sanitized lifecycle and guest observations without transport material or provider output.
ExitCode ¶
ExitCode() -> int
Treat incomplete cloud or guest operations as unsuccessful without claiming connectivity.
Source code in installed/flayer/vpn_project.py
265 266 267 268 | |
VpnYandexProvider ¶
VpnYandexProvider(settings: YandexCloudSettings, runner: CommandRunner | None = None)
Bases: YandexLifecycleProvider
Add one authenticated read-only public host-key channel to the existing lifecycle adapter.
Source code in installed/flayer/providers/yandex.py
127 128 129 130 131 132 133 134 | |
ReadHostKey ¶
ReadHostKey(instance: ProviderResource, fingerprint: str) -> str | None
Extract one exact bootstrap marker without logging unrelated serial-console contents.
Source code in installed/flayer/vpn_project.py
624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | |
InitializeVpnProject ¶
InitializeVpnProject(directory: str | Path) -> Path
Create one exclusive private project and an administration key without cloud access.
Source code in installed/flayer/vpn_project.py
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
LoadVpnProject ¶
LoadVpnProject(directory: str | Path) -> VpnProject
Read explicit editable public TOML and administration public key from private storage.
Source code in installed/flayer/vpn_project.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | |
PrepareVpnProject ¶
PrepareVpnProject(project: VpnProject) -> VpnProjectReport
Prepare private materials and verify both renderers locally without exporting false endpoints.
Source code in installed/flayer/vpn_project.py
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | |
CompileVpnProject ¶
CompileVpnProject(project: VpnProject) -> DeploymentPlan
Compile six owned resources while binding only the verified nonsecret bootstrap file.
Source code in installed/flayer/vpn_project.py
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 | |
RunVpnProject ¶
RunVpnProject(project: VpnProject, action: str, *, allow_mutation: bool = False, scope_confirm: str = '', rollback: bool = False, provider: VpnYandexProvider | None = None, guest_factory: Callable[..., SshGuestProvisioner] = SshGuestProvisioner) -> VpnProjectReport
Compose explicit cloud consent, durable resources, authenticated guest install, and client export.
Source code in installed/flayer/vpn_project.py
746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 | |