From a007caf449308d67af4a7fd767c2214b22829e0d Mon Sep 17 00:00:00 2001 From: brooke Date: Mon, 28 Apr 2025 15:46:48 -0400 Subject: [PATCH] initial --- .drone.yml | 38 ++++++++++++++++++++++++++++++++++++++ .env.sample | 29 +++++++++++++++++++++++++++++ .gitignore | 1 + README.md | 24 ++++++++++++++++++++++++ compose.yml | 40 ++++++++++++++++++++++++++++++++++++++++ entrypoint.sh.tmpl | 27 +++++++++++++++++++++++++++ release/.git-keep-me | 0 7 files changed, 159 insertions(+) create mode 100644 .drone.yml create mode 100644 .env.sample create mode 100644 .gitignore create mode 100644 README.md create mode 100644 compose.yml create mode 100644 entrypoint.sh.tmpl create mode 100644 release/.git-keep-me diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..47080d2 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,38 @@ +--- +kind: pipeline +name: deploy to swarm-test.autonomic.zone +steps: + - name: deployment + image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest + settings: + host: swarm-test.autonomic.zone + stack: example_com # UPDATE ME + generate_secrets: true + purge: true + deploy_key: + from_secret: drone_ssh_swarm_test + networks: + - proxy + environment: + DOMAIN: example.swarm-test.autonomic.zone # UPDATE ME + STACK_NAME: example_com # UPDATE ME + LETS_ENCRYPT_ENV: production +trigger: + branch: + - main +--- +kind: pipeline +name: generate recipe catalogue +steps: + - name: release a new version + image: plugins/downstream + settings: + server: https://build.coopcloud.tech + token: + from_secret: drone_abra-bot_token + fork: true + repositories: + - coop-cloud/auto-recipes-catalogue-json + +trigger: + event: tag diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..a273972 --- /dev/null +++ b/.env.sample @@ -0,0 +1,29 @@ +TYPE=borgwarehouse + +DOMAIN=borgwarehouse.example.com + +## Domain aliases +#EXTRA_DOMAINS=', `www.borgwarehouse.example.com`' + +LETS_ENCRYPT_ENV=production + +## Required variables section ## + +# Hostname and URL +NEXTAUTH_URL=https://your.domain.com + +# Secrects +NEXTAUTH_SECRET=your-secret +CRONJOB_KEY=your-other-secret + +# data folders (volume mounts) +# set this variable if you have a dedicated share/mount on the server that can hold your borg repos +# the folder must be owned by 1001:1001 +# BORG_REPOSITORY_PATH=./repos + +# SMTP server settings +#MAIL_SMTP_FROM= +#MAIL_SMTP_HOST= +#MAIL_SMTP_PORT= +#MAIL_SMTP_LOGIN= +#MAIL_REJECT_SELFSIGNED_TLS=true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a6353d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.envrc diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d42de1 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# borgwarehouse + +> One line description of the recipe + + + +* **Category**: Apps +* **Status**: 0 +* **Image**: [`borgwarehouse`](https://hub.docker.com/r/borgwarehouse), 4, upstream +* **Healthcheck**: No +* **Backups**: No +* **Email**: No +* **Tests**: No +* **SSO**: No + + + +## Quick start + +* `abra app new borgwarehouse --secrets` +* `abra app config ` +* `abra app deploy ` + +For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech). diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..6c8dd08 --- /dev/null +++ b/compose.yml @@ -0,0 +1,40 @@ +--- +version: "3.8" + +services: + app: + image: borgwarehouse/borgwarehouse:v3.0.0 + user: "1001:1001" + environment: + - WEB_SERVER_PORT=3000 + - SSH_SERVER_PORT=2002 + - FQDN=${DOMAIN} + - MAIL_SMTP_PWD_FILE="/run/secrets/smtp_password" + volumes: + - config:/home/borgwarehouse/app/config + - sshkey:/home/borgwarehouse/.ssh + - sshhost:/etc/ssh + - ${BORG_REPOSITORY_PATH:-repos}:/home/borgwarehouse/repos + - tmp:/home/borgwarehouse/tmp + - log:/home/borgwarehouse/logs + deploy: + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000" + - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})" + - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" + - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" + - "coop-cloud.${STACK_NAME}.version=0.1.0+v3.0.0" +networks: + proxy: + external: true + +volumes: + config: + sshkey: + sshhost: + repos: + tmp: + log: diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl new file mode 100644 index 0000000..6f071c4 --- /dev/null +++ b/entrypoint.sh.tmpl @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e + +file_env() { + local var="$1" + local fileVar="${var}_FILE" + local def="${2:-}" + + if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then + echo >&2 "error: both $var and $fileVar are set (but are exclusive)" + exit 1 + fi + + local val="$def" + + if [ "${!var:-}" ]; then + val="${!var}" + elif [ "${!fileVar:-}" ]; then + val="$(< "${!fileVar}")" + fi + + export "$var"="$val" + unset "$fileVar" +} + +file_env "MAIL_SMTP_PWD" \ No newline at end of file diff --git a/release/.git-keep-me b/release/.git-keep-me new file mode 100644 index 0000000..e69de29