improved launch process using cloudflare
This commit is contained in:
@@ -61,7 +61,6 @@
|
||||
|
||||
<div class="text-center mt-3">
|
||||
<p class="mb-1"><a href="{{ url_for('auth.forgot_password') }}" class="text-decoration-none">Forgot your password?</a></p>
|
||||
<p class="mb-0">Don't have an account? <a href="{{ url_for('auth.register') }}" class="text-decoration-none">Sign Up</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -69,6 +69,13 @@
|
||||
api_key: '{{ portainer_settings.api_key if portainer_settings else "" }}'
|
||||
};
|
||||
|
||||
window.cloudflareSettings = {
|
||||
email: '{{ cloudflare_settings.email if cloudflare_settings else "" }}',
|
||||
api_key: '{{ cloudflare_settings.api_key if cloudflare_settings else "" }}',
|
||||
zone_id: '{{ cloudflare_settings.zone_id if cloudflare_settings else "" }}',
|
||||
server_ip: '{{ cloudflare_settings.server_ip if cloudflare_settings else "" }}'
|
||||
};
|
||||
|
||||
// Pass CSRF token to JavaScript
|
||||
window.csrfToken = '{{ csrf_token }}';
|
||||
</script>
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
{% if is_master %}
|
||||
<!-- Connections Tab -->
|
||||
<div class="tab-pane fade {% if active_tab == 'connections' %}show active{% endif %}" id="connections" role="tabpanel" aria-labelledby="connections-tab">
|
||||
{{ connections_tab(portainer_settings, nginx_settings, site_settings, git_settings) }}
|
||||
{{ connections_tab(portainer_settings, nginx_settings, site_settings, git_settings, cloudflare_settings) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% from "settings/components/connection_modals.html" import connection_modals %}
|
||||
|
||||
{% macro connections_tab(portainer_settings, nginx_settings, site_settings, git_settings) %}
|
||||
{% macro connections_tab(portainer_settings, nginx_settings, site_settings, git_settings, cloudflare_settings) %}
|
||||
<!-- Meta tags for JavaScript -->
|
||||
<meta name="management-api-key" content="{{ site_settings.management_api_key }}">
|
||||
<meta name="git-settings" content="{{ git_settings|tojson|safe }}">
|
||||
@@ -161,6 +161,57 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Cloudflare Connection Card -->
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">
|
||||
<i class="fas fa-cloud me-2"></i>Cloudflare Connection
|
||||
</h5>
|
||||
<button class="btn btn-sm btn-outline-primary" onclick="testCloudflareConnection()">
|
||||
<i class="fas fa-plug me-1"></i>Test Connection
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="cloudflareForm" onsubmit="saveCloudflareConnection(event)">
|
||||
<div class="mb-3">
|
||||
<label for="cloudflareEmail" class="form-label">Email Address</label>
|
||||
<input type="email" class="form-control" id="cloudflareEmail" name="cloudflareEmail"
|
||||
placeholder="Enter your Cloudflare email" required
|
||||
value="{{ cloudflare_settings.email if cloudflare_settings and cloudflare_settings.email else '' }}">
|
||||
<div class="form-text">The email address associated with your Cloudflare account</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="cloudflareApiKey" class="form-label">API Key</label>
|
||||
<input type="password" class="form-control" id="cloudflareApiKey" name="cloudflareApiKey"
|
||||
placeholder="Enter your Cloudflare API key" required
|
||||
value="{{ cloudflare_settings.api_key if cloudflare_settings and cloudflare_settings.api_key else '' }}">
|
||||
<div class="form-text">You can generate this in your Cloudflare account settings</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="cloudflareZone" class="form-label">Zone ID</label>
|
||||
<input type="text" class="form-control" id="cloudflareZone" name="cloudflareZone"
|
||||
placeholder="Enter your Cloudflare zone ID" required
|
||||
value="{{ cloudflare_settings.zone_id if cloudflare_settings and cloudflare_settings.zone_id else '' }}">
|
||||
<div class="form-text">The zone ID for your domain in Cloudflare</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="cloudflareServerIp" class="form-label">Server IP Address</label>
|
||||
<input type="text" class="form-control" id="cloudflareServerIp" name="cloudflareServerIp"
|
||||
placeholder="Enter your server IP address (e.g., 192.168.1.100)" required
|
||||
value="{{ cloudflare_settings.server_ip if cloudflare_settings and cloudflare_settings.server_ip else '' }}">
|
||||
<div class="form-text">The IP address of this server for DNS management</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save me-1"></i>Save Cloudflare Settings
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Save Connection Modal -->
|
||||
|
||||
Reference in New Issue
Block a user