Skip to content

Commit 1fce8da

Browse files
committed
bump selkies, block downloads properly, fix icon copies, make sure downloads are not rendered in browser
1 parent 42a56c4 commit 1fce8da

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN \
1616
https://github.com/selkies-project/selkies.git \
1717
/src && \
1818
cd /src && \
19-
git checkout -f 7cf9ad486b370d856a721a4dc2cc6c7a7823cb74
19+
git checkout -f f143e7b8006d98e4bea47f39ebb5e1b3053f34f4
2020

2121
RUN \
2222
echo "**** build shared core library ****" && \
@@ -186,7 +186,7 @@ RUN \
186186
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
187187
curl -o \
188188
/tmp/selkies.tar.gz -L \
189-
"https://github.com/selkies-project/selkies/archive/7cf9ad486b370d856a721a4dc2cc6c7a7823cb74.tar.gz" && \
189+
"https://github.com/selkies-project/selkies/archive/f143e7b8006d98e4bea47f39ebb5e1b3053f34f4.tar.gz" && \
190190
cd /tmp && \
191191
tar xf selkies.tar.gz && \
192192
cd selkies-* && \

Dockerfile.aarch64

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN \
1616
https://github.com/selkies-project/selkies.git \
1717
/src && \
1818
cd /src && \
19-
git checkout -f 7cf9ad486b370d856a721a4dc2cc6c7a7823cb74
19+
git checkout -f f143e7b8006d98e4bea47f39ebb5e1b3053f34f4
2020

2121
RUN \
2222
echo "**** build shared core library ****" && \
@@ -184,7 +184,7 @@ RUN \
184184
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
185185
curl -o \
186186
/tmp/selkies.tar.gz -L \
187-
"https://github.com/selkies-project/selkies/archive/7cf9ad486b370d856a721a4dc2cc6c7a7823cb74.tar.gz" && \
187+
"https://github.com/selkies-project/selkies/archive/f143e7b8006d98e4bea47f39ebb5e1b3053f34f4.tar.gz" && \
188188
cd /tmp && \
189189
tar xf selkies.tar.gz && \
190190
cd selkies-* && \

root/defaults/default.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ server {
4343
fancyindex_footer SUBFOLDERnginx/footer.html;
4444
fancyindex_header SUBFOLDERnginx/header.html;
4545
alias REPLACE_DOWNLOADS_PATH/;
46+
if (-f $request_filename) {
47+
add_header Content-Disposition "attachment";
48+
add_header X-Content-Type-Options "nosniff";
49+
}
4650
}
4751
error_page 500 502 503 504 /50x.html;
4852
location = SUBFOLDER50x.html {
@@ -97,6 +101,10 @@ server {
97101
fancyindex_footer SUBFOLDERnginx/footer.html;
98102
fancyindex_header SUBFOLDERnginx/header.html;
99103
alias REPLACE_DOWNLOADS_PATH/;
104+
if (-f $request_filename) {
105+
add_header Content-Disposition "attachment";
106+
add_header X-Content-Type-Options "nosniff";
107+
}
100108
}
101109
error_page 500 502 503 504 /50x.html;
102110
location = SUBFOLDER50x.html {

root/etc/s6-overlay/s6-rc.d/init-nginx/run

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ CUSER="${CUSTOM_USER:-abc}"
1111
SFOLDER="${SUBFOLDER:-/}"
1212
FILE_MANAGER_PATH="${FILE_MANAGER_PATH:-$HOME/Desktop}"
1313
DASHBOARD="${DASHBOARD:-selkies-dashboard}"
14+
SELKIES_FILE_TRANSFERS="${SELKIES_FILE_TRANSFERS:-upload,download}"
15+
HARDEN_DESKTOP="${HARDEN_DESKTOP:-false}"
1416

1517
# create self signed cert
1618
if [ ! -f "/config/ssl/cert.pem" ]; then
@@ -31,7 +33,10 @@ sed -i "s/3001/$CHPORT/g" ${NGINX_CONFIG}
3133
sed -i "s/CWS/$CWS/g" ${NGINX_CONFIG}
3234
sed -i "s|SUBFOLDER|$SFOLDER|g" ${NGINX_CONFIG}
3335
sed -i "s|REPLACE_DOWNLOADS_PATH|$FILE_MANAGER_PATH|g" ${NGINX_CONFIG}
34-
s6-setuidgid abc mkdir -p $HOME/Desktop
36+
s6-setuidgid abc mkdir -p ${FILE_MANAGER_PATH}
37+
if [[ $SELKIES_FILE_TRANSFERS != *"download"* ]] || [[ ${HARDEN_DESKTOP,,} == "true" ]]; then
38+
sed -i '/files {/,/}/d' ${NGINX_CONFIG}
39+
fi
3540
if [ ! -z ${DISABLE_IPV6+x} ]; then
3641
sed -i '/listen \[::\]/d' ${NGINX_CONFIG}
3742
fi
@@ -55,8 +60,10 @@ cp -a \
5560
sed -i "s|REPLACE_DOWNLOADS_PATH|$FILE_MANAGER_PATH|g" /usr/share/selkies/web/nginx/footer.html
5661
cp \
5762
/usr/share/selkies/www/icon.png \
58-
/usr/share/selkies/$DASHBOARD/favicon.ico \
59-
/usr/share/selkies/$DASHBOARD/icon.png
63+
/usr/share/selkies/web/favicon.ico
64+
cp \
65+
/usr/share/selkies/www/icon.png \
66+
/usr/share/selkies/web/icon.png
6067
# manifest creation
6168
echo "{
6269
\"name\": \"${TITLE}\",

0 commit comments

Comments
 (0)