diff options
-rw-r--r-- | bin/ncp/NETWORKING/nc-trusted-proxies.sh | 37 | ||||
-rw-r--r-- | changelog.md | 6 | ||||
-rw-r--r-- | etc/ncp-config.d/nc-trusted-proxies.cfg | 28 |
3 files changed, 69 insertions, 2 deletions
diff --git a/bin/ncp/NETWORKING/nc-trusted-proxies.sh b/bin/ncp/NETWORKING/nc-trusted-proxies.sh new file mode 100644 index 00000000..34965335 --- /dev/null +++ b/bin/ncp/NETWORKING/nc-trusted-proxies.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Manually add trusted proxies in NextCloudPi +# +# Copyleft 2019 by Pascal Haefliger <45995338+paschaef_a_t_users_d_o_t_noreply_d_o_tgithub_d_o_t_com> +# GPL licensed (see end of file) * Use at your own risk! +# +# + +configure() +{ + [[ "$PROXY1" != "" ]] && ncc config:system:set trusted_proxies 0 --value="$PROXY1" + [[ "$PROXY2" != "" ]] && ncc config:system:set trusted_proxies 1 --value="$PROXY2" + [[ "$PROXY3" != "" ]] && ncc config:system:set trusted_proxies 2 --value="$PROXY3" + + exit 0 +} + +install(){ :; } + +# License +# +# This script is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this script; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA + diff --git a/changelog.md b/changelog.md index 85c74f4b..056cf7e6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ -[v1.21.0](https://github.com/nextcloud/nextcloudpi/commit/5046177) (2020-02-28) upgrade to NC18.0.1 +[v1.22.0](https://github.com/nextcloud/nextcloudpi/commit/bd03e1c) (2020-03-03) Add nc-trusted-proxies (#1094) + +[v1.21.0](https://github.com/nextcloud/nextcloudpi/commit/4a51c1f) (2020-02-28) upgrade to NC18.0.1 [v1.20.11](https://github.com/nextcloud/nextcloudpi/commit/f066b03) (2020-02-27) redis: make sure we have the right permissions for conf file @@ -9,7 +11,7 @@ [v1.20.8 ](https://github.com/nextcloud/nextcloudpi/commit/986046f) (2020-02-05) nc-backup: add more info to description (#1073) -[v1.20.7](https://github.com/nextcloud/nextcloudpi/commit/b404765) (2020-01-26) fail2ban: update regex for NC17 +[v1.20.7 ](https://github.com/nextcloud/nextcloudpi/commit/b404765) (2020-01-26) fail2ban: update regex for NC17 [v1.20.6 ](https://github.com/nextcloud/nextcloudpi/commit/4a99207) (2020-01-21) ncp-config: dont save passwords diff --git a/etc/ncp-config.d/nc-trusted-proxies.cfg b/etc/ncp-config.d/nc-trusted-proxies.cfg new file mode 100644 index 00000000..5c624861 --- /dev/null +++ b/etc/ncp-config.d/nc-trusted-proxies.cfg @@ -0,0 +1,28 @@ +{ + "id": "nc-trusted-proxies", + "name": "Nc-trusted-proxies", + "title": "nc-trusted-proxies", + "description": "Manually add trusted proxies", + "info": "This operation is only needed if NCP is running behind a reverse proxy and the true client IP address is needed", + "infotitle": "", + "params": [ + { + "id": "PROXY1", + "name": "Trusted Proxy #1", + "value": "", + "suggest": "my.proxy.com" + }, + { + "id": "PROXY2", + "name": "Trusted Proxy #2", + "value": "", + "suggest": "other.proxy.com" + }, + { + "id": "PROXY3", + "name": "Trusted Proxy #3", + "value": "", + "suggest": "172.0.0.1" + } + ] +} |