Skip to content

Commit

Permalink
fix: remove environment checks
Browse files Browse the repository at this point in the history
Remove checks for .dockerenv file for compatibility with other container environments such as Kubernetes
  • Loading branch information
qx6ghqkz committed Jan 11, 2025
1 parent 628a6d0 commit c9e660e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gallery_dl_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def file_iterator(file_path):
@asynccontextmanager
async def lifespan(app):
yield
if os.path.isfile("/.dockerenv") and os.path.isdir("/config"):
if os.path.isdir("/config"):
if os.path.isfile(log_file) and os.path.getsize(log_file) > 0:
dst_dir = "/config/logs"

Expand Down
4 changes: 3 additions & 1 deletion gallery_dl_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ def load(_configs):
exit_code = None
loads = 0

if not os.path.isfile("/.dockerenv"):
if os.name == "nt":
_configs = get_default_configs()
else:
_configs = _configs + get_default_configs()

if config.log.level <= logging.ERROR:
config.log.setLevel(logging.CRITICAL)
Expand Down
7 changes: 0 additions & 7 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#!/usr/bin/env bash

check_env () {
if [[ ! -f "/.dockerenv" ]]; then
exit 0
fi
}

check_etc () {
if [[ ! -f "/etc/passwd" ]]; then
exit 1
Expand Down Expand Up @@ -104,7 +98,6 @@ exit() {
command exit 0
}

check_env
check_etc
get_ids
if [[ "$UID" -ne "$UID_OG" || "$GID" -ne "$GID_OG" ]]; then
Expand Down

0 comments on commit c9e660e

Please sign in to comment.