Skip to content

Commit

Permalink
Merge pull request fog#207 from palladius/master
Browse files Browse the repository at this point in the history
Adding .fog.example and amending docs
  • Loading branch information
icco authored May 7, 2017
2 parents 52bc06d + b75c4d9 commit 98db230
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 18 deletions.
27 changes: 27 additions & 0 deletions .fog.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
##################################################################
# This is configuration snippet to configure Google Cloud Platform
# for fog library.
#
# 1. Copy this file into your home dir: "~/.fog":
#
# $ cat .fog.example >> ~/.fog
#
# 2. Follow instructions to generate a private key:
# 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
#################################################################
24 changes: 6 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +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
```

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.
cat .fog.example >> ~/.fog # appends the sample configuration
vim ~/.fog # edit file with yout config


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

Expand All @@ -94,7 +82,7 @@ If you want to be able to bootstrap SSH-able instances, (using `servers.bootstra

Once you've specified your credentials, you should be good to go!
```
λ bundle exec pry
$ bundle exec pry
[1] pry(main)> require 'fog/google'
=> true
[2] pry(main)> connection = Fog::Compute::Google.new
Expand All @@ -106,4 +94,4 @@ Once you've specified your credentials, you should be good to go!

## Contributing

See `CONTRIBUTING.md` in this repository.
See `CONTRIBUTING.md` in this repository.

0 comments on commit 98db230

Please sign in to comment.