mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-16 22:17:59 +00:00
Add check and set JWT_PRIVATE_KEY env (#6675)
Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
parent
697aaf3c41
commit
7a09ebd288
3
scripts/parse_jwt_pk.py
Normal file
3
scripts/parse_jwt_pk.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import seahub_settings
|
||||||
|
|
||||||
|
print(seahub_settings.JWT_PRIVATE_KEY)
|
@ -51,12 +51,19 @@ function validate_running_user () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3/site-packages:${INSTALLPATH}/seafile/lib64/python3/site-packages:${INSTALLPATH}/seahub/thirdpart:$PYTHONPATH
|
export PYTHONPATH=${INSTALLPATH}/seafile/lib/python3/site-packages:${INSTALLPATH}/seafile/lib64/python3/site-packages:${INSTALLPATH}/seahub/thirdpart:${central_config_dir}:$PYTHONPATH
|
||||||
if [[ -d ${INSTALLPATH}/pro ]]; then
|
if [[ -d ${INSTALLPATH}/pro ]]; then
|
||||||
export PYTHONPATH=$PYTHONPATH:$pro_pylibs_dir
|
export PYTHONPATH=$PYTHONPATH:$pro_pylibs_dir
|
||||||
export SEAFES_DIR=$seafesdir
|
export SEAFES_DIR=$seafesdir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function set_jwt_private_key () {
|
||||||
|
if [ -z "${JWT_PRIVATE_KEY}" ]; then
|
||||||
|
jwt_pk=$(python3 parse_jwt_pk.py)
|
||||||
|
export JWT_PRIVATE_KEY=$jwt_pk
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function validate_central_conf_dir () {
|
function validate_central_conf_dir () {
|
||||||
if [[ ! -d ${central_config_dir} ]]; then
|
if [[ ! -d ${central_config_dir} ]]; then
|
||||||
echo "Error: there is no conf/ directory."
|
echo "Error: there is no conf/ directory."
|
||||||
@ -109,6 +116,7 @@ function validate_already_running () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function start_seafile_server () {
|
function start_seafile_server () {
|
||||||
|
set_jwt_private_key;
|
||||||
validate_already_running;
|
validate_already_running;
|
||||||
validate_central_conf_dir;
|
validate_central_conf_dir;
|
||||||
validate_seafile_data_dir;
|
validate_seafile_data_dir;
|
||||||
|
Loading…
Reference in New Issue
Block a user