Allow edit-able flow background paths
Is your feature request related to a problem? Please describe. Currently you have to re-upload the flow background you would like to use, this leads to duplicate flow background files in /media.
Describe the solution you'd like Allow custom flow background paths, editable textbox.
Not a fix, but a workaround to this issue is to unmount the media volume. This allows you to input a custom URL in the field value, which is easier to add dynamic images hosted on a cdn, for example.
You can also update the SQL directly.
update authentik_flows_flow set background = 'https://example.com/image.png';
or for local files
update authentik_flows_flow set background = './media/background.png';
Hey,
FWIW, I reached this solution (there is a somewhat limited UI when editing default-authentication-flow):
#!/bin/sh -eu
# save as set-background.sh, chmod 755 and use as:
# env TOKEN=token ./set-background.sh https://authentik.example https://authentik.example/media/public/background.png
#!/bin/sh -eu
set_authentik_background() {
ak_url="$1"
bg_url="$2"
for flow_slug in $(curl -sH "Authorization: Bearer ${TOKEN}" "${ak_url}/api/v3/flows/instances/" | jq -r ".results | .[] | select(.background != \"${bg_url}\") | .slug"); do
printf "Changing flow background: '%s'... " "${flow_slug}"
curl -H "Authorization: Bearer ${TOKEN}" -X POST \
"${ak_url}/api/v3/flows/instances/${flow_slug}/set_background_url/" \
--json "{\"url\": \"${bg_url}\"}"
echo
done
}
set_authentik_background "$1" "$2"
By using the different slugs of different flows in the URL parameter (instead of default-authentication-flow), I guess it can be done on all flows as asked in #4586.
Note: the URL has to either be absolute or not start with /static in order not to have the wrong unsplash attribution.
I'd rather do it like this as it uses the API and gives us some notion of stability :-).
kinda duplicate of #3974, we'll be adding a default background image setting in the brand which will affect flows that don't have a custom image set