Skip to content

Commit

Permalink
mount helper: add support for a key file option.
Browse files Browse the repository at this point in the history
This is pull request #182 from vaygr/key_file-fstab.
  • Loading branch information
jacobsa committed Aug 15, 2016
2 parents b086bc3 + b19ffd8 commit 8128102
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/mounting.md
Expand Up @@ -22,6 +22,10 @@ Console:

GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json gcsfuse [...]

When mounting with an fstab entry, you can use the `key_file` option. For example:

my-bucket /mount/point gcsfuse rw,noauto,user,key_file=/path/to/key.json

[gce]: https://cloud.google.com/compute/
[gce-service-accounts]: https://cloud.google.com/compute/docs/authentication
[gcloud tool]: https://cloud.google.com/sdk/gcloud/
Expand Down Expand Up @@ -97,6 +101,7 @@ with dashes instead of underscores:
* `implicit_dirs`
* `dir_mode`
* `file_mode`
* `key_file`

On both OS X and Linux, you can also add entries to your `/etc/fstab` file like
the following:
Expand Down
8 changes: 8 additions & 0 deletions tools/mount_gcsfuse/main.go
Expand Up @@ -86,6 +86,14 @@ func makeGcsfuseArgs(
"--"+strings.Replace(name, "_", "-", -1),
)

// Special case: support mount-like formatting for gcsfuse string flags.
case "key_file":
args = append(
args,
"--"+strings.Replace(name, "_", "-", -1),
value,
)

// Special case: support mount-like formatting for gcsfuse string flags.
case "dir_mode", "file_mode":
args = append(
Expand Down

0 comments on commit 8128102

Please sign in to comment.