From d0cece30015a90fbb74d5cd028aa70642375f0dc Mon Sep 17 00:00:00 2001 From: tdv Date: Thu, 30 Oct 2025 16:54:22 +0200 Subject: [PATCH] added helper scrip for vault installation in dev env --- certs/vault_install.sh | 72 +++++++++++++++++++ .../DataTableNoCheckboxScroll.vue | 38 ++++------ .../customcompometns/DeviceTasksDialog.vue | 15 ++-- readme.md | 6 +- 4 files changed, 96 insertions(+), 35 deletions(-) create mode 100644 certs/vault_install.sh diff --git a/certs/vault_install.sh b/certs/vault_install.sh new file mode 100644 index 0000000..b05287e --- /dev/null +++ b/certs/vault_install.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# ------------------------------------------------------- +# HashiCorp Vault Installation and Configuration Script +# ------------------------------------------------------- +set -e +# ------------------------------------------------------- +# 1. Install Vault +# ------------------------------------------------------- +# yum install -y yum-utils +# yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo +# yum -y install vault +# echo "[+] Vault installed successfully." +# ------------------------------------------------------- +# 2. Create directories and set permissions +# ------------------------------------------------------- +useradd --system --home /opt/vault --shell /bin/false vault +mkdir -p /opt/vault/data +chown -R vault:vault /opt/vault +mkdir -p /etc/vault +chown -R vault:vault /etc/vault +echo "[+] Directories and permissions set." +# ------------------------------------------------------- +# 3. Create Vault configuration file +# ------------------------------------------------------- +cat > /etc/vault/config.hcl <<'EOF' +storage "file" { + path = "/opt/vault/data" +} + +listener "tcp" { + address = "127.0.0.1:8200" + tls_disable = 1 +} + +disable_mlock = true +ui = true +EOF + +echo "[+] Vault configuration file created at /etc/vault/config.hcl." +# ------------------------------------------------------- +# 4. Create systemd service file +# ------------------------------------------------------- +cat > /etc/systemd/system/vault.service <<'EOF' +[Unit] +Description=HashiCorp Vault +After=network-online.target +Wants=network-online.target + +[Service] +User=vault +Group=vault +ExecStart=/usr/bin/vault server -config=/etc/vault/config.hcl +Restart=on-failure +LimitNOFILE=65536 + +[Install] +WantedBy=multi-user.target +EOF + +echo "[+] Vault systemd service file created at /etc/systemd/system/vault.service." +# ------------------------------------------------------- +# 5. Enable and start Vault service +# ------------------------------------------------------- +restorecon -v /usr/bin/vault +systemctl daemon-reload +systemctl enable vault +systemctl start vault +echo "[+] Vault service started and enabled." +# ------------------------------------------------------- +# 6. Final status +# ------------------------------------------------------- +systemctl --no-pager status vault | grep "Active:" || echo "[+] Vault service may need manual check." \ No newline at end of file diff --git a/management-ui/src/customcompometns/DataTableNoCheckboxScroll.vue b/management-ui/src/customcompometns/DataTableNoCheckboxScroll.vue index 56e6396..64bd86a 100644 --- a/management-ui/src/customcompometns/DataTableNoCheckboxScroll.vue +++ b/management-ui/src/customcompometns/DataTableNoCheckboxScroll.vue @@ -37,18 +37,16 @@ const minWidthClass = props.minTableWidth ?? 'min-w-[1100px]' // tweak as needed \ No newline at end of file diff --git a/management-ui/src/customcompometns/DeviceTasksDialog.vue b/management-ui/src/customcompometns/DeviceTasksDialog.vue index 82e532b..6167ed7 100644 --- a/management-ui/src/customcompometns/DeviceTasksDialog.vue +++ b/management-ui/src/customcompometns/DeviceTasksDialog.vue @@ -59,7 +59,7 @@ function fmt(ts?: string | null) { const task_columns: ColumnDef[] = [ { accessorKey: 'id', header: 'ID' }, -// { accessorKey: 'deviceGuid', header: 'GUID' }, + // { accessorKey: 'deviceGuid', header: 'GUID' }, { accessorKey: 'type', header: 'Task' }, { accessorKey: 'payload', @@ -77,9 +77,9 @@ const task_columns: ColumnDef[] = [ const s = row.original.status const cls = s === 'finished' ? 'px-2 py-0.5 rounded text-xs text-green-700 bg-green-100' - : s === 'running' ? 'px-2 py-0.5 rounded text-xs text-blue-700 bg-blue-100' - : s === 'error' ? 'px-2 py-0.5 rounded text-xs text-red-700 bg-red-100' - : 'px-2 py-0.5 rounded text-xs text-amber-700 bg-amber-100' + : s === 'running' ? 'px-2 py-0.5 rounded text-xs text-blue-700 bg-blue-100' + : s === 'error' ? 'px-2 py-0.5 rounded text-xs text-red-700 bg-red-100' + : 'px-2 py-0.5 rounded text-xs text-amber-700 bg-amber-100' return h('span', { class: cls }, s) }, }, @@ -100,7 +100,7 @@ const task_columns: ColumnDef[] = [