-
-
Notifications
You must be signed in to change notification settings - Fork 113
ct: add Alpine Linux Caddy #902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a781427
ct: add Alpine Linux Caddy
cobaltgit e5819be
frontend: fix alpine caddy json
cobaltgit cfe2483
ct: alpine caddy: source development build.func
cobaltgit 383502f
alpine-caddy: change copyright to community-scripts ORG
cobaltgit bd1dbc6
alpine-caddy: use apk for xcaddy
cobaltgit 2510dd7
alpine-caddy: revert to manually setting up go and xcaddy
cobaltgit ef69b4d
alpine-caddy: only extract xcaddy binary from release tarball
cobaltgit cadd02e
alpine-caddy: fix typo!
cobaltgit 7e5cbc4
alpine-caddy: add default Caddyfile and webpage
cobaltgit 3fd2f00
alpine-caddy: move config creation to install step
cobaltgit 9b160ec
alpine-caddy: fix json
cobaltgit 7659eae
Update alpine-caddy.json
tremor021 1ba35e7
Rename alpine-caddy.json to caddy.json
tremor021 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) | ||
# Copyright (c) 2021-2025 cobalt | ||
# Author: cobalt (cobaltgit) | ||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE | ||
# Source: https://caddyserver.com/ | ||
|
||
APP="Alpine-Caddy" | ||
var_tags="${var_tags:-webserver}" | ||
var_cpu="${var_cpu:-1}" | ||
var_ram="${var_ram:-256}" | ||
var_disk="${var_disk:-3}" | ||
var_os="${var_os:-alpine}" | ||
var_version="${var_version:-3.22}" | ||
var_unprivileged="${var_unprivileged:-1}" | ||
|
||
header_info "$APP" | ||
variables | ||
color | ||
catch_errors | ||
|
||
function update_script() { | ||
header_info | ||
check_container_storage | ||
check_container_resources | ||
if [[ ! -d /etc/caddy ]]; then | ||
msg_error "No ${APP} Installation Found!" | ||
exit | ||
fi | ||
msg_info "Updating $APP LXC" | ||
$STD apk -U upgrade | ||
msg_ok "Updated $APP LXC" | ||
|
||
msg_info "Restarting Caddy" | ||
rc-service caddy restart | ||
msg_ok "Restarted Caddy" | ||
exit | ||
} | ||
|
||
start | ||
build_container | ||
description | ||
|
||
msg_ok "Completed Successfully!\n" | ||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" | ||
echo -e "${INFO}${YW} Access it using the following URL:${CL}" | ||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}" |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
___ __ _ ______ __ __ | ||
/ | / /___ (_)___ ___ / ____/___ _____/ /___/ /_ __ | ||
/ /| | / / __ \/ / __ \/ _ \______/ / / __ `/ __ / __ / / / / | ||
/ ___ |/ / /_/ / / / / / __/_____/ /___/ /_/ / /_/ / /_/ / /_/ / | ||
/_/ |_/_/ .___/_/_/ /_/\___/ \____/\__,_/\__,_/\__,_/\__, / | ||
/_/ /____/ |
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"name": "Caddy", | ||
"slug": "caddy", | ||
"categories": [ | ||
21 | ||
], | ||
"date_created": "2024-05-11", | ||
"type": "ct", | ||
"updateable": true, | ||
"privileged": false, | ||
"interface_port": 80, | ||
"documentation": "https://caddyserver.com/docs/", | ||
"website": "https://caddyserver.com/", | ||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/caddy.webp", | ||
"config_path": "/etc/caddy/Caddyfile", | ||
"description": "Caddy is a powerful, extensible platform to serve your sites, services, and apps, written in Go.", | ||
"install_methods": [ | ||
{ | ||
"type": "default", | ||
"script": "ct/caddy.sh", | ||
"resources": { | ||
"cpu": 1, | ||
"ram": 512, | ||
"hdd": 4, | ||
"os": "debian", | ||
"version": "12" | ||
} | ||
}, | ||
{ | ||
"type": "alpine", | ||
"script": "ct/alpine-caddy.sh", | ||
"resources": { | ||
"cpu": 1, | ||
"ram": 256, | ||
"hdd": 3, | ||
"os": "alpine", | ||
"version": "3.22" | ||
} | ||
} | ||
], | ||
"default_credentials": { | ||
"username": null, | ||
"password": null | ||
}, | ||
"notes": [ | ||
{ | ||
"text": "xcaddy needs to be updated manually after a caddy update!", | ||
"type": "warning" | ||
}, | ||
{ | ||
"text": "if you need an internal module run: `caddy add-package PACKAGENAME`", | ||
"type": "info" | ||
}, | ||
{ | ||
"text": "if you need an external module run: `xcaddy build --with github.com/caddy-dns/cloudflare`", | ||
"type": "info" | ||
} | ||
] | ||
} | ||
|
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright (c) 2021-2025 cobalt | ||
cobaltgit marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
# Author: cobalt (cobaltgit) | ||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE | ||
# Source: https://caddyserver.com/ | ||
|
||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" | ||
color | ||
verb_ip6 | ||
catch_errors | ||
setting_up_container | ||
network_check | ||
update_os | ||
|
||
msg_info "Installing Caddy" | ||
$STD apk add --no-cache caddy caddy-openrc | ||
msg_ok "Installed Caddy" | ||
|
||
read -r -p "${TAB3}Would you like to install xCaddy Addon? <y/N> " prompt | ||
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then | ||
setup_go | ||
msg_info "Setup xCaddy" | ||
$STD apk add --no-cache git | ||
cd /opt | ||
RELEASE=$(curl -fsSL https://api.github.com/repos/caddyserver/xcaddy/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') | ||
curl -fsSL "https://github.com/caddyserver/xcaddy/releases/download/${RELEASE}/xcaddy_${RELEASE:1}_linux_amd64.tar.gz" -o "xcaddy_${RELEASE:1}_linux_amd64.tar.gz" | ||
$STD tar xzf xcaddy_"${RELEASE:1}"_linux_amd64.tar.gz -C /usr/local/bin | ||
rm -rf /opt/xcaddy* | ||
$STD xcaddy build | ||
msg_ok "Setup xCaddy" | ||
fi | ||
|
||
msg_info "Enabling Caddy Service" | ||
$STD rc-update add caddy default | ||
msg_ok "Enabled Caddy Service" | ||
|
||
msg_info "Starting Caddy" | ||
$STD service caddy start | ||
msg_ok "Started Caddy" | ||
|
||
motd_ssh | ||
customize |
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.
Uh oh!
There was an error while loading. Please reload this page.