Skip to content

Commit c90a6a8

Browse files
committed
Added option to disable encryption. Encryption is default
1 parent ccad656 commit c90a6a8

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ RUN apt-get update && apt-get install -y \
2929
####################
3030
# ENVIRONMENT VARIABLES
3131
####################
32+
# Encryption
33+
ENV ENCRYPT_MEDIA "1"
34+
3235
# Rclone
3336
ENV BUFFER_SIZE "500M"
3437
ENV MAX_READ_AHEAD "30G"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Volumes:
5555
* `-v /cloud-decrypt` - Cloud files decrypted with Rclone - Append **:shared**
5656

5757
Environment variables:
58+
* `-e ENCRYPT_MEDIA` - If media is or should be encrypted. 0 means no encryption and 1 means encryption (default **1**)
5859
* `-e BUFFER_SIZE` - Rclone: Buffer size when copying files (default **500M**)
5960
* `-e MAX_READ_AHEAD` - Rclone: The number of bytes that can be prefetched for sequential reads (default **30G**)
6061
* `-e CHECKERS` - Rclone: Number of checkers to run in parallel (default **16**)

scripts/mount.script

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@
1111
# FUNCTIONS
1212
###############################################################################
1313
mount_gdrive () {
14+
cloud_dir="${cloud_encrypt_dir}"
15+
if [ "$(printenv ENCRYPT_MEDIA)" -eq "0" ]; then
16+
cloud_dir="${cloud_decrypt_dir}"
17+
fi
18+
1419
# Make sure GD mountpoint exists.
15-
if [ ! -d "${cloud_encrypt_dir}" ]; then
16-
mkdir -p "${cloud_encrypt_dir}"
20+
if [ ! -d "${cloud_dir}" ]; then
21+
mkdir -p "${cloud_dir}"
1722
fi
1823

1924
# Make sure Plexdrive temp folder exists.
@@ -23,10 +28,10 @@ mount_gdrive () {
2328

2429
# Mount GD if not already mounted.
2530
if [ $(ps -ef | grep "plexdrive" | grep -v "grep" | wc -l) == "0" ]; then
26-
echo "[ $(date $(printenv DATE_FORMAT)) ] Mounting Google Drive mountpoint: ${cloud_encrypt_dir}"
27-
screen -dmS plexdrive plexdrive $mongo $plexdrive_options "${cloud_encrypt_dir}"
31+
echo "[ $(date $(printenv DATE_FORMAT)) ] Mounting Google Drive mountpoint: ${cloud_dir}"
32+
screen -dmS plexdrive plexdrive $mongo $plexdrive_options "${cloud_dir}"
2833
else
29-
echo "[ $(date $(printenv DATE_FORMAT)) ] Google Drive mountpoint: ${cloud_encrypt_dir} already mounted."
34+
echo "[ $(date $(printenv DATE_FORMAT)) ] Google Drive mountpoint: ${cloud_dir} already mounted."
3035
fi
3136
}
3237

@@ -73,6 +78,8 @@ if pidof -o %PPID -x "$(basename "$0")"; then
7378
echo "[ $(date $(printenv DATE_FORMAT)) ] Mount already in progress. Aborting."
7479
else
7580
mount_gdrive
76-
mount_local_media
81+
if [ "$(printenv ENCRYPT_MEDIA)" != "0" ]; then
82+
mount_local_media
83+
fi
7784
mount_union
7885
fi

0 commit comments

Comments
 (0)