HEX
Server: Apache
System: Linux server.inglory.de 5.15.0-139-generic #149~20.04.1-Ubuntu SMP Wed Apr 16 08:29:56 UTC 2025 x86_64
User: inglory.de_9f9idjkoa1i (10000)
PHP: 8.3.30
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/inglory.de/seafile/seafile-server-latest/reset-admin-password.sh
#!/bin/bash
# Almost a copy of reset-admin.sh, but taking arguments.
SCRIPT=$(readlink -f "$0")
INSTALLPATH=$(dirname "${SCRIPT}")
TOPDIR=$(dirname "${INSTALLPATH}")
default_ccnet_conf_dir=${TOPDIR}/ccnet
default_seafile_data_dir=${TOPDIR}/seafile-data
central_config_dir=${TOPDIR}/conf

function check_python_executable() {
    PYTHON="python3"

    if !(which $PYTHON) 2>/dev/null 1>&2; then
        echo
        echo "Can't find a python executable of $PYTHON in PATH"
        echo "Install $PYTHON before continue."
        echo "Or if you installed it in a non-standard PATH, set the PYTHON enviroment variable to it"
        echo
        exit 1
    fi
}

function validate_seafile_data_dir () {
    if [[ ! -d ${default_seafile_data_dir} ]]; then
        echo "Error: there is no seafile server data directory."
        echo "Have you run setup-seafile.sh before this?"
        echo ""
        exit 1;
    fi
}

check_python_executable;
validate_seafile_data_dir;

export CCNET_CONF_DIR=${default_ccnet_conf_dir}
export SEAFILE_CONF_DIR=${default_seafile_data_dir}
export SEAFILE_CENTRAL_CONF_DIR=${central_config_dir}
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3.6/site-packages:${INSTALLPATH}/seafile/lib64/python3.6/site-packages:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH
export SEAFILE_RPC_PIPE_PATH=${INSTALLPATH}/runtime

manage_py=${INSTALLPATH}/seahub/manage.py
exec "$PYTHON" "$manage_py" createsuperuser $@