2023-03-22 01:12:21 +00:00
|
|
|
#!/bin/bash
|
2022-02-12 03:00:24 +00:00
|
|
|
|
2023-03-21 18:37:55 +00:00
|
|
|
export TARGET
|
|
|
|
|
2023-03-22 01:12:21 +00:00
|
|
|
set -euo pipefail
|
2022-02-12 03:00:24 +00:00
|
|
|
|
2024-07-21 20:40:59 +00:00
|
|
|
# Update and install packages
|
2022-02-12 03:00:24 +00:00
|
|
|
apt-get update
|
2024-09-07 23:42:43 +00:00
|
|
|
# shellcheck disable=SC2086
|
2022-02-12 03:00:24 +00:00
|
|
|
DEBIAN_FRONTEND=noninteractive \
|
|
|
|
apt-get install -y \
|
|
|
|
imagemagick \
|
|
|
|
file \
|
|
|
|
gosu \
|
|
|
|
sudo \
|
|
|
|
net-tools \
|
|
|
|
iputils-ping \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
jq \
|
|
|
|
dos2unix \
|
|
|
|
mysql-client \
|
|
|
|
tzdata \
|
|
|
|
rsync \
|
|
|
|
nano \
|
|
|
|
unzip \
|
|
|
|
zstd \
|
2022-05-27 03:02:26 +00:00
|
|
|
lbzip2 \
|
2023-03-12 18:40:35 +00:00
|
|
|
nfs-common \
|
2024-09-07 23:42:43 +00:00
|
|
|
libpcap0.8 \
|
|
|
|
${EXTRA_DEB_PACKAGES}
|
2022-02-12 03:00:24 +00:00
|
|
|
|
2024-07-21 20:40:59 +00:00
|
|
|
# Install Git LFS
|
2024-05-26 13:31:52 +00:00
|
|
|
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
|
|
|
|
apt-get update
|
2024-07-21 20:40:59 +00:00
|
|
|
apt-get install -y git-lfs
|
2024-05-26 13:31:52 +00:00
|
|
|
|
2024-07-21 20:40:59 +00:00
|
|
|
# Clean up APT when done
|
2023-03-12 18:40:35 +00:00
|
|
|
apt-get clean
|
2023-03-21 18:37:55 +00:00
|
|
|
|
2024-07-21 20:40:59 +00:00
|
|
|
# Download and install patched knockd
|
2023-03-22 01:12:21 +00:00
|
|
|
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
|
2023-03-21 18:37:55 +00:00
|
|
|
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
|
|
|
|
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
|
2024-02-03 04:23:07 +00:00
|
|
|
setcap cap_net_raw=ep /usr/local/sbin/knockd
|
2023-03-21 18:37:55 +00:00
|
|
|
find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \;
|
2024-04-17 13:11:04 +00:00
|
|
|
|
2024-07-21 20:40:59 +00:00
|
|
|
# Set git credentials globally
|
|
|
|
cat <<EOF >> /etc/gitconfig
|
|
|
|
[user]
|
|
|
|
name = Minecraft Server on Docker
|
|
|
|
email = server@example.com
|
|
|
|
EOF
|