fix: update htpasswd generation for monitoring and status page
- Modified the htpasswd command to limit the password length to 72 characters for security compliance. - Added a new task to generate an htpasswd hash specifically for the status page. - Updated the task that creates the htpasswd file to use the output from the new hash generation.
This commit is contained in:
@@ -869,7 +869,7 @@
|
|||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: "[8/10] Сгенерировать htpasswd хеш для мониторинга"
|
- name: "[8/10] Сгенерировать htpasswd хеш для мониторинга"
|
||||||
command: htpasswd -nb admin "{{ status_page_password }}"
|
command: htpasswd -nb admin "{{ status_page_password[:72] }}"
|
||||||
register: htpasswd_output
|
register: htpasswd_output
|
||||||
changed_when: false
|
changed_when: false
|
||||||
- name: "[8/10] Создать файл паролей для мониторинга"
|
- name: "[8/10] Создать файл паролей для мониторинга"
|
||||||
@@ -929,11 +929,15 @@
|
|||||||
- "{{ project_root }}/infra/nginx/ssl/cert.pem"
|
- "{{ project_root }}/infra/nginx/ssl/cert.pem"
|
||||||
- "{{ project_root }}/infra/nginx/ssl/key.pem"
|
- "{{ project_root }}/infra/nginx/ssl/key.pem"
|
||||||
|
|
||||||
|
- name: "[8/10] Сгенерировать htpasswd хеш для status page"
|
||||||
|
command: htpasswd -nb admin "{{ status_page_password[:72] }}"
|
||||||
|
register: status_page_htpasswd_output
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: "[8/10] Создать htpasswd файл для status page"
|
- name: "[8/10] Создать htpasswd файл для status page"
|
||||||
htpasswd:
|
copy:
|
||||||
path: "{{ project_root }}/infra/nginx/.htpasswd"
|
content: "{{ status_page_htpasswd_output.stdout }}"
|
||||||
name: "admin"
|
dest: "{{ project_root }}/infra/nginx/.htpasswd"
|
||||||
password: "{{ status_page_password }}"
|
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
|
|||||||
Reference in New Issue
Block a user