Hello Felix, Michael,
First let me address again why I want to do this (change the default URI):
A few years back when owncloud was initially released, I had a look at the source code. At that time the software was as close to a PHP mess as it gets, buggy to no end. While I think it has come a long way since then, I am still wary to expose it on a public facing server.
In my experience, almost all security breaches nowadays happen with automated systems that scan for software on default locations and identify versions that are vulnerable, and then proceed with an exploit. Even the western security agencies did that to stock up on relay boxes for their activities.
Therefore the single most important measure to secure a public facing system is to minimize attack vectors in the first place, i.e. relocate all services to custom locations as possible and only accept connections on TLS secured ports as possible as to not expose the location to third parties.
In the case of owncloud as stated earlier, I would see this as a necessity. I will not deploy owncloud public facing on the default location when I am responsible for the security of the system.
Before owncloud was dockerized, it was relatively simple to change the URI. In my brief flirt with Docker, I quickly decided that the benefits of docker were outweighed by the introduced additional complexity and therefore to me, it only makes sense in massive deployments.
Like in this case. I hope you will consider my points and repair the App package so that the URI can be modified again via UCR as in previous versions.
Regarding the reverse proxy solution, I tried it this morning with Apache (Rewrite Rules and mod_proxy), and it is not possible because owncloud uses absolute URIs in the HTML and Javascript. So one would have to rewrite the content to make it work, not really a good solution.
Now I have found and changed all the locations to make it work:
On the Univention system itself, the default-ssl.conf and UCR:
# ucr search --all veryowncloud | grep "^ucs"
ucs/web/overview/entries/admin/owncloud-admindoc/icon: /veryowncloud/core/img/favicon.png
ucs/web/overview/entries/admin/owncloud-userdoc/icon: /veryowncloud/core/img/favicon.png
ucs/web/overview/entries/service/owncloud/link: /veryowncloud
In the Docker Containter:
- the Apache configuration Rewrite Rule changed to
RewriteCond %{REQUEST_URI} !^/veryowncloud
RewriteRule ^(.*)$ /verowncloud$1 [R=301,L]
- in the /var/www/owncloud/.htaccess
ErrorDocument 403 /veryowncloud/core/templates/403.php
ErrorDocument 404 /veryowncloud/core/templates/404.php
[...]
RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
RewriteCond %{REQUEST_FILENAME} !/updater/
RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
RewriteRule . index.php [PT,E=PATH_INFO:$1]
RewriteBase /veryowncloud
<IfModule mod_env.c>
SetEnv front_controller_active true
<IfModule mod_dir.c>
[...]
And finally the /var/www/owncloud/config/config.php
as stated in my initial post.
Please fix the owncloud package in the next version so that the URI is controllable via UCR. We use and pay for Univention because it reduces complexity and provides stability over updates.
regards,
Andreas