rename oCIS web to oC Web

This commit is contained in:
Willy Kloucek
2020-12-07 10:26:15 +01:00
parent 3325259b86
commit 664bbe0018
14 changed files with 15 additions and 15 deletions
@@ -0,0 +1,21 @@
# If you're on a internet facing server please comment out following line.
# It skips certificate validation for various parts of oCIS and is needed if you use self signed certificates.
INSECURE=true
### Traefik settings ###
# Domain of Traefik, where you can find the dashboard. Defaults to "traefik.owncloud.test"
TRAEFIK_DOMAIN=
# Basic authentication for the dashboard. Defaults to user "admin" and password "admin"
TRAEFIK_BASIC_AUTH_USERS=
# Email address for obtaining LetsEncrypt certificates, needs only be changed if this is a public facing server
TRAEFIK_ACME_MAIL=
### oCIS settings ###
# oCIS version. Defaults to "latest"
OCIS_DOCKER_TAG=
# Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test"
OCIS_DOMAIN=
### oC10 ###
# Domain of ownCloud 10, where you can find the frontend. Defaults to "oc10.owncloud.test"
#OC10_DOMAIN=
@@ -0,0 +1,6 @@
---
document this deployment example in docs/ocis/deployment/ocis_oc10_backend.md
---
Please refer to [our documentation](https://owncloud.github.io/ocis/deployment/owncloud10_with_oc_web/)
for instructions on how to deploy this scenario.
@@ -0,0 +1,558 @@
<?php
function getConfigFromEnv() {
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
$domain = trim(
explode(
",",
$_SERVER['HTTP_X_FORWARDED_HOST']
)[0]
);
} else if (isset($_SERVER['SERVER_NAME'])) {
$domain = $_SERVER['SERVER_NAME'];
} else {
$domain = 'localhost';
}
$config = [
'apps_paths' => [
0 => [
"path" => OC::$SERVERROOT . "/apps",
"url" => "/apps",
"writable" => false
],
1 => [
"path" => OC::$SERVERROOT . "/custom",
"url" => "/custom",
"writable" => true
]
],
'trusted_domains' => [
0 => $domain
],
'openid-connect' => [
'provider-url' => getenv('OCIS_DOMAIN'),
'client-id' => 'oc10',
'client-secret' => 'super',
'loginButtonName' => 'OpenId Connect',
'search-attribute' => 'preferred_username',
'mode' => 'userid',
'autoRedirectOnLoginPage' => true,
'insecure' => true,
'post_logout_redirect_uri' => getenv('OWNCLOUD_DOMAIN') . '/',
],
'datadirectory' => getenv('OWNCLOUD_VOLUME_FILES'),
'dbtype' => getenv('OWNCLOUD_DB_TYPE'),
'dbhost' => getenv('OWNCLOUD_DB_HOST'),
'dbname' => getenv('OWNCLOUD_DB_NAME'),
'dbuser' => getenv('OWNCLOUD_DB_USERNAME'),
'dbpassword' => getenv('OWNCLOUD_DB_PASSWORD'),
'dbtableprefix' => getenv('OWNCLOUD_DB_PREFIX'),
'phoenix.baseUrl' => getenv('OCIS_DOMAIN'),
'cors.allowed-domains' => [getenv('OCIS_DOMAIN')],
'log_type' => 'owncloud',
'supportedDatabases' => [
'sqlite',
'mysql',
'pgsql',
],
'upgrade.disable-web' => true,
];
if (getenv('OWNCLOUD_CORS_ALLOWED_DOMAINS') != '') {
$config['cors.allowed-domains'] = explode(',', getenv('OWNCLOUD_CORS_ALLOWED_DOMAINS'));
}
if (getenv('OWNCLOUD_VERSION_HIDE') != '') {
$config['version.hide'] = getenv('OWNCLOUD_VERSION_HIDE') == 'true';
}
if (getenv('OWNCLOUD_SHOW_SERVER_HOSTNAME') != '') {
$config['show_server_hostname'] = getenv('OWNCLOUD_SHOW_SERVER_HOSTNAME') == 'true';
}
if (getenv('OWNCLOUD_DEFAULT_LANGUAGE') != '') {
$config['default_language'] = getenv('OWNCLOUD_DEFAULT_LANGUAGE');
}
if (getenv('OWNCLOUD_DEFAULT_APP') != '') {
$config['defaultapp'] = getenv('OWNCLOUD_DEFAULT_APP');
}
if (getenv('OWNCLOUD_KNOWLEDGEBASE_ENABLED') != '') {
$config['knowledgebaseenabled'] = getenv('OWNCLOUD_KNOWLEDGEBASE_ENABLED') == 'true';
}
if (getenv('OWNCLOUD_ENABLE_AVATARS') != '') {
$config['enable_avatars'] = getenv('OWNCLOUD_ENABLE_AVATARS') == 'true';
}
if (getenv('OWNCLOUD_ALLOW_USER_TO_CHANGE_DISPLAY_NAME') != '') {
$config['allow_user_to_change_display_name'] = getenv('OWNCLOUD_ALLOW_USER_TO_CHANGE_DISPLAY_NAME') == 'true';
}
if (getenv('OWNCLOUD_REMEMBER_LOGIN_COOKIE_LIFETIME') != '') {
$config['remember_login_cookie_lifetime'] = (int) getenv('OWNCLOUD_REMEMBER_LOGIN_COOKIE_LIFETIME');
}
if (getenv('OWNCLOUD_SESSION_LIFETIME') != '') {
$config['session_lifetime'] = (int) getenv('OWNCLOUD_SESSION_LIFETIME');
}
if (getenv('OWNCLOUD_SESSION_KEEPALIVE') != '') {
$config['session_keepalive'] = getenv('OWNCLOUD_SESSION_KEEPALIVE') == 'true';
}
if (getenv('OWNCLOUD_TOKEN_AUTH_ENFORCED') != '') {
$config['token_auth_enforced'] = getenv('OWNCLOUD_TOKEN_AUTH_ENFORCED') == 'true';
}
if (getenv('OWNCLOUD_CSRF_DISABLED') != '') {
$config['csrf.disabled'] = getenv('OWNCLOUD_CSRF_DISABLED') == 'true';
}
if (getenv('OWNCLOUD_SKELETON_DIRECTORY') != '') {
$config['skeletondirectory'] = getenv('OWNCLOUD_SKELETON_DIRECTORY');
}
if (getenv('OWNCLOUD_LOST_PASSWORD_LINK') != '') {
$config['lost_password_link'] = getenv('OWNCLOUD_LOST_PASSWORD_LINK');
}
if (getenv('OWNCLOUD_ACCOUNTS_ENABLE_MEDIAL_SEARCH') != '') {
$config['accounts.enable_medial_search'] = getenv('OWNCLOUD_ACCOUNTS_ENABLE_MEDIAL_SEARCH') == 'true';
}
if (getenv('OWNCLOUD_USER_SEARCH_MIN_LENGTH') != '') {
$config['user.search_min_length'] = (int) getenv('OWNCLOUD_USER_SEARCH_MIN_LENGTH');
}
if (getenv('OWNCLOUD_MAIL_DOMAIN') != '') {
$config['mail_domain'] = getenv('OWNCLOUD_MAIL_DOMAIN');
}
if (getenv('OWNCLOUD_MAIL_FROM_ADDRESS') != '') {
$config['mail_from_address'] = getenv('OWNCLOUD_MAIL_FROM_ADDRESS');
}
if (getenv('OWNCLOUD_MAIL_SMTP_DEBUG') != '') {
$config['mail_smtpdebug'] = getenv('OWNCLOUD_MAIL_SMTP_DEBUG') == 'true';
}
if (getenv('OWNCLOUD_MAIL_SMTP_MODE') != '') {
$config['mail_smtpmode'] = getenv('OWNCLOUD_MAIL_SMTP_MODE');
}
if (getenv('OWNCLOUD_MAIL_SMTP_HOST') != '') {
$config['mail_smtphost'] = getenv('OWNCLOUD_MAIL_SMTP_HOST');
}
if (getenv('OWNCLOUD_MAIL_SMTP_PORT') != '') {
$config['mail_smtpport'] = (int) getenv('OWNCLOUD_MAIL_SMTP_PORT');
}
if (getenv('OWNCLOUD_MAIL_SMTP_TIMEOUT') != '') {
$config['mail_smtptimeout'] = (int) getenv('OWNCLOUD_MAIL_SMTP_TIMEOUT');
}
if (getenv('OWNCLOUD_MAIL_SMTP_SECURE') != '') {
$config['mail_smtpsecure'] = getenv('OWNCLOUD_MAIL_SMTP_SECURE');
}
if (getenv('OWNCLOUD_MAIL_SMTP_AUTH') != '') {
$config['mail_smtpauth'] = getenv('OWNCLOUD_MAIL_SMTP_AUTH') == 'true';
}
if (getenv('OWNCLOUD_MAIL_SMTP_AUTH_TYPE') != '') {
$config['mail_smtpauthtype'] = getenv('OWNCLOUD_MAIL_SMTP_AUTH_TYPE');
}
if (getenv('OWNCLOUD_MAIL_SMTP_NAME') != '') {
$config['mail_smtpname'] = getenv('OWNCLOUD_MAIL_SMTP_NAME');
}
if (getenv('OWNCLOUD_MAIL_SMTP_PASSWORD') != '') {
$config['mail_smtppassword'] = getenv('OWNCLOUD_MAIL_SMTP_PASSWORD');
}
if (getenv('OWNCLOUD_OVERWRITE_HOST') != '') {
$config['overwritehost'] = getenv('OWNCLOUD_OVERWRITE_HOST');
}
if (getenv('OWNCLOUD_OVERWRITE_PROTOCOL') != '') {
$config['overwriteprotocol'] = getenv('OWNCLOUD_OVERWRITE_PROTOCOL');
}
if (getenv('OWNCLOUD_OVERWRITE_WEBROOT') != '') {
$config['overwritewebroot'] = getenv('OWNCLOUD_OVERWRITE_WEBROOT');
}
if (getenv('OWNCLOUD_OVERWRITE_COND_ADDR') != '') {
$config['overwritecondaddr'] = getenv('OWNCLOUD_OVERWRITE_COND_ADDR');
}
if (getenv('OWNCLOUD_OVERWRITE_CLI_URL') != '') {
$config['overwrite.cli.url'] = getenv('OWNCLOUD_OVERWRITE_CLI_URL');
}
if (getenv('OWNCLOUD_HTACCESS_REWRITE_BASE') != '') {
$config['htaccess.RewriteBase'] = getenv('OWNCLOUD_HTACCESS_REWRITE_BASE');
}
if (getenv('OWNCLOUD_PROXY') != '') {
$config['proxy'] = getenv('OWNCLOUD_PROXY');
}
if (getenv('OWNCLOUD_PROXY_USERPWD') != '') {
$config['proxyuserpwd'] = getenv('OWNCLOUD_PROXY_USERPWD');
}
if (getenv('OWNCLOUD_TRASHBIN_RETENTION_OBLIGATION') != '') {
$config['trashbin_retention_obligation'] = getenv('OWNCLOUD_TRASHBIN_RETENTION_OBLIGATION');
}
if (getenv('OWNCLOUD_TRASHBIN_PURGE_LIMIT') != '') {
$config['trashbin_purge_limit'] = (int) getenv('OWNCLOUD_TRASHBIN_PURGE_LIMIT');
}
if (getenv('OWNCLOUD_VERSIONS_RETENTION_OBLIGATION') != '') {
$config['versions_retention_obligation'] = getenv('OWNCLOUD_VERSIONS_RETENTION_OBLIGATION');
}
if (getenv('OWNCLOUD_UPDATE_CHECKER') != '') {
$config['updatechecker'] = getenv('OWNCLOUD_UPDATE_CHECKER') == 'true';
}
if (getenv('OWNCLOUD_UPDATER_SERVER_URL') != '') {
$config['updater.server.url'] = getenv('OWNCLOUD_UPDATER_SERVER_URL');
}
if (getenv('OWNCLOUD_HAS_INTERNET_CONNECTION') != '') {
$config['has_internet_connection'] = getenv('OWNCLOUD_HAS_INTERNET_CONNECTION') == 'true';
}
if (getenv('OWNCLOUD_CHECK_FOR_WORKING_WELLKNOWN_SETUP') != '') {
$config['check_for_working_wellknown_setup'] = getenv('OWNCLOUD_CHECK_FOR_WORKING_WELLKNOWN_SETUP') == 'true';
}
if (getenv('OWNCLOUD_OPERATION_MODE') != '') {
$config['operation.mode'] = getenv('OWNCLOUD_OPERATION_MODE');
}
if (getenv('OWNCLOUD_LOG_FILE') != '') {
$config['logfile'] = getenv('OWNCLOUD_LOG_FILE');
}
if (getenv('OWNCLOUD_LOG_LEVEL') != '') {
$config['loglevel'] = (int) getenv('OWNCLOUD_LOG_LEVEL');
}
if (getenv('OWNCLOUD_LOG_DATE_FORMAT') != '') {
$config['logdateformat'] = getenv('OWNCLOUD_LOG_DATE_FORMAT');
}
if (getenv('OWNCLOUD_LOG_TIMEZONE') != '') {
$config['logtimezone'] = getenv('OWNCLOUD_LOG_TIMEZONE');
}
if (getenv('OWNCLOUD_CRON_LOG') != '') {
$config['cron_log'] = getenv('OWNCLOUD_CRON_LOG') == 'true';
}
if (getenv('OWNCLOUD_LOG_ROTATE_SIZE') != '') {
$config['log_rotate_size'] = (int) getenv('OWNCLOUD_LOG_ROTATE_SIZE');
}
if (getenv('OWNCLOUD_ENABLE_PREVIEWS') != '') {
$config['enable_previews'] = getenv('OWNCLOUD_ENABLE_PREVIEWS') == 'true';
}
if (getenv('OWNCLOUD_PREVIEW_MAX_X') != '') {
$config['preview_max_x'] = (int) getenv('OWNCLOUD_PREVIEW_MAX_X');
}
if (getenv('OWNCLOUD_PREVIEW_MAX_Y') != '') {
$config['preview_max_y'] = (int) getenv('OWNCLOUD_PREVIEW_MAX_Y');
}
if (getenv('OWNCLOUD_PREVIEW_MAX_SCALE_FACTOR') != '') {
$config['preview_max_scale_factor'] = (int) getenv('OWNCLOUD_PREVIEW_MAX_SCALE_FACTOR');
}
if (getenv('OWNCLOUD_PREVIEW_MAX_FILESIZE_IMAGE') != '') {
$config['preview_max_filesize_image'] = getenv('OWNCLOUD_PREVIEW_MAX_FILESIZE_IMAGE');
}
if (getenv('OWNCLOUD_PREVIEW_LIBREOFFICE_PATH') != '') {
$config['preview_libreoffice_path'] = getenv('OWNCLOUD_PREVIEW_LIBREOFFICE_PATH');
}
if (getenv('OWNCLOUD_PREVIEW_OFFICE_CL_PARAMETERS') != '') {
$config['preview_office_cl_parameters'] = getenv('OWNCLOUD_PREVIEW_OFFICE_CL_PARAMETERS');
}
if (getenv('OWNCLOUD_ENABLED_PREVIEW_PROVIDERS') != '') {
$config['enabledPreviewProviders'] = explode(',', getenv('OWNCLOUD_ENABLED_PREVIEW_PROVIDERS'));
}
if (getenv('OWNCLOUD_COMMENTS_MANAGER_FACTORY') != '') {
$config['comments.managerFactory'] = getenv('OWNCLOUD_COMMENTS_MANAGER_FACTORY');
}
if (getenv('OWNCLOUD_SYSTEMTAGS_MANAGER_FACTORY') != '') {
$config['systemtags.managerFactory'] = getenv('OWNCLOUD_SYSTEMTAGS_MANAGER_FACTORY');
}
if (getenv('OWNCLOUD_MAINTENANCE') != '') {
$config['maintenance'] = getenv('OWNCLOUD_MAINTENANCE') == 'true';
}
if (getenv('OWNCLOUD_SINGLEUSER') != '') {
$config['singleuser'] = getenv('OWNCLOUD_SINGLEUSER');
}
if (getenv('OWNCLOUD_ENABLE_CERTIFICATE_MANAGEMENT') != '') {
$config['enable_certificate_management'] = getenv('OWNCLOUD_ENABLE_CERTIFICATE_MANAGEMENT');
}
if (getenv('OWNCLOUD_MEMCACHE_LOCAL') != '') {
$config['memcache.local'] = getenv('OWNCLOUD_MEMCACHE_LOCAL');
}
if (getenv('OWNCLOUD_CACHE_PATH') != '') {
$config['cache_path'] = getenv('OWNCLOUD_CACHE_PATH');
}
if (getenv('OWNCLOUD_CACHE_CHUNK_GC_TTL') != '') {
$config['cache_chunk_gc_ttl'] = (int) getenv('OWNCLOUD_CACHE_CHUNK_GC_TTL');
}
if (getenv('OWNCLOUD_DAV_CHUNK_BASE_DIR') != '') {
$config['dav.chunk_base_dir'] = getenv('OWNCLOUD_DAV_CHUNK_BASE_DIR');
}
if (getenv('OWNCLOUD_SHARING_MANAGER_FACTORY') != '') {
$config['sharing.managerFactory'] = getenv('OWNCLOUD_SHARING_MANAGER_FACTORY');
}
if (getenv('OWNCLOUD_SHARING_FEDERATION_ALLOW_HTTP_FALLBACK') != '') {
$config['sharing.federation.allowHttpFallback'] = getenv('OWNCLOUD_SHARING_FEDERATION_ALLOW_HTTP_FALLBACK') == 'true';
}
if (getenv('OWNCLOUD_SQLITE_JOURNAL_MODE') != '') {
$config['sqlite.journal_mode'] = getenv('OWNCLOUD_SQLITE_JOURNAL_MODE');
}
if (getenv('OWNCLOUD_MYSQL_UTF8MB4') != '') {
$config['mysql.utf8mb4'] = getenv('OWNCLOUD_MYSQL_UTF8MB4') == 'true';
}
if (getenv('OWNCLOUD_TEMP_DIRECTORY') != '') {
$config['tempdirectory'] = getenv('OWNCLOUD_TEMP_DIRECTORY');
}
if (getenv('OWNCLOUD_HASHING_COST') != '') {
$config['hashingCost'] = (int) getenv('OWNCLOUD_HASHING_COST');
}
if (getenv('OWNCLOUD_BLACKLISTED_FILES') != '') {
$config['blacklisted_files'] = explode(',', getenv('OWNCLOUD_BLACKLISTED_FILES'));
}
if (getenv('OWNCLOUD_EXCLUDED_DIRECTORIES') != '') {
$config['excluded_directories'] = explode(',', getenv('OWNCLOUD_EXCLUDED_DIRECTORIES'));
}
if (getenv('OWNCLOUD_INTEGRITY_EXCLUDED_FILES') != '') {
$config['integrity.excluded.files'] = explode(',', getenv('OWNCLOUD_INTEGRITY_EXCLUDED_FILES'));
}
if (getenv('OWNCLOUD_INTEGRITY_IGNORE_MISSING_APP_SIGNATURE') != '') {
$config['integrity.ignore.missing.app.signature'] = explode(',', getenv('OWNCLOUD_INTEGRITY_IGNORE_MISSING_APP_SIGNATURE'));
}
if (getenv('OWNCLOUD_SHARE_FOLDER') != '') {
$config['share_folder'] = getenv('OWNCLOUD_SHARE_FOLDER');
}
if (getenv('OWNCLOUD_CIPHER') != '') {
$config['cipher'] = getenv('OWNCLOUD_CIPHER');
}
if (getenv('OWNCLOUD_MINIMUM_SUPPORTED_DESKTOP_VERSION') != '') {
$config['minimum.supported.desktop.version'] = getenv('OWNCLOUD_MINIMUM_SUPPORTED_DESKTOP_VERSION');
}
if (getenv('OWNCLOUD_QUOTA_INCLUDE_EXTERNAL_STORAGE') != '') {
$config['quota_include_external_storage'] = getenv('OWNCLOUD_QUOTA_INCLUDE_EXTERNAL_STORAGE') == 'true';
}
if (getenv('OWNCLOUD_FILESYSTEM_CHECK_CHANGES') != '') {
$config['filesystem_check_changes'] = (int) getenv('OWNCLOUD_FILESYSTEM_CHECK_CHANGES');
}
if (getenv('OWNCLOUD_PART_FILE_IN_STORAGE') != '') {
$config['part_file_in_storage'] = getenv('OWNCLOUD_PART_FILE_IN_STORAGE') == 'true';
}
if (getenv('OWNCLOUD_MOUNT_FILE') != '') {
$config['mount_file'] = getenv('OWNCLOUD_MOUNT_FILE');
}
if (getenv('OWNCLOUD_FILESYSTEM_CACHE_READONLY') != '') {
$config['filesystem_cache_readonly'] = getenv('OWNCLOUD_FILESYSTEM_CACHE_READONLY') == 'true';
}
if (getenv('OWNCLOUD_SECRET') != '') {
$config['secret'] = getenv('OWNCLOUD_SECRET');
}
if (getenv('OWNCLOUD_TRUSTED_PROXIES') != '') {
$config['trusted_proxies'] = explode(',', getenv('OWNCLOUD_TRUSTED_PROXIES'));
}
if (getenv('OWNCLOUD_FORWARDED_FOR_HEADERS') != '') {
$config['forwarded_for_headers'] = explode(',', getenv('OWNCLOUD_FORWARDED_FOR_HEADERS'));
}
if (getenv('OWNCLOUD_MAX_FILESIZE_ANIMATED_GIFS_PUBLIC_SHARING') != '') {
$config['max_filesize_animated_gifs_public_sharing'] = (int) getenv('OWNCLOUD_MAX_FILESIZE_ANIMATED_GIFS_PUBLIC_SHARING');
}
if (getenv('OWNCLOUD_FILELOCKING_ENABLED') != '') {
$config['filelocking.enabled'] = getenv('OWNCLOUD_FILELOCKING_ENABLED') == 'true';
}
if (getenv('OWNCLOUD_FILELOCKING_TTL') != '') {
$config['filelocking.ttl'] = getenv('OWNCLOUD_FILELOCKING_TTL');
}
if (getenv('OWNCLOUD_MEMCACHE_LOCKING') != '') {
$config['memcache.locking'] = getenv('OWNCLOUD_MEMCACHE_LOCKING');
}
if (getenv('OWNCLOUD_UPGRADE_AUTOMATIC_APP_UPDATES') != '') {
$config['upgrade.automatic-app-update'] = getenv('OWNCLOUD_UPGRADE_AUTOMATIC_APP_UPDATES') == 'true';
}
if (getenv('OWNCLOUD_DEBUG') != '') {
$config['debug'] = getenv('OWNCLOUD_DEBUG') == 'true';
}
if (getenv('OWNCLOUD_FILES_EXTERNAL_ALLOW_NEW_LOCAL') != '') {
$config['files_external_allow_create_new_local'] = getenv('OWNCLOUD_FILES_EXTERNAL_ALLOW_NEW_LOCAL') == 'true';
}
if (getenv('OWNCLOUD_SMB_LOGGING_ENABLE') != '') {
$config['smb.logging.enable'] = getenv('OWNCLOUD_SMB_LOGGING_ENABLE');
}
if (getenv('OWNCLOUD_DAV_ENABLE_ASYNC') != '') {
$config['dav.enable.async'] = getenv('OWNCLOUD_DAV_ENABLE_ASYNC');
}
if (getenv('OWNCLOUD_LICENSE_KEY') != '') {
$config['license-key'] = getenv('OWNCLOUD_LICENSE_KEY');
}
if (getenv('OWNCLOUD_MARKETPLACE_KEY') != '') {
$config['marketplace.key'] = getenv('OWNCLOUD_MARKETPLACE_KEY');
}
if (getenv('OWNCLOUD_MARKETPLACE_CA') != '') {
$config['marketplace.ca'] = getenv('OWNCLOUD_MARKETPLACE_CA');
}
if (getenv('OWNCLOUD_APPSTORE_URL') != '') {
$config['appstoreurl'] = getenv('OWNCLOUD_APPSTORE_URL');
}
if (getenv('OWNCLOUD_LOGIN_ALTERNATIVES') != '') {
$rows = explode(',', getenv('OWNCLOUD_LOGIN_ALTERNATIVES'));
foreach ($rows as $key => $value) {
parse_str($value, $opts);
$config['login.alternatives'][$key] = $opts;
}
}
switch (true) {
case getenv('OWNCLOUD_REDIS_ENABLED') && getenv('OWNCLOUD_REDIS_ENABLED') == 'true':
$config = array_merge_recursive($config, [
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
]);
switch (true) {
case getenv('OWNCLOUD_REDIS_SEEDS') != '':
$config['redis.cluster']['seeds'] = explode(',', getenv('OWNCLOUD_REDIS_SEEDS'));
if (getenv('OWNCLOUD_REDIS_TIMEOUT') != '') {
$config['redis.cluster']['timeout'] = (float) getenv('OWNCLOUD_REDIS_TIMEOUT');
}
if (getenv('OWNCLOUD_REDIS_READ_TIMEOUT') != '') {
$config['redis.cluster']['read_timeout'] = (float) getenv('OWNCLOUD_REDIS_READ_TIMEOUT');
}
if (getenv('OWNCLOUD_REDIS_FAILOVER_MODE') != '') {
switch (getenv('OWNCLOUD_REDIS_FAILOVER_MODE')) {
case 'FAILOVER_NONE':
$config['redis.cluster']['failover_mode'] = \RedisCluster::FAILOVER_NONE;
case 'FAILOVER_ERROR':
$config['redis.cluster']['failover_mode'] = \RedisCluster::FAILOVER_ERROR;
case 'FAILOVER_DISTRIBUTE':
$config['redis.cluster']['failover_mode'] = \RedisCluster::FAILOVER_DISTRIBUTE;
}
}
case getenv('OWNCLOUD_REDIS_HOST') != '':
$config['redis']['host'] = getenv('OWNCLOUD_REDIS_HOST');
$config['redis']['port'] = getenv('OWNCLOUD_REDIS_PORT');
if (getenv('OWNCLOUD_REDIS_DB') != '') {
$config['redis']['dbindex'] = getenv('OWNCLOUD_REDIS_DB');
}
if (getenv('OWNCLOUD_REDIS_PASSWORD') != '') {
$config['redis']['password'] = getenv('OWNCLOUD_REDIS_PASSWORD');
}
if (getenv('OWNCLOUD_REDIS_TIMEOUT') != '') {
$config['redis']['timeout'] = (float) getenv('OWNCLOUD_REDIS_TIMEOUT');
}
}
break;
case getenv('OWNCLOUD_MEMCACHED_ENABLED') && getenv('OWNCLOUD_MEMCACHED_ENABLED') == 'true':
$config = array_merge_recursive($config, [
'memcache.distributed' => '\OC\Memcache\Memcached',
'memcache.locking' => '\OC\Memcache\Memcached',
'memcached_servers' => [
[
getenv('OWNCLOUD_MEMCACHED_HOST'),
getenv('OWNCLOUD_MEMCACHED_PORT'),
],
],
]);
if (getenv('OWNCLOUD_MEMCACHED_OPTIONS') != '') {
parse_str(getenv('OWNCLOUD_MEMCACHED_OPTIONS'), $opts);
foreach($opts as $key => $value) {
$config['memcached_options'][constant($key)] = $value;
}
}
break;
}
return $config;
}
$CONFIG = getConfigFromEnv();
@@ -0,0 +1,3 @@
config.json
identifier-registration.yaml
proxy-config.json
@@ -0,0 +1,34 @@
{
"server": "https://ocis.owncloud.test",
"theme": "owncloud",
"version": "0.1.0",
"openIdConnect": {
"metadata_url": "https://ocis.owncloud.test/.well-known/openid-configuration",
"authority": "https://ocis.owncloud.test",
"client_id": "phoenix",
"response_type": "code",
"scope": "openid profile email"
},
"applications": [
{
"title": {
"en": "Classic Design",
"de": "Klassisches ownCloud"
},
"icon": "switch_ui",
"url": "https://oc10.owncloud.test",
"target": "_self"
},
{
"title": {
"en": "Settings",
"de": "Einstellungen"
},
"icon": "application",
"url": "https://oc10.owncloud.test/index.php/settings/personal",
"target": "_self",
"menu": "user"
}
],
"apps": ["files", "draw-io", "markdown-editor", "media-viewer"]
}
@@ -0,0 +1,50 @@
---
# OpenID Connect client registry.
clients:
- id: phoenix
name: OCIS
application_type: web
insecure: yes
trusted: yes
redirect_uris:
- https://ocis.owncloud.test/
- https://ocis.owncloud.test/oidc-callback.html
- https://ocis.owncloud.test/oidc-silent-redirect.html
origins:
- https://ocis.owncloud.test
- id: oc10
name: OC10
application_type: web
secret: super
insecure: yes
trusted: yes
redirect_uris:
- https://oc10.owncloud.test/
- https://oc10.owncloud.test/apps/openidconnect/redirect
origins:
- https://oc10.owncloud.test
- id: ocis-explorer.js
name: OCIS Graph Explorer
trusted: yes
application_type: web
insecure: yes
- id: xdXOt13JKxym1B1QcEncf2XDkLAexMBFwiT9j6EfhhHFJhs2KM9jbjTmf8JBXE69
secret: UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh
application_type: native
insecure: true
- id: e4rAsNUSIUs0lF4nbv9FmCeUkTlV9GdgTLDH1b5uie7syb90SzEVrbN7HIpmWJeD
secret: dInFYGV33xKzhbRmpqQltYNdfLdJIfJ9L5ISoKhNoT9qZftpdWSP71VrpGR9pmoD
application_type: native
redirect_uris:
- oc://android.owncloud.com
- id: mxd5OQDk6es5LzOzRvidJNfXLUZS2oN3oUFeXPP8LpPrhx3UroJFduGEYIBOxkY1
secret: KFeFWWEZO9TkisIQzR3fo7hfiMXlOpaqP8CFuTbSHzV1TUuGECglPxpiVKJfOXIx
application_type: native
redirect_uris:
- oc://ios.owncloud.com
- oc.ios://ios.owncloud.com
@@ -0,0 +1,63 @@
{
"HTTP": {
"Namespace": "ocis_oc10_backend"
},
"policy_selector": {
"static": {
"policy": "ocis_oc10_backend"
}
},
"policies": [
{
"name": "ocis_oc10_backend",
"routes": [
{
"endpoint": "/",
"backend": "http://localhost:9100"
},
{
"endpoint": "/.well-known/",
"backend": "http://localhost:9130"
},
{
"endpoint": "/konnect/",
"backend": "http://localhost:9130"
},
{
"endpoint": "/signin/",
"backend": "http://localhost:9130"
},
{
"endpoint": "/ocs/",
"backend": "https://oc10.owncloud.test",
"apache-vhost": true
},
{
"endpoint": "/remote.php/",
"backend": "https://oc10.owncloud.test",
"apache-vhost": true
},
{
"endpoint": "/dav/",
"backend": "https://oc10.owncloud.test",
"apache-vhost": true
},
{
"endpoint": "/webdav/",
"backend": "https://oc10.owncloud.test",
"apache-vhost": true
},
{
"endpoint": "/status.php",
"backend": "https://oc10.owncloud.test",
"apache-vhost": true
},
{
"endpoint": "/index.php/",
"backend": "https://oc10.owncloud.test",
"apache-vhost": true
}
]
}
]
}
@@ -0,0 +1,220 @@
---
version: "3.7"
services:
traefik:
image: "traefik:v2.3"
networks:
default:
aliases:
- ${OCIS_DOMAIN:-ocis.owncloud.test}
- ${OC10_DOMAIN:-oc10.owncloud.test}
command:
#- "--log.level=DEBUG"
- "--certificatesResolvers.http.acme.email=${TRAEFIK_ACME_MAIL:-'example@example.org'}"
- "--certificatesResolvers.http.acme.storage=/certs/acme.json"
- "--certificatesResolvers.http.acme.httpChallenge.entryPoint=http"
- "--api.dashboard=true"
- "--entryPoints.http.address=:80"
- "--entryPoints.https.address=:443"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.exposedByDefault=false"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "certs:/certs"
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=http"
- "traefik.http.routers.traefik.rule=Host(`${TRAEFIK_DOMAIN:-traefik.owncloud.test}`)"
- "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_BASIC_AUTH_USERS:-admin:$apr1$4vqie50r$YQAmQdtmz5n9rEALhxJ4l.}" # defaults to admin:admin
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`${TRAEFIK_DOMAIN:-traefik.owncloud.test}`)"
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=http"
- "traefik.http.routers.traefik-secure.service=api@internal"
restart: always
ocis:
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
entrypoint:
- /bin/sh
- -c
- |
cp /config/identifier-registration.dist.yaml /config/identifier-registration.yaml
sed -i 's/ocis.owncloud.test/${OCIS_DOMAIN:-ocis.owncloud.test}/g' /config/identifier-registration.yaml
sed -i 's/oc10.owncloud.test/${OC10_DOMAIN:-oc10.owncloud.test}/g' /config/identifier-registration.yaml
cp /config/config.dist.json /config/config.json
sed -i 's/ocis.owncloud.test/${OCIS_DOMAIN:-ocis.owncloud.test}/g' /config/config.json
sed -i 's/oc10.owncloud.test/${OC10_DOMAIN:-oc10.owncloud.test}/g' /config/config.json
cp /config/proxy-config.dist.json /config/proxy-config.json
sed -i 's/ocis.owncloud.test/${OCIS_DOMAIN:-ocis.owncloud.test}/g' /config/proxy-config.json
sed -i 's/oc10.owncloud.test/${OC10_DOMAIN:-oc10.owncloud.test}/g' /config/proxy-config.json
ocis server
networks:
default:
environment:
# general config
OCIS_DOMAIN: ${OCIS_DOMAIN:-ocis.owncloud.test}
OCIS_LOG_LEVEL: error
# proxy
PROXY_AUTOPROVISION_ACCOUNTS: "true"
PROXY_INSECURE_BACKENDS: "${INSECURE:-false}"
PROXY_OIDC_INSECURE: "${INSECURE:-false}"
PROXY_CONFIG_FILE: "/config/proxy-config.json"
PROXY_ENABLE_PRESIGNEDURLS: "false"
PROXY_OIDC_ISSUER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
PROXY_TLS: "false"
# konnectd - binddn must exist as oc10 admin user
KONNECTD_IDENTIFIER_REGISTRATION_CONF: "/config/identifier-registration.yaml"
KONNECTD_INSECURE: "${INSECURE:-false}"
KONNECTD_ISS: https://${OCIS_DOMAIN:-ocis.owncloud.test}
KONNECTD_SIGNING_KID: super
KONNECTD_TLS: 0
LDAP_BASEDN: "dc=example,dc=org"
LDAP_BINDDN: "cn=admin,dc=example,dc=org"
LDAP_BINDPW: "admin"
LDAP_EMAIL_ATTRIBUTE: mail
LDAP_FILTER: "(objectClass=posixaccount)"
LDAP_LOGIN_ATTRIBUTE: uid
LDAP_NAME_ATTRIBUTE: givenName
LDAP_SCOPE: sub
LDAP_URI: ldap://localhost:9125
LDAP_UUID_ATTRIBUTE_TYPE: text
LDAP_UUID_ATTRIBUTE: uid
# glauth
GLAUTH_BACKEND_DATASTORE: owncloud
GLAUTH_BACKEND_SERVERS: https://${OC10_DOMAIN:-oc10.owncloud.test}/apps/graphapi/v1.0
GLAUTH_BACKEND_INSECURE: "${INSECURE:-false}"
# graph
GRAPH_OIDC_ENDPOINT: https://${OC10_DOMAIN:-oc10.owncloud.test}/apps/graphapi/v1.0
# web ui
PHOENIX_WEB_CONFIG: "/config/config.json"
# storage - although not used, yet
STORAGE_OIDC_ISSUER: https://${OCIS_DOMAIN:-ocis.owncloud.test}
STORAGE_OIDC_INSECURE: "${INSECURE:-false}"
STORAGE_TRANSFER_EXPIRES: 86400
STORAGE_FRONTEND_PUBLIC_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
STORAGE_DATAGATEWAY_PUBLIC_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}/data
STORAGE_LDAP_IDP: https://${OCIS_DOMAIN:-ocis.owncloud.test}
STORAGE_METADATA_ROOT: /opt/ocis-metadata
STORAGE_DRIVER_OCIS_ROOT: /opt/ocis-storage
# store config
STORE_DATA_PATH: /opt/ocis-store
# settings config
SETTINGS_DATA_PATH: /opt/ocis-settings
volumes:
- ./config/ocis:/config
- ocis-storage:/opt/ocis-storage
- ocis-metadata:/opt/ocis-metadata
- ocis-store:/opt/ocis-store
- ocis-settings:/opt/ocis-settings
labels:
- "traefik.enable=true"
- "traefik.http.routers.ocis.entrypoints=http"
- "traefik.http.routers.ocis.rule=Host(`${OCIS_DOMAIN:-ocis.owncloud.test}`)"
- "traefik.http.middlewares.ocis-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.ocis.middlewares=ocis-https-redirect"
- "traefik.http.routers.ocis-secure.entrypoints=https"
- "traefik.http.routers.ocis-secure.rule=Host(`${OCIS_DOMAIN:-ocis.owncloud.test}`)"
- "traefik.http.routers.ocis-secure.tls=true"
- "traefik.http.routers.ocis-secure.tls.certresolver=http"
- "traefik.http.routers.ocis-secure.service=ocis"
- "traefik.http.services.ocis.loadbalancer.server.port=9200"
restart: always
oc10:
image: owncloud/server:10.6.0-rc1
depends_on:
- db
- redis
environment:
PROXY_LOG_LEVEL: debug
OCIS_DOMAIN: https://${OCIS_DOMAIN:-ocis.owncloud.test}
OWNCLOUD_DOMAIN: ${OC10_DOMAIN:-oc10.owncloud.test}
OWNCLOUD_DB_TYPE: mysql
OWNCLOUD_DB_NAME: owncloud
OWNCLOUD_DB_USERNAME: owncloud
OWNCLOUD_DB_PASSWORD: owncloud
OWNCLOUD_DB_HOST: db
OWNCLOUD_ADMIN_USERNAME: admin
OWNCLOUD_ADMIN_PASSWORD: admin
OWNCLOUD_MYSQL_UTF8MB4: "true"
OWNCLOUD_REDIS_ENABLED: "true"
OWNCLOUD_REDIS_HOST: redis
OWNCLOUD_TRUSTED_PROXIES: ${OC10_DOMAIN:-oc10.owncloud.test}
OWNCLOUD_OVERWRITE_PROTOCOL: https
OWNCLOUD_OVERWRITE_HOST: ${OC10_DOMAIN:-oc10.owncloud.test}
OWNCLOUD_APPS_ENABLE: "openidconnect,oauth2,user_ldap,graphapi"
OWNCLOUD_LOG_LEVEL: 0
volumes:
- ./config/oc10/config.php:/etc/templates/config.php
- files:/mnt/data
- tmp:/tmp/shared
labels:
- "traefik.enable=true"
- "traefik.http.routers.oc10.entrypoints=http"
- "traefik.http.routers.oc10.rule=Host(`${OC10_DOMAIN:-oc10.owncloud.test}`)"
- "traefik.http.middlewares.oc10-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.oc10.middlewares=oc10-https-redirect"
- "traefik.http.routers.oc10-secure.entrypoints=https"
- "traefik.http.routers.oc10-secure.rule=Host(`${OC10_DOMAIN:-oc10.owncloud.test}`)"
- "traefik.http.routers.oc10-secure.tls=true"
- "traefik.http.routers.oc10-secure.tls.certresolver=http"
- "traefik.http.routers.oc10-secure.service=oc10"
- "traefik.http.services.oc10.loadbalancer.server.port=8080"
restart: always
db:
image: webhippie/mariadb:latest
environment:
MARIADB_ROOT_PASSWORD: owncloud
MARIADB_USERNAME: owncloud
MARIADB_PASSWORD: owncloud
MARIADB_DATABASE: owncloud
MARIADB_MAX_ALLOWED_PACKET: 128M
MARIADB_INNODB_LOG_FILE_SIZE: 256M
healthcheck:
test: ["CMD", "/usr/bin/healthcheck"]
interval: 30s
timeout: 10s
retries: 5
volumes:
- mysql:/var/lib/mysql
- backup:/var/lib/backup
restart: always
redis:
image: webhippie/redis:latest
environment:
- REDIS_DATABASES=1
volumes:
- redis:/var/lib/redis
restart: always
volumes:
certs:
ocis-storage:
ocis-metadata:
ocis-store:
ocis-settings:
files:
driver: local
mysql:
driver: local
backup:
driver: local
redis:
driver: local
tmp:
driver: local