flyctl Documentation

repository·master·Indexed 23 days ago

https://github.com/superfly/flyctl

flyctl is the command-line interface for managing resources on fly.io, allowing developers to authenticate, deploy, and manage applications from their terminal. The documentation covers installation via package managers, scripts, or GitHub, building from source on Windows, versioning behavior, and internal audit tools like `fly audit lint` and `fly audit list`. It also includes technical details for the Wintun network adapter used in its dependencies.

Tokens
23.7K
Snippets
9
Records
196
Agent score
81%

What's inside flyctl

  1. Wintun License Information

    master

    The Wintun repository (including documentation and example code) is Copyright © 2018-2021 WireGuard LLC. The source code is licensed under the GPLv2.

    Note that prebuilt binaries obtained from wintun.net are released under a more permissive license, as specified in the files distributed within their official .zip packages.

  2. Understand flyctl versioning and update behavior

    master

    flyctl uses semantic versioning with two distinct types of versions:

    1. Release versions: Standard major.minor.patch format.
    2. Prerelease versions: major.minor.patch-pre-incnumber format (e.g., v0.0.100-pre-1).

    Update Notifications

    • If you are running a Release version: You will only be notified when a new stable release is available. Prereleases are ignored.
    • If you are running a Prerelease version: You will be notified of any new prerelease OR any new stable release. If a release has occurred followed by a new prerelease, the upgrade prompt will suggest the latest prerelease.
  3. How flyctl determines the target app

    master

    By default, flyctl attempts to identify the target application by looking for a fly.toml file in the current working directory. It will use the app name defined within that file.

    If you need to target a different application, you can override this behavior using the -a flag or other command-line app name settings.

  4. Create Wintun adapters and sessions

    master

    Wintun operates using Adapters and Sessions.

    • Adapters: Named interfaces (e.g., "OfficeNet") that belong to a specific pool (e.g., "WireGuard"). Multiple adapters can exist within the same pool.
    • Sessions: A tunnel session started on a specific adapter to facilitate packet transfer.

    Use WintunCreateAdapter to define an adapter and WintunStartSession to begin a session on that adapter.

    // Create adapters within a pool named "WireGuard"
    WINTUN_ADAPTER_HANDLE Adapter1 = WintunCreateAdapter(L"WireGuard", L"OfficeNet", &SomeFixedGUID1, NULL);
    WINTUN_ADAPTER_HANDLE Adapter2 = WintunCreateAdapter(L"WireGuard", L"HomeNet", &SomeFixedGUID2, NULL);
    
    // Start a session on an adapter
    WINTUN_SESSION_HANDLE Session = WintunStartSession(Adapter2, 0x400000);
  5. Install flyctl using a package manager

    master

    For macOS, Linux, or WSL, you can use Homebrew to install or upgrade flyctl.

    Note: Most installations alias flyctl to fly. You can use fly interchangeably with flyctl during the transition period.

  6. Install flyctl using the install script

    master

    You can use a shell script to download and install flyctl into a local bin directory.

    MacOS, Linux, WSL

    Use curl to pipe the installation script to sh.

    Windows

    Use PowerShell to run the installation script.

  7. Integrate Wintun into a C/C++ project

    master

    To use Wintun in your application:

    1. Copy the wintun.h header file into your project.
    2. Dynamically load wintun.dll using the Windows API functions LoadLibraryEx() and GetProcAddress() to resolve the necessary functions.
    3. Use the typedefs provided in wintun.h to map the resolved function pointers.

    For a ready-to-use implementation of this loading logic, you can copy the InitializeWintun function from the official example.c source.

  8. Install the latest prerelease of flyctl

    master

    To install the latest prerelease version of flyctl instead of the stable release, run the install.sh script with the prerel parameter.

    Note: If no prerelease version is currently available, the script will fall back to installing the latest stable release version.

  9. Get started with flyctl

    master

    Follow these steps to authenticate and begin managing your apps:

    1. Sign in: Authenticate your CLI with your fly.io account.
    2. List apps: View all applications associated with your account.
    3. Check status: View the status of a specific application.
  10. Build the Wintun driver from source

    master

    To build the Wintun driver, you must use Visual Studio 2019 with Windows SDK 10.0.18362.0 and the Windows Driver Kit (WDK) for Windows 10, version 1903.

    Important Security/Deployment Note: Do not distribute drivers or files named "Wintun" to avoid clashing with official deployments. Instead, distribute wintun.dll as downloaded from the official wintun.net website.

    To build:

    1. Open wintun.sln in Visual Studio.
    2. Run bcdedit /set testsigning on in an elevated command prompt to enable unsigned driver loading.
    3. Use the default run sequence (F5) in Visual Studio to build the example project.
    bcdedit /set testsigning on