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
|
||||
|
||||
- name: "[8/10] Сгенерировать htpasswd хеш для мониторинга"
|
||||
command: htpasswd -nb admin "{{ status_page_password }}"
|
||||
command: htpasswd -nb admin "{{ status_page_password[:72] }}"
|
||||
register: htpasswd_output
|
||||
changed_when: false
|
||||
- name: "[8/10] Создать файл паролей для мониторинга"
|
||||
@@ -929,11 +929,15 @@
|
||||
- "{{ project_root }}/infra/nginx/ssl/cert.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"
|
||||
htpasswd:
|
||||
path: "{{ project_root }}/infra/nginx/.htpasswd"
|
||||
name: "admin"
|
||||
password: "{{ status_page_password }}"
|
||||
copy:
|
||||
content: "{{ status_page_htpasswd_output.stdout }}"
|
||||
dest: "{{ project_root }}/infra/nginx/.htpasswd"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
Reference in New Issue
Block a user