File tree 2 files changed +17
-17
lines changed
2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -8,19 +8,21 @@ ENV CRYFS_FRONTEND="noninteractive" \
8
8
CRYFS_FRONTEND=noninteractive \
9
9
CRYFS_NO_UPDATE_CHECK=true \
10
10
TINI_SUBREAPER="" \
11
- DEBIAN_FRONTEND=noninteractive
12
- RUN apt-get update && apt-get --no-install-recommends install -y build-essential
11
+ DEBIAN_FRONTEND=noninteractive \
12
+ CRYFS_LOCAL_STATE_DIR=/data
13
+ VOLUME [ "/encrypted" , "/decrypted" , "/data" ]
14
+ RUN apt-get update --no-install-recommends && apt-get upgrade --no-install-recommends -y
15
+ # && apt-get --no-install-recommends install -y build-essential
13
16
RUN apt-get --no-install-recommends install cryfs fuse tini -y &&\
14
17
useradd -s /usr/sbin/nologin -m secretfs && passwd -d secretfs &&\
15
18
echo 'nonroot ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers &&\
16
19
echo user_allow_other >> /etc/fuse.conf &&\
17
20
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
18
21
WORKDIR /app
19
- VOLUME [ "/encrypted" , "/decrypted" ]
20
-
21
22
COPY run.sh /usr/bin/run.sh
22
23
RUN chmod +x /usr/bin/run.sh
23
24
USER nobody:nobody
25
+
24
26
# Set the entrypoint and default command
25
27
ENTRYPOINT ["/usr/bin/tini" , "-g" , "--" ]
26
28
CMD ["/usr/bin/run.sh" ]
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
-
4
- ENC_PATH=/encrypted
5
- DEC_PATH=/decrypted
3
+ set -o nounset
4
+ declare -r ENC_PATH=/encrypted
5
+ declare -r DEC_PATH=/decrypted
6
6
7
7
# Define colors
8
- RED=' \033[0;31m'
9
- GREEN=' \033[0;32m'
10
- YELLOW=' \033[0;33m'
11
- BLUE=' \033[0;34m'
12
- RESET=' \033[0m'
8
+ declare -r RED=' \033[0;31m'
9
+ declare -r GREEN=' \033[0;32m'
10
+ declare -r YELLOW=' \033[0;33m'
11
+ declare -r BLUE=' \033[0;34m'
12
+ declare -r RESET=' \033[0m'
13
13
14
14
# Debug function with colorized output
15
15
debug () {
@@ -62,19 +62,17 @@ function sighup_handler {
62
62
trap sigterm_handler SIGINT SIGTERM
63
63
trap sighup_handler SIGHUP
64
64
65
- debug " $( mask_string " $PASSWD " ) "
66
-
67
65
_user=" $( id -u -n) "
68
66
_uid=" $( id -u) "
69
67
debug " Running as $_user with UID: $_uid "
70
-
68
+ sleep infinity
71
69
unset pid
72
70
if [ ! -z " $PASSWD " ]; then
73
- debug " mounting ${ENC_PATH} on ${DEC_PATH} "
71
+ info " mounting ${ENC_PATH} on ${DEC_PATH} with password: " $( mask_string " $PASSWD " , " * " ) " "
74
72
echo " ${PASSWD} " | cryfs -o ${MOUNT_OPTIONS} -f " ${ENC_PATH} " " ${DEC_PATH} " & pid=($! )
75
73
else
76
74
cryfs ${ENCFS_OPTS} -o ${MOUNT_OPTIONS} -f " ${ENC_PATH} " " ${DEC_PATH} " & pid=($! )
77
- info " mounting ${ENC_PATH} on ${DEC_PATH} "
75
+ info " mounting ${ENC_PATH} on ${DEC_PATH} without password "
78
76
fi
79
77
wait " ${pid} "
80
78
You can’t perform that action at this time.
0 commit comments