From 94ead20660f63c71d3b14ed415acf2585270488b Mon Sep 17 00:00:00 2001
From: Martin Schneider <martin.schneider@open-xchange.com>
Date: Fri, 9 Sep 2016 11:37:50 +0200
Subject: [PATCH] Lean config: provide templates for yml configuration files

---
 .../conf/as-config-defaults.yml               |   1 +
 .../examples/as-config-defaults-template.yml  |  46 +++
 .../conf/client-onboarding-scenarios.yml      |   1 +
 .../client-onboarding-scenarios-template.yml  | 331 ++++++++++++++++++
 com.openexchange.database/conf/globaldb.yml   |   2 +-
 .../doc/examples/globaldb-template.yml        |  57 +++
 open-xchange-appsuite-backend/debian/docs     |   1 +
 .../open-xchange-appsuite-backend.spec        |   1 +
 open-xchange-client-onboarding/debian/docs    |   1 +
 .../open-xchange-client-onboarding.spec       |   1 +
 open-xchange-core/debian/docs                 |   1 +
 open-xchange-core/open-xchange-core.spec      |   1 +
 12 files changed, 443 insertions(+), 1 deletion(-)
 create mode 100644 com.openexchange.apps.manifests.json/doc/examples/as-config-defaults-template.yml
 create mode 100644 com.openexchange.client.onboarding/doc/examples/client-onboarding-scenarios-template.yml
 create mode 100644 com.openexchange.database/doc/examples/globaldb-template.yml
 create mode 100644 open-xchange-appsuite-backend/debian/docs
 create mode 100644 open-xchange-client-onboarding/debian/docs

diff --git a/com.openexchange.apps.manifests.json/conf/as-config-defaults.yml b/com.openexchange.apps.manifests.json/conf/as-config-defaults.yml
index 275d75945ead..b04457e4b322 100644
--- a/com.openexchange.apps.manifests.json/conf/as-config-defaults.yml
+++ b/com.openexchange.apps.manifests.json/conf/as-config-defaults.yml
@@ -1,5 +1,6 @@
 # If you want to override values here
 # Use the as-config.yml. This file will be overwritten
+# A template (as-config-defaults-template.yml) with up-to-date configuration examples can be found at /usr/share/doc
 default:
     pageTitle: 'App Suite. '
 
diff --git a/com.openexchange.apps.manifests.json/doc/examples/as-config-defaults-template.yml b/com.openexchange.apps.manifests.json/doc/examples/as-config-defaults-template.yml
new file mode 100644
index 000000000000..275d75945ead
--- /dev/null
+++ b/com.openexchange.apps.manifests.json/doc/examples/as-config-defaults-template.yml
@@ -0,0 +1,46 @@
+# If you want to override values here
+# Use the as-config.yml. This file will be overwritten
+default:
+    pageTitle: 'App Suite. '
+
+    pageHeaderPrefix: 'OX'
+    pageHeader: 'App Suite'
+
+    productName: 'OX App Suite'
+    productNameMail: 'OX Mail'
+
+    contact: 'Open-Xchange AG, Rollnerstr. 14, D-90408 Nürnberg, E-Mail: info@open-xchange.com'
+
+    forgotPassword: false
+
+    copyright: '(c) 2016-2020 OX Software GmbH'
+
+    staySignedIn: true
+
+    # Optional custom locations
+    # logoutLocation: 'http://my.landing-page.tld'
+    # guestLogoutLocation: 'http://guest.landing-page.tld'
+    # loginLocation: 'http://my.login-page.tld'
+
+    # Defines basic styling for notification mails. If you
+    # override these you must specify all mandatory elements!
+    notificationMails:
+        # Call to actions are often shown as buttons. Their
+        # appearance can be configured in terms of font color,
+        # background color and border color.
+        # Mandatory!
+        button:
+            textColor: '#ffffff'
+            backgroundColor: '#3c73aa'
+            borderColor: '#356697'
+        # Notification mails can contain a footer section consisting of
+        # a text and logo/image. To omit footers at all, you can omit this
+        # section.
+        footer:
+            # Images are referenced via their file name below 
+            # '/opt/open-xchange/templates'. If you don't want any image 
+            # to be included, omit this key.
+            image: 'ox_logo_claim_blue_small.png'
+            # The footer text can be customized. If no text shall be
+            # displayed, omit this key.
+            text: ''
diff --git a/com.openexchange.client.onboarding/conf/client-onboarding-scenarios.yml b/com.openexchange.client.onboarding/conf/client-onboarding-scenarios.yml
index 86631dce7ed7..7198b1180528 100644
--- a/com.openexchange.client.onboarding/conf/client-onboarding-scenarios.yml
+++ b/com.openexchange.client.onboarding/conf/client-onboarding-scenarios.yml
@@ -1,4 +1,5 @@
 # The YAML configuration file for on-boarding scenarios
+# A template (client-onboarding-scenarios-template.yml) with up-to-date configuration examples can be found at /usr/share/doc
 #
 # Notation/meaning is:
 # <unique-scenario-identifier>:
diff --git a/com.openexchange.client.onboarding/doc/examples/client-onboarding-scenarios-template.yml b/com.openexchange.client.onboarding/doc/examples/client-onboarding-scenarios-template.yml
new file mode 100644
index 000000000000..86631dce7ed7
--- /dev/null
+++ b/com.openexchange.client.onboarding/doc/examples/client-onboarding-scenarios-template.yml
@@ -0,0 +1,331 @@
+# The YAML configuration file for on-boarding scenarios
+#
+# Notation/meaning is:
+# <unique-scenario-identifier>:
+#     enabled: <true|false>
+#       Boolean. If set to 'false' the scenario will not be available, useful for testing/enabling the scenario later on
+#
+#     type: <plist|manual|link>
+#       String. The type of the scenario. Currently known:
+#       "plist" for generating a plist configuration file for iOS and OSX devices,
+#       "manual" for a description for the user for manual set-up
+#       "link" for a link/URL to either Apple App Store, Apple Mac App Store or Google Play Store
+#
+#     link: <link>
+#       Object. The link and type routing to the app in either Apple App Store, Apple Mac App Store or Google Play Store. ONLY VALID IN CASE "type" IS SET TO "link"!
+#         url: <url>
+#         String: The URL of the link. For specifying a property that provides the actual link, please use special "property" scheme; e.g. "property://com.openexchange.client.onboarding.app.mylink"
+#
+#         type: <appstore|playstore>
+#         String: Optional. Denotes to what store the URL points to (if it is not a common download link not pointing to a commercial store. Supported values are "appstore", "macappstore" and "playstore"
+#
+#     providers: <provider-identifiers>
+#       Array of strings. A list of providers that are supposed to "contribute" to this scenario.
+#
+#     alternatives: <alternative-scenarios>
+#       Array of strings. A list of alternative/fall-back scenarios; e.g. the scenario for manual setup
+#
+#     icon: <file-name>
+#       String. The name of the icon image file located in '/opt/open-xchange/templates' directory or the base64-encoded binary content
+#
+#     displayName_t10e: <display-name>
+#       String. The translatable display name; will be available in scenarios.pot file
+#
+#     description_t10e: <description>
+#       String. The translatable description; will be available in scenarios.pot file
+#
+
+
+#
+# ------------------------------================== NOTE ==================------------------------------
+#
+#  Each scenario listed in this file needs to be added to 'client-onboarding.properties' as well to become effective.
+#  Moreover, the capabilites for the scenario-associated provider(s) need to be available for such users that
+#  are supposed to use it.
+#
+#  Example:
+#   A scenario identified by "myscenario" is intended to be added:
+#
+#   - Add the scenario identifier to the "scenarios" property of such devices that are supposed to offer it;
+#      e.g. "com.openexchange.client.onboarding.windows.desktop.scenarios= ... , myscenario
+#
+#   - Add the scenario identifier to the generic "enabledScenarios" property;
+#      e.g. "com.openexchange.client.onboarding.enabledScenarios= ... , myscenario
+#
+#   - At last, ensure the capabilities as required by the associated provider(s) are available
+#      app                -> No capabilites required; always available
+#      drivewindowsclient -> Requires "drive" capability
+#      emclient           -> Requires "emclient_basic" or "emclient_premium" capability
+#      mailapp            -> Requires "mobile_mail_app" and "webmail" capabilities
+#      driveapp           -> Requires "drive" capability
+#      caldav             -> Requires "caldav" capability
+#      carddav            -> Requires "carddav" capability
+#      oxupdater          -> Requires at least one product being available that is managed by OX Updater 
+#                             (OX Drive, OX Notifier, OXtender2, OX Uploader)
+#      eas                -> Requires "active_sync" capability
+#      mail               -> Requires "webmail" capability
+#
+
+
+### Generic Apps
+################################################################################
+
+# Only an example
+myappleappinstall:
+    # Disabled...
+    enabled: false
+    type: link
+    link:
+        url: property://com.openexchange.client.onboarding.app.store.url
+        type: appstore
+    providers: [app]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    ## icon: <icon>
+    # The translatable display name
+    ## displayName_t10e: <the display name>
+    # The translatable description
+    ## description_t10e: <the description>
+
+# Only another example
+mygoogleappinstall:
+    # Disabled...
+    enabled: false
+    type: link
+    link:
+        url: http://play.google.com/store/apps/details?id=mygoogleapp
+        type: playstore
+    providers: [app]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    ## icon: <icon>
+    # The translatable display name
+    ## displayName_t10e: <the display name>
+    # The translatable description
+    ## description_t10e: <the description>
+
+# Yet another example
+myplainappinstall:
+    # Disabled...
+    enabled: false
+    type: link
+    link:
+        url: http://my.host.invalid/path/to/the/installer
+    providers: [app]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    ## icon: <icon>
+    # The translatable display name
+    ## displayName_t10e: <the display name>
+    # The translatable description
+    ## description_t10e: <the description>
+
+
+### Installer for Drive Windows Client
+################################################################################
+
+drivewindowsclientinstall:
+    enabled: true
+    type: link
+    providers: [drivewindowsclient]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    icon: fa-cloud
+    # The translatable display name
+    displayName_t10e: "Drive Application"
+    # The translatable description
+    description_t10e: "Synchronize your files with our Drive application."
+
+
+### Installer for Windows eM-Client
+################################################################################
+
+emclientinstall:
+    # Disabled by default
+    enabled: false
+    type: link
+    providers: [emclient]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    icon: "fa-envelope-o, fa-calendar, fa-users"
+    # The translatable display name
+    displayName_t10e: "Mail + Calendar + Address Book"
+    # The translatable description
+    description_t10e: "To synchronize your Mail, Calendar, Tasks and Address Book data, download and install our desktop application."
+
+
+### OX Drive App
+################################################################################
+
+driveappinstall:
+    # Disbled by default
+    enabled: false
+    type: link
+    providers: [driveapp]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    icon: fa-cloud
+    # The translatable display name
+    displayName_t10e: "Drive App"
+    # The translatable description
+    description_t10e: "Synchronize your files with our Drive App."
+
+
+### OX Mail App
+################################################################################
+
+mailappinstall:
+    # Disbled by default
+    enabled: false
+    type: link
+    providers: [mailapp]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    icon: fa-envelope-o
+    # The translatable display name
+    displayName_t10e: "Mail App"
+    # The translatable description
+    description_t10e: "Synchronize your Mail with our Mail App."
+
+
+### Sync App
+################################################################################
+
+syncappinstall:
+    # Disbled by default
+    enabled: false
+    type: link
+    providers: [syncapp]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    icon: "fa-calendar, fa-users"
+    # The translatable display name
+    displayName_t10e: "Calendar + Address Book"
+    # The translatable description
+    description_t10e: "Synchronize your Calendar and Address Book data with your device."
+
+
+### CalDAV & CardDAV Sync
+################################################################################
+
+davsync:
+    # Disbled by default
+    enabled: false
+    type: plist
+    providers: [carddav, caldav]
+    alternatives: [davmanual]
+    # The comma-separated Font Awesome names
+    icon: "fa-calendar, fa-users"
+    # The translatable display name
+    displayName_t10e: "Calendar + Address Book"
+    # The translatable description
+    description_t10e: "Synchronize your Calendar and Address Book data with your device."
+
+#davsync_mybrand:
+#    enabled: true
+#    type: plist
+#    providers: [carddav, caldav]
+#    alternatives: [davmanual]
+#    # The comma-separated Font Awesome names
+#    icon: <base64>
+#    # The translatable display name
+#    displayName_t10e: "OX Sync"
+#    # The translatable description
+#    description_t10e: "Synchronize all your appointments and contacts"
+
+davmanual:
+    # Disbled by default
+    enabled: false
+    type: manual
+    providers: [carddav, caldav]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    icon: fa-wrench
+    # The translatable display name
+    displayName_t10e: "Calendar + Address Book"
+    # The translatable description
+    description_t10e: "To manually setup your Calendar and Address Book accounts, please use the following information."
+
+
+### OX Updater
+################################################################################
+
+# Requires the appropriate updater package being installed (e.g. "open-xchange-outlook-updater", "open-xchange-updater-drive", and so on)
+# and the associated permissions are granted to the users, which are supposed to download the file
+
+oxupdaterinstall:
+    # Disbled by default
+    enabled: false
+    type: link
+    providers: [oxupdater]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    icon: fa-laptop
+    # The translatable display name
+    displayName_t10e: "Updater"
+    # The translatable description
+    description_t10e: "When executing the downloaded file, an installation wizard will be launched. Follow the instructions and install the updater. Installs latest versions of Windows® client software. The Updater automatically informs about new updates. You can download the updates from within the Updater."
+    # Alternative texts for Outlook Connector. If they should be used, remove the 'alt_' prefix and comment out the above ones.
+    alt_displayName_t10e: "Connector for Microsoft Outlook®"
+    alt_description_t10e: "Synchronization of Mail, Calendar, Contacts and Tasks, along with Public, Shared and System Folders to Microsoft Outlook® clients."
+
+
+### Exchange ActiveSync
+################################################################################
+
+eassync:
+    # Disbled by default
+    enabled: false
+    type: plist
+    providers: [eas]
+    alternatives: [easmanual]
+    # The comma-separated Font Awesome names
+    icon: "fa-envelope-o, fa-calendar, fa-users"
+    # The translatable display name
+    displayName_t10e: "Mail + Calendar + Address Book"
+    # The translatable description
+    description_t10e: "Synchronize your Mail, Calendar and Address Book data with your device."
+
+easmanual:
+    # Disbled by default
+    enabled: false
+    type: manual
+    providers: [eas]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    icon: "fa-envelope-o, fa-calendar, fa-users"
+    # The translatable display name
+    displayName_t10e: "Mail + Calendar + Address Book"
+    # The translatable description
+    description_t10e: "To manually setup your Mail, Calendar and Address Book accounts, please use the following information."
+
+
+### IMAP/SMTP
+################################################################################
+
+mailsync:
+    # Disbled by default
+    enabled: false
+    type: plist
+    providers: [mail]
+    alternatives: [mailmanual]
+    # The comma-separated Font Awesome names
+    icon: fa-envelope-o
+    # The translatable display name
+    displayName_t10e: "Mail"
+    # The translatable description
+    description_t10e: "Synchronize your Mail with Apple Mail App."
+
+mailmanual:
+    # Disbled by default
+    enabled: false
+    type: manual
+    providers: [mail]
+    alternatives: []
+    # The comma-separated Font Awesome names
+    icon: fa-envelope-o
+    # The translatable display name
+    displayName_t10e: "Mail"
+    # The translatable description
+    description_t10e: "To manually setup your Mail account, please use the following information"
+
diff --git a/com.openexchange.database/conf/globaldb.yml b/com.openexchange.database/conf/globaldb.yml
index f178aa040c87..642d82c0d1f6 100644
--- a/com.openexchange.database/conf/globaldb.yml
+++ b/com.openexchange.database/conf/globaldb.yml
@@ -1,5 +1,5 @@
 # Configuration file for global, cross-context databases
-
+# A template (globaldb-template.yml) with up-to-date configuration examples can be found at /usr/share/doc
 
 # Please ensure that the same version of this configuration file is used for 
 # all nodes in the cluster.
diff --git a/com.openexchange.database/doc/examples/globaldb-template.yml b/com.openexchange.database/doc/examples/globaldb-template.yml
new file mode 100644
index 000000000000..8be24656155f
--- /dev/null
+++ b/com.openexchange.database/doc/examples/globaldb-template.yml
@@ -0,0 +1,57 @@
+# Configuration file for global, cross-context databases
+
+# Please ensure that the same version of this configuration file is used for 
+# all nodes in the cluster.
+
+# By default, no database is configured, so that features that require access
+# to the cross-context database are not available.
+
+# For each cross-context database, the database pool identifier, as well as 
+# the associated context groups need to be specified. The "id" property refers
+# to the database pool identifier of the corresponding database master of the 
+# targeted pool, previously registered with "./registerdatabase". The 
+# identifier is also printed out when executing the "./listdatabase" 
+# commandline tool.
+ 
+# In most cases, it's sufficient to configure the same global database 
+# settings for the whole user base of the installation. For that purpose, the 
+# "default" section is used, and no further configuration steps are necessary 
+# after the referenced database has been registered.
+
+# For setups serving multiple different "brands" or "domains", one or more 
+# contexts can be classified into a specific "group". The association with
+# the group is done by assigning the property "com.openexchange.context.group"
+# to a context via config cascade. A context may only be part of one group,
+# contexts without group association automatically fall into the "default"
+# group. 
+
+# Having contexts separated into different groups also allows to use different
+# global databases as defined in the additional sections of this configuration 
+# file. Context groups are bound to each configuration section by specifying 
+# the group name in the "groups" array. 
+# Each group name can only be specified in one section. The name of each
+# configuration block may be chosen freely, yet the referenced group names 
+# have to match the actual values assigned to the contexts via 
+# "com.openexchange.context.group".
+
+# Besides using different database schemas for the cross-context database, the 
+# context group names also serve as differentiating key for various data held 
+# in the global databases. For example, data of a guest user that was invited 
+# to a share in one context of a group can be used throughout all other 
+# contexts of the same group. Or, there may be a different set of registered 
+# OAuth applications available for each context group.
+
+
+# Section for the "default" global database. The configuration becomes active 
+# once the "id" is defined.
+default:
+    groups: [default]
+    id:
+
+# Example for an additional configuration setting that directs all cross-
+# context data from the context groups "de", "fr" and "nl" to the database
+# pool with identifier 32. As outlined above, contexts may be assigned to 
+# those groups via config cascade.
+# central_europe:
+#     groups: [de, fr, nl]
+#     id: 32
diff --git a/open-xchange-appsuite-backend/debian/docs b/open-xchange-appsuite-backend/debian/docs
new file mode 100644
index 000000000000..6db459b93873
--- /dev/null
+++ b/open-xchange-appsuite-backend/debian/docs
@@ -0,0 +1 @@
+com.openexchange.apps.manifests.json/doc/examples
diff --git a/open-xchange-appsuite-backend/open-xchange-appsuite-backend.spec b/open-xchange-appsuite-backend/open-xchange-appsuite-backend.spec
index 8b32f0fe5b1e..cd7be41e5734 100644
--- a/open-xchange-appsuite-backend/open-xchange-appsuite-backend.spec
+++ b/open-xchange-appsuite-backend/open-xchange-appsuite-backend.spec
@@ -91,6 +91,7 @@ ox_move_config_file /opt/open-xchange/templates /opt/open-xchange/templates prin
 %config(noreplace) /opt/open-xchange/etc/settings/upsell-appsuite.properties
 %dir /opt/open-xchange/templates/
 %config(noreplace) /opt/open-xchange/templates/*
+%doc com.openexchange.apps.manifests.json/doc/examples
 
 %changelog
 * Tue Sep 06 2016 Marcus Klein <marcus.klein@open-xchange.com>
diff --git a/open-xchange-client-onboarding/debian/docs b/open-xchange-client-onboarding/debian/docs
new file mode 100644
index 000000000000..63a007f1c15a
--- /dev/null
+++ b/open-xchange-client-onboarding/debian/docs
@@ -0,0 +1 @@
+com.openexchange.client.onboarding/doc/examples
diff --git a/open-xchange-client-onboarding/open-xchange-client-onboarding.spec b/open-xchange-client-onboarding/open-xchange-client-onboarding.spec
index f574cd925df6..3661cd60e25d 100644
--- a/open-xchange-client-onboarding/open-xchange-client-onboarding.spec
+++ b/open-xchange-client-onboarding/open-xchange-client-onboarding.spec
@@ -102,6 +102,7 @@ fi
 /opt/open-xchange/lib/*
 %dir /opt/open-xchange/sbin/
 /opt/open-xchange/sbin/*
+%doc com.openexchange.client.onboarding/doc/examples
 
 %changelog
 * Tue Sep 06 2016 Thorben Betten <thorben.betten@open-xchange.com>
diff --git a/open-xchange-core/debian/docs b/open-xchange-core/debian/docs
index d991ad37f015..f9c8bdb2bcb5 100644
--- a/open-xchange-core/debian/docs
+++ b/open-xchange-core/debian/docs
@@ -1,2 +1,3 @@
 docs/
 com.openexchange.server/doc/examples
+com.openexchange.database/doc/examples
diff --git a/open-xchange-core/open-xchange-core.spec b/open-xchange-core/open-xchange-core.spec
index 5d847d3da6cb..2cda462f40a0 100644
--- a/open-xchange-core/open-xchange-core.spec
+++ b/open-xchange-core/open-xchange-core.spec
@@ -1434,6 +1434,7 @@ exit 0
 %dir %attr(750, open-xchange, root) /var/spool/open-xchange/uploads
 %doc docs/
 %doc com.openexchange.server/doc/examples
+%doc com.openexchange.database/doc/examples
 
 %changelog
 * Tue Sep 06 2016 Marcus Klein <marcus.klein@open-xchange.com>
-- 
GitLab