Skip to content

Commit

Permalink
Allow environment variables (#49)
Browse files Browse the repository at this point in the history
- Allow use of environment variables from Lidarr/Lidarr#4812
- Update Dockerfile
  • Loading branch information
TheCaptain989 committed May 19, 2024
1 parent 0c338ed commit c6dab29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FROM scratch
LABEL org.opencontainers.image.source=https://github.com/TheCaptain989/lidarr-flac2mp3
LABEL org.opencontainers.image.description="A Docker Mod to Lidarr to automatically convert FLAC files to MP3s, or other format"
LABEL org.opencontainers.image.licenses=GPL-3.0-only
LABEL maintainer="TheCaptain989"
LABEL org.opencontainers.image.authors="TheCaptain989"

# Copy local files
COPY --from=buildstage /root-layer/ /
6 changes: 6 additions & 0 deletions root/usr/local/bin/flac2mp3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,12 @@ elif [ -f "$flac2mp3_config" ]; then
[[ $flac2mp3_xml_entity = "ApiKey" ]] && flac2mp3_apikey=$flac2mp3_xml_content
done < $flac2mp3_config

# Allow use of environment variables from https://github.com/Lidarr/Lidarr/pull/4812
[ -n "${LIDARR__SERVER__PORT}" ] && flac2mp3_port="${LIDARR__SERVER__PORT}"
[ -n "${LIDARR__SERVER__URLBASE}" ] && flac2mp3_urlbase="${LIDARR__SERVER__URLBASE}"
[ -n "${LIDARR__SERVER__BINDADDRESS}" ] && flac2mp3_bindaddress="${LIDARR__SERVER__BINDADDRESS}"
[ -n "${LIDARR__AUTH__APIKEY}" ] && flac2mp3_apikey="${LIDARR__AUTH__APIKEY}"

# Check for localhost
[[ $flac2mp3_bindaddress = "*" ]] && flac2mp3_bindaddress=localhost

Expand Down

0 comments on commit c6dab29

Please sign in to comment.