Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding .fog.example and amending docs #207

Merged
merged 2 commits into from
May 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.