Add Fireshare

This commit is contained in:
Viyurz 2024-07-26 15:55:33 +02:00
parent 08aed28b75
commit 331e79a838
Signed by: Viyurz
SSH key fingerprint: SHA256:IskOHTmhHSJIvAt04N6aaxd5SZCVWW1Guf9tEcxIMj8
8 changed files with 105 additions and 0 deletions

13
env.yml
View file

@ -21,6 +21,13 @@ cifs_mounts:
gid: "{{ host_uid }}"
file_mode: 640
dir_mode: 750
fireshare:
src: "//{{ cifs_host }}/backup/fireshare"
path: /mnt/storagebox/fireshare
uid: "{{ users['fireshare'] + uid_shift }}"
gid: "{{ users['fireshare'] + uid_shift }}"
file_mode: 644
dir_mode: 755
storagebox:
src: "//{{ cifs_host }}/backup"
path: /mnt/storagebox
@ -41,6 +48,7 @@ projects:
- coturn
- element
- etebase
- fireshare
- hedgedoc
- homepage
- keycloak
@ -84,6 +92,7 @@ ports:
coturn_relay_max: 49172
element: 8084
etebase: 3735
fireshare: 8085
hedgedoc: 8086
homepage: 8686
keycloak: 8444
@ -110,6 +119,7 @@ ports:
users:
coturn: 666
etebase: 373
fireshare: 1007
hedgedoc: 1004
homepage: 8686
keycloak: 1000
@ -131,6 +141,9 @@ volumes:
coturn_tls_certificate_file: "/etc/letsencrypt/live/turn.{{ domain }}/fullchain.pem"
coturn_tls_certificate_key_file: "/etc/letsencrypt/live/turn.{{ domain }}/privkey.pem"
etebase_datadir: /mnt/etebasedata
fireshare_datadir: /mnt/firesharedata
fireshare_processeddir: /mnt/storagebox/fireshare/processed
fireshare_videosdir: /mnt/storagebox/fireshare/videos
hedgedoc_uploadsdir: /mnt/hedgedocuploads
mailserver_datadir: /mnt/mailserver
mailserver_tls_certificate_file: "/etc/letsencrypt/live/mail.{{ domain }}/fullchain.pem"

View file

@ -0,0 +1,9 @@
- name: Include setup tasks
include_tasks:
file: setup.yml
when: run_setup | default(false) | bool
- name: Include update tasks
include_tasks:
file: update.yml
when: run_update | default(false) | bool

View file

@ -0,0 +1,27 @@
- name: "(Re)Create {{ project_dir }} project directory"
file:
path: "{{ project_dir }}"
state: "{{ item }}"
loop:
- absent
- directory
- name: Template docker-compose.yaml & .env to project directory
template:
src: "{{ item }}"
dest: "{{ project_dir }}/{{ item }}"
owner: "{{ host_uid }}"
group: "{{ host_uid }}"
mode: '640'
loop:
- docker-compose.yaml
- .env
- name: "Create (if not exists) directory {{ volumes['fireshare_datadir'] }} & set permissions"
file:
path: "{{ volumes['fireshare_datadir'] }}"
state: directory
owner: "{{ users['fireshare'] + uid_shift }}"
group: "{{ users['fireshare'] + uid_shift }}"
mode: '750'
become: true

View file

@ -0,0 +1,18 @@
- name: Pull project services
community.docker.docker_compose:
project_src: "{{ project_dir }}"
recreate: never
pull: true
debug: true
when: docker_pull_images | bool
register: fireshare_docker_compose_pull_result
- name: Display pulled image(s) name
set_fact:
fireshare_pulled_images: "{{ fireshare_pulled_images | default([]) + [item.pulled_image.name] }}"
loop: "{{ fireshare_docker_compose_pull_result['actions'] | default([]) | selectattr('pulled_image', 'defined') }}"
- name: Create/Restart project services
community.docker.docker_compose:
project_src: "{{ project_dir }}"
restarted: "{{ run_setup | default(false) | bool }}"

View file

@ -0,0 +1,9 @@
ADMIN_USERNAME='{{ fireshare_secrets["admin_username"] }}'
ADMIN_PASSWORD='{{ fireshare_secrets["admin_password"] }}'
SECRET_KEY='{{ fireshare_secrets["secret_key"] }}'
MINUTES_BETWEEN_VIDEO_SCANS=5
# The location in the video thumbnails are generated. A value between 0-100 where 50 would be the frame in the middle of the video file and 0 would be the first frame of the video.
THUMBNAIL_VIDEO_LOCATION=0
DOMAIN=clips.{{ domain }}
PUID={{ users['fireshare'] }}
PGID={{ users['fireshare'] }}

View file

@ -0,0 +1,12 @@
services:
fireshare:
container_name: fireshare
image: docker.io/shaneisrael/fireshare:latest
restart: always
env_file: .env
ports:
- 127.0.0.1:{{ ports['fireshare'] }}:80
volumes:
- {{ volumes['fireshare_datadir'] }}:/data
- {{ volumes['fireshare_processeddir'] }}:/processed
- {{ volumes['fireshare_videosdir'] }}:/videos

View file

@ -0,0 +1,12 @@
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name clips.{{ domain }};
location / {
proxy_pass http://127.0.0.1:{{ ports['fireshare'] }};
client_max_body_size 500M;
}
}

View file

@ -11,6 +11,11 @@ cifs_credentials:
coturn_secrets:
static_auth_secret:
fireshare_secrets:
admin_username:
admin_password:
secret_key:
hedgedoc_secrets:
client_id:
client_secret: