Skip to content

Commit c4bd4d1

Browse files
committed
try to contain path traversal better
1 parent 386253f commit c4bd4d1

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

service/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ COPY --from=builder /root/.local/bin /service
4646
COPY --from=builder /app/config /service/config
4747

4848
COPY --from=builder /app/static /service/static
49-
RUN chown -R service:service /service/static
49+
RUN mkdir -p /data/uploads
50+
RUN chown -R service:service /service/static /data
5051

5152
COPY cleanup/cleanup.sh /service/cleanup.sh
5253
RUN chmod +x /service/cleanup.sh

service/docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
services:
44
timetype:
55
build: .
6+
read_only: true
67
volumes:
78
- ./data:/data:rw
9+
tmpfs:
10+
- /var/run
11+
- /service/static/tmp
812
ports:
913
- "4711:3000"
1014
restart: unless-stopped
1115
environment:
16+
# Yesod
1217
YESOD_PORT: 3000
1318
YESOD_HOST: 0.0.0.0
1419
YESOD_DATA_DIR: /data

service/entrypoint.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
set -e
33
set -x
44

5-
chown -R service:service "/data/"
6-
75
cron
86

97
exec su -s /bin/sh -c '/service/timetype' service

0 commit comments

Comments
 (0)