Skip to content

Commit

Permalink
fix: #179 protect caddy admin port from an outside actors
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Sep 15, 2024
1 parent b051b65 commit 91df9f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Models/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected static function booted()

protected function generateUniqueSlug($id)
{
$slug = Str::slug($this->name);
$slug = Str::slug($this->name, '_');
$vocabulary = config('ptah.services.slug.vocabulary');
$adjectives = config('ptah.services.slug.adjectives');

Expand Down
10 changes: 9 additions & 1 deletion scripts/self-hosted/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,21 @@ if [ -z "$SKIP_CORE_INSTALL" ]; then
header "Install System Packages"

$PKG_UPDATE_REGISTRIES
$PKG_INSTALL sudo curl unzip ca-certificates apache2-utils
$PKG_INSTALL sudo curl unzip ca-certificates apache2-utils netfilter-persistent

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

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

header "Configure Docker"
help_text "Adding Caddy admin port to iptables"

iptables -I DOCKER-USER -p tcp -s 127.0.0.1 --dport 2019 -j ACCEPT
iptables -I DOCKER-USER -p tcp --dport 2019 -j REJECT --reject-with tcp-reset

netfilter-persistent save

rm -f /tmp/ptah-agent

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

0 comments on commit 91df9f8

Please sign in to comment.