Config swif backend with config file

What is the problem you are having with rclone?

I'm trying to connect to a swift backend. I have a env file to export some variables.
Here is the content of my env file :

export OS_AUTH_URL=https://api.pub1.infomaniak.cloud/identity
# With the addition of Keystone we have standardized on the term **project**
# as the entity that owns the resources.
export OS_PROJECT_ID=xxxxxxxx
export OS_PROJECT_NAME="xxxxxxxx"
export OS_USER_DOMAIN_NAME="Default"
if [ -z "$OS_USER_DOMAIN_NAME" ]; then unset OS_USER_DOMAIN_NAME; fi
export OS_PROJECT_DOMAIN_ID="default"
if [ -z "$OS_PROJECT_DOMAIN_ID" ]; then unset OS_PROJECT_DOMAIN_ID; fi
# unset v2.0 items in case set
unset OS_TENANT_ID
unset OS_TENANT_NAME
# In addition to the owning entity (tenant), OpenStack stores the entity
# performing the action as the **user**.
export OS_USERNAME="xxxxxxxx"
# With Keystone you pass the keystone password.
export OS_PASSWORD=xxxxxxxx
# If your configuration has multiple regions, we set that information here.
# OS_REGION_NAME is optional and only valid in certain environments.
export OS_REGION_NAME="dc3-a"
# Don't leave a blank variable, unset it if it was empty
if [ -z "$OS_REGION_NAME" ]; then unset OS_REGION_NAME; fi
export OS_INTERFACE=public
export OS_IDENTITY_API_VERSION=3

In my config file I have

[swift]
type = swift
env_auth = true
auth = https://api.pub1.infomaniak.cloud/identity/v3
auth_version = 3

When I run source swift.sh I can then access to swift: backend.

But using this way, I must run source swift.sh first. That means that the backend will not be reacheable after a reboot.

I tried to put this info into the config file, as shown in the doc

[remote]
type = swift
user = $OS_USERNAME
key = $OS_PASSWORD
auth = $OS_AUTH_URL
tenant = $OS_TENANT_NAME

But this doen't work, because I have this error

rclone lsd remote:
2022/03/05 11:06:23 Failed to create file system for "test:": Bad Request

How can I put the info of swift.sh to rclone config ?
I'm sure it's not related to incorrect password because I copy paste the infos.

Thanks a lot for your help !

I suspect you'll need to put more of the variables in the config file

I assume you put the actual values in the config file, so user = me key = KJkjlkjLKJlkj etc?

Try running with -vv --dump bodies that might give a clue.

Of course I used the real values for each variable.

What I need, is a corresponding table between rclone config variable and swift env variable.

Does it exist?

Forget it, it's written in the doc of rclone. I'll try and keep you informed

Just checking :slight_smile:

I munged this from the docs

config parameter description swift var
application_credential_id Application Credential ID OS_APPLICATION_CREDENTIAL_ID
application_credential_name Application Credential Name OS_APPLICATION_CREDENTIAL_NAME
application_credential_secret Application Credential Secret OS_APPLICATION_CREDENTIAL_SECRET
auth Authentication URL for server OS_AUTH_URL
auth_token Auth Token from alternate authentication - optional OS_AUTH_TOKEN
domain User domain - optional (v3 auth) OS_USER_DOMAIN_NAME
endpoint_type Endpoint type to choose from the service catalogue OS_ENDPOINT_TYPE
key API key or password OS_PASSWORD
region Region name - optional OS_REGION_NAME
storage_url Storage URL - optional OS_STORAGE_URL
tenant Tenant name - optional for v1 auth, this or tenant_id required otherwise OS_TENANT_NAME or OS_PROJECT_NAME
tenant_domain Tenant domain - optional (v3 auth) OS_PROJECT_DOMAIN_NAME
tenant_id Tenant ID - optional for v1 auth, this or tenant required otherwise OS_TENANT_ID
user User name to log in OS_USERNAME
user_id User ID to log in - optional - most swift systems use user and leave this blank (v3 auth) OS_USER_ID

swift is really annoying - I can never work out exactly which ones of those credentials will be needed!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.