fix: Rename freeflowuniverse to incubaid

This commit is contained in:
Mahmoud-Emad
2025-10-12 12:30:19 +03:00
parent 801c4abb43
commit 8f2d187b17
1593 changed files with 8753 additions and 8300 deletions

View File

@@ -1,6 +1,6 @@
module hetznermanager
import freeflowuniverse.herolib.core.texttools
import incubaid.herolib.core.texttools
pub struct SSHKey {
pub mut:

View File

@@ -1,8 +1,8 @@
module hetznermanager
import freeflowuniverse.herolib.core.base
import freeflowuniverse.herolib.core.playbook { PlayBook }
import freeflowuniverse.herolib.ui.console
import incubaid.herolib.core.base
import incubaid.herolib.core.playbook { PlayBook }
import incubaid.herolib.ui.console
import json
__global (

View File

@@ -1,8 +1,8 @@
module hetznermanager
import freeflowuniverse.herolib.core.httpconnection
import freeflowuniverse.herolib.data.encoderhero
import freeflowuniverse.herolib.core.playbook
import incubaid.herolib.core.httpconnection
import incubaid.herolib.data.encoderhero
import incubaid.herolib.core.playbook
pub const version = '0.0.0'
const singleton = false

View File

@@ -1,7 +1,7 @@
// File: lib/virt/hetznermanager/play.v
module hetznermanager
import freeflowuniverse.herolib.core.playbook { PlayBook }
import incubaid.herolib.core.playbook { PlayBook }
// play processes playbook actions for the hetznermanager module.
// It allows configuring and managing Hetzner servers through heroscript.

View File

@@ -8,11 +8,11 @@ Before using the module, you need to configure at least one client instance with
```hs
!!hetznermanager.configure
name:"main"
user:"<your_robot_username>"
password:"${HETZNER_PASSWORD}"
whitelist:"2111181, 2392178" // Optional: comma-separated list of server IDs to operate on
sshkey: "name of sshkey as used with hetzner"
name:"main"
user:"<your_robot_username>"
password:"${HETZNER_PASSWORD}"
whitelist:"2111181, 2392178" // Optional: comma-separated list of server IDs to operate on
sshkey: "name of sshkey as used with hetzner"
```
## 2. Usage
@@ -24,6 +24,7 @@ You can interact with the Hetzner module in two ways: via HeroScript for automat
HeroScript provides a simple, declarative way to execute server operations. You can run a script containing these actions using `playcmds.run()`.
**Example Script:**
```hs
# Place a server into rescue mode
@@ -53,40 +54,39 @@ HeroScript provides a simple, declarative way to execute server operations. You
data: 'ssh-rsa AAAA...'
```
#### Available Heroscript Actions:
* `!!hetznermanager.configure`: Configures a new client instance.
* `name` (string): A unique name for this configuration.
* `user` (string): Hetzner Robot username.
* `password` (string): Hetzner Robot password.
* `whitelist` (string, optional): Comma-separated list of server IDs to restrict operations to.
* `sshkey` (string, optional): Default public SSH key to deploy in rescue mode.
* `!!hetznermanager.server_rescue`: Activates the rescue system.
* `instance` (string, optional): The client instance to use (defaults to 'default').
* `server_name` or `id` (string/int): Identifies the target server.
* `wait` (bool, optional): Wait for the server to reboot into rescue (default: `true`).
* `hero_install` (bool, optional): Install Herolib in the rescue system (default: `false`).
* `reset` (bool, optional): Force activation even if already in rescue mode (default: `false`).
* `!!hetznermanager.ubuntu_install`: Performs a fresh installation of Ubuntu 24.04.
* `instance` (string, optional): The client instance to use (defaults to 'default').
* `server_name` or `id` (string/int): Identifies the target server.
* `wait` (bool, optional): Wait for the installation and reboot to complete (default: `true`).
* `hero_install` (bool, optional): Install Herolib on the newly installed system (default: `false`).
* `!!hetznermanager.server_reset`: Triggers a hardware reset.
* All parameters are the same as `server_rescue`, except for `hero_install` and `reset`.
* `!!hetznermanager.key_create` / `key_delete`: Manages SSH keys in your account.
* `instance` (string, optional): The client instance to use.
* `key_name` (string): The name of the key.
* `data` (string, for create): The public key data.
#### Available Heroscript Actions
* `!!hetznermanager.configure`: Configures a new client instance.
* `name` (string): A unique name for this configuration.
* `user` (string): Hetzner Robot username.
* `password` (string): Hetzner Robot password.
* `whitelist` (string, optional): Comma-separated list of server IDs to restrict operations to.
* `sshkey` (string, optional): Default public SSH key to deploy in rescue mode.
* `!!hetznermanager.server_rescue`: Activates the rescue system.
* `instance` (string, optional): The client instance to use (defaults to 'default').
* `server_name` or `id` (string/int): Identifies the target server.
* `wait` (bool, optional): Wait for the server to reboot into rescue (default: `true`).
* `hero_install` (bool, optional): Install Herolib in the rescue system (default: `false`).
* `reset` (bool, optional): Force activation even if already in rescue mode (default: `false`).
* `!!hetznermanager.ubuntu_install`: Performs a fresh installation of Ubuntu 24.04.
* `instance` (string, optional): The client instance to use (defaults to 'default').
* `server_name` or `id` (string/int): Identifies the target server.
* `wait` (bool, optional): Wait for the installation and reboot to complete (default: `true`).
* `hero_install` (bool, optional): Install Herolib on the newly installed system (default: `false`).
* `!!hetznermanager.server_reset`: Triggers a hardware reset.
* All parameters are the same as `server_rescue`, except for `hero_install` and `reset`.
* `!!hetznermanager.key_create` / `key_delete`: Manages SSH keys in your account.
* `instance` (string, optional): The client instance to use.
* `key_name` (string): The name of the key.
* `data` (string, for create): The public key data.
### 2.2. V Language Usage
For more granular control, you can call the module functions directly from your V code.
```v
import freeflowuniverse.herolib.virt.hetznermanager
import freeflowuniverse.herolib.ui.console
import incubaid.herolib.virt.hetznermanager
import incubaid.herolib.ui.console
// Get a configured client instance by the name you provided during configuration
mut cl := hetznermanager.get(name: 'main')!
@@ -114,19 +114,19 @@ println('Server has been reset.')
## Features
- Server listing and information retrieval
- Hardware reset functionality
- Rescue mode management with optional Herolib installation
- Automated Ubuntu 24.04 installation
- SSH key management
- Automatic server status monitoring during long operations
- Built-in caching for API responses to reduce rate-limiting
- Integration with Herolib installation tools
* Server listing and information retrieval
* Hardware reset functionality
* Rescue mode management with optional Herolib installation
* Automated Ubuntu 24.04 installation
* SSH key management
* Automatic server status monitoring during long operations
* Built-in caching for API responses to reduce rate-limiting
* Integration with Herolib installation tools
## Notes
- The module uses Redis for caching API responses (default 60-second cache duration).
- Server operations that include `wait: true` will monitor the server until the operation completes, providing feedback on the process.
- Reset operations with `wait: true` will timeout after 2 minutes if the server doesn't respond to SSH.
- The module automatically manages `ssh-keygen -R` to remove old host keys during reboots and reinstalls.
- The official API documentation can be found at [https://robot.hetzner.com/doc/webservice/en.html#preface](https://robot.hetzner.com/doc/webservice/en.html#preface).
* The module uses Redis for caching API responses (default 60-second cache duration).
* Server operations that include `wait: true` will monitor the server until the operation completes, providing feedback on the process.
* Reset operations with `wait: true` will timeout after 2 minutes if the server doesn't respond to SSH.
* The module automatically manages `ssh-keygen -R` to remove old host keys during reboots and reinstalls.
* The official API documentation can be found at [https://robot.hetzner.com/doc/webservice/en.html#preface](https://robot.hetzner.com/doc/webservice/en.html#preface).

View File

@@ -1,10 +1,10 @@
module hetznermanager
import freeflowuniverse.herolib.core.texttools
import incubaid.herolib.core.texttools
import time
import freeflowuniverse.herolib.ui.console
import freeflowuniverse.herolib.osal.core as osal
import freeflowuniverse.herolib.builder
import incubaid.herolib.ui.console
import incubaid.herolib.osal.core as osal
import incubaid.herolib.builder
import os
// ///////////////////////////RESCUE

View File

@@ -1,10 +1,10 @@
module hetznermanager
import freeflowuniverse.herolib.core.texttools
import incubaid.herolib.core.texttools
import time
import freeflowuniverse.herolib.ui.console
import freeflowuniverse.herolib.osal.core as osal
import freeflowuniverse.herolib.builder
import incubaid.herolib.ui.console
import incubaid.herolib.osal.core as osal
import incubaid.herolib.builder
// /////////////////////////////////////RESET

View File

@@ -1,10 +1,10 @@
module hetznermanager
import freeflowuniverse.herolib.core.texttools
import incubaid.herolib.core.texttools
import time
import freeflowuniverse.herolib.ui.console
import freeflowuniverse.herolib.osal.core as osal
import freeflowuniverse.herolib.builder
import incubaid.herolib.ui.console
import incubaid.herolib.osal.core as osal
import incubaid.herolib.builder
/////////////////////////// LIST