From 54c6dd33968f321c9a0450d362f82055f82f0b2d Mon Sep 17 00:00:00 2001 From: tmunsch Date: Mon, 11 Jan 2021 15:32:15 -0500 Subject: [PATCH 1/4] added Update feature Added startup type update to update minio version Color coded console output to make things more readable --- storage/minio/minio.sh | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/storage/minio/minio.sh b/storage/minio/minio.sh index 48b5818e..777e5abb 100644 --- a/storage/minio/minio.sh +++ b/storage/minio/minio.sh @@ -1,39 +1,51 @@ #!/bin/bash ################################## -echo Starting up.... -echo "Startup Type: $STARTUP_TYPE" +echo "$(tput setaf 2)Starting up...." +echo "Startup Type: $(tput setaf 2)$STARTUP_TYPE" if [ -f "keys/key.txt" ]; then -echo "Key file detected..." +echo "$(tput setaf 2)Key file detected..." export MINIO_ACCESS_KEY=`cat keys/key.txt` else echo minioadmin > keys/key.txt -echo "No key file detected...Preparing First Time Boot" +echo "$(tput setaf 3)No key file detected...Preparing First Time Boot" fi if [ -f "keys/secret.txt" ]; then -echo "Secret file detected..." +echo "$(tput setaf 2)Secret file detected..." export MINIO_SECRET_KEY=`cat keys/secret.txt` else echo minioadmin > keys/secret.txt echo "No secret file detected...Preparing First Time Boot" fi if [ -f "keys/oldsecret.txt" ]; then -echo "Old secret file detected..." +echo "$(tput setaf 1)Old secret file detected..." export MINIO_SECRET_KEY_OLD=`cat keys/oldsecret.txt` fi if [ -f "keys/oldkey.txt" ]; then -echo "Old key file detected..." +echo "$(tput setaf 1)Old key file detected..." export MINIO_ACCESS_KEY_OLD=`cat keys/oldkey.txt` fi if [ -f "keys/justrotated.txt" ]; then -echo "Previous key rotation detected...." -echo "Clearing the Lanes...." +echo "$(tput setaf 3)Previous key rotation detected...." +echo "$(tput setaf 3)Clearing the Lanes...." unset MINIO_ACCESS_KEY_OLD unset MINIO_SECRET_KEY_OLD +echo "$(tput setaf 2)Lanes Cleared!" STARTUP_TYPE=normal rm keys/justrotated.txt rm keys/oldsecret.txt rm keys/oldkey.txt fi + +########################################## +if [ -z "$STARTUP_TYPE" ] || [ "$STARTUP_TYPE" == "update" ]; then +echo "$(tput setaf 3)Performing update...." +echo "$(tput setaf 1)Removing old minio version" +rm minio +echo "$(tput setaf 3)Downloading new minio version" +wget https://dl.min.io/server/minio/release/linux-amd64/minio +chmod +x minio +echo "$(tput setaf 2)Update Complete" +fi ########################################## if [ -z "$STARTUP_TYPE" ] || [ "$STARTUP_TYPE" == "rotate" ]; then touch keys/justrotated.txt @@ -45,12 +57,13 @@ export MINIO_ACCESS_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | h echo $MINIO_ACCESS_KEY > keys/key.txt export MINIO_SECRET_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) echo $MINIO_SECRET_KEY > keys/secret.txt -echo Your New Access Key is: $MINIO_ACCESS_KEY -echo Your New Secret Key is: $MINIO_SECRET_KEY -echo Your Old Access Key is: $MINIO_ACCESS_KEY_OLD -echo Your Old Access Key is: $MINIO_SECRET_KEY_OLD -echo Booting... +echo "Your New Access Key is: $(tput setaf 2)$MINIO_ACCESS_KEY" +echo "Your New Secret Key is: $(tput setaf 2)$MINIO_SECRET_KEY" +echo "Your Old Access Key is: $(tput setaf 3)$MINIO_ACCESS_KEY_OLD" +echo "Your Old Access Key is: $(tput setaf 3)$MINIO_SECRET_KEY_OLD" +echo "$(tput setaf 2)Booting..." ./minio server data --address 0.0.0.0:$SERVER_PORT else +echo "$(tput setaf 2)Booting..." ./minio server data --address 0.0.0.0:$SERVER_PORT fi From 035d2b7b00761fd5955a5c5202bc40bcc7aeffef Mon Sep 17 00:00:00 2001 From: tmunsch Date: Mon, 11 Jan 2021 15:34:30 -0500 Subject: [PATCH 2/4] added update startup feature added update startup feature --- storage/minio/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/storage/minio/README.md b/storage/minio/README.md index da88976a..73fcc597 100644 --- a/storage/minio/README.md +++ b/storage/minio/README.md @@ -3,6 +3,8 @@ ## Features Auto generate keys on server creation bypassing default minio keys +## Update +Auto update minio to latest version using "update" startup feature Automatic Key rotation using "rotate" startup feature From 155b522f6f882e5c32c38a19a82e25d6e1e746a6 Mon Sep 17 00:00:00 2001 From: tmunsch Date: Mon, 11 Jan 2021 15:35:55 -0500 Subject: [PATCH 3/4] added update startup variable added update startup variable --- storage/minio/egg-minio-s3.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/storage/minio/egg-minio-s3.json b/storage/minio/egg-minio-s3.json index 9c48eb32..a491acea 100644 --- a/storage/minio/egg-minio-s3.json +++ b/storage/minio/egg-minio-s3.json @@ -1,14 +1,17 @@ { "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", "meta": { - "version": "PTDL_v1" + "version": "PTDL_v1", + "update_url": null }, - "exported_at": "2020-12-14T05:29:26+02:00", + "exported_at": "2021-01-11T15:35:14-05:00", "name": "Minio S3", "author": "accounts@bofanodes.io", "description": "MinIO is a cloud storage server compatible with Amazon S3, released under Apache License v2. As an object store, MinIO can store unstructured data such as photos, videos, log files, backups and container images. The maximum size of an object is 5TB.", "features": null, - "image": "quay.io\/parkervcp\/pterodactyl-images:ubuntu", + "images": [ + "quay.io\/parkervcp\/pterodactyl-images:ubuntu" + ], "startup": ".\/minio.sh", "config": { "files": "{}", @@ -31,7 +34,7 @@ "default_value": "normal", "user_viewable": true, "user_editable": true, - "rules": "required|string|in:normal,rotate" + "rules": "required|string|in:normal,rotate,update" } ] -} \ No newline at end of file +} From cad0a655c861b6ea7fbb752cb8e11d1679edc1f4 Mon Sep 17 00:00:00 2001 From: tmunsch Date: Mon, 11 Jan 2021 15:36:55 -0500 Subject: [PATCH 4/4] fixed description for startup variable --- storage/minio/egg-minio-s3.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/minio/egg-minio-s3.json b/storage/minio/egg-minio-s3.json index a491acea..9ef0e0cf 100644 --- a/storage/minio/egg-minio-s3.json +++ b/storage/minio/egg-minio-s3.json @@ -29,7 +29,7 @@ "variables": [ { "name": "Startup Type", - "description": "normal or rotate", + "description": "normal,rotate,update", "env_variable": "STARTUP_TYPE", "default_value": "normal", "user_viewable": true,