Skip to content

Commit 3666f49

Browse files
push-app-to-main[bot]MickLesktremor021
authored
Garage | Alpine-Garage (#8656)
* 'Add new script' * add alpine-garage-install.sh * add alpine-garage.sh * Update alpine-garage.sh * Update garage-install.sh * Increase default RAM and disk for Garage containers Updated ct/garage.sh and ct/alpine-garage.sh to set higher default RAM (1024MB for Garage, 512MB for Alpine-Garage) and disk (5GB for both). Synced these resource changes in frontend/public/json/garage.json to ensure consistency in container setup defaults. * Apply suggestion from @tremor021 --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <[email protected]> Co-authored-by: Slaviša Arežina <[email protected]>
1 parent db9809a commit 3666f49

File tree

5 files changed

+339
-0
lines changed

5 files changed

+339
-0
lines changed

ct/alpine-garage.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://garagehq.deuxfleurs.fr/
7+
8+
APP="Alpine-Garage"
9+
var_tags="${var_tags:-alpine;object-storage}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-512}"
12+
var_disk="${var_disk:-5}"
13+
var_os="${var_os:-alpine}"
14+
var_version="${var_version:-3.22}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
if [[ ! -f /usr/local/bin/garage ]]; then
25+
msg_error "No ${APP} Installation Found!"
26+
exit
27+
fi
28+
29+
GITEA_RELEASE=$(curl -fsSL https://api.github.com/repos/deuxfleurs-org/garage/tags | jq -r '.[0].name')
30+
if [[ "${GITEA_RELEASE}" != "$(cat ~/.garage 2>/dev/null)" ]] || [[ ! -f ~/.garage ]]; then
31+
msg_info "Stopping Service"
32+
rc-service garage stop || true
33+
msg_ok "Stopped Service"
34+
35+
msg_info "Backing Up Data"
36+
cp /usr/local/bin/garage /usr/local/bin/garage.old 2>/dev/null || true
37+
cp /etc/garage.toml /etc/garage.toml.bak 2>/dev/null || true
38+
msg_ok "Backed Up Data"
39+
40+
msg_info "Updating Garage"
41+
curl -fsSL "https://garagehq.deuxfleurs.fr/_releases/${GITEA_RELEASE}/x86_64-unknown-linux-musl/garage" -o /usr/local/bin/garage
42+
chmod +x /usr/local/bin/garage
43+
echo "${GITEA_RELEASE}" >~/.garage
44+
msg_ok "Updated Garage"
45+
46+
msg_info "Starting Service"
47+
rc-service garage start || rc-service garage restart
48+
msg_ok "Started Service"
49+
msg_ok "Update Successfully!"
50+
else
51+
msg_ok "No update required. Garage is already at ${GITEA_RELEASE}"
52+
fi
53+
exit
54+
}
55+
56+
start
57+
build_container
58+
description
59+
60+
msg_ok "Completed Successfully!\n"
61+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
62+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
63+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"

ct/garage.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://garagehq.deuxfleurs.fr/
7+
8+
APP="Garage"
9+
var_tags="${var_tags:-object-storage}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-1024}"
12+
var_disk="${var_disk:-5}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-13}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -f /usr/local/bin/garage ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
GITEA_RELEASE=$(curl -fsSL https://api.github.com/repos/deuxfleurs-org/garage/tags | jq -r '.[0].name')
31+
if [[ "${GITEA_RELEASE}" != "$(cat ~/.garage 2>/dev/null)" ]] || [[ ! -f ~/.garage ]]; then
32+
msg_info "Stopping Service"
33+
systemctl stop garage
34+
msg_ok "Stopped Service"
35+
36+
msg_info "Backing Up Data"
37+
cp /usr/local/bin/garage /usr/local/bin/garage.old 2>/dev/null || true
38+
cp /etc/garage.toml /etc/garage.toml.bak 2>/dev/null || true
39+
msg_ok "Backed Up Data"
40+
41+
msg_info "Updating Garage"
42+
curl -fsSL "https://garagehq.deuxfleurs.fr/_releases/${GITEA_RELEASE}/x86_64-unknown-linux-musl/garage" -o /usr/local/bin/garage
43+
chmod +x /usr/local/bin/garage
44+
echo "${GITEA_RELEASE}" >~/.garage
45+
msg_ok "Updated Garage"
46+
47+
msg_info "Starting Service"
48+
systemctl start garage
49+
msg_ok "Started Service"
50+
msg_ok "Update Successfully!"
51+
else
52+
msg_ok "No update required. Garage is already at ${GITEA_RELEASE}"
53+
fi
54+
exit
55+
}
56+
57+
start
58+
build_container
59+
description
60+
61+
msg_ok "Completed Successfully!\n"
62+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
63+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
64+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}"

frontend/public/json/garage.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "Garage",
3+
"slug": "garage",
4+
"categories": [
5+
8
6+
],
7+
"date_created": "2025-10-27",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 3900,
12+
"documentation": "https://garagehq.deuxfleurs.fr/documentation/quick-start/",
13+
"website": "https://garagehq.deuxfleurs.fr/",
14+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/garage.webp",
15+
"config_path": "/etc/garage.toml",
16+
"description": "Garage is a lightweight, self-hosted, S3-compatible object storage service built for distributed environments. It is designed to be simple, efficient, and easy to deploy across multiple nodes.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/garage.sh",
21+
"resources": {
22+
"cpu": 1,
23+
"ram": 1024,
24+
"hdd": 5,
25+
"os": "debian",
26+
"version": "13"
27+
}
28+
},
29+
{
30+
"type": "alpine",
31+
"script": "ct/alpine-garage.sh",
32+
"resources": {
33+
"cpu": 1,
34+
"ram": 512,
35+
"hdd": 5,
36+
"os": "alpine",
37+
"version": "3.22"
38+
}
39+
}
40+
],
41+
"default_credentials": {
42+
"username": null,
43+
"password": null
44+
},
45+
"notes": [
46+
{
47+
"text": "The Garage configuration file is located at `/etc/garage.toml`. You can edit RPC and API bindings, tokens, and data directories there.",
48+
"type": "info"
49+
},
50+
{
51+
"text": "Admin API runs by default on port `3903`, S3 API on port `3900`, Web UI on `3902`. Adjust firewall rules accordingly.",
52+
"type": "warning"
53+
},
54+
{
55+
"text": "To view your generated tokens and RPC secret, check `~/garage.creds` after installation.",
56+
"type": "info"
57+
}
58+
]
59+
}

install/alpine-garage-install.sh

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://garagehq.deuxfleurs.fr/
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apk add --no-cache openssl
18+
msg_ok "Installed Dependencies"
19+
20+
GITEA_RELEASE=$(curl -s https://api.github.com/repos/deuxfleurs-org/garage/tags | jq -r '.[0].name')
21+
curl -fsSL "https://garagehq.deuxfleurs.fr/_releases/${GITEA_RELEASE}/x86_64-unknown-linux-musl/garage" -o /usr/local/bin/garage
22+
chmod +x /usr/local/bin/garage
23+
mkdir -p /var/lib/garage/{data,meta,snapshots}
24+
mkdir -p /etc/garage
25+
RPC_SECRET=$(openssl rand -hex 64 | cut -c1-64)
26+
ADMIN_TOKEN=$(openssl rand -base64 32)
27+
METRICS_TOKEN=$(openssl rand -base64 32)
28+
{
29+
echo "Garage Tokens and Secrets"
30+
echo "RPC Secret: $RPC_SECRET"
31+
echo "Admin Token: $ADMIN_TOKEN"
32+
echo "Metrics Token: $METRICS_TOKEN"
33+
} >~/garage.creds
34+
echo $GITEA_RELEASE >>~/.garage
35+
cat <<EOF >/etc/garage.toml
36+
metadata_dir = "/var/lib/garage/meta"
37+
data_dir = "/var/lib/garage/data"
38+
db_engine = "sqlite"
39+
replication_factor = 1
40+
41+
rpc_bind_addr = "0.0.0.0:3901"
42+
rpc_public_addr = "127.0.0.1:3901"
43+
rpc_secret = "${RPC_SECRET}"
44+
45+
[s3_api]
46+
s3_region = "garage"
47+
api_bind_addr = "0.0.0.0:3900"
48+
root_domain = ".s3.garage"
49+
50+
[s3_web]
51+
bind_addr = "0.0.0.0:3902"
52+
root_domain = ".web.garage"
53+
index = "index.html"
54+
55+
[k2v_api]
56+
api_bind_addr = "0.0.0.0:3904"
57+
58+
[admin]
59+
api_bind_addr = "0.0.0.0:3903"
60+
admin_token = "${ADMIN_TOKEN}"
61+
metrics_token = "${METRICS_TOKEN}"
62+
EOF
63+
msg_ok "Configured Garage"
64+
65+
msg_info "Creating Service"
66+
cat <<'EOF' >/etc/init.d/garage
67+
#!/sbin/openrc-run
68+
name="Garage Object Storage"
69+
command="/usr/local/bin/garage"
70+
command_args="server"
71+
command_background="yes"
72+
pidfile="/run/garage.pid"
73+
depend() {
74+
need net
75+
}
76+
EOF
77+
78+
chmod +x /etc/init.d/garage
79+
$STD rc-update add garage default
80+
$STD rc-service garage restart || rc-service garage start
81+
msg_ok "Service active"
82+
83+
motd_ssh
84+
customize

install/garage-install.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://garagehq.deuxfleurs.fr/
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Setup Garage"
17+
GITEA_RELEASE=$(curl -s https://api.github.com/repos/deuxfleurs-org/garage/tags | jq -r '.[0].name')
18+
curl -fsSL "https://garagehq.deuxfleurs.fr/_releases/${GITEA_RELEASE}/x86_64-unknown-linux-musl/garage" -o /usr/local/bin/garage
19+
chmod +x /usr/local/bin/garage
20+
mkdir -p /var/lib/garage/{data,meta,snapshots}
21+
mkdir -p /etc/garage
22+
RPC_SECRET=$(openssl rand -hex 32)
23+
ADMIN_TOKEN=$(openssl rand -base64 32)
24+
METRICS_TOKEN=$(openssl rand -base64 32)
25+
{
26+
echo "Garage Tokens and Secrets"
27+
echo "RPC Secret: $RPC_SECRET"
28+
echo "Admin Token: $ADMIN_TOKEN"
29+
echo "Metrics Token: $METRICS_TOKEN"
30+
} >>~/garage.creds
31+
echo $GITEA_RELEASE >>~/.garage
32+
cat <<EOF >/etc/garage.toml
33+
metadata_dir = "/var/lib/garage/meta"
34+
data_dir = "/var/lib/garage/data"
35+
db_engine = "sqlite"
36+
replication_factor = 1
37+
38+
rpc_bind_addr = "[::]:3901"
39+
rpc_public_addr = "127.0.0.1:3901"
40+
rpc_secret = "${RPC_SECRET}"
41+
42+
[s3_api]
43+
s3_region = "garage"
44+
api_bind_addr = "[::]:3900"
45+
root_domain = ".s3.garage.localhost"
46+
47+
[s3_web]
48+
bind_addr = "[::]:3902"
49+
root_domain = ".web.garage.localhost"
50+
index = "index.html"
51+
52+
[k2v_api]
53+
api_bind_addr = "[::]:3904"
54+
55+
[admin]
56+
api_bind_addr = "[::]:3903"
57+
admin_token = "${ADMIN_TOKEN}"
58+
metrics_token = "${METRICS_TOKEN}"
59+
EOF
60+
msg_ok "Set up Garage"
61+
62+
motd_ssh
63+
customize
64+
65+
msg_info "Cleaning up"
66+
$STD apt -y autoremove
67+
$STD apt -y autoclean
68+
$STD apt -y clean
69+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)