Nextjournal / Aug 13 2020
S3 / GCS access

This repo is mounted by: s3fs
apt-get updateapt-get install fuse automake build-essential make libcurl4 libcurl4-openssl-dev libxml2 libxml2-dev mime-support openssl libssl-dev libfuse-dev libtool pkg-config # patch s3fs-fusecp -r /s3fs-fuse /s3fs-fuse-patchedcd /s3fs-fuse-patchedgit checkout gcs-directories./autogen.sh./configuremakemake installapt-get remove automake build-essential libcurl4-openssl-dev libxml2-dev libssl-dev libfuse-dev pkg-configapt-get autoremoverm -fr /s3fs-fuse-patched90.3s
s3fs (Bash)
S3 type ("S3" or "GCS")
my-bucket Bucket Name ("my-bucket")
nil directory (e.g. bar)
nil secret (access_key_id:****)
true readonly? (true)
SECRET="${SECRET-_}"MOUNT_DIR="/volumes/${MOUNT_DIR:=_}"BUCKET="${BUCKET:=_}"BUCKET_TYPE="${BUCKET_TYPE-_}"READONLY="${READONLY:=_}"case "$BUCKET" in *.*) bucket_options="-o use_path_request_style" ;; *) bucket_options="" ;;esac if [ -n "$SECRET" ]; then echo "$SECRET" | tr -d '[:space:]' > ~/.passwd-s3fs chmod 600 ~/.passwd-s3fs credentials_file_option=" -o passwd_file=/root/.passwd-s3fs"else credentials_file_option=" -o public_bucket=1"fiif [ "$READONLY" = "false" ]; then readonly_option=""else readonly_option=" -oro"fiif cat /proc/mounts | grep "${MOUNT_DIR} " >/dev/null 2>/dev/null; then umount -vf "$MOUNT_DIR" fimkdir -p "$MOUNT_DIR"if [ "$BUCKET_TYPE" = "GCS" ]; then s3fs "$BUCKET" "$MOUNT_DIR" \ ${credentials_file_option} \ ${readonly_option} \ -o sigv2 \ -o nomultipart \ -o allow_other \ -o complement_stat \ -o url=https://storage.googleapis.com stat "$MOUNT_DIR" || :else # S3 s3fs "$BUCKET" "$MOUNT_DIR" \ ${credentials_file_option} \ ${readonly_option} ${bucket_options}fi1.1s
Bash
s3fs