Skip to content

Commit 7afe7b7

Browse files
Merge pull request #45 from jgsheppa/update_initializer_documentation
Update config example in README
2 parents c1c666a + 855ae7d commit 7afe7b7

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,24 @@ This gem wraps the standalone executable version of the [Litestream](https://lit
5252

5353
Supported platforms are:
5454

55-
* arm64-darwin (macos-arm64)
56-
* x86_64-darwin (macos-x64)
57-
* arm64-linux (linux-arm64)
58-
* x86_64-linux (linux-x64)
55+
- arm64-darwin (macos-arm64)
56+
- x86_64-darwin (macos-x64)
57+
- arm64-linux (linux-arm64)
58+
- x86_64-linux (linux-x64)
5959

6060
### Using a local installation of `litestream`
6161

6262
If you are not able to use the vendored standalone executables (for example, if you're on an unsupported platform), you can use a local installation of the `litestream` executable by setting an environment variable named `LITESTREAM_INSTALL_DIR` to the directory containing the executable.
6363

6464
For example, if you've installed `litestream` so that the executable is found at `/usr/local/bin/litestream`, then you should set your environment variable like so:
6565

66-
``` sh
66+
```sh
6767
LITESTREAM_INSTALL_DIR=/usr/local/bin
6868
```
6969

7070
This also works with relative paths. If you've installed into your app's directory at `./.bin/litestream`:
7171

72-
``` sh
72+
```sh
7373
LITESTREAM_INSTALL_DIR=.bin
7474
```
7575

@@ -95,11 +95,12 @@ dbs:
9595
The gem also provides a default initializer file at `config/initializers/litestream.rb` that allows you to configure these four environment variables referenced in the configuration file in Ruby. By providing a Ruby interface to these environment variables, you can use any method of storing secrets that you prefer. For example, the default generated file uses Rails' encrypted credentials to store your secrets:
9696

9797
```ruby
98-
litestream_credentials = Rails.application.credentials.litestream
99-
Litestream.configure do |config|
100-
config.replica_bucket = litestream_credentials.replica_bucket
101-
config.replica_key_id = litestream_credentials.replica_key_id
102-
config.replica_access_key = litestream_credentials.replica_access_key
98+
Rails.application.configure do
99+
litestream_credentials = Rails.application.credentials.litestream
100+
101+
config.litestream.replica_bucket = litestream_credentials&.replica_bucket
102+
config.litestream.replica_key_id = litestream_credentials&.replica_key_id
103+
config.litestream.replica_access_key = litestream_credentials&.replica_access_key
103104
end
104105
```
105106

@@ -276,7 +277,7 @@ end
276277

277278
There is only one screen in the dashboard.
278279

279-
* the show view of the Litestream replication process:
280+
- the show view of the Litestream replication process:
280281

281282
![screenshot of the single page in the web dashboard, showing details of the Litestream replication process](images/show-screenshot.png)
282283

0 commit comments

Comments
 (0)