Skip to content

Commit

Permalink
fix: performance (maybe)
Browse files Browse the repository at this point in the history
  • Loading branch information
thearchitector committed Jul 31, 2023
1 parent 14c1e33 commit e8f91a8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ LABEL org.opencontainers.image.authors="Elias Gabriel <me@eliasfgabriel.com>"
LABEL org.opencontainers.image.source="https://github.com/metabronx/blackstrap_s3"
# LABEL org.opencontainers.image.licenses="MIT"

ENV AWS_S3_MOUNT=/home/blackstrap-user
ENV AWS_S3_URL="https://s3.amazonaws.com"
ENV AWS_S3_AUTHFILE="/opt/s3fs/passwd-s3fs"

RUN apk upgrade && \
apk --no-cache add \
shadow \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

An S3 SFTP-enabled file system bridge.

In conjunction with `sdcli`, Blackstrap S3 automatically configures a local SFTP-enabled S3 bridge for BLOB-based file management.
In conjunction with [sdcli](https://github.com/metabronx/sdcli), Blackstrap S3 automatically configures a local SFTP-enabled S3 bridge for BLOB-based file management.

The created container is intended to **only** be run locally, as the SSH configuration is highly insecure for the benefit of
easier local access.
Expand Down
11 changes: 7 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
#! /usr/bin/env bash

# set up auth file
AWS_S3_AUTHFILE="/opt/s3fs/passwd-s3fs"
echo "${AWS_S3_ACCESS_KEY_ID}:${AWS_S3_SECRET_ACCESS_KEY}" > "${AWS_S3_AUTHFILE}"
chmod 600 "${AWS_S3_AUTHFILE}"

# mount s3 bucket
export AWS_S3_MOUNT=/home/blackstrap-user
S3FS_OPTS=${S3FS_OPTS:-"\
-o storage_class=intelligent_tiering \
-o use_cache=/tmp/s3fs \
-o del_cache \
-o multireq_max=100 \
-o streamupload \
-o max_thread_count=$(nproc) \
-o multipart_size=5 \
-o parallel_count=10 \
-o max_dirty_data=50 \
-o listobjectsv2 \
-o complement_stat \
-o update_parent_dir_stat"}
s3fs ${S3FS_OPTS} \
-o allow_other \
-o passwd_file="${AWS_S3_AUTHFILE}" \
-o url="${AWS_S3_URL}" \
-o url="${AWS_S3_URL:=https://s3.amazonaws.com}" \
"${AWS_S3_BUCKET}" \
"${AWS_S3_MOUNT}"

ls "${AWS_S3_MOUNT}"

# check if it worked
if healthcheck.sh; then
echo "Mounted bucket ${AWS_S3_BUCKET} onto ${AWS_S3_MOUNT}"
echo "Mounted bucket ${AWS_S3_BUCKET} onto /home/blackstrap-user"
exec "$@"
else
echo "Mount failure"
Expand Down
8 changes: 4 additions & 4 deletions sshd_config
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ X11Forwarding no
#PermitTTY yes
PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
TCPKeepAlive no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
Compression no
ClientAliveInterval 50
#ClientAliveCountMax 3
#UseDNS no
UseDNS no
PidFile /etc/ssh/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
Expand Down

0 comments on commit e8f91a8

Please sign in to comment.