diff --git a/roles/server/linx/tasks/main.yml b/roles/server/linx/tasks/main.yml index 44d42f0..5f0fbb7 100644 --- a/roles/server/linx/tasks/main.yml +++ b/roles/server/linx/tasks/main.yml @@ -73,6 +73,14 @@ notify: - restart linx +- name: Install helper script for uploading + template: + src: "upload.sh" + dest: "{{ user_directory }}/upload.sh" + owner: root + group: "{{ system_user }}" + mode: "u=rwx,g=rx,o=" + - name: Register service for linx template: src: "linx.service" diff --git a/roles/server/linx/templates/upload.sh b/roles/server/linx/templates/upload.sh new file mode 100644 index 0000000..ec16f79 --- /dev/null +++ b/roles/server/linx/templates/upload.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -euo pipefail; + +if [[ -z "${1:-}" ]]; then + echo "Missing file for upload" > /dev/stderr; + exit 2; +fi + +curl -H "Linx-Api-Key: {{ auth_code }}" -H "Linx-Delete-Key: {{ auth_code }}" -T "$1" https://{{ domain }}/upload/;