Skip to content

Commit

Permalink
Fixes sobolevn#291 ... remove extra changes newline
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonCsSanders committed Dec 28, 2018
1 parent 14eea46 commit 8789269
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 2 deletions.
66 changes: 66 additions & 0 deletions Dockerfile-kitchen20181228-62002-1pbt41w
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
FROM debian:stable

ENV DEBIAN_FRONTEND="noninteractive" container="docker"

RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
apt-utils \
curl \
locales \
lsb-release \
net-tools \
openssh-server \
python-pip \
python2.7 \
sudo \
systemd \
&& pip install --upgrade pip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& if ! getent passwd kitchen; then \
useradd -d /home/kitchen -m -s /bin/bash -p '*' kitchen; \
fi \
&& echo "kitchen ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
&& echo "Defaults !requiretty" >> /etc/sudoers \
&& mkdir -p /home/kitchen/.ssh \
&& chown -R kitchen /home/kitchen/.ssh \
&& chmod 0700 /home/kitchen/.ssh \
&& echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCydNsPAZszt2CKjBFUhLEnkU5XbD8YbfvACgRfHszMtp7224pDrKq/X76laLEmuVwVXnuxhRDhMy59SzGPIxR0/vR8ZuvySISpkKK+xlN3SB4keF//rac8o/QZivPG33kpHUFug3s81NZrU1410HvlrwJh+qQHcJC9+TCs633QtzoD/IxL21xjyAOkRbPL1HW97RZomRatrwyuP9PCZdtfLn55FRMxSn4Lu/h5X9xcPEbqHcr2FDPJhNnPCj97JUd3YENg8wErCoE0kn+e/NQMhOYEeHJ66QsP/G/YnrO2uOzm54N3840TO9EP3uDHWllpcEsvDlbc4yGYqjBzaV3r kitchen_docker_key' >> /home/kitchen/.ssh/authorized_keys \
&& chown kitchen /home/kitchen/.ssh/authorized_keys \
&& chmod 0600 /home/kitchen/.ssh/authorized_keys \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen \
&& cd /lib/systemd/system/sysinit.target.wants/; ls | grep -v systemd-tmpfiles-setup | /usr/bin/xargs rm -f $1 \
&& /bin/rm -f /lib/systemd/system/multi-user.target.wants/* \
&& /bin/rm -f /etc/systemd/system/*.wants/* \
&& /bin/rm -f /lib/systemd/system/local-fs.target.wants/* \
&& /bin/rm -f /lib/systemd/system/sockets.target.wants/*udev* \
&& /bin/rm -f /lib/systemd/system/sockets.target.wants/*initctl* \
&& /bin/rm -f /lib/systemd/system/basic.target.wants/* \
&& /bin/rm -f /lib/systemd/system/anaconda.target.wants/* \
&& /bin/rm -f /lib/systemd/system/plymouth* \
&& /bin/rm -f /lib/systemd/system/systemd-update-utmp* \
&& sed -ri 's/^#?UsePAM\s+.*/UsePAM no/' /etc/ssh/sshd_config \
&& sed -ri 's/^#?PubkeyAuthentication\s+.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config \
&& sed -ri 's/^#?UsePrivilegeSeparation\s+.*/UsePrivilegeSeparation no/' /etc/ssh/sshd_config \
&& echo "UseDNS=no" >> /etc/ssh/sshd_config \
&& systemctl set-default multi-user.target \
&& ln -s /lib/systemd/system/ssh.service /etc/systemd/system/multi-user.target.wants/ssh.service \
&& ln -s /lib/systemd/system/systemd-journald.service /etc/systemd/system/multi-user.target.wants/systemd-journald.service \
&& echo $'[Unit]\
\nDescription=Finish boot up\
\nAfter=ssh.service\
\n\
\n[Service]\
\nType=oneshot\
\nRemainAfterExit=yes\
\nExecStartPre=/bin/sleep 3s\
\nExecStart=/bin/rm -f /run/nologin\
\n\
\n[Install]\
\nWantedBy=default.target' >> /etc/systemd/system/FinishBootUp.service \
&& ln -s /etc/systemd/system/FinishBootUp.service /etc/systemd/system/multi-user.target.wants/FinishBootUp.service

EXPOSE 22

VOLUME [ "/sys/fs/cgroup" ]
4 changes: 2 additions & 2 deletions src/commands/git_secret_changes.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function changes {
# Path was already normalized
path=$(_append_root_path "$filename")
fi

if [[ ! -f "$path" ]]; then
_abort "file not found. Consider using 'git secret reveal': $filename"
fi
Expand All @@ -59,7 +59,7 @@ function changes {
decrypted=$(_decrypt "$path" "0" "0" "$homedir" "$passphrase")

# Let's diff the result:
diff_result=$(diff -u <(echo "$decrypted") "$path") || true
diff_result=$(diff -u <(echo -n "$decrypted") "$path") || true
# There was a bug in the previous version, since `diff` returns
# exit code `1` when the files are different.
echo "changes in ${path}:"
Expand Down

0 comments on commit 8789269

Please sign in to comment.