This repository has been archived by the owner on May 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Update config to work with new caddy version #2112
Draft
Gorian
wants to merge
1
commit into
pelican-eggs:master
Choose a base branch
from
Gorian:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
added `git config pull.ff only` to startup command to fix git warning, and updated caddy run command as new version uses `--config` instead of `-config`
@Gorian I ask that you fill out the checklist in the PR. |
Oops, my bad! Done @parkervcp :) |
parkervcp
suggested changes
Feb 6, 2023
"logs": "{}", | ||
"stop": "^C" | ||
}, | ||
"scripts": { | ||
"installation": { | ||
"script": "#!\/bin\/bash\r\n# 5e Tools install script\r\n#\r\n# Server Files: \/mnt\/server\r\ndeclare -r DIR=\"\/mnt\/server\"\r\ndeclare -r CADDY_INSTALL_URL=\"https:\/\/caddyserver.com\/api\/download?os=linux&arch=amd64&idempotency=41554620449867\"\r\ndeclare -r LOCAL_REPO=\"${DIR}\/5e-tools\"\r\n\r\ndie() {\r\n local message=\"$1\"\r\n printf \"\\n%s\\n\" \"${message}\"\r\n exit 2\r\n}\r\ncd_error() {\r\n die \"ERROR: installation encountered an error while trying to change directory\"\r\n}\r\n\r\nmain() {\r\n local git_origin\r\n apt update\r\n apt install -y wget\r\n cd \"${DIR}\" || cd_error\r\n printf \"\\nInstalling Caddy...\\n\"\r\n wget \"${CADDY_INSTALL_URL}\" -O .\/caddy\r\n chmod +x .\/caddy\r\n printf \"\\nGenerating Caddy configuration...\\n\"\r\n # this is a default config\r\n # key variables, such as the port, will get overwritten with the pterodactyl\r\n # configuration parser\r\n cat <<EOF >\"${DIR}\/caddy.json\"\r\n{\r\n \"apps\": {\r\n \"http\": {\r\n \"servers\": {\r\n \"srv0\": {\r\n \"listen\": [\r\n \":8080\"\r\n ],\r\n \"routes\": [\r\n {\r\n \"handle\": [\r\n {\r\n \"handler\": \"vars\",\r\n \"root\": \"\/home\/container\/5e-tools\"\r\n },\r\n {\r\n \"encodings\": {\r\n \"gzip\": {},\r\n \"zstd\": {}\r\n },\r\n \"handler\": \"encode\",\r\n \"prefer\": [\r\n \"zstd\",\r\n \"gzip\"\r\n ]\r\n },\r\n {\r\n \"handler\": \"file_server\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n }\r\n}\r\nEOF\r\n git config --global pull.ff only\r\n if [[ ! -d \"${LOCAL_REPO}\" ]]; then\r\n printf \"\\nCloning latest version (this may take a while)...\\n\"\r\n # $REPOSITORY is passed via environment variable from pterodactyl\r\n git clone \"${REPOSITORY}\" \"${LOCAL_REPO}\"\r\n else\r\n cd \"${LOCAL_REPO}\" || cd_error\r\n git_origin=\"$(git config --get remote.origin.url)\"\r\n cd \"${DIR}\" || cd_error\r\n printf \"\\n\\ngit origin is %s\\n\\n\" \"${git_origin}\"\r\n # if the user hasn't change the repository variable\r\n if [[ \"${git_origin}\" == \"${REPOSITORY}\" ]]; then\r\n cd \"${LOCAL_REPO}\" || cd_error\r\n printf \"\\nRepository already installed - updating...\\n\"\r\n git fetch --all\r\n git reset --hard origin\/master\r\n git pull\r\n cd \"${DIR}\" || cd_error\r\n else\r\n printf \"\\nRepository variable changed since last update\\n...\\n\"\r\n rm -rf \"${LOCAL_REPO}\"\r\n git clone \"${REPOSITORY}\" \"${LOCAL_REPO}\"\r\n fi\r\n fi\r\n printf \"\\nInstallation Complete\\n\"\r\n}\r\nmain \"@\"", | ||
"script": "#!\/bin\/bash\r\n# 5e Tools install script\r\n#\r\n# Server Files: \/mnt\/server\r\ndeclare -r DIR=\"\/mnt\/server\"\r\ndeclare -r CADDY_INSTALL_URL=\"https:\/\/caddyserver.com\/api\/download?os=linux&arch=amd64\"\r\ndeclare -r LOCAL_REPO=\"${DIR}\/5e-tools\"\r\n\r\ndie() {\r\n local message=\"$1\"\r\n printf \"\\n%s\\n\" \"${message}\"\r\n exit 2\r\n}\r\n\r\ncd_error() {\r\n die \"ERROR: installation encountered an error while trying to change directory\"\r\n}\r\n\r\nmain() {\r\n local git_origin\r\n apt update\r\n apt install -y wget\r\n cd \"${DIR}\" || cd_error\r\n printf \"\\nInstalling Caddy...\\n\"\r\n wget \"${CADDY_INSTALL_URL}\" -O .\/caddy\r\n chmod +x .\/caddy\r\n printf \"\\nGenerating Caddy configuration...\\n\"\r\n # this is a default config\r\n # key variables, such as the port, will get overwritten with the pterodactyl\r\n # configuration parser\r\n cat <<EOF >\"${DIR}\/caddy.json\"\r\n{\r\n \"apps\": {\r\n \"http\": {\r\n \"servers\": {\r\n \"srv0\": {\r\n \"listen\": [\r\n \":8080\"\r\n ],\r\n \"routes\": [\r\n {\r\n \"handle\": [\r\n {\r\n \"handler\": \"vars\",\r\n \"root\": \"\/home\/container\/5e-tools\"\r\n },\r\n {\r\n \"encodings\": {\r\n \"gzip\": {},\r\n \"zstd\": {}\r\n },\r\n \"handler\": \"encode\",\r\n \"prefer\": [\r\n \"zstd\",\r\n \"gzip\"\r\n ]\r\n },\r\n {\r\n \"handler\": \"file_server\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n }\r\n}\r\nEOF\r\n git config --global pull.ff only\r\n if [[ ! -d \"${LOCAL_REPO}\" ]]; then\r\n printf \"\\nCloning latest version (this may take a while)...\\n\"\r\n # $REPOSITORY is passed via environment variable from pterodactyl\r\n git clone \"${REPOSITORY}\" \"${LOCAL_REPO}\" --progress\r\n else\r\n cd \"${LOCAL_REPO}\" || cd_error\r\n git_origin=\"$(git config --get remote.origin.url)\"\r\n cd \"${DIR}\" || cd_error\r\n printf \"\\n\\ngit origin is %s\\n\\n\" \"${git_origin}\"\r\n # if the user hasn't change the repository variable\r\n if [[ \"${git_origin}\" == \"${REPOSITORY}\" ]]; then\r\n cd \"${LOCAL_REPO}\" || cd_error\r\n printf \"\\nRepository already installed - updating...\\n\"\r\n git fetch --all\r\n git reset --hard origin\/master\r\n git pull\r\n cd \"${DIR}\" || cd_error\r\n else\r\n printf \"\\nRepository variable changed since last update\\n...\\n\"\r\n rm -rf \"${LOCAL_REPO}\"\r\n git clone \"${REPOSITORY}\" \"${LOCAL_REPO}\"\r\n fi\r\n fi\r\n printf \"\\nInstallation Complete\\n\"\r\n}\r\nmain \"@\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All you changed was to remove the idempotency
from the url and add --progress
to a git clone. This doesn't appear to actually change a config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦🏻 I thought the new start command got exported too. I'll fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gorian please look at PR
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
added
git config pull.ff only
to startup command to fix git warning, and updated caddy run command as new version uses--config
instead of-config
Description
Checklist for all submissions
New egg Submissions