Skip to content

Commit

Permalink
Move all pict-rs environmentals to external variables file
Browse files Browse the repository at this point in the history
- Rename pictrs.yml to vars.yml
- Start moving some variables to vars.yml for easier management and
discoverability
  • Loading branch information
codyro committed Sep 2, 2023
1 parent 4b8a5c4 commit a8c859d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
12 changes: 0 additions & 12 deletions examples/pictrs.yml

This file was deleted.

25 changes: 25 additions & 0 deletions examples/vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
postgres_password: "{{ lookup('password', 'inventory/host_vars/{{domain}}/passwords/postgres.psk chars=ascii_letters,digits') }}"

# You can set any pict-rs environmental variables here. They will populate the templates/docker-compose.yml file.
# https://git.asonix.dog/asonix/pict-rs
pictrs_env_vars:
- PICTRS__SERVER__API_KEY: {{ postgres_password }}
- PICTRS__MEDIA__VIDEO_CODEC: vp9
- PICTRS__MEDIA__GIF__MAX_WIDTH: 256
- PICTRS__MEDIA__GIF__MAX_HEIGHT: 256
- PICTRS__MEDIA__GIF__MAX_AREA: 65536
- PICTRS__MEDIA__GIF__MAX_FRAME_COUNT: 400
- PICTRS_OPENTELEMETRY_URL: http://otel:4137
- RUST_LOG: debug
- RUST_BACKTRACE: full
# - PICTRS__STORE__TYPE: object_storage
# - PICTRS__STORE__ENDPOINT: '<S3 endpoint>'
# - PICTRS__STORE__BUCKET_NAME: '<bucket name>'
# - PICTRS__STORE__REGION: '<region>'
# - PICTRS__STORE__USE_PATH_STYLE: false
# - PICTRS__STORE__ACCESS_KEY: '<access key>'
# - PICTRS__STORE__SECRET_KEY: '<secret key>'




1 change: 0 additions & 1 deletion lemmy-almalinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
ansible.builtin.command: nginx -s reload
vars:
lemmy_port: "{{ 32767 | random(start=1024) }}"
postgres_password: "{{ lookup('password', 'host_vars/{{ domain }}/passwords/postgres chars=ascii_letters,digits') }}"
tasks:
- name: Ensure target system is >= EL9
ansible.builtin.fail:
Expand Down
3 changes: 0 additions & 3 deletions lemmy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@
owner: "1000"
group: "1000"

vars:
postgres_password: "{{ lookup('password', 'inventory/host_vars/{{domain}}/passwords/postgres chars=ascii_letters,digits') }}"

- name: enable and start docker service
systemd:
name: docker
Expand Down
9 changes: 0 additions & 9 deletions templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ services:
# we can set options to pictrs like this, here we set max. image size and forced format for conversion
# entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
environment:
- PICTRS_OPENTELEMETRY_URL=http://otel:4137
- PICTRS__SERVER__API_KEY={{ postgres_password }}
- RUST_LOG=debug
- RUST_BACKTRACE=full
- PICTRS__MEDIA__VIDEO_CODEC=vp9
- PICTRS__MEDIA__GIF__MAX_WIDTH=256
- PICTRS__MEDIA__GIF__MAX_HEIGHT=256
- PICTRS__MEDIA__GIF__MAX_AREA=65536
- PICTRS__MEDIA__GIF__MAX_FRAME_COUNT=400
{% if pictrs_env_vars is defined and pictrs_env_vars|length > 0 %}
{%- for item in pictrs_env_vars %}
{%- for key, value in item.items() %}
Expand Down

0 comments on commit a8c859d

Please sign in to comment.