mirror of
https://github.com/buildplan/du_setup.git
synced 2025-12-29 16:14:59 +00:00
Merge pull request #75 from buildplan/flex_djson
Improve the flexibility of the built-in Docker daemon.json file
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
|
||||
-----
|
||||
|
||||
**Version:** v0.75
|
||||
**Version:** v0.76
|
||||
|
||||
**Last Updated:** 2025-11-09
|
||||
**Last Updated:** 2025-11-10
|
||||
|
||||
**Compatible With:**
|
||||
|
||||
@@ -87,12 +87,12 @@ sha256sum du_setup.sh
|
||||
|
||||
Compare the output hash to the one below. They must match exactly.
|
||||
|
||||
`3ff5b2aa56f7e003fe42a1a61c52680240ce6a004ff12e0a782e44651304bccb`
|
||||
`09b6b710aa75119bf1205e7f2609c6ec43d695f589a1b66415baa464ca9e169b`
|
||||
|
||||
Or echo the hash to check, it should output: `du_setup.sh: OK`
|
||||
|
||||
```bash
|
||||
echo 3ff5b2aa56f7e003fe42a1a61c52680240ce6a004ff12e0a782e44651304bccb du_setup.sh | sha256sum --check
|
||||
echo 09b6b710aa75119bf1205e7f2609c6ec43d695f589a1b66415baa464ca9e169b du_setup.sh | sha256sum --check
|
||||
```
|
||||
|
||||
### 3. Run the Script
|
||||
|
||||
51
du_setup.sh
51
du_setup.sh
@@ -1,8 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Debian and Ubuntu Server Hardening Interactive Script
|
||||
# Version: 0.75 | 2025-11-09
|
||||
# Version: 0.76 | 2025-11-10
|
||||
# Changelog:
|
||||
# - v0.76: Improve the flexibility of the built-in Docker daemon.json file to prevent any potential Docker issues.
|
||||
# - v0.75: Updated Docker daemon.json file to be more secure.
|
||||
# - v0.74: Add optional dtop (https://github.com/amir20/dtop) after docker installation.
|
||||
#. Update .bashrc
|
||||
@@ -80,7 +81,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
# --- Update Configuration ---
|
||||
CURRENT_VERSION="0.75"
|
||||
CURRENT_VERSION="0.76"
|
||||
SCRIPT_URL="https://raw.githubusercontent.com/buildplan/du_setup/refs/heads/main/du_setup.sh"
|
||||
CHECKSUM_URL="${SCRIPT_URL}.sha256"
|
||||
|
||||
@@ -231,7 +232,7 @@ print_header() {
|
||||
printf '%s\n' "${CYAN}╔═════════════════════════════════════════════════════════════════╗${NC}"
|
||||
printf '%s\n' "${CYAN}║ ║${NC}"
|
||||
printf '%s\n' "${CYAN}║ DEBIAN/UBUNTU SERVER SETUP AND HARDENING SCRIPT ║${NC}"
|
||||
printf '%s\n' "${CYAN}║ v0.75 | 2025-11-09 ║${NC}"
|
||||
printf '%s\n' "${CYAN}║ v0.76 | 2025-11-10 ║${NC}"
|
||||
printf '%s\n' "${CYAN}║ ║${NC}"
|
||||
printf '%s\n' "${CYAN}╚═════════════════════════════════════════════════════════════════╝${NC}"
|
||||
printf '\n'
|
||||
@@ -3815,23 +3816,35 @@ install_docker() {
|
||||
NEW_DOCKER_CONFIG=$(mktemp)
|
||||
tee "$NEW_DOCKER_CONFIG" > /dev/null <<DAEMONFILE
|
||||
{
|
||||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "10m",
|
||||
"max-file": "3"
|
||||
},
|
||||
"live-restore": true,
|
||||
"dns": ["9.9.9.9", "1.1.1.1", "208.67.222.222"],
|
||||
"userland-proxy": false,
|
||||
"no-new-privileges": true,
|
||||
"icc": false,
|
||||
"default-ulimits": {
|
||||
"nofile": {
|
||||
"Name": "nofile",
|
||||
"Hard": 64000,
|
||||
"Soft": 64000
|
||||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "10m",
|
||||
"max-file": "5",
|
||||
"compress": "true"
|
||||
},
|
||||
"live-restore": true,
|
||||
"dns": [
|
||||
"9.9.9.9",
|
||||
"1.1.1.1",
|
||||
"208.67.222.222"
|
||||
],
|
||||
"default-address-pools": [
|
||||
{
|
||||
"base": "172.80.0.0/16",
|
||||
"size": 24
|
||||
}
|
||||
],
|
||||
"userland-proxy": false,
|
||||
"default-ulimits": {
|
||||
"nofile": {
|
||||
"Name": "nofile",
|
||||
"Hard": 64000,
|
||||
"Soft": 64000
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"buildkit": true
|
||||
}
|
||||
}
|
||||
}
|
||||
DAEMONFILE
|
||||
mkdir -p /etc/docker
|
||||
|
||||
@@ -1 +1 @@
|
||||
3ff5b2aa56f7e003fe42a1a61c52680240ce6a004ff12e0a782e44651304bccb du_setup.sh
|
||||
09b6b710aa75119bf1205e7f2609c6ec43d695f589a1b66415baa464ca9e169b du_setup.sh
|
||||
|
||||
Reference in New Issue
Block a user