Create postgresql user and set password in two steps instead of one. This
ensures that if a user already exists for some reason (setup already run), then
re-running will simply set a new password and generates a new configuration.
Otherwise, the user creation setup having failed because of existing user will
also fail to set new password and the generated configuration is not usable.
- Newer version of owncloud package enable the Apache2 owncloud configuration
by default. This happens eventhough database configuraiton is not available.
Plinth only checks for Apache2 owncloud configuration as enabled to determine
if owncloud is enabled and hence falsely shows the owncloud is enabled.
- Newer version of owncloud also create a /etc/owncloud/config.php with simple
instance identifier set. So merely checking if the files exists is not of
much use.
- This patch checks if the dbtype variable is configured in config.php or
autoconfig.php along with Apache2 owncloud configuration to determine if
owncloud is enabled.
- The same logic is used to determine if autoconfig.php must be generated.
Restarting Apache breaks existing connections. This includes the connection
on which the Plinth's user has made the ownCloud enable/disable request. This
leads to an almost certain 'Connection Interupted' message to the client when
changes to ownCloud are submitted.
On the other hand, 'reload' is sufficient and 'restart' is not required. It is
also faster and recommended by 'a2enconf' and 'a2disconf' commands.
The package license (AGPL3+) implicitly indicates the license of each
file. However, it is desirable to have license headers in each file.
This is the case for many prominent projects like GNU project, Mozilla
etc.