Add ERP Local Agent secure self update framework

This commit is contained in:
A R R R Associates
2026-08-09 12:45:44 +05:30
parent b374aadf44
commit f79862203b
25 changed files with 1011 additions and 583 deletions
@@ -3,9 +3,10 @@
<div class="space-y-6">
<div class="flex flex-col gap-3 md:flex-row md:items-center md:justify-between">
<div>
<h1 class="text-2xl font-bold text-slate-900">Branch Local Storage</h1>
<p class="text-sm text-slate-500">Partner/branch controlled storage setup for engagement document streaming.</p>
<h1 class="text-2xl font-bold text-slate-900">ERP Local Agent</h1>
<p class="text-sm text-slate-500">Branch-local ERP runtime. Existing storage remains unchanged; future Tally/GST/local tools will use the same agent.</p>
<p class="text-xs text-slate-400 mt-1">Scope: {{ storage_scope_title or '-' }}</p>
<p class="text-xs text-emerald-700 mt-1">ERP Local Agent release: {{ erp_local_agent_version or '-' }} · automatic updates enabled</p>
</div>
<div class="flex flex-wrap gap-2">
<a href="/documents" class="px-3 py-2 rounded-xl bg-slate-100 text-slate-700 text-sm font-semibold">Back to Documents</a>
@@ -41,13 +42,13 @@
{% if request.query_params.get('created') == '1' %}
<div class="rounded-2xl border border-emerald-200 bg-emerald-50 p-4 text-sm text-emerald-800">
Storage node created. Use the <strong>Download Agent Package</strong> button in the node row to generate the branch package. Secret and standalone .env are not displayed.
Storage node created. Use the <strong>Download ERP Local Agent</strong> button in the node row to generate the branch package. Secret and standalone .env are not displayed.
</div>
{% endif %}
{% if request.query_params.get('error') == 'env_download_disabled' %}
<div class="rounded-2xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-800">
Standalone .env download is disabled for security. Download the pre-configured agent ZIP instead.
Standalone .env download is disabled for security. Download the pre-configured ERP Local Agent ZIP instead.
</div>
{% endif %}
@@ -79,7 +80,7 @@
</div>
<div><label class="text-sm font-medium">Local Storage Root</label><input name="storage_root_path" class="mt-1 w-full rounded-xl border p-2" value="D:\AuditFirmStorage"><p class="text-xs text-amber-700 mt-1">For a new branch setup only. Existing branch nodes keep their already configured root.</p></div>
<div><label class="text-sm font-medium">Quota GB</label><input name="quota_limit_gb" class="mt-1 w-full rounded-xl border p-2" placeholder="Optional"></div>
<button class="w-full rounded-xl bg-emerald-700 text-white py-2 font-semibold">Download / Regenerate Branch Agent Package</button>
<button class="w-full rounded-xl bg-emerald-700 text-white py-2 font-semibold">Download / Regenerate ERP Local Agent</button>
</form>
<form method="post" action="/documents/storage-nodes" class="rounded-2xl border bg-white p-5 space-y-4 shadow-sm">
@@ -123,7 +124,7 @@
<div class="rounded-2xl border bg-white overflow-hidden shadow-sm">
<div class="p-4 border-b flex items-center justify-between">
<div>
<h2 class="font-bold text-slate-900">Configured storage nodes</h2>
<h2 class="font-bold text-slate-900">Configured ERP Local Agents</h2>
<p class="text-xs text-slate-500">Partners/Branch Managers see only their managed branch. One branch should have one active node and one fixed storage root. Existing node secrets are not shown again.</p>
</div>
</div>
@@ -147,7 +148,7 @@
<form method="post" action="/documents/storage-nodes/{{ node.id }}/download-agent-package">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<input type="hidden" name="storage_root_path" value="{{ node.storage_root_path or 'D:\AuditFirmStorage' }}">
<button class="text-sm text-emerald-700 font-semibold">Download Agent Package</button>
<button class="text-sm text-emerald-700 font-semibold">Download ERP Local Agent</button>
</form>
<form method="post" action="/documents/storage-nodes/{{ node.id }}/toggle">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">