Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinatorTime committed Dec 17, 2024
1 parent 56c7793 commit 1794015
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ENV ROCKET_PROFILE=release \
ADMIN_SESSION_LIFETIME=3 \
REQUIRE_DEVICE_EMAIL=false \
R2_DATA_SYNC_LOG=false \
SYNC_DATA_CLOUDFLARE_R2=${SYNC_DATA_CLOUDFLARE_R2} \
FLY_SWAP=false

# Install dependencies and set timezone
Expand Down
53 changes: 26 additions & 27 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,33 @@ else
fi

if [[ "$SYNC_DATA_CLOUDFLARE_R2" == "true" ]]; then
# Configure Rclone
mkdir -p /root/.config/rclone
chmod 700 /root/.config/rclone

cat << EOF > /root/.config/rclone/rclone.conf
[Cloudflare]
type = s3
provider = Cloudflare
access_key_id = $CF_ACCESS_KEY
secret_access_key = $CF_ACCESS_KEY_SECRET
region = auto
endpoint = $CF_R2_ENDPOINT
acl = private
no_check_bucket = true
EOF
chmod 600 /root/.config/rclone/rclone.conf
mkdir -p /data
chmod 700 /data
REMOTE_NAME="Cloudflare"
REMOTE_PATH="vaultwarden-data/data"
rclone copy $REMOTE_NAME:$REMOTE_PATH ./data
echo "Data sync complete."
# Configure Rclone
mkdir -p /root/.config/rclone
chmod 700 /root/.config/rclone

cat << EOF > /root/.config/rclone/rclone.conf
[Cloudflare]
type = s3
provider = Cloudflare
access_key_id = $CF_ACCESS_KEY
secret_access_key = $CF_ACCESS_KEY_SECRET
region = auto
endpoint = $CF_R2_ENDPOINT
acl = private
no_check_bucket = true
EOF
chmod 600 /root/.config/rclone/rclone.conf

mkdir -p /data
chmod 700 /data

REMOTE_NAME="Cloudflare"
REMOTE_PATH="vaultwarden-data/data"

rclone copy $REMOTE_NAME:$REMOTE_PATH ./data
echo "Data synced from R2"
else
echo "Skipping data sync."
echo "Skipping data sync from R2"
fi

# Run the original entrypoint
Expand Down

0 comments on commit 1794015

Please sign in to comment.