Skip to content

Commit

Permalink
Only change paths if using ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
lildude committed Apr 27, 2024
1 parent 7b3e4d5 commit 2c70ebd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ The configuration is self-explanatory, but essentially we need details about acc

Remember to restart the add-on when the configuration is changed.

To use this add-on with a reverse proxy, like [Nginx Proxy Manager][rev-proxy], you will need to enable "Show disabled ports" in the Network section of the add-on configuration and set a port.

## Changelog & Releases

This repository keeps a change log using [GitHub's releases][releases] functionality.
Expand All @@ -56,3 +58,4 @@ To destroy this data, you'll need to either uninstall the PostgreSQL add-on or c
[postgres]: https://github.com/matt-FFFFFF/hassio-addon-postgres
[releases]: https://github.com/lildude/ha-addon-ghostfolio/releases
[semver]: https://semver.org/spec/v2.0.0.html
[rev-proxy]: https://github.com/hassio-addons/addon-nginx-proxy-manager
10 changes: 7 additions & 3 deletions rootfs/etc/services.d/ghostfolio/run
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ ingress_entry=$(curl -X GET \
-s http://supervisor/addons/self/info | \
jq -r '.data.ingress_entry')

if bashio::var.is_empty "port"; then
if bashio::var.is_empty "$(bashio::addon.port 3333)"; then
if [[ $(grep hassio_ingress /ghostfolio/apps/client/en/main.*.js) -eq 0 ]]; then
sed -Ei "s^(\`|\")/api^\1${ingress_entry}/api^g" /ghostfolio/apps/client/*/*.js
sed -Ei "s^\(/assets^\(${ingress_entry}/assets^g" /ghostfolio/apps/client/*/*.js
sed -Ei.direct "s^(\`|\")/api^\1${ingress_entry}/api^g" /ghostfolio/apps/client/*/*.js
sed -Ei.direct "s^\(/assets^\(${ingress_entry}/assets^g" /ghostfolio/apps/client/*/*.js
fi
else
if [[ $(find "/ghostfolio/apps/client/en/*.js.direct" 2> /dev/null | wc -l) -gt 0 ]]; then
find /ghostfolio/apps/ -name '*.direct' -exec sh -c 'echo "$0" "${0%.direct}"' {} \;
fi
fi

Expand Down

0 comments on commit 2c70ebd

Please sign in to comment.