From 29aae5b973f0ee53e2684ad69367d2fb0df6f563 Mon Sep 17 00:00:00 2001 From: finnie2006 <57916807+finnie2006@users.noreply.github.com> Date: Fri, 24 Jun 2022 09:43:09 +0200 Subject: [PATCH] Add files via upload Big update, Added the option to install wordpress, and you can now install composer packages by specifying them Egg has also been renamed from nginx egg to webhost egg --- README.md | 25 +++++++++++---- egg-web-host-egg.json | 62 +++++++++++++++++++++++++++++++++++++ nginx/conf.d/default.conf | 5 ++- nginx/nginx.conf | 14 ++++----- php-fpm/fpm.pool.d/www.conf | 4 +-- php-fpm/php-fpm.conf | 4 +-- php-fpm/php.ini | 6 ++-- start.sh | 1 + 8 files changed, 100 insertions(+), 21 deletions(-) create mode 100644 egg-web-host-egg.json diff --git a/README.md b/README.md index a8da08e..b16c8cc 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,25 @@ -# pterodactyl eggs +# Pterodactyl webhost egg How to use: 1. Go to releases and download the json file -2. Import the egg like u normaly do -3. Create a new server -4. Navigate to the given port and ip and u are good to go just add ur files to the webroot folder -Note: if u want it using a domain then create a reverse proxy on the host (an example will be added later) +2. Import the egg to your panel like you normally do +3. Create a new server, additionally you can enable wordpress, this will install wordpress for you +and you can also install composer packages, this can also be done after the install +4. Navigate to the given port and ip and you are good to go just add you files to the webroot folder +(when using wordpress go to http://ip:port/wp-admin) +Note: if you want it using a domain then create a reverse proxy on the host -forked and edited from https://gitlab.com/tenten8401/pterodactyl-nginx + +To remove logs from console, open nginx/conf.d/default.conf and uncomment (remove #): + +``` +#access_log /home/container/naccess.log; +#error_log /home/container/nerror.log error +``` + + +Originally forked and edited from https://gitlab.com/tenten8401/pterodactyl-nginx + +A sigma production diff --git a/egg-web-host-egg.json b/egg-web-host-egg.json new file mode 100644 index 0000000..68d6c9b --- /dev/null +++ b/egg-web-host-egg.json @@ -0,0 +1,62 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v2", + "update_url": null + }, + "exported_at": "2022-06-24T09:34:21+02:00", + "name": "WebHost Egg", + "author": "info@finniedj.nl", + "description": "An egg to host any Website.\r\nit also has composer, just specify your packages in the packages box, and it will install the packages when you start the server, it also has wordpress, just turn on the slider when you make the server, and wordpress will get installed for you\r\n\r\nSigma Productions 2022", + "features": null, + "docker_images": { + "ghcr.io\/finnie2006\/nginx-ptero": "ghcr.io\/finnie2006\/nginx-ptero" + }, + "file_denylist": [], + "startup": "{{STARTUP_CMD}}; if [[ ! -z ${COMPOSER_MODULES} ]]; then composer require ${COMPOSER_MODULES} --working-dir=\/home\/containe\r\nr\/webroot; fi;", + "config": { + "files": "{\r\n \"nginx\/conf.d\/default.conf\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \" listen \": \" listen {{server.build.default.port}};\"\r\n }\r\n }\r\n}", + "startup": "{\r\n \"done\": \"\",\r\n \"userInteraction\": []\r\n}", + "logs": "{\r\n \"custom\": false,\r\n \"location\": \"logs\/latest.log\"\r\n}", + "stop": "^C" + }, + "scripts": { + "installation": { + "script": "#!\/bin\/ash\r\ncd \/mnt\/server\r\napk --update add git\r\n\r\n# cloning repo with nginx and php files\r\ngit clone https:\/\/github.com\/finnie2006\/ptero-nginx .\/temp\r\n\r\ncp -r .\/temp\/nginx \/mnt\/server\/\r\ncp -r .\/temp\/php-fpm \/mnt\/server\/\r\ncp -r .\/temp\/webroot \/mnt\/server\/\r\ncp .\/temp\/start.sh \/mnt\/server\/\r\nchmod +x \/mnt\/server\/start.sh\r\nrm -rf .\/temp\r\nif [ \"${WORDPRESS}\" == \"false\" ] || [ \"${WORDPRESS}\" == \"0\" ]; then\r\necho -e \"Install complete go to http:\/\/ip:port\/\"\r\nfi\r\n\r\n\r\n#wordpress\r\nif [ \"${WORDPRESS}\" == \"true\" ] || [ \"${WORDPRESS}\" == \"1\" ]; then\r\n echo -e \"Installing wordpress\"\r\n cd \/mnt\/server\/webroot\r\n wget http:\/\/wordpress.org\/latest.tar.gz\r\n tar xzf latest.tar.gz\r\n mv wordpress\/* .\r\n rm -rf wordpress latest.tar.gz\r\n echo -e \"Install complete go to http:\/\/ip:port\/wp-admin \"\r\n exit 0\r\n \r\n fi", + "container": "alpine:latest", + "entrypoint": "ash" + } + }, + "variables": [ + { + "name": "Startup Command", + "description": "The command to startup the egg \r\n(Do not change if you do not know what you are doing!)", + "env_variable": "STARTUP_CMD", + "default_value": ".\/start.sh", + "user_viewable": true, + "user_editable": true, + "rules": "present", + "field_type": "text" + }, + { + "name": "Wordpress", + "description": "Enable or disable Wordpress\r\n\r\n0 = false (default)\r\n1 = true", + "env_variable": "WORDPRESS", + "default_value": "false", + "user_viewable": true, + "user_editable": true, + "rules": "required|boolean", + "field_type": "text" + }, + { + "name": "Composer modules", + "description": "Specify the composer modules you want to install, separate the packages with a space\r\nyou can always add packages later..", + "env_variable": "COMPOSER_MODULES", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string", + "field_type": "text" + } + ] +} \ No newline at end of file diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index 4379f96..f04c462 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -2,6 +2,9 @@ server { listen 80; server_name ""; + #access_log /home/container/naccess.log; + #error_log /home/container/nerror.log error; + root /home/container/webroot; index index.html index.htm index.php; charset utf-8; @@ -21,7 +24,7 @@ server { location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass unix:/tmp/php-fpm.sock; + fastcgi_pass unix:/home/container/tmp/php-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M"; diff --git a/nginx/nginx.conf b/nginx/nginx.conf index b886a25..11c0609 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,5 +1,5 @@ worker_processes auto; -pid /tmp/nginx.pid; +pid /home/container/tmp/nginx.pid; daemon off; events { @@ -20,11 +20,11 @@ http { include /home/container/nginx/mime.types; default_type application/octet-stream; - proxy_temp_path /tmp; - client_body_temp_path /tmp; - fastcgi_temp_path /tmp; - uwsgi_temp_path /tmp; - scgi_temp_path /tmp; + proxy_temp_path /home/container/tmp; + client_body_temp_path /home/container/tmp; + fastcgi_temp_path /home/container/tmp; + uwsgi_temp_path /home/container/tmp; + scgi_temp_path /home/container/tmp; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on; @@ -41,4 +41,4 @@ http { gzip_disable "msie6"; include /home/container/nginx/conf.d/*.conf; -} \ No newline at end of file +} diff --git a/php-fpm/fpm.pool.d/www.conf b/php-fpm/fpm.pool.d/www.conf index 7ae25d4..a437469 100644 --- a/php-fpm/fpm.pool.d/www.conf +++ b/php-fpm/fpm.pool.d/www.conf @@ -1,7 +1,7 @@ [www] -listen = /tmp/php-fpm.sock +listen = /home/container/tmp/php-fpm.sock pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 -pm.max_spare_servers = 3 \ No newline at end of file +pm.max_spare_servers = 3 diff --git a/php-fpm/php-fpm.conf b/php-fpm/php-fpm.conf index 43d1ccf..846476e 100644 --- a/php-fpm/php-fpm.conf +++ b/php-fpm/php-fpm.conf @@ -14,7 +14,7 @@ ; Pid file ; Note: the default prefix is /var ; Default Value: none -pid = /tmp/php-fpm.pid +pid = /home/container/tmp/php-fpm.pid ; Error log file ; If it's set to "syslog", log is sent to syslogd instead of being written @@ -122,4 +122,4 @@ error_log = /home/container/php-fpm.log ; Relative path can also be used. They will be prefixed by: ; - the global prefix if it's been set (-p argument) ; - /usr otherwise -include=/home/container/php-fpm/fpm.pool.d/*.conf \ No newline at end of file +include=/home/container/php-fpm/fpm.pool.d/*.conf diff --git a/php-fpm/php.ini b/php-fpm/php.ini index fce2e7d..6198899 100644 --- a/php-fpm/php.ini +++ b/php-fpm/php.ini @@ -740,7 +740,7 @@ user_dir = ; Directory where the temporary files should be placed. ; Defaults to the system default (see sys_get_temp_dir) -; sys_temp_dir = "/tmp" +sys_temp_dir = "/home/container/tmp" ; Whether or not to enable the dl() function. The dl() function does NOT work ; properly in multithreaded servers, such as IIS or Zeus, and is automatically @@ -818,7 +818,7 @@ file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ; http://php.net/upload-tmp-dir -;upload_tmp_dir = +upload_tmp_dir = '/home/container/tmp' ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize @@ -1741,7 +1741,7 @@ soap.wsdl_cache_enabled=1 ; Sets the directory name where SOAP extension will put cache files. ; http://php.net/soap.wsdl-cache-dir -soap.wsdl_cache_dir="/tmp" +soap.wsdl_cache_dir="/home/container/tmp" ; (time to live) Sets the number of second while cached file will be used ; instead of original one. diff --git a/start.sh b/start.sh index 6866bd7..d4c81d3 100644 --- a/start.sh +++ b/start.sh @@ -1,4 +1,5 @@ #!/bin/ash +rm -rf /home/container/tmp/* echo "Starting PHP-FPM..." /usr/sbin/php-fpm8 --fpm-config /home/container/php-fpm/php-fpm.conf --daemonize