feat(taskserv): implement real-time version checking with configurable HTTP client
- Add: GitHub API integration for live version checking in taskserv management - Add: HTTP client configuration option (http.use_curl) in config.defaults.toml - Add: Helper function fetch_latest_version with curl/http get support - Fix: Settings path structure for prov_data_dirpath access pattern - Remove: Legacy simulation code for version checking - Update: Core configuration name from "provisioning-system" to "provisioning" - Clean: Remove obsolete example configs and infrastructure files
This commit is contained in:
parent
38a7470da0
commit
3c3ef47f7f
34 changed files with 5942 additions and 13 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{%- if taskserv.name == "os" %}
|
||||
{%- if taskserv.name == "os" %}
|
||||
HOSTNAME="{{server.hostname}}"
|
||||
{% if server.ip_addresses.pub %}
|
||||
PUB_IP="{{server.ip_addresses.pub}}"
|
||||
|
|
@ -18,4 +18,16 @@ INSTALLER_USER={{server.installer_user}}
|
|||
{% if taskserv.ssh_keys %}
|
||||
SSH_KEYS="{{taskserv.ssh_keys}}"
|
||||
{% endif %}
|
||||
|
||||
# Nushell Runtime Configuration (optional)
|
||||
{% if taskserv.install_nushell | default(false) %}
|
||||
INSTALL_NUSHELL="true"
|
||||
NUSHELL_VERSION="{{taskserv.nushell_version | default('0.107.1')}}"
|
||||
NUSHELL_READONLY="{{taskserv.nushell_readonly | default('true')}}"
|
||||
NUSHELL_PLUGINS="{{taskserv.nushell_plugins | default('false')}}"
|
||||
NUSHELL_NETWORK="{{taskserv.nushell_network | default('false')}}"
|
||||
NUSHELL_EXECUTION_MODE="{{taskserv.nushell_execution_mode | default('restricted')}}"
|
||||
{% else %}
|
||||
INSTALL_NUSHELL="false"
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,65 @@ let defs = load_defs
|
|||
|
||||
let ssh_keys = ($defs.taskserv.ssh_keys | str replace "~" $env.HOME | str trim)
|
||||
|
||||
if $ssh_keys != "" {
|
||||
if $ssh_keys != "" {
|
||||
let target_path = $env.PROVISIONING_WK_ENV_PATH
|
||||
^mkdir -p $"($target_path)/.ssh"
|
||||
for key in ($ssh_keys | split row " ") {
|
||||
for key in ($ssh_keys | split row " ") {
|
||||
log_debug $"on ($key)"
|
||||
if ($key | path exists) { cp $key $"($target_path)/.ssh" }
|
||||
if ($key | path exists) { cp $key $"($target_path)/.ssh" }
|
||||
if ($"($key).pub" | path exists) { cp $"($key).pub" $"($target_path)/.ssh" }
|
||||
}
|
||||
}
|
||||
|
||||
# Prepare Nushell installation if enabled
|
||||
let install_nushell = ($defs.taskserv.install_nushell? | default false)
|
||||
if $install_nushell {
|
||||
log_info "Preparing Nushell runtime installation..."
|
||||
|
||||
let target_path = $env.PROVISIONING_WK_ENV_PATH
|
||||
let nushell_script = "../../nushell/default/install-nushell.sh"
|
||||
|
||||
# Copy Nushell installation script if it exists
|
||||
if ($nushell_script | path exists) {
|
||||
cp $nushell_script $"($target_path)/install-nushell.sh"
|
||||
^chmod +x $"($target_path)/install-nushell.sh"
|
||||
log_debug "Copied Nushell installation script"
|
||||
} else {
|
||||
log_warn "Nushell installation script not found at ($nushell_script)"
|
||||
}
|
||||
|
||||
# Copy Nushell configuration templates
|
||||
let nushell_templates = [
|
||||
"../../nushell/default/config.nu.j2"
|
||||
"../../nushell/default/env.nu.j2"
|
||||
"../../nushell/default/remote-exec.nu.j2"
|
||||
]
|
||||
|
||||
^mkdir -p $"($target_path)/nushell/templates"
|
||||
for template in $nushell_templates {
|
||||
if ($template | path exists) {
|
||||
let template_name = ($template | path basename)
|
||||
cp $template $"($target_path)/nushell/templates/($template_name)"
|
||||
log_debug $"Copied Nushell template: ($template_name)"
|
||||
}
|
||||
}
|
||||
|
||||
# Copy observability scripts
|
||||
let observability_scripts = [
|
||||
"../../nushell/observability/collect.nu"
|
||||
"../../nushell/observability/process.nu"
|
||||
"../../nushell/observability/telemetry.nu"
|
||||
]
|
||||
|
||||
^mkdir -p $"($target_path)/nushell/observability"
|
||||
for script in $observability_scripts {
|
||||
if ($script | path exists) {
|
||||
let script_name = ($script | path basename)
|
||||
cp $script $"($target_path)/nushell/observability/($script_name)"
|
||||
^chmod +x $"($target_path)/nushell/observability/($script_name)"
|
||||
log_debug $"Copied observability script: ($script_name)"
|
||||
}
|
||||
}
|
||||
|
||||
log_info "Nushell runtime preparation completed"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue