How to resolve domain to IP address for Collabora Office server with dynamic IP for nextcloud office
If you install your own Collabora Office server on your home server and your public IP address changes from time to time (dynamic IP address) you'll find an issue: Your nextcloud ist blocking requests to the office server because the IP of the wopi allow list does not match that one from your server. For now you are not able to set a domain to the wopi allow list directly in nextcloud settings.
A PHP script resolves the domain of your Collabora Office server to an IP address and sets the new IP address to the wopi allowlist of your nextcloud instance. Simple! :)
- Download the ip-resolution.php and set the variables for your nextcloud instance.
- Upload the ip-resolution.php to your web server. Don't copy it to your owncloud server, it would make updating nextcloud fail.
- Open the URL to the ip-resolution.php in your browser. No errors should be visible.
- If everything is fine, in the ip-resolution.php set $DEBUG to
false. - Set a cronjob that runs the ip-resolution.php e.g. each 15 minutes.
That's all! If you like this gist, I'd be happy if you give it a star :)