#!/bin/sh if [ -z "$FILEBROWSER_PASSWORD" ]; then FILEBROWSER_PASSWORD=$(tr -dc 'A-Za-z0-9!@#$%^&*()_+' < /dev/urandom | head -c 16) fi echo "=========================================" echo "FILEBROWSER ADMIN CREDENTIALS" echo "=========================================" echo "Username: $FILEBROWSER_USERNAME" echo "Password: $FILEBROWSER_PASSWORD" echo "=========================================" filebrowser config init --database /config/filebrowser.db if ! filebrowser users ls --database /config/filebrowser.db | grep -q "^$FILEBROWSER_USERNAME"; then echo "Creating admin user: $FILEBROWSER_USERNAME" filebrowser users add $FILEBROWSER_USERNAME $FILEBROWSER_PASSWORD --database /config/filebrowser.db --perm.admin else echo "Admin user $FILEBROWSER_USERNAME already exists, skipping creation" fi filebrowser --port 8080 --root /data --address 0.0.0.0 --database /config/filebrowser.db & FILEBROWSER_PID=$! exec node /foundry/main.mjs --port=30000 --headless --noupdate --dataPath=/data