fixing newt configuration

This commit is contained in:
Fabio Sinibaldi 2026-07-29 17:38:16 +02:00
parent c503d49904
commit bd299333b8
5 changed files with 32 additions and 26 deletions

View File

@ -17,15 +17,7 @@
src: templates/newt-config.secret.j2
dest: "{{ compose_dir.path }}/newt-config.secret"
- name: Defining network
community.docker.docker_network:
name: "newt-network"
state: present
- name: Starting newt project
community.docker.docker_compose_v2:
project_src: "{{ compose_dir.path }}"

View File

@ -2,5 +2,9 @@
"id": "{{ pangolin_site_id }}",
"secret": "{{ newt_secret }}",
"endpoint": "https://pangolin.{{ base_domain }}",
"dockerSocket": "unix:///var/run/docker.sock",
"dockerEnforceNetworkValidation": true,
"tlsClientCert": ""
}

View File

@ -4,20 +4,13 @@ services:
image: fosrl/newt
container_name: newt
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- CONFIG_FILE=/run/secrets/newt-config
secrets:
- newt-config
networks:
- newt-network
networks:
newt-network:
external: true
secrets:
newt-config:
file: ./newt-config.secret

View File

@ -30,6 +30,13 @@
dest: "{{ nginx_conf_dir.path }}/nginx.conf"
- name: Create nginx logs dir
file:
path: "/home/{{ ansible_user }}/nginx/logs"
state: directory
register: nginx_logs_dir
- name: Create container
docker_container:
name: nginx-static
@ -39,5 +46,10 @@
volumes:
- "{{ site_dir.path }}:/usr/share/nginx/html"
- "{{ nginx_conf_dir.path }}:/etc/nginx/conf.d"
- "{{ nginx_logs_dir.path }}:/var/log/nginx"
restart_policy : "unless-stopped"
init : true
networks:
- name: "newt_compose_default"
init : true
recreate: true
state: started

View File

@ -1,8 +1,13 @@
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.html;
}
listen 80;
root /usr/share/nginx/html;
index index.html index.htm;
server_name static1;
client_max_body_size 32m;
access_log /var/log/nginx/static1.access.log;
error_log /var/log/nginx/static1.error.log debug;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/lib/nginx/html;
}
}