Skip to content

Commit

Permalink
Add support for viewing/entering tar.gz archives in mc without extens…
Browse files Browse the repository at this point in the history
…ions (like Docker build cache files)
  • Loading branch information
dimikot committed Sep 13, 2024
1 parent 5929c07 commit 8c3ae16
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker/ci-runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN true \
&& apt-get install -y --no-install-recommends \
openssh-client \
build-essential haproxy rinetd \
awscli jq gh rsync python3 python3-yaml rsyslog systemctl tzdata gosu less mc git curl wget pv psmisc unzip vim nano telnet net-tools apt-transport-https ca-certificates locales gnupg lsb-release
awscli jq gh rsync python3 python3-yaml rsyslog systemctl tzdata gosu less mc git curl wget pv psmisc unzip zstd file vim nano telnet net-tools apt-transport-https ca-certificates locales gnupg lsb-release

# Install & patch Docker-in-Docker service. Requires sysbox installed on the host. See also:
# https://forums.docker.com/t/etc-init-d-docker-62-ulimit-error-setting-limit-invalid-argument-problem/139424
Expand Down
11 changes: 11 additions & 0 deletions docker/ci-runner/root/entrypoint.10-mc-vfs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
#
# Configures MC VSF parameters.
#
set -u -e

for file in /etc/mc/mc.ext /root/.config/mc/mc.ext; do
if [[ -f $file ]] && ! grep -q "/POSIX tar archive" /etc/mc/mc.ext; then
sed -i $"1i type/POSIX tar archive\n Open=%cd %p/utar://\n View=%view{ascii} tar tf \"\${MC_EXT_FILENAME}\"\n" $file
fi
done
2 changes: 1 addition & 1 deletion docker/ci-storage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN true \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
openssh-server \
awscli jq gh rsync python3 python3-yaml rsyslog systemctl tzdata gosu less mc git curl wget pv psmisc unzip vim nano telnet net-tools apt-transport-https ca-certificates locales gnupg lsb-release \
awscli jq gh rsync python3 python3-yaml rsyslog systemctl tzdata gosu less mc git curl wget pv psmisc unzip zstd file vim nano telnet net-tools apt-transport-https ca-certificates locales gnupg lsb-release \
&& sed -i -e "s|#PermitRootLogin.*|PermitRootLogin no|" /etc/ssh/sshd_config \
&& useradd -m guest -s /bin/bash \
&& mkdir ~guest/.ssh && chmod 700 ~guest/.ssh \
Expand Down
11 changes: 11 additions & 0 deletions docker/ci-storage/root/entrypoint.10-mc-vfs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
#
# Configures MC VSF parameters.
#
set -u -e

for file in /etc/mc/mc.ext /root/.config/mc/mc.ext; do
if [[ -f $file ]] && ! grep -q "/POSIX tar archive" /etc/mc/mc.ext; then
sed -i $"1i type/POSIX tar archive\n Open=%cd %p/utar://\n View=%view{ascii} tar tf \"\${MC_EXT_FILENAME}\"\n" $file
fi
done

0 comments on commit 8c3ae16

Please sign in to comment.