Skip to content

Commit

Permalink
[feature/custom-app-scheme] Custom app/auth schemes (#1060)
Browse files Browse the repository at this point in the history
* - add support and documentation for DISABLE_APPSTORE_LICENSING build flag

* - ReleaseNotesHostViewController: remove unused reference to StoreKit
- OCLicenseDuration: make sure SKProductSubscriptionPeriod conversion code is excluded when using the DISABLE_APPSTORE_LICENSING build flag

* - add support for app.custom-app-scheme and app.custom-auth-scheme to Fastfile
- add documentation for new custom scheme Branding.plist parameters

* - remove test values from Branding.plist

* - move build options from `app.` space to `build.` space and rename options accordingly
- add legacy support for previously used Branding.plist build customization option names
- add `BuildOptions` class to `ownCloudApp` framework to make build customization options visible in documentation

* - ensure BuildOptions class is actually loaded/initialized

* - update Xcode to 12.5.1 for GitHub workflow configuration-documentation.yml

* - adapt code in `ImportPasteboardAction.swift` to also compile in Xcode 12.4

* Configuration documentation updated

Co-authored-by: felix-schwarz <felix-schwarz@users.noreply.github.com>
Co-authored-by: Matthias Hühne <mhuehne@owncloud.com>
  • Loading branch information
3 people authored Nov 22, 2021
1 parent 1441c04 commit 7783b40
Show file tree
Hide file tree
Showing 10 changed files with 466 additions and 17 deletions.
76 changes: 76 additions & 0 deletions doc/BUILD_CUSTOMIZATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Build Flags

## Description

Build Flags can be used to control the inclusion or exclusion of certain functionality or features.

## Usage in Branding

A space-separated list of flags can be specified in the `Branding.plist` with the key `build.flags`, f.ex.:

```xml
<key>build.flags</key>
<string>DISABLE_BACKGROUND_LOCATION</string>
```

## Flags

The following options can be used as `build.flags`:

### `DISABLE_BACKGROUND_LOCATION`

Removes the following from the app:
- the option for location-triggered background uploads from Settings
- the location description keys from the app's `Info.plist`

Not used by default.

### `DISABLE_APPSTORE_LICENSING`

Removes the following from the app:
- App Store integration for OCLicense
- App Store related view controllers and settings section


# Custom Schemes

## Description

The app uses two URL schemes:
- `oc` for authentication
- `owncloud` for private links

Both schemes are part of the app's `Info.plist`, which can only be changed at build time.

## Usage in Branding

### Private Links

The default `owncloud` app URL scheme in `Info.plist` can be changed by providing an alternative scheme name in the `Branding.plist` with the key `build.custom-app-scheme`, f.ex.:

```xml
<key>build.custom-app-scheme</key>
<string>myscheme</string>
```

### Authentication

The default `oc` app URL scheme in `Info.plist` can be changed by providing an alternative scheme name in the `Branding.plist` with the key `build.custom-auth-scheme`, f.ex.:

```xml
<key>build.custom-auth-scheme</key>
<string>ms</string>
```

The change in the `Info.plist` is only necessary when an external browser is used for authentication via OAuth2 or OIDC. In that case, the scheme must also be changed in the regular options for OIDC and OAuth2 authentication methods:

```xml
<key>authentication-oauth2.oa2-redirect-uri</key>
<string>ms://ios.owncloud.com</string>
<key>authentication-oauth2.oidc-redirect-uri</key>
<string>ms://ios.owncloud.com</string>
```

Depending on OAuth2 and OIDC implementation on the server side:
- it may be necessary to also adapt the registered redirect URI on the server
- authentication could fail if not adapted on the server
120 changes: 117 additions & 3 deletions doc/CONFIGURATION.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
[
{
"autoExpansion" : "none",
"category" : "Account",
"categoryTag" : "account",
"classIdentifier" : "account",
"className" : "ownCloud.ServerListTableViewController",
"defaultValue" : false,
"description" : "Skip \"Account\" screen / automatically open \"Files\" screen after login",
"flatIdentifier" : "account.auto-connect",
"key" : "auto-connect",
"label" : "account.auto-connect",
"status" : "supported",
"type" : "bool"
},
{
"autoExpansion" : "none",
"category" : "Actions",
Expand Down Expand Up @@ -462,6 +476,10 @@
"key" : "browser-session-class",
"label" : "authentication.browser-session-class",
"possibleValues" : [
{
"description" : "Replace `http` with `awb` and `https` with `awbs` to delegate browser sessions to the AirWatch browser.",
"value" : "AWBrowser"
},
{
"description" : "Replace http and https with custom schemes to delegate browser sessions to a different app.",
"value" : "CustomScheme"
Expand Down Expand Up @@ -645,6 +663,19 @@
"status" : "advanced",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Branding",
"categoryTag" : "branding",
"classIdentifier" : "branding",
"className" : "Branding",
"description" : "URL to open when selecting the \"Send feedback\" option. Allows the use of all placeholders provided in `http.user-agent`.",
"flatIdentifier" : "branding.send-feedback-url",
"key" : "send-feedback-url",
"label" : "Feedback URL",
"status" : "advanced",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Branding",
Expand Down Expand Up @@ -677,7 +708,7 @@
"categoryTag" : "branding",
"classIdentifier" : "branding",
"className" : "Branding",
"defaultValue" : "https://doc.owncloud.com/ios-app/",
"defaultValue" : "https://doc.owncloud.com/ios-app/latest/",
"description" : "URL to documentation for the app. Opened when selecting \"Documentation\" in the settings.",
"flatIdentifier" : "branding.url-documentation",
"key" : "url-documentation",
Expand Down Expand Up @@ -727,6 +758,19 @@
"status" : "advanced",
"type" : "urlString"
},
{
"autoExpansion" : "none",
"category" : "Branding",
"categoryTag" : "branding",
"classIdentifier" : "branding",
"className" : "Branding",
"description" : "Default values for user defaults. Allows overriding default settings.",
"flatIdentifier" : "branding.user-defaults-default-values",
"key" : "user-defaults-default-values",
"label" : "branding.user-defaults-default-values",
"status" : "advanced",
"type" : "dictionary"
},
{
"autoExpansion" : "none",
"category" : "Browser Session",
Expand All @@ -753,6 +797,47 @@
"status" : "advanced",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Build",
"categoryTag" : "build",
"classIdentifier" : "build",
"className" : "BuildOptions",
"defaultValue" : "owncloud",
"description" : "Name of the URL scheme to use for private links. Must be provided in Branding.plist at build time. For documentation, please see doc/BUILD_CUSTOMIZATION.md.",
"flatIdentifier" : "build.custom-app-scheme",
"key" : "custom-app-scheme",
"label" : "build.custom-app-scheme",
"status" : "supported",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Build",
"categoryTag" : "build",
"classIdentifier" : "build",
"className" : "BuildOptions",
"defaultValue" : "oc",
"description" : "Name of the URL scheme to use for OAuth2/OIDC authentication. Must be provided in Branding.plist at build time. The authentication redirect URI parameters must also be changed accordingly in Branding.plist and on the server side. For documentation, please see doc/BUILD_CUSTOMIZATION.md.",
"flatIdentifier" : "build.custom-auth-scheme",
"key" : "custom-auth-scheme",
"label" : "build.custom-auth-scheme",
"status" : "supported",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Build",
"categoryTag" : "build",
"classIdentifier" : "build",
"className" : "BuildOptions",
"description" : "A set of space separated flags to customize the build. Must be provided in Branding.plist at build time. For documentation, please see doc/BUILD_CUSTOMIZATION.md.",
"flatIdentifier" : "build.flags",
"key" : "flags",
"label" : "build.flags",
"status" : "supported",
"type" : "string"
},
{
"autoExpansion" : "none",
"category" : "Connection",
Expand Down Expand Up @@ -1207,8 +1292,7 @@
"categoryTag" : "connection",
"classIdentifier" : "core",
"className" : "OCCore",
"defaultValue" : 10,
"description" : "Minimum number of seconds until the next scan for changes, measured from the completion of the previous scan.",
"description" : "Minimum number of milliseconds until the next scan for changes, measured from the completion of the previous scan. If no value is provided, uses the poll interval provided in the server's capabilities (in milliseconds) if it is greater or equal 5 seconds. Defaults to 10 seconds otherwise.",
"flatIdentifier" : "core.scan-for-changes-interval",
"key" : "scan-for-changes-interval",
"label" : "core.scan-for-changes-interval",
Expand Down Expand Up @@ -1409,6 +1493,22 @@
"status" : "debugOnly",
"type" : "bool"
},
{
"autoExpansion" : "none",
"category" : "Localization",
"categoryTag" : "localization",
"classIdentifier" : "locale",
"className" : "OCLocaleFilterClassSettings",
"defaultValue" : {

},
"description" : "Dictionary with localization overrides where the key is the English string whose localization should be overridden, and the value is a dictionary where the keys are the language codes (f.ex. \"en\", \"de\") and the values the translations to use.",
"flatIdentifier" : "locale.overrides",
"key" : "overrides",
"label" : "Localization Overrides",
"status" : "advanced",
"type" : "dictionary"
},
{
"autoExpansion" : "none",
"category" : "Logging",
Expand Down Expand Up @@ -1731,6 +1831,20 @@
"status" : "advanced",
"type" : "int"
},
{
"autoExpansion" : "none",
"category" : "Passcode",
"categoryTag" : "passcode",
"classIdentifier" : "passcode",
"className" : "AppLockSettings",
"defaultValue" : false,
"description" : "Controls wether the biometrical unlock will be enabled automatically.",
"flatIdentifier" : "passcode.use-biometrical-unlock",
"key" : "use-biometrical-unlock",
"label" : "passcode.use-biometrical-unlock",
"status" : "advanced",
"type" : "bool"
},
{
"autoExpansion" : "none",
"category" : "Release Notes",
Expand Down
Loading

0 comments on commit 7783b40

Please sign in to comment.