Compare commits

...
Author SHA1 Message Date
LinuxServer-CI 514e75083f Bot Updating Templated Files 2023-07-26 15:03:01 +00:00
AdamandGitHub 0a1b2a8279 Merge pull request #3 from ksurl/fgenv 2023-07-26 16:01:43 +01:00
ksurl ead86e6242 validate config file extension for lock file env 2023-07-25 16:20:00 +00:00
ksurl 4ca267e9ec update init for fg env 2023-07-23 15:44:20 +00:00
ksurl 4add7ed23a add fg env to readme vars 2023-07-19 03:13:35 +00:00
ksurl d7ecb52042 add env for logfile and config file 2023-07-19 03:09:44 +00:00
4 changed files with 27 additions and 6 deletions
+6
View File
@@ -90,6 +90,8 @@ services:
- PGID=1000
- TZ=Etc/UTC
- FG_LOG_LEVEL=info
- FG_LOG_FILE=/config/flexget.log
- FG_CONFIG_FILE=/config/.flexget/config.yml
- FG_WEBUI_PASSWORD=info #optional
volumes:
- /path/to/data:/config
@@ -108,6 +110,8 @@ docker run -d \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e FG_LOG_LEVEL=info \
-e FG_LOG_FILE=/config/flexget.log \
-e FG_CONFIG_FILE=/config/.flexget/config.yml \
-e FG_WEBUI_PASSWORD=info `#optional` \
-p 5050:5050 \
-v /path/to/data:/config \
@@ -128,6 +132,8 @@ Container images are configured using parameters passed at runtime (such as thos
| `-e PGID=1000` | for GroupID - see below for explanation |
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
| `-e FG_LOG_LEVEL=info` | Set the FlexGet logging level. |
| `-e FG_LOG_FILE=/config/flexget.log` | Set the FlexGet log file location. |
| `-e FG_CONFIG_FILE=/config/.flexget/config.yml` | Set the FlexGet config file location. |
| `-e FG_WEBUI_PASSWORD=info` | Set the FlexGet webui password. Pay attention to Bash/YAML reserved characters. |
| `-v /config` | Local path for FlexGet config files. |
| `-v /data` | Default path for downloads. |
+2
View File
@@ -22,6 +22,8 @@ param_container_name: "{{ project_name }}"
param_usage_include_env: true
param_env_vars:
- { env_var: "FG_LOG_LEVEL", env_value: "info", desc: "Set the FlexGet logging level." }
- { env_var: "FG_LOG_FILE", env_value: "/config/flexget.log", desc: "Set the FlexGet log file location." }
- { env_var: "FG_CONFIG_FILE", env_value: "/config/.flexget/config.yml", desc: "Set the FlexGet config file location." }
param_usage_include_vols: true
param_volumes:
- { vol_path: "/config", vol_host_path: "/path/to/data", desc: "Local path for FlexGet config files." }
@@ -5,17 +5,30 @@ mkdir -p \
/config/.flexget \
/data
FG_CONFIG_FILE="${FG_CONFIG_FILE:-/config/.flexget/config.yml}"
case "${FG_CONFIG_FILE}" in
*yml)
FG_LOCK_FILE="${FG_CONFIG_FILE/config.yml/.config-lock}"
;;
*yaml)
FG_LOCK_FILE="${FG_CONFIG_FILE/config.yaml/.config-lock}"
;;
default)
echo "invalid config file extension"
exit 1
;;
esac
# clean up config-lock from unclean shutdown
if [[ -f "/config/.flexget/.config-lock" ]]; then
rm -rf "/config/.flexget/.config-lock"
if [[ -f "${FG_LOCK_FILE}" ]]; then
rm -rf "${FG_LOCK_FILE}"
fi
if [[ ! -f "/config/.flexget/config.yml" ]]; then
cp /default/config.yml /config/.flexget/config.yml
if [[ ! -f "{$FG_CONFIG_FILE}" ]]; then
cp /default/config.yml "${FG_CONFIG_FILE}"
fi
if [[ -n "${FG_WEBUI_PASSWORD}" ]]; then
if ! flexget --loglevel error web passwd "${FG_WEBUI_PASSWORD}" | tee /dev/stderr | grep -q 'Updated password'; then
if ! flexget -c "${FG_CONFIG_FILE}" --loglevel error web passwd "${FG_WEBUI_PASSWORD}" | tee /dev/stderr | grep -q 'Updated password'; then
echo "Halting init, please address the above issues and recreate the container"
sleep infinity
fi
+1 -1
View File
@@ -4,4 +4,4 @@
exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 5050" \
s6-setuidgid abc python3 /lsiopy/bin/flexget \
--loglevel "${FG_LOG_LEVEL:-info}" --logfile "/config/flexget.log" -c /config/.flexget/config.yml daemon start --autoreload-config
--loglevel "${FG_LOG_LEVEL:-info}" --logfile "${FG_LOG_FILE:-/config/.flexget/flexget.log}" -c "${FG_CONFIG_FILE:-/config/.flexget/config.yml}" daemon start --autoreload-config