From 71909a403d3ac82e167e1c8821e2226e0018effd Mon Sep 17 00:00:00 2001 From: hadyyasser23 Date: Tue, 8 Jun 2021 14:09:29 +0200 Subject: [PATCH 1/2] feat: add DockerFile and update wipe.sh --- DockerFile | 41 +++++++++++++++++++++++++++++++++++++++++ server/files/wipe.sh | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 DockerFile diff --git a/DockerFile b/DockerFile new file mode 100644 index 0000000..703c0b6 --- /dev/null +++ b/DockerFile @@ -0,0 +1,41 @@ +FROM ubuntu:18.04 + +WORKDIR /usr/src/app + +COPY . . + +USER 0 + +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y git + +RUN apt-get install --yes systemd curl git sudo + +# Kill all the things we don't need +RUN find /etc/systemd/system \ + /lib/systemd/system \ + -path '*.wants/*' \ + -not -name '*journald*' \ + -not -name '*systemd-tmpfiles*' \ + -not -name '*systemd-user-sessions*' \ + -exec rm \{} \; + +RUN mkdir -p /etc/sudoers.d + +RUN systemctl set-default multi-user.target + +RUN alias python=python3 + +RUN apt-get install dialog apt-utils -y + +RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata + +RUN ./server/server-setup.sh -y +COPY ./server/settings.yml ./server/settings.yml +COPY ./client/settings.yml ./client/settings.yml + +EXPOSE 80 +EXPOSE 5000 + +CMD [ "python", "server/server.py" ] \ No newline at end of file diff --git a/server/files/wipe.sh b/server/files/wipe.sh index 77f733b..42075a3 100644 --- a/server/files/wipe.sh +++ b/server/files/wipe.sh @@ -16,9 +16,9 @@ #dryrun=echo while read username homedir; do - $dryrun rm -rf $homedir & while read pid; do $dryrun kill -9 $pid + $dryrun shred -f $homedir & done < <(ps -o pid= -U $username) $dryrun userdel --force $username & done < <(awk -F: '$3 >= 1000 {print $1, $6}' /etc/passwd) From a447b24d5daa1183ff2fd17a4db789301009a3cc Mon Sep 17 00:00:00 2001 From: hadyyasser23 Date: Tue, 22 Jun 2021 01:48:11 +0200 Subject: [PATCH 2/2] upgrade wipe.sh to use shred --- server/files/wipe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/files/wipe.sh b/server/files/wipe.sh index 42075a3..d05ba3d 100644 --- a/server/files/wipe.sh +++ b/server/files/wipe.sh @@ -23,4 +23,4 @@ while read username homedir; do $dryrun userdel --force $username & done < <(awk -F: '$3 >= 1000 {print $1, $6}' /etc/passwd) -wait +wait \ No newline at end of file