Skip to content

Commit

Permalink
Optimise initial ownCloud setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt committed Sep 19, 2024
1 parent 6943950 commit 991ccff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion spk/owncloud/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SPK_DEPENDS = WebStation:PHP7.4:Apache2.4
MAINTAINER = SynoCommunity
DESCRIPTION = ownCloud is a personal cloud which runs on your own server and gives you freedom and control over your own data.
DISPLAY_NAME = ownCloud
CHANGELOG = "1. Update ownCloud to 10.15.0.<br/>2. Various script fixes and refinements."
CHANGELOG = "1. Update ownCloud to 10.15.0.<br/>2. Various script fixes and refinements.<br/>3. Optimise initial ownCloud setup."
HOMEPAGE = https://owncloud.com/

LICENSE = AGPLv3
Expand Down
15 changes: 11 additions & 4 deletions spk/owncloud/src/service-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,22 @@ setup_owncloud_instance()
fi
done

# Add HTTP to HTTPS redirect to Apache configuration file
# Enable HTTP Strict Transport Security in Apache configuration file
APACHE_CONF="${WEB_ROOT}/.htaccess"
if [ -f "${APACHE_CONF}" ]; then
{
echo "RewriteEngine On"
echo "RewriteCond %{HTTPS} off"
echo "RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]"
echo "<IfModule mod_headers.c>"
echo "Header always set Strict-Transport-Security \"max-age=15552000; includeSubDomains\""
echo "</IfModule>"
} >> "${APACHE_CONF}"
fi

# Configure background jobs using cron
exec_occ system:cron

# Configure memory caching
MEMCACHE_VAL="\\OC\\Memcache\\APCu"
exec_occ config:system:set memcache.local --value="$MEMCACHE_VAL"
fi
}

Expand Down
5 changes: 4 additions & 1 deletion spk/owncloud/src/web/owncloud.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"start_servers": 2
},
"open_basedir": "",
"php_settings": {},
"php_settings": {
"error_log": "/var/services/web/owncloud/php_errors.log",
"max_execution_time": "900"
},
"profile_desc": "PHP Profile for ownCloud",
"profile_name": "ownCloud Profile"
}

0 comments on commit 991ccff

Please sign in to comment.