Page MenuHomeDevCentral

No OneTemporary

diff --git a/roles/paas-docker/containers/acme_dns.sls b/roles/paas-docker/containers/acme_dns.sls
index fcb6281..88e2027 100644
--- a/roles/paas-docker/containers/acme_dns.sls
+++ b/roles/paas-docker/containers/acme_dns.sls
@@ -1,73 +1,73 @@
# -------------------------------------------------------------
# Salt — Provision Docker engine
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2020-02-04
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
{% set has_selinux = salt['grains.get']('selinux:enabled', False) %}
{% set containers = pillar['docker_containers'][grains['id']] %}
{% for instance, container in containers['acme_dns'].items() %}
# -------------------------------------------------------------
# Storage directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/srv/{{ instance }}:
file.directory:
- makedirs: True
/srv/{{ instance }}/etc:
file.directory
/srv/{{ instance }}/lib:
file.directory
{% if has_selinux %}
selinux_context_openfire_data:
selinux.fcontext_policy_present:
- name: /srv/{{ instance }}
- sel_type: container_file_t
selinux_context_openfire_data_applied:
selinux.fcontext_policy_applied:
- name: /srv/{{ instance }}
{% endif %}
# -------------------------------------------------------------
# Configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/srv/{{ instance }}/etc/config.cfg:
file.managed:
- source: salt://roles/paas-docker/containers/files/acme/config.cfg
- template: jinja
- context:
ip: {{ container['ip'] }}
domain: {{ container['host'] }}
nsadmin: {{ container['nsadmin'] }}
# -------------------------------------------------------------
# Container
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ instance }}:
docker_container.running:
- detach: True
- interactive: True
- image: joohoi/acme-dns
- binds:
- /srv/{{ instance }}/etc:/etc/acme-dns:ro
- /srv/{{ instance }}/lib:/var/lib/acme-dns
- ports:
- 53
- 53/udp
- 80
- port_bindings:
- 53:53
- 53:53/udp
- - {{ container['app_port'] }}:80
+ - 127.0.0.1:{{ container['app_port'] }}:80
{% endfor %}
diff --git a/roles/paas-docker/nginx/files/includes/geo_nasqueron b/roles/paas-docker/nginx/files/includes/geo_nasqueron
new file mode 100644
index 0000000..48a50fe
--- /dev/null
+++ b/roles/paas-docker/nginx/files/includes/geo_nasqueron
@@ -0,0 +1,21 @@
+geo $nasqueron_server {
+ default 0;
+
+ # Dreadnought
+ 51.255.124.8/30 1;
+
+ # Ysul
+ 163.172.49.16 1;
+ 212.83.187.132 1;
+
+ # WindRiver
+ 51.159.18.59 1;
+
+ # CloudHugger
+ 188.165.200.229 1;
+}
+
+map $not_a_nasqueron_server {
+ default 0;
+ 0 1;
+}
diff --git a/roles/paas-docker/nginx/files/vhosts/acme_dns.conf b/roles/paas-docker/nginx/files/vhosts/acme_dns.conf
index 60f08b5..31a072b 100644
--- a/roles/paas-docker/nginx/files/vhosts/acme_dns.conf
+++ b/roles/paas-docker/nginx/files/vhosts/acme_dns.conf
@@ -1 +1,63 @@
-{% include 'roles/paas-docker/nginx/files/vhosts/_default.conf' %}
+# -------------------------------------------------------------
+# Configuration for Docker PaaS front-end nginx
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Author: Sébastien Santoro aka Dereckson
+# Created: 2020-02-04
+# Source file: roles/paas-docker/nginx/files/vhosts/acme_dns.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+include includes/geo_nasqueron;
+
+server {
+ listen 80;
+ listen [::]:80;
+ server_name {{ fqdn }};
+
+ include includes/letsencrypt;
+
+ return 301 https://$host$request_uri;
+}
+
+server {
+ server_name {{ fqdn }};
+
+ include includes/tls;
+ ssl_certificate /srv/letsencrypt/etc/live/{{ fqdn }}/fullchain.pem;
+ ssl_certificate_key /srv/letsencrypt/etc/live/{{ fqdn }}/privkey.pem;
+
+ include includes/letsencrypt;
+
+ # ---------------------------------------------------------
+ # Public homepage
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ root /var/wwwroot-502/acme.nasqueron.org;
+
+ location = / {
+ index index.html;
+ }
+
+ location = /index.html {
+ }
+
+ # ---------------------------------------------------------
+ # API
+ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ location / {
+ if ($not_a_nasqueron_server) {
+ return 403;
+ }
+
+ proxy_pass http://localhost:{{ app_port }};
+ include includes/proxy_params;
+ }
+
+}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 09:43 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259950
Default Alt Text
(4 KB)

Event Timeline