From b75c4d9ae589c02fe2cfe13ad8392c106403caca Mon Sep 17 00:00:00 2001 From: Riccardo Carlesso Date: Sat, 8 Apr 2017 13:08:53 +0200 Subject: [PATCH] better docs and DRYing config out of README --- .fog.example | 31 +++++++++++++++++++++++-------- README.md | 22 ++++------------------ 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.fog.example b/.fog.example index bc3fa86f4c..3779e753a1 100644 --- a/.fog.example +++ b/.fog.example @@ -1,12 +1,27 @@ -##################################################### +################################################################## # This is configuration snippet to configure Google Cloud Platform -# for fig library. +# for fog library. +# +# 1. Copy this file into your home dir: "~/.fog": +# +# $ cat .fog.example >> ~/.fog # -# 1. Copy this file into your home dir: "~/.fog" # 2. Follow instructions to generate a private key: -# https://cloud.google.com/storage/docs/authentication#generating-a-private-key - -my_credential: - google_project: my-project - google_client_email: xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com +# https://cloud.google.com/storage/docs/authentication#generating-a-private-key +# +# 3. Edit the new file accordingly. +# +################################################################## +# START GOOGLE CONFIG +my_google_credentials: + google_project: my-project-id + google_client_email: xxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com google_json_key_location: /path/to/my-project-xxxxxxxxxxxx.json + # You can also provide service account credentials with `google_json_key_string` or + # with `google_key_location` and `google_key_string` for P12 private keys. + # If so, uncomment the two following lines. + # HMAC credentials follow a similar format: + #google_storage_access_key_id: GOOGXXXXXXXXXXXXXXXX + #google_storage_secret_access_key: XXXX+XXX/XXXXXXXX+XXXXXXXXXXXXXXXXXXXXX +# /END GOOGLE CONFIG +################################################################# \ No newline at end of file diff --git a/README.md b/README.md index 4ef1bbc48e..4df10d362d 100644 --- a/README.md +++ b/README.md @@ -67,26 +67,12 @@ $ gem install fog-google #### Credentials -Follow the [instructions to generate a private key](https://cloud.google.com/storage/docs/authentication#generating-a-private-key). You can then create a fog credentials file at `~/.fog`, which will look something like this: +Follow the [instructions to generate a private key](https://cloud.google.com/storage/docs/authentication#generating-a-private-key). A sample credentials file can be found in `.fog.example` in this directory: -``` -my_credential: - google_project: my-project - google_client_email: xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com - google_json_key_location: /path/to/my-project-xxxxxxxxxxxx.json -``` - -Or simply `cat .fog.example >> ~.fog` and edit parameters in the file. + cat .fog.example >> ~/.fog # appends the sample configuration + vim ~/.fog # edit file with yout config + -You can also provide service account credentials with `google_json_key_string` or with `google_key_location` and `google_key_string` for P12 private keys. - -HMAC credentials follow a similar format: - -``` -my_credentials: - google_storage_access_key_id: GOOGXXXXXXXXXXXXXXXX - google_storage_secret_access_key: XXXX+XXX/XXXXXXXX+XXXXXXXXXXXXXXXXXXXXX -``` #### SSH-ing into instances