Upload files to "/"

This commit is contained in:
2025-11-21 19:20:26 +00:00
parent 5182ce5403
commit 89c617405b
4 changed files with 197 additions and 0 deletions

BIN
banner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

21
cert-renewal.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
# /srv/pterodactyl/cert-renewal.sh
# Script til automatisk fornyelse af Certbot certifikater
cd /srv/pterodactyl/ || exit
echo "--- Starter Let's Encrypt certifikatfornyelse ---"
# Kører Certbot for at tjekke fornyelse
docker-compose run --rm certbot renew --quiet
# Tjekker exit-koden
if [ $? -eq 0 ]; then
echo "Certbot kørsel succesfuld. Genstarter Nginx."
docker-compose restart nginx
else
echo "FEJL: Certbot fornyelsen mislykkedes."
fi
echo "--- Certifikatfornyelse afsluttet ---"

110
docker-compose.yml Normal file
View File

@@ -0,0 +1,110 @@
version: '3.7'
services:
# --- 1. MariaDB Database Service ---
mariadb:
build: ./docker/mariadb
image: tuxinet/pterodactyl-mariadb:local
container_name: pterodactyl_database
restart: always
environment:
# SKAL UDSKIFTES!
MYSQL_ROOT_PASSWORD: DitSuperSikreRootPassword
MYSQL_DATABASE: panel
MYSQL_USER: pterodactyl
MYSQL_PASSWORD: DitSuperSikreDBPassword
volumes:
- /srv/pterodactyl/mysql/data:/var/lib/mysql
ports:
- "3306:3306"
# --- 2. Pterodactyl Panel Service (Webserver/PHP) ---
panel:
build: ./docker/panel
image: tuxinet/pterodactyl-panel:local
container_name: pterodactyl_panel
restart: always
depends_on:
- mariadb
- redis
environment:
# Databaseforbindelse
DB_HOST: mariadb
DB_PORT: 3306
DB_DATABASE: panel
DB_USERNAME: pterodactyl
DB_PASSWORD: DitSuperSikreDBPassword # SKAL MATCHES
# SMTP Email Konfiguration - SKAL UDFYLDES!
MAIL_FROM_ADDRESS: "noreply@ditdomæne.dk"
MAIL_FROM_NAME: "Pterodactyl Panel"
MAIL_DRIVER: smtp
MAIL_HOST: smtp.ditdomæne.dk # DIN SMTP HOST
MAIL_PORT: 587
MAIL_USERNAME: "din-email-bruger" # DIN SMTP BRUGER
MAIL_PASSWORD: "din-email-adgangskode" # DIN SMTP ADGANGSKODE
MAIL_ENCRYPTION: tls
# Generel App Konfiguration
APP_URL: https://panel.ditdomæne.dk # SKAL REDIGERES
APP_TIMEZONE: Europe/Copenhagen
CACHE_DRIVER: redis
SESSION_DRIVER: redis
QUEUE_DRIVER: redis
REDIS_HOST: redis
REDIS_PORT: 6379
volumes:
- /srv/pterodactyl/panel:/app
# --- 3. Redis Service (Caching/Køer) ---
redis:
build: ./docker/redis
image: tuxinet/pterodactyl-redis:local
container_name: pterodactyl_redis
restart: always
# --- 4. Pterodactyl Wings Service (Game Server Daemon) ---
wings:
build: ./docker/wings
image: tuxinet/pterodactyl-wings:local
container_name: pterodactyl_wings
restart: always
cap_add:
- NET_ADMIN
- NET_RAW
ports:
# Wings API Port & SFTP Port (OBLIGATORISK)
- "8080:8080"
- "2022:2022"
# Tilføj dine spilserver-porte her:
# - "25565-25570:25565-25570"
volumes:
- /srv/pterodactyl/wings:/etc/pterodactyl
- /var/run/docker.sock:/var/run/docker.sock:ro
- /srv/pterodactyl/servers:/var/lib/pterodactyl/volumes
# --- 5. Nginx Reverse Proxy Service (Webserver med SSL) ---
nginx:
build: ./docker/nginx
image: tuxinet/pterodactyl-nginx:local
container_name: pterodactyl_nginx
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- /srv/pterodactyl/nginx/conf.d:/etc/nginx/conf.d:ro
- /srv/pterodactyl/nginx/certbot/www:/var/www/certbot:ro
- /srv/pterodactyl/nginx/certbot/conf:/etc/letsencrypt:ro
depends_on:
- panel
# --- 6. Certbot Service (SSL/TLS) ---
certbot:
build: ./docker/certbot
image: tuxinet/pterodactyl-certbot:local
container_name: pterodactyl_certbot
volumes:
- /srv/pterodactyl/nginx/certbot/www:/var/www/certbot
- /srv/pterodactyl/nginx/certbot/conf:/etc/letsencrypt
entrypoint: /bin/sh -c "trap exit TERM; while :; do sleep 3600; done"

66
install.sh Normal file
View File

@@ -0,0 +1,66 @@
#!/bin/bash
# Domæne du vil bruge til Pterodactyl Panel (SKAL REDIGERES!)
DOMAIN="panel.ditdomæne.dk"
# Opret hovedmapper
mkdir -p /srv/pterodactyl/{panel,wings,mysql/data,servers}
mkdir -p /srv/pterodactyl/nginx/{conf.d,certbot/{conf,www}}
# Opret Nginx konfigurationsfil
cat <<EOF > /srv/pterodactyl/nginx/conf.d/default.conf
server {
listen 80;
server_name ${DOMAIN};
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
server_name ${DOMAIN};
# SSL konfiguration (Certbot stier)
ssl_certificate /etc/letsencrypt/live/${DOMAIN}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${DOMAIN}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
root /var/www/html/public;
index index.html index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass panel:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ /\. {
deny all;
}
}
EOF
echo "✅ Mappestruktur og Nginx konfiguration er oprettet."
# Generer dummy certifikater for at starte Nginx
openssl req -x509 -nodes -newkey rsa:4096 -days 365 -keyout /srv/pterodactyl/nginx/certbot/conf/privkey.pem -out /srv/pterodactyl/nginx/certbot/conf/fullchain.pem -subj "/CN=${DOMAIN}" 2>/dev/null
echo "✅ Dummy SSL-certifikater oprettet."
echo ""
echo "Næste trin: Rediger 'docker-compose.yml' og kør 'docker-compose up -d'."