Close to a fully working package
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
garage/*
|
||||
garage/*
|
||||
.ignore/**
|
||||
@@ -1,34 +1,19 @@
|
||||
{
|
||||
"id": "com.jadud.garage",
|
||||
"title": "Garage",
|
||||
"version": "0.0.1",
|
||||
"healthCheckPath": "/health",
|
||||
"multiDomain": true,
|
||||
"httpPort": 3900,
|
||||
"tcpPorts": {
|
||||
"GARAGE_WEB": {
|
||||
"title": "Garage web server domain",
|
||||
"description": "Web port",
|
||||
"defaultValue": 3902,
|
||||
"containerPort": 3902,
|
||||
"portCount": 1
|
||||
},
|
||||
"GARAGE_ADMIN": {
|
||||
"title": "Admin port",
|
||||
"description": "Admin port",
|
||||
"defaultValue": 3903,
|
||||
"containerPort": 3903,
|
||||
"portCount": 1
|
||||
}
|
||||
},
|
||||
"addons": {
|
||||
"localstorage": {
|
||||
"sqlite": {
|
||||
"paths": ["/app/data/garage/meta/db.sqlite"],
|
||||
"_documentation": "https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#:~:text=%3Cmetadata_dir%3E/db.sqlite"
|
||||
"addons": {
|
||||
"localstorage": {
|
||||
"sqlite": {
|
||||
"paths": [
|
||||
"/app/data/garage/meta/db.sqlite"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"manifestVersion": 2,
|
||||
"icon": ""
|
||||
},
|
||||
"healthCheckPath": "/health",
|
||||
"httpPort": 80,
|
||||
"icon": "",
|
||||
"id": "com.jadud.garage",
|
||||
"manifestVersion": 2,
|
||||
"multiDomain": true,
|
||||
"title": "Garage",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
|
||||
17
CloudronManifest.jsonnet
Normal file
17
CloudronManifest.jsonnet
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"id": "com.jadud.garage",
|
||||
"title": "Garage",
|
||||
"version": "0.0.1",
|
||||
"healthCheckPath": "/health",
|
||||
"multiDomain": true,
|
||||
"httpPort": 80,
|
||||
"addons": {
|
||||
"localstorage": {
|
||||
"sqlite": {
|
||||
"paths": ["/app/data/garage/meta/db.sqlite"],
|
||||
}
|
||||
}
|
||||
},
|
||||
"manifestVersion": 2,
|
||||
"icon": ""
|
||||
}
|
||||
12
Makefile
12
Makefile
@@ -6,17 +6,21 @@ DOMAIN?=garage
|
||||
test-build:
|
||||
docker build -t garage:latest .
|
||||
|
||||
build: templates
|
||||
build:
|
||||
cloudron build
|
||||
jsonnet CloudronManifest.jsonnet > CloudronManifest.json
|
||||
|
||||
install: build uninstall
|
||||
cloudron install \
|
||||
--location "${DOMAIN}" \
|
||||
--secondary-domains \
|
||||
GARAGE_WEB="web.${DOMAIN}",GARAGE_ADMIN="admin.${DOMAIN}"
|
||||
--alias-domains "*.web.${DOMAIN}","admin.${DOMAIN}","api.${DOMAIN}"
|
||||
|
||||
# install: build uninstall
|
||||
# cloudron install \
|
||||
# --location "${DOMAIN}"
|
||||
|
||||
update:
|
||||
cloudron update
|
||||
|
||||
uninstall:
|
||||
cloudron uninstall --app "${DOMAIN}"
|
||||
- cloudron uninstall --app "${DOMAIN}"
|
||||
|
||||
55
caddyfile
55
caddyfile
@@ -1,38 +1,33 @@
|
||||
{
|
||||
debug
|
||||
admin off
|
||||
auto_https off
|
||||
}
|
||||
|
||||
# I feel like a proxy in front of Garage (within the container)
|
||||
# would let me redirect `/health` from the TLD through to the admin API,
|
||||
# which is the only place the healthcheck URL exists. But, Cloudron has no notion
|
||||
# of the healthcheck being somewhere else.
|
||||
# caddy run --watch --config /app/data/caddyfile --adapter caddyfile
|
||||
|
||||
# https://garagehq.deuxfleurs.fr/documentation/cookbook/reverse-proxy/
|
||||
s3.garage.tld, *.s3.garage.tld {
|
||||
reverse_proxy localhost:3900 {
|
||||
health_uri /health
|
||||
health_port 3903
|
||||
#health_interval 15s
|
||||
#health_timeout 5s
|
||||
}
|
||||
api.{$CLOUDRON_APP_DOMAIN}:80 {
|
||||
respond /health 200 {
|
||||
body "OK API"
|
||||
}
|
||||
reverse_proxy localhost:3900
|
||||
}
|
||||
|
||||
# These would need to be templated, I think, so they match the domain
|
||||
# that is coming in to the container.
|
||||
*.web.garage.tld {
|
||||
reverse_proxy localhost:3902 {
|
||||
health_uri /health
|
||||
health_port 3903
|
||||
#health_interval 15s
|
||||
#health_timeout 5s
|
||||
}
|
||||
admin.{$CLOUDRON_APP_DOMAIN}:80 {
|
||||
respond /health 200 {
|
||||
body "OK ADMIN"
|
||||
}
|
||||
reverse_proxy localhost:3903
|
||||
}
|
||||
|
||||
{$CLOUDRON_APP_DOMAIN}:80 {
|
||||
respond /health 200 {
|
||||
body "OK S3"
|
||||
}
|
||||
reverse_proxy localhost:3900
|
||||
}
|
||||
|
||||
|
||||
*.web.{$CLOUDRON_APP_DOMAIN}:80 {
|
||||
reverse_proxy localhost:3902
|
||||
}
|
||||
|
||||
admin.garage.tld {
|
||||
reverse_proxy localhost:3903 {
|
||||
health_uri /health
|
||||
health_port 3903
|
||||
#health_interval 15s
|
||||
#health_timeout 5s
|
||||
}
|
||||
}
|
||||
@@ -18,10 +18,8 @@ if [[ ! -f /app/data/.initialized ]]; then
|
||||
# Note: it templates in the domain, which needs to be substituted at this point.
|
||||
# If the end-user moves the domain... this will break.
|
||||
sed -e 's/CLOUDRON_APP_DOMAIN/'"${CLOUDRON_APP_DOMAIN}"'/g' /garage/garage.toml > /app/data/garage.toml
|
||||
cp /garage/caddyfile /app/data/caddyfile
|
||||
|
||||
# For redirecting /health to admin.DOMAIN/health
|
||||
sed -e 's/CLOUDRON_APP_DOMAIN/'"${CLOUDRON_APP_DOMAIN}"'/g' /garage/caddyfile > /app/data/caddyfile
|
||||
|
||||
# Generate an RPC secret file. This is used for clusters.
|
||||
# We don't have clusters, but garage wantses it.
|
||||
# It is precious to garage.
|
||||
@@ -34,5 +32,5 @@ fi
|
||||
# Chown the things and run.
|
||||
chown -R cloudron:cloudron /app/data/garage
|
||||
|
||||
# gosu cloudron:cloudron caddy run --config /app/data/caddyfile --adapter caddyfile &
|
||||
gosu cloudron:cloudron caddy run --watch --config /app/data/caddyfile --adapter caddyfile &
|
||||
gosu cloudron:cloudron /usr/bin/garage server
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
garage status
|
||||
garage layout assign -z home -c 1G 8e20b876358d1f32
|
||||
garage layout show
|
||||
garage layout apply --version 1
|
||||
garage bucket create site
|
||||
garage key create site-key
|
||||
garage bucket allow \
|
||||
--read \
|
||||
--write \
|
||||
--owner \
|
||||
site \
|
||||
--key site-key
|
||||
garage bucket website --allow site
|
||||
Reference in New Issue
Block a user