Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to add domains/hostnames in wopi allow list. #4148

Open
JMarcosHP opened this issue Oct 17, 2024 · 1 comment
Open

Add support to add domains/hostnames in wopi allow list. #4148

JMarcosHP opened this issue Oct 17, 2024 · 1 comment

Comments

@JMarcosHP
Copy link

Is your feature request related to a problem? Please describe.
Nextcloud setups with dynamic IP need to update the wopi allow list every time the public IP changes or need to execute external scripts to keep the list updated.

Describe the solution you'd like
Using domains that point to the current public IP with ddns services like cloudflare api, duck dns, etc. Can fix this issue.

Describe alternatives you've considered
Unset wopi allow list (not recommended).

Additional context
This

And this

@elzody elzody added enhancement New feature or request needs discussion and removed enhancement New feature or request labels Oct 21, 2024
@JL710
Copy link

JL710 commented Nov 10, 2024

I would love to get this!

And others seem too:

I am not familiar with php and would not be able to add this by my self but I did a bit of research:
It appears that more or less the only thing that would need to be edited would be this function

public function isWOPIAllowed(): bool {
$allowedRanges = $this->config->getAppValue(Application::APPNAME, 'wopi_allowlist');
if ($allowedRanges === '') {
return true;
}
$allowedRanges = preg_split('/(\s|,|;|\|)+/', $allowedRanges);
$userIp = $this->request->getRemoteAddress();
if (IpUtils::checkIp($userIp, $allowedRanges)) {
return true;
}
$this->logger->warning('WOPI request denied from ' . $userIp . ' as it does not match the configured ranges: ' . implode(', ', $allowedRanges));
return false;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants