ccarney16 / pterodactyl-containers

Pterodactyl Panel within a docker container
230 stars 78 forks source link

BUG: unexpected character (at "BUILDING.md") #157

Closed Svenum closed 4 months ago

Svenum commented 5 months ago

The pterodactyl-panel crashes on the newest version v1.11.5

Log:

[init] Creating PHP Cache Directories
[init] /entrypoint.d exists. Executing pre-start functions
[wait-for-mysql] Waiting for database connection...
[tls-config] Cannot find SSL certificate and/or key, not injecting tls rules.
[proxy-parser] Enabling trusted_proxies directive for web server.

[pterodactyl-init] Clearing cache/views...

   INFO  Compiled views cleared successfully.  

   INFO  Configuration cache cleared successfully.  

[pterodactyl-init] Migrating/Seeding database...

   INFO  Nothing to migrate.  

   INFO  Seeding database.  

  Database\Seeders\NestSeeder ........................................ RUNNING  
  Database\Seeders\NestSeeder ................................... 1.35 ms DONE  

  Database\Seeders\EggSeeder ......................................... RUNNING  
*********************************************
*     Updating Eggs for Nest: Minecraft     *
*********************************************

Updated Bungeecord
Updated Forge Minecraft
Updated Paper
Updated Sponge (SpongeVanilla)
Updated Vanilla Minecraft

*************************************************
*     Updating Eggs for Nest: Source Engine     *
*************************************************

Updated Ark: Survival Evolved
Updated Counter-Strike: Global Offensive
Updated Custom Source Engine Game
Updated Garrys Mod
Updated Insurgency
Updated Team Fortress 2

*************************************************
*     Updating Eggs for Nest: Voice Servers     *
*************************************************

Updated Mumble Server
Updated Teamspeak3 Server

****************************************
*     Updating Eggs for Nest: Rust     *
****************************************

Updated Rust

  Database\Seeders\EggSeeder .................................. 248.66 ms DONE  

[init] Caddy Version: v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=
[init] PHP Version: 8.2
[init] Loaded PHP Modules:
  [PHP Modules] bcmath bz2 calendar Core ctype curl date dom exif fileinfo filter ftp gd gettext gmp hash iconv intl json libxml mbstring mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar posix random readline Reflection session shmop SimpleXML soap sockets sodium SPL sqlite3 standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl Zend OPcache zip zlib zstd  
  [Zend Modules] Zend OPcache  
--- Starting Web Server ---
{"level":"info","ts":1711994499.2747397,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
{"level":"warn","ts":1711994499.275955,"msg":"Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies","adapter":"caddyfile","file":"/etc/caddy/Caddyfile","line":5}
{"level":"info","ts":1711994499.276423,"msg":"redirected default logger","from":"stderr","to":"stdout"}
2024-04-01T18:01:39Z    INFO    admin   admin endpoint started  {"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}
2024-04-01T18:01:39Z    WARN    http.auto_https server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server   {"server_name": "srv0", "http_port": 80}
2024-04-01T18:01:39Z    INFO    tls.cache.maintenance   started background certificate maintenance      {"cache": "0xc00040a280"}
2024-04-01T18:01:39Z    INFO    tls.cache.maintenance   stopped background certificate maintenance      {"cache": "0xc00040a280"}
Error: loading initial config: loading new config: loading http app module: provision http: server srv0: setting up route handlers: route 6: loading handler modules: position 0: loading module 'reverse_proxy': provision http.handlers.reverse_proxy: invalid IP address: 'BUILDING.md': ParseAddr("BUILDING.md"): unexpected character (at "BUILDING.md")
[01-Apr-2024 18:01:39] NOTICE: fpm is running, pid 69
[01-Apr-2024 18:01:39] NOTICE: ready to handle connections
[01-Apr-2024 18:01:39] NOTICE: systemd monitor interval set to 10000ms
[caddy] service is no longer running! exiting...
babatonga commented 5 months ago

I have exactly the same issue on unraid, had to go back to ccarney16/pterodactyl-panel:v1.11.4

Svenum commented 5 months ago

I am on Unraid too.

ccarney16 commented 4 months ago

This appears to be an issue with unraid in regards to an update to the caddy configuration file. TRUSTED_PROXIES is now handled by caddy and appears to be filled by information that is not a list of IP addresses. I would strongly suggest contacting the template author to see if they can push out an update.

Svenum commented 4 months ago

I did not use the template. I wrote my own compose file.

Svenum commented 4 months ago
networks:
  proxy_default:
    external: true
  default:

services:
  redis:
    image: redis:alpine
    restart: unless-stopped

  mariadb:
    image: mariadb:11
    restart: unless-stopped
    volumes:
      - "/mnt/cache/appdata/gs/mariadb/data:/var/lib/mysql"
      - "/mnt/cache/appdata/gs/mariadb/config:/etc/mysql/conf.d"
    environment:
      MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
      MARIADB_DATABASE: "pterodactyl"
      MARIADB_USER: "pterodactyl"
      MARIADB_PASSWORD: ${DB_PASSWORD}

  pterodactyl:
    image: ccarney16/pterodactyl-panel:v1.11.4
    restart: no
    networks:
      - proxy_default
      - default
    volumes:
      - "/mnt/cache/appdata/gs/pterodactyl-wings/data:/mnt/user/appdata/gs/pterodactyl-wings/data"
      - "/mnt/cache/appdata/gs/pterodactyl-wings/:/etc/pterodactyl"
      - "/mnt/cache/appdata/gs/pterodactyl/:/data"
      - "/mnt/cache/appdata/gs/pterodactyl/nginx/:/etc/nginx/conf.d/"
      - "/mnt/cache/appdata/gs/pterodactyl/entrypoint.sh:/entrypoint.sh"
    environment:
      APP_URL: "https://pterodactyl.holypenguin.net/"
      APP_NAME: "Holy Pterenguin"
      APP_TIMEZONE: "Europe/Berlin"
      APP_ENVIRONMENT_ONLY: false
      APP_SERVICE_AUTHOR: "holyadmin@example.com"
      APP_ENV: "production"
      TRUSTED_PROXIES: "*"
      DB_HOST: "mariadb"
      DB_PORT: 3306
      DB_DATABASE: pterodactyl
      DB_USERNAME: pterodactyl
      DB_PASSWORD: ${DB_PASSWORD}
      CACHE_DRIVER: "redis"
      SESSION_DRIVER: "redis"
      QUEUE_DRIVER: "redis"
      REDIS_HOST: redis
      DEBUG: false
      MAIL_FROM: "pterodactyl@example.com"
      MAIL_DRIVER: "smtp"
      MAIL_HOST: "smtp.example.com"
      MAIL_PORT: "465"
      MAIL_USERNAME: "pterodactyl@example.com"
      MAIL_PASSWORD: ${MAIL_PASSWORD}
      MAIL_ENCRYPTION: "ssl"
    labels:
      traefik.enable: true
      traefik.http.routers.pterodactyl.entryPoints: https
      traefik.http.services.pterodactyl.loadbalancer.server.port: 80
    depends_on:
      - mariadb
      - redis

  pterodactyl-wings:
    image: ccarney16/pterodactyl-daemon:latest
    restart: unless-stopped
    networks:
      - proxy_default
      - default
    tty: true
    environment:
      TZ: "Europe/Berlin"
      WINGS_UID: 1000
      WINGS_GID: 1000
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
      - "/mnt/cache/appdata/gs/pterodactyl-wings/data:/mnt/user/appdata/gs/pterodactyl-wings/data"
      - "/mnt/cache/appdata/gs/pterodactyl-wings/:/etc/pterodactyl"
      - "/tmp/pterodactyl:/tmp/pterodactyl"
    labels:
      traefik.enable: true
      traefik.http.routers.pterodactyl_wings.entryPoints: https
      traefik.http.services.pterodactyl_wings.loadbalancer.server.port: 443
      traefik.tcp.routers.pterodactyl_wings.entryPoints: sftp_pterodactyl
      traefik.tcp.services.pterodactyl_wings.loadbalancer.server.port: 2222
      traefik.tcp.routers.pterodactyl_wings.rule: 'HostSNI(`*`)'
    depends_on:
      - pterodactyl
babatonga commented 4 months ago

Is it possible that the wildcard * in TRUSTED_PROXIES is no longer supported? It looks like you can replace it with 0.0.0.0/0 (and maybe ::/0?)

ccarney16 commented 4 months ago

After reviewing the updated container, It appears I did not account for a wildcard to be used in TRUSTED_PROXIES. I will update the documentation and configuration to mention to follow caddy's trusted proxies convention over pterodactyl.

There is also an actual bug in the script that converts the wildcard into filenames.

Svenum commented 4 months ago

Without the TRUSTED_PROXY and the new build its working. Thanks :)