changes suggested

nc-nginx-test
elena 2023-02-27 09:29:48 +00:00 committed by Evilham
parent 944505ab72
commit 0888c2ba05
2 changed files with 8 additions and 7 deletions

9
dd-ctl
View File

@ -327,7 +327,6 @@ down(){
setup_nextcloud(){ setup_nextcloud(){
echo " --> Applying custom settings in nextcloud" echo " --> Applying custom settings in nextcloud"
cp "$CUSTOM_PATH/custom/avatars/dd" "$DATA_FOLDER/avatars/master-avatars/"
# docker exec -u www-data dd-apps-nextcloud-app sh -c 'export OC_PASS=$DDADMIN_PASSWORD && php occ user:add --password-from-env --display-name="DD Admin" --group="admin" $DDADMIN_USER' # docker exec -u www-data dd-apps-nextcloud-app sh -c 'export OC_PASS=$DDADMIN_PASSWORD && php occ user:add --password-from-env --display-name="DD Admin" --group="admin" $DDADMIN_USER'
# docker exec -u www-data dd-apps-nextcloud-app sh -c 'export OC_PASS=admin && php occ user:delete admin' # docker exec -u www-data dd-apps-nextcloud-app sh -c 'export OC_PASS=admin && php occ user:delete admin'
@ -997,11 +996,11 @@ case "$OPERATION" in
update_logos_and_menu update_logos_and_menu
;; ;;
customize) customize)
#up up
#wait_for_moodle wait_for_moodle
setup_nextcloud setup_nextcloud
#setup_wordpress setup_wordpress
#setup_moodle setup_moodle
;; ;;
down) down)
down down

View File

@ -49,11 +49,13 @@ def setup_avatar_views(app: "ApiFlaskApp") -> None:
# TODO: check if this is redundant and remove it # TODO: check if this is redundant and remove it
@app.route("/avatar/<username>", methods=["GET"]) @app.route("/avatar/<username>", methods=["GET"])
def avatar(username: str) -> Response: def avatar(username: str) -> Response:
file = 'dd' file = 'dd.jpg'
filepath = '/custom/avatars/'
if username != 'admin': if username != 'admin':
file = avatars.get_user_avatar(username) file = avatars.get_user_avatar(username)
filepath = os.path.join("", "../avatars/master-avatars/")
return send_from_directory( return send_from_directory(
os.path.join(app.root_path, "../avatars/master-avatars/"), filepath,
file, file,
mimetype="image/jpg", mimetype="image/jpg",
) )