azukaar / Cosmos-Server

☁️ The Most Secure and Easy Selfhosted Home Server. Take control of your data and privacy without sacrificing security and stability (Authentication, anti-DDOS, anti-bot)
https://cosmos-cloud.io
Other
3.13k stars 112 forks source link

[HELP]: setup pterodactyl panel and node #65

Closed Serph91P closed 1 year ago

Serph91P commented 1 year ago

What happened?

Would love some help setting those two up. Had them running on unraid fine. But the config there from swag reverse proxy looked like this and have no idea how to recreate in cosmos. The biggest difference I think is the part with listen 443 ssl https2. This is the only docker I know which needed this. Got the docker running on cosmos but the url is not reachable. If someone could support it would be much appreciated.


## Version 2023/05/31
# this is for your actual panel, not nodes
# make sure you set your pterodactyl servers "remote" and "api" addresses to the domains you specify here
# ensure you have enabled "ssl encryption" and (if necessary) "behind proxy" in your pterodactyl server
# make sure that your pterodactyl container is named pterodactyl
# make sure that your dns has a cname set for pterodactyl

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name panel.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth (requires ldap-location.conf in the location block)
    #include /config/nginx/ldap-server.conf;

    # enable for Authelia (requires authelia-location.conf in the location block)
    #include /config/nginx/authelia-server.conf;

    # enable for Authentik (requires authentik-location.conf in the location block)
    #include /config/nginx/authentik-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable for ldap auth (requires ldap-server.conf in the server block)
        #include /config/nginx/ldap-location.conf;

        # enable for Authelia (requires authelia-server.conf in the server block)
        #include /config/nginx/authelia-location.conf;

        # enable for Authentik (requires authentik-server.conf in the server block)
        #include /config/nginx/authentik-location.conf;
        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app redacted;
        set $upstream_port 8001;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }
}

### What should have happened?

Docker is running and reachable via the domain setup

### How to reproduce the bug?

Install the pterodactyl panel docker container.

### Relevant log output

_No response_

### Other details

https://pterodactyl.io/panel/1.0/webserver_configuration.html

### System details

Not rely necessary else just ask :)
bruj0 commented 1 year ago

Hi! Pterodactyl seems to be composed of a panel and a daemon so its going to be have at least 2 containers. I think a good start is to follow this "how to": https://github.com/ccarney16/pterodactyl-containers/wiki Its going to generate a docker composer project that we can then import into Cosmos. Im going to try it and report back :)

Serph91P commented 1 year ago

Hi! Pterodactyl seems to be composed of a panel and a daemon so its going to be have at least 2 containers. I think a good start is to follow this "how to": https://github.com/ccarney16/pterodactyl-containers/wiki Its going to generate a docker composer project that we can then import into Cosmos. Im going to try it and report back :)

Hey and first for all thank you for helping :)

I tried to use the official docker container: ghcr.io/pterodactyl/panel:latest The Panel I got setup and running, but the reverse proxy seems not to be working. Like I wrote before the http2 irritates me and dunno where I would set it. I can open the page but its completely blank and I get a 502 error. So I guess it has something to do with the reverse proxy settings. I will try the container you posted and see if those work correctly.

Serph91P commented 1 year ago

Found this guide from the cosmos discord (https://guides.engels.zip/pterodactyl-setup/00-information-about-pterodactyl). Sadly the Page still stays white. So dunno why I get a 502 error still.

Serph91P commented 1 year ago

found the culprit I guess:

2023-08-03 11:44:36
 2023/08/03 13:44:36 [INFO] SmartShield: Request received
2023-08-03 11:44:36
 2023/08/03 13:44:36 http: proxy error: unsupported protocol scheme "http2"
2023-08-03 11:44:36
 2023/08/03 13:44:36 "GET https://panel.redacted/ HTTP/2.0" from ip-redacted - 502 0B in 2.143349ms

Dunno how to fix this one or get it to work.

Serph91P commented 1 year ago

Got if fixed with the help of dicsord.

php artisan key:generate
php artisan optimize