Skip to content

Commit f9321bc

Browse files
committed
Update README
1 parent 2a5ae1d commit f9321bc

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

README.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# swift-http-import
22

33
* [Why this instead of rclone?](#why-this-instead-of-rclone)
4-
* [Do NOT use if...](#do-not-use-if)
4+
* [Do NOT use if\.\.\.](#do-not-use-if)
55
* [Implicit assumptions](#implicit-assumptions)
66
* [Installation](#installation)
77
* [Usage](#usage)
8+
* [Specifying sensitive info as environment variables](#specifying-sensitive-info-as-environment-variables)
89
* [Alternative authentication options](#alternative-authentication-options)
910
* [Source specification](#source-specification)
1011
* [Yum](#yum)
@@ -106,8 +107,13 @@ jobs:
106107
object_prefix: ubuntu-repos
107108
```
108109
109-
The first paragraph contains the authentication parameters for OpenStack's Identity v3 API. Optionally a `region_name`
110-
can be specified, but this is only required if there are multiple regions to choose from.
110+
The first paragraph contains the authentication parameters for
111+
OpenStack's Identity v3 API. Optionally a `region_name` can be specified, but this is only
112+
required if there are multiple regions to choose from.
113+
114+
You can use the `fromEnv` special syntax for the `to.container`, `to.object_prefix`, and
115+
the Swift fields (options under the `swift` key).
116+
See [specifying sensitive info as environment variables](#specifying-sensitive-info-as-environment-variables) for more details.
111117

112118
Each sync job contains the source URL as `from.url`, and `to.container` has the target container name, optionally paired with an
113119
object name prefix in the target container. For example, in the case above, the file
@@ -124,6 +130,21 @@ ubuntu-repos/pool/main/p/pam/pam_1.1.8.orig.tar.gz
124130
125131
The order of jobs is significant: Source trees will be scraped in the order indicated by the `jobs` list.
126132
133+
### Specifying sensitive info as environment variables
134+
135+
For some config fields, instead of specifying the value as plain text, you can use the
136+
special `fromEnv` syntax to read the respective value from an exported environment
137+
variable.
138+
139+
For example, instead of specifying the `swift.password` as plain text, you can use the
140+
following syntax to retrieve the password from the `OS_PASSWORD` environment variable:
141+
142+
```yaml
143+
swift:
144+
password: { fromEnv: OS_PASSWORD }
145+
...
146+
```
147+
127148
### Alternative authentication options
128149

129150
Instead of password-based authentication, [application credentials][app-cred] can also be used, for example:
@@ -139,13 +160,6 @@ jobs: ...
139160
140161
[app-cred]: https://docs.openstack.org/python-openstackclient/latest/cli/command-objects/application-credentials.html
141162
142-
Instead of providing your secret credentials as plain text in the config file, you can use a special syntax for the
143-
`password` field or the `application_credential_secret` field to read the respective password from an exported
144-
environment variable:
145-
146-
```yaml
147-
password: { fromEnv: ENVIRONMENT_VARIABLE }
148-
```
149163
150164
### Source specification
151165
@@ -254,8 +268,8 @@ Since GitHub's API rate limits the number of requests per IP therefore it is
254268
field. Refer to the [GitHub API docs](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting)
255269
for more info on its rate limiting. This field is **required** if the repository is hosted on a Github Enterprise instance instead of `github.com`.
256270
Instead of providing your token as plain text in the config file, you can use the
257-
`fromEnv` special syntax for the `jobs[].from.token` field. See [Alternative
258-
authentication options](#alternative-authentication-options) for more details.
271+
`fromEnv` special syntax for the `jobs[].from.token` field. See
272+
[specifying sensitive info as environment variables](#specifying-sensitive-info-as-environment-variables) for more details.
259273

260274
If a repository publishes GitHub releases using different tags, e.g. server components at
261275
`server-x.y.z` and client at `client-x.y.z`, and you only want to get releases whose tag
@@ -301,6 +315,10 @@ jobs:
301315
object_prefix: ubuntu-repos
302316
```
303317

318+
For defining Swift options, you can use the `fromEnv` special syntax for all the fields
319+
under the `from` key instead of specifying these fields as plain text. See
320+
[specifying sensitive info as environment variables](#specifying-sensitive-info-as-environment-variables)
321+
304322
### File selection
305323

306324
#### By name

0 commit comments

Comments
 (0)