github.com/google/fleetspeak@v0.1.15-0.20240426164851-4f31f62c1aea/sandboxes/passthrough-mode/README.md (about)

     1  # Passthrough Mode
     2  
     3  ## Introduction
     4  
     5  This sandbox demonstrates how to run Fleetspeak in 'passthrough mode'. \
     6  ![Passthrough Mode](../diagrams/passthroughMode_355.png "Passthrough Mode")
     7  
     8  ## Setup
     9  
    10  Before you run the commands below make sure that you successfully executed the
    11  steps outlined in the [setup instructions](../../sandboxes#setup-instructions).
    12  
    13  ## Bring up the test environment
    14  
    15  ```
    16  docker compose up --build -d
    17  
    18  [+] Running 5/5
    19   ✔ Network passthrough-mode_default                            Created                                                                                               0.1s
    20   ✔ Container passthrough-mode-mysql-server-1                   Healthy                                                                                               0.0s
    21   ✔ Container passthrough-mode-fleetspeak-server-1              Started                                                                                               0.0s
    22   ✔ Container passthrough-mode-fleetspeak-server-passthrough-1  Healthy                                                                                               0.0s
    23   ✔ Container passthrough-mode-fleetspeak-client-1              Started                                                                                               0.0s
    24  ```
    25  
    26  ## Find the client id
    27  
    28  ```
    29  docker logs passthrough-mode-fleetspeak-client-1
    30  # The output should look similar to the below
    31  
    32  # config.go:44] Read 1 trusted certificates.
    33  # manager.go:103] initial load of writeback failed (continuing): open /fleetspeak-client.state: no such file or directory
    34  # manager.go:165] Using new client id: **46cdb0f943ee8f44**
    35  # client.go:175] No signed service configs could be read; continuing: invalid signed services directory path: unable to stat path [/config/fleetspeak-client/services]: stat /config/fleetspeak-client/services: no such file or directory
    36  # services.go:146] Started service hello with config:
    37  #   name:"hello"  factory:"Daemon"  config:{[type.googleapis.com/fleetspeak.daemonservice.Config]:{argv:"/venv/FSENV/bin/python"  argv:"/config/hello.py"}}
    38  # system_service.go:251] Unable to get revoked certificate list: unable to retrieve file, last attempt failed with: failed with http response code: 404
    39  
    40  # Run the test app container
    41  docker run -it --name greeter --network passthrough-mode_default -p 1337:1337 --rm greeter bash
    42  ```
    43  
    44  ## Run the test app
    45  
    46  ```
    47  # In the above find the client id and export it in a variable
    48  export CLIENT_ID=**46cdb0f943ee8f44**
    49  
    50  # Start the test app, when it runs add your input and hit enter. You should see the string being ecohed.
    51  /venv/FSENV/bin/python ./greeter.py --client_id=$CLIENT_ID --fleetspeak_message_listen_address="0.0.0.0:1337" \
    52      --fleetspeak_server="fleetspeak-server:9091" --alsologtostderr
    53  ```
    54  
    55  ## Bring down the test environment
    56  
    57  ```
    58  docker compose down
    59  ```