Skip to content

Commit 91df9f8

Browse files
committed
fix: #179 protect caddy admin port from an outside actors
1 parent b051b65 commit 91df9f8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Diff for: app/Models/Service.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected static function booted()
8080

8181
protected function generateUniqueSlug($id)
8282
{
83-
$slug = Str::slug($this->name);
83+
$slug = Str::slug($this->name, '_');
8484
$vocabulary = config('ptah.services.slug.vocabulary');
8585
$adjectives = config('ptah.services.slug.adjectives');
8686

Diff for: scripts/self-hosted/core.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,21 @@ if [ -z "$SKIP_CORE_INSTALL" ]; then
8787
header "Install System Packages"
8888

8989
$PKG_UPDATE_REGISTRIES
90-
$PKG_INSTALL sudo curl unzip ca-certificates apache2-utils
90+
$PKG_INSTALL sudo curl unzip ca-certificates apache2-utils netfilter-persistent
9191

9292
header "Install Docker"
9393
help_text "installation script provided by Docker and available at https://get.docker.com/"
9494

9595
curl -fsSL https://get.docker.com/ | sh
9696

97+
header "Configure Docker"
98+
help_text "Adding Caddy admin port to iptables"
99+
100+
iptables -I DOCKER-USER -p tcp -s 127.0.0.1 --dport 2019 -j ACCEPT
101+
iptables -I DOCKER-USER -p tcp --dport 2019 -j REJECT --reject-with tcp-reset
102+
103+
netfilter-persistent save
104+
97105
rm -f /tmp/ptah-agent
98106

99107
curl -L https://github.com/ptah-sh/ptah-agent/releases/latest/download/ptah-agent-linux-x86_64.bin -o /tmp/ptah-agent

0 commit comments

Comments
 (0)