From 52d7f4151b85d59801a0a410828a470eb08483c6 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Mon, 27 Nov 2023 08:02:57 +0000 Subject: [PATCH] docs: info on how to mount s3 using s3fs (fusefs) --- docs/dev/Backend.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/docs/dev/Backend.md b/docs/dev/Backend.md index fe6cf0f255..a060fc229e 100644 --- a/docs/dev/Backend.md +++ b/docs/dev/Backend.md @@ -217,6 +217,47 @@ Creating a new release during development may not always be feasible. > Note: this is useful for debugging features during active development. +## Accessing S3 Files use s3fs + +The s3fs tool allows you to mount an S3 bucket on your filesystem, +to browse like any other directory. + +Install: + +```bash +sudo apt update +sudo apt install s3fs +``` + +Create a credentials file: + +```bash +# Replace ACCESS_KEY_ID and SECRET_ACCESS_KEY +echo ACCESS_KEY_ID:SECRET_ACCESS_KEY > ${HOME}/.passwd-s3fs +chmod 600 ${HOME}/.passwd-s3fs +``` + +Mount your bucket: + +> If you wish for this to be permanent, see below. + +```bash +sudo mkdir /mnt/fmtm/local +sudo chown $(whoami):$(whoami) /mnt/fmtm/local +s3fs fmtm-data /mnt/fmtm/local \ + -o passwd_file=/home/$(whoami)/s3-creds/fmtm-local \ + -o url=http://s3.fmtm.localhost:7050 \ + -o use_path_request_style +``` + +Access the files like a directory under: `/mnt/fmtm/local`. + +To mount permanently, add the following to `/etc/fstab`: + +`fmtm-local /mnt/fmtm/local fuse.s3fs _netdev,allow_other,\ +use_path_request_style,passwd_file=/home/$(whoami)/s3-creds/fmtm-local,\ +url=http://s3.fmtm.localhost:7050 0 0` + ## Running JOSM in the dev stack - Run JOSM with FMTM: