From 2234feb23d1f9c50e94ad1c5b2d854282748cc03 Mon Sep 17 00:00:00 2001 From: Fjodor42 Date: Sun, 2 Jul 2023 12:16:07 +0200 Subject: [PATCH] jottacloud: add Onlime provider --- backend/jottacloud/jottacloud.go | 22 ++++++++++++++++++++++ docs/content/jottacloud.md | 17 +++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/backend/jottacloud/jottacloud.go b/backend/jottacloud/jottacloud.go index ea83a5932..0e6f087ed 100644 --- a/backend/jottacloud/jottacloud.go +++ b/backend/jottacloud/jottacloud.go @@ -74,6 +74,10 @@ const ( tele2CloudTokenURL = "https://mittcloud-auth.tele2.se/auth/realms/comhem/protocol/openid-connect/token" tele2CloudAuthURL = "https://mittcloud-auth.tele2.se/auth/realms/comhem/protocol/openid-connect/auth" tele2CloudClientID = "desktop" + + onlimeCloudTokenURL = "https://cloud-auth.onlime.dk/auth/realms/onlime_wl/protocol/openid-connect/token" + onlimeCloudAuthURL = "https://cloud-auth.onlime.dk/auth/realms/onlime_wl/protocol/openid-connect/auth" + onlimeCloudClientID = "desktop" ) // Register with Fs @@ -139,6 +143,9 @@ func Config(ctx context.Context, name string, m configmap.Mapper, config fs.Conf }, { Value: "tele2", Help: "Tele2 Cloud authentication.\nUse this if you are using Tele2 Cloud.", + }, { + Value: "onlime", + Help: "Onlime Cloud authentication.\nUse this if you are using Onlime Cloud.", }}) case "auth_type_done": // Jump to next state according to config chosen @@ -261,6 +268,21 @@ machines.`) RedirectURL: oauthutil.RedirectLocalhostURL, }, }) + case "onlime": // onlime cloud config + m.Set("configVersion", fmt.Sprint(configVersion)) + m.Set(configClientID, onlimeCloudClientID) + m.Set(configTokenURL, onlimeCloudTokenURL) + return oauthutil.ConfigOut("choose_device", &oauthutil.Options{ + OAuth2Config: &oauth2.Config{ + Endpoint: oauth2.Endpoint{ + AuthURL: onlimeCloudAuthURL, + TokenURL: onlimeCloudTokenURL, + }, + ClientID: onlimeCloudClientID, + Scopes: []string{"openid", "jotta-default", "offline_access"}, + RedirectURL: oauthutil.RedirectLocalhostURL, + }, + }) case "choose_device": return fs.ConfigConfirm("choose_device_query", false, "config_non_standard", `Use a non-standard device/mountpoint? Choosing no, the default, will let you access the storage used for the archive diff --git a/docs/content/jottacloud.md b/docs/content/jottacloud.md index 787396919..44db179ac 100644 --- a/docs/content/jottacloud.md +++ b/docs/content/jottacloud.md @@ -14,6 +14,8 @@ it also provides white-label solutions to different companies, such as: * Telia Sky (sky.telia.no) * Tele2 * Tele2 Cloud (mittcloud.tele2.se) +* Onlime + * Onlime Cloud Storage (onlime.dk) * Elkjøp (with subsidiaries): * Elkjøp Cloud (cloud.elkjop.no) * Elgiganten Sweden (cloud.elgiganten.se) @@ -84,6 +86,18 @@ Tele2 Cloud customers as no support for creating a CLI token exists, and additio authentication flow where the username is generated internally. To setup rclone to use Tele2 Cloud, choose Tele2 Cloud authentication in the setup. The rest of the setup is identical to the default setup. +### Onlime Cloud Storage authentication + +Onlime has sold access to Jottacloud proper, while providing localized support to Danish Customers, but +have recently set up their own hosting, transferring their customers from Jottacloud servers to their +own ones. + +This, of course, necessitates using their servers for authentication, but otherwise functionality and +architecture seems equivalent to Jottacloud. + +To setup rclone to use Onlime Cloud Storage, choose Onlime Cloud authentication in the setup. The rest +of the setup is identical to the default setup. + ## Configuration Here is an example of how to make a remote called `remote` with the default setup. First run: @@ -127,6 +141,9 @@ Press Enter for the default (standard). / Tele2 Cloud authentication. 4 | Use this if you are using Tele2 Cloud. \ (tele2) + / Onlime Cloud authentication. + 5 | Use this if you are using Onlime Cloud. + \ (onlime) config_type> 1 Personal login token. Generate here: https://www.jottacloud.com/web/secure