Alexandre
2022-12-05 10:29:57 +01:00
parent 9dd398fd9d
commit 6a5d8b0f21
5 changed files with 23 additions and 43 deletions

View File

@@ -42,7 +42,6 @@
"environment": {
"PHOTOPRISM_ADMIN_PASSWORD": "please_change_password",
"PHOTOPRISM_ADMIN_USER": "admin",
"PHOTOPRISM_HTTP_COMPRESSION": "none",
"PHOTOPRISM_HTTP_PORT": "2341",
"working_dir": "/data/photoprism"
},
@@ -101,5 +100,5 @@
],
"slug": "photoprism",
"url": "https://github.com/alexbelgium/hassio-addons-test",
"version": "20220121-3"
}
"version": "20220121-4"
}

View File

@@ -13,6 +13,4 @@ ingress_entry=$(bashio::addon.ingress_entry)
sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf
sed -i "s|%%ingress_entry%%|${ingress_entry}|g" /etc/nginx/servers/ingress.conf
# Avoid error message
grep -rnl "PhotoPrism has been updated…" /opt/photoprism | xargs sed -i "s|PhotoPrism has been updated…|Please click cancel|g"
sed -i "s|%%ingress_entry%%|${ingress_entry}|g" /etc/nginx/servers/ssl.conf

View File

@@ -57,6 +57,13 @@ case $(bashio::config 'DB_TYPE') in
;;
esac
############
# Base url #
############
PHOTOPRISM_SITE_URL="$(bashio::addon.ingress_entry)/"
export PHOTOPRISM_SITE_URL
##############
# LAUNCH APP #
##############

View File

@@ -10,9 +10,8 @@ server {
proxy_set_header If-Range $http_if_range;
location / {
# Proxy
proxy_pass http://127.0.0.1:2341;
proxy_pass http://127.0.0.1:2341%%ingress_entry%%/;
proxy_read_timeout 300;
proxy_redirect off;
@@ -27,35 +26,12 @@ server {
proxy_set_header Connection "Upgrade"; # Do protocol switch
proxy_set_header X-Forwarded-Proto $scheme; # Let PP know that this connection used HTTP or HTTPS
# Rewrite url
sub_filter_once off;
sub_filter_types *;
sub_filter "/browse" "%%ingress_entry%%/browse";
sub_filter "/static" "%%ingress_entry%%/static";
sub_filter "/api/v1" "%%ingress_entry%%/api/v1";
sub_filter "/api/v1%%ingress_entry%%" "%%ingress_entry%%/api/v1";
# Allow frames
proxy_hide_header "Content-Security-Policy";
add_header X-Frame-Options SAMEORIGIN;
add_header Access-Control-Allow-Origin *;
proxy_set_header Accept-Encoding "";
# REMOVED
#sub_filter "/auth" "%%ingress_entry%%/auth";
#sub_filter "/manifest.json" "%%ingress_entry%%/manifest.json";
#sub_filter "/albums" "%%ingress_entry%%/albums";
#sub_filter "/videos" "%%ingress_entry%%/videos";
#sub_filter "/people" "%%ingress_entry%%/people";
#sub_filter "/favorites" "%%ingress_entry%%/favorites";
#sub_filter "/moments" "%%ingress_entry%%/moments";
#sub_filter "/calendar" "%%ingress_entry%%/calendar";
#sub_filter "/places" "%%ingress_entry%%/places";
#sub_filter "/labels" "%%ingress_entry%%/labels";
#sub_filter "/folders" "%%ingress_entry%%/folders";
#sub_filter "/private" "%%ingress_entry%%/private";
#sub_filter "/library" "%%ingress_entry%%/library";
#sub_filter "/settings" "%%ingress_entry%%/settings";
proxy_hide_header 'x-frame-options'; # Allow frames
proxy_hide_header "Content-Security-Policy";
add_header Access-Control-Allow-Origin *;
proxy_set_header Accept-Encoding "";
}
}

View File

@@ -3,13 +3,13 @@ server {
include /etc/nginx/includes/server_params.conf;
include /etc/nginx/includes/proxy_params.conf;
client_max_body_size 0;
location / {
set $upstream_port 2341;
proxy_pass http://127.0.0.1:$upstream_port;
}
location /ubooquity/ {
set $upstream_port 2341;
proxy_pass http://127.0.0.1:$upstream_port;
location = / {
return 301 %%ingress_entry%%/;
}
location %%ingress_entry%%/ {
set $upstream_port 2341;
proxy_pass http://127.0.0.1:$upstream_port;
}
}