Rename project to UploadShield: update runtime, configs, docs, and provisioning; run lint/tests

This commit is contained in:
2026-02-12 14:48:07 +01:00
parent d1310e0844
commit 7c8bccc911
20 changed files with 95 additions and 104 deletions

View File

@@ -5,11 +5,11 @@
- hosts: web
become: true
vars:
upload_logger_root: "{{ playbook_dir | default('.') | dirname | realpath }}"
logs_dir: "{{ upload_logger_root }}/logs"
quarantine_dir: "{{ upload_logger_root }}/quarantine"
state_dir: "{{ upload_logger_root }}/state"
examples_dir: "{{ upload_logger_root }}/examples"
uploadshield_root: "{{ playbook_dir | default('.') | dirname | realpath }}"
logs_dir: "{{ uploadshield_root }}/logs"
quarantine_dir: "{{ uploadshield_root }}/quarantine"
state_dir: "{{ uploadshield_root }}/state"
examples_dir: "{{ uploadshield_root }}/examples"
quarantine_owner: "root"
quarantine_group: "www-data"
quarantine_perms: "0700"
@@ -17,8 +17,8 @@
logs_perms: "0750"
log_file_mode: "0640"
selinux_fcontext: "httpd_sys_rw_content_t"
tmpfiles_conf: "/etc/tmpfiles.d/upload-logger.conf"
logrotate_dest: "/etc/logrotate.d/upload-logger"
tmpfiles_conf: "/etc/tmpfiles.d/uploadshield.conf"
logrotate_dest: "/etc/logrotate.d/uploadshield"
tasks:
- name: Ensure logs directory exists
@@ -45,14 +45,14 @@
group: "{{ quarantine_group }}"
mode: "{{ state_perms }}"
- name: Ensure example upload-logger.json is copied (only when missing)
- name: Ensure example uploadshield.json is copied (only when missing)
copy:
src: "{{ examples_dir }}/upload-logger.json"
dest: "{{ upload_logger_root }}/upload-logger.json"
src: "{{ examples_dir }}/uploadshield.json"
dest: "{{ uploadshield_root }}/uploadshield.json"
owner: "{{ quarantine_owner }}"
group: "{{ quarantine_group }}"
mode: "0644"
when: not (upload_logger_root + '/upload-logger.json') | path_exists
when: not (uploadshield_root + '/uploadshield.json') | path_exists
- name: Install tmpfiles.d entry to recreate dirs at boot
copy:
@@ -66,12 +66,12 @@
- name: Install logrotate snippet if example exists
copy:
src: "{{ examples_dir }}/logrotate.d/upload-logger"
src: "{{ examples_dir }}/logrotate.d/uploadshield"
dest: "{{ logrotate_dest }}"
owner: root
group: root
mode: '0644'
when: (examples_dir + '/logrotate.d/upload-logger') | path_exists
when: (examples_dir + '/logrotate.d/uploadshield') | path_exists
- name: Set SELinux fcontext for directories when selinux enabled
when: ansible_selinux.status == 'enabled'

View File

@@ -1,13 +1,13 @@
---
# Ansible playbook snippet to provision UploadShield directories and permissions.
# Usage: ansible-playbook -i inventory scripts/ansible/upload-logger-provision.yml
# Usage: ansible-playbook -i inventory scripts/ansible/uploadshield-provision.yml
- hosts: web
become: true
vars:
upload_logger_root: "{{ playbook_dir | default('.') | dirname | realpath }}"
quarantine_dir: "{{ upload_logger_root }}/quarantine"
state_dir: "{{ upload_logger_root }}/state"
uploadshield_root: "{{ playbook_dir | default('.') | dirname | realpath }}"
quarantine_dir: "{{ uploadshield_root }}/quarantine"
state_dir: "{{ uploadshield_root }}/state"
quarantine_owner: "root"
quarantine_group: "www-data"
quarantine_perms: "0700"