Add Coolify domain sync for system admin

This commit is contained in:
A R R R Associates
2026-07-09 10:32:36 +05:30
parent 2ef58ded85
commit 94aa8292e2
6 changed files with 380 additions and 1 deletions
@@ -67,5 +67,39 @@
</div>
</div>
</div>
{% if coolify_result is defined and coolify_result %}
<div class="rounded-2xl {% if coolify_result.ok %}bg-emerald-50 text-emerald-800{% else %}bg-red-50 text-red-800{% endif %} p-4 text-sm">
<div class="font-semibold">Coolify: {{ coolify_result.status.replace('_', ' ')|title }}</div>
<div class="mt-1">{{ coolify_result.message }}</div>
{% if coolify_result.domain_url %}<div class="mt-2 text-xs">Domain URL: {{ coolify_result.domain_url }}</div>{% endif %}
{% if coolify_result.updated_domains %}<div class="mt-2 text-xs">Application domains: {{ coolify_result.updated_domains|join(', ') }}</div>{% endif %}
</div>
{% endif %}
<div class="rounded-2xl border bg-white p-5 shadow-soft">
<div class="flex flex-col gap-3 md:flex-row md:items-start md:justify-between">
<div>
<h2 class="text-lg font-semibold text-slate-900">Coolify / Traefik Route</h2>
<p class="mt-1 text-sm text-slate-500">System Admin can add this custom domain to the configured Coolify ERP application. DNS should already point to your Coolify server before SSL is issued.</p>
</div>
<div class="flex flex-col gap-2 sm:flex-row">
<form method="post" action="/domains/{{ mapping.id }}/coolify/check">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
<button class="w-full rounded-xl border px-4 py-2 text-sm font-medium text-slate-700">Check Coolify App</button>
</form>
<form method="post" action="/domains/{{ mapping.id }}/coolify/sync">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
<button class="w-full rounded-xl bg-slate-900 px-4 py-2 text-sm font-medium text-white">Add to Coolify</button>
</form>
</div>
</div>
<div class="mt-4 grid grid-cols-1 gap-3 text-sm md:grid-cols-3">
<div class="rounded-xl bg-slate-50 p-3"><div class="text-slate-500">Coolify URL format</div><div class="font-medium text-slate-900">https://{{ mapping.domain_name }}</div></div>
<div class="rounded-xl bg-slate-50 p-3"><div class="text-slate-500">Proxy mode</div><div class="font-medium text-slate-900">{{ mapping.ssl_mode or 'manual' }}</div></div>
<div class="rounded-xl bg-slate-50 p-3"><div class="text-slate-500">Proxy/SSL status</div><div class="font-medium text-slate-900">{{ (mapping.ssl_status or 'not_checked').replace('_', ' ')|title }}</div></div>
</div>
</div>
</div>
{% endblock %}
@@ -1,6 +1,14 @@
{% extends "ui/templates/base/layout.html" %}
{% block content %}
<div class="space-y-6">
{% if coolify_result is defined and coolify_result %}
<div class="rounded-2xl {% if coolify_result.ok %}bg-emerald-50 text-emerald-800{% else %}bg-red-50 text-red-800{% endif %} p-4 text-sm">
<div class="font-semibold">Coolify API: {{ coolify_result.status.replace('_', ' ')|title }}</div>
<div class="mt-1">{{ coolify_result.message }}</div>
{% if coolify_result.updated_domains %}<div class="mt-2 text-xs">Application domains: {{ coolify_result.updated_domains|join(', ') }}</div>{% endif %}
</div>
{% endif %}
<div class="flex flex-col gap-3 md:flex-row md:items-end md:justify-between">
<div>
<h1 class="text-2xl font-semibold text-slate-900">SSL Automation</h1>
@@ -11,6 +19,7 @@
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
<button class="rounded-xl bg-slate-900 px-4 py-2 text-sm font-medium text-white shadow-sm">Check Active SSL</button>
</form>
<a href="/domains/coolify/status" class="rounded-xl border px-4 py-2 text-sm font-medium text-slate-700 shadow-sm">Coolify Status</a>
<a href="/domains/verification" class="rounded-xl border px-4 py-2 text-sm font-medium text-slate-700 shadow-sm">DNS Verification</a>
<a href="/domains" class="rounded-xl border px-4 py-2 text-sm font-medium text-slate-700 shadow-sm">Domains</a>
</div>
@@ -34,6 +34,11 @@
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
<button class="rounded-xl bg-slate-900 px-4 py-2 text-sm font-medium text-white">Check SSL Now</button>
</form>
<form method="post" action="/domains/{{ mapping.id }}/coolify/sync">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
<button class="rounded-xl bg-slate-900 px-4 py-2 text-sm font-medium text-white">Add Domain to Coolify</button>
</form>
<form method="post" action="/domains/{{ mapping.id }}/ssl/mark-managed" class="flex gap-2">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
<select name="provider" class="rounded-xl border px-3 py-2 text-sm">