generated from coop-cloud/example
Initialise package
This commit is contained in:
parent
59785cd398
commit
62ecb0fd87
33
.drone.yml
33
.drone.yml
|
@ -14,43 +14,20 @@ steps:
|
||||||
DOMAIN: gotosocial.swarm-test.autonomic.zone
|
DOMAIN: gotosocial.swarm-test.autonomic.zone
|
||||||
STACK_NAME: gotosocial
|
STACK_NAME: gotosocial
|
||||||
LETS_ENCRYPT_ENV: production
|
LETS_ENCRYPT_ENV: production
|
||||||
|
GTS_ACCOUNTS_OPEN_REGISTRATION: false
|
||||||
- name: notify coopcloud-dev on failure
|
GTS_ACCOUNTS_APPROVAL_REQUIRED: true
|
||||||
image: plugins/matrix
|
GTS_ACCOUNTS_REASON_REQUIRED: true
|
||||||
settings:
|
APP_ENTRYPOINT_VERSION: v1
|
||||||
homeserver: https://matrix.autonomic.zone
|
|
||||||
roomid: "IFazIpLtxiScqbHqoa:autonomic.zone"
|
|
||||||
userid: "@autono-bot:autonomic.zone"
|
|
||||||
accesstoken:
|
|
||||||
from_secret: autono_bot_access_token
|
|
||||||
depends_on:
|
|
||||||
- deployment
|
|
||||||
when:
|
|
||||||
status:
|
|
||||||
- failure
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: recipe release
|
name: recipe release
|
||||||
steps:
|
steps:
|
||||||
- name: release a new version
|
- name: release a new version
|
||||||
image: decentral1se/drone-abra:latest
|
image: thecoopcloud/drone-abra:latest
|
||||||
settings:
|
settings:
|
||||||
command: recipe gotosocial release
|
command: recipe gotosocial release
|
||||||
deploy_key:
|
deploy_key:
|
||||||
from_secret: abra_bot_deploy_key
|
from_secret: abra_bot_deploy_key
|
||||||
|
|
||||||
- name: trigger downstream builds
|
|
||||||
image: plugins/downstream
|
|
||||||
settings:
|
|
||||||
server: https://drone.autonomic.zone
|
|
||||||
token:
|
|
||||||
from_secret: decentral1se_token
|
|
||||||
fork: true
|
|
||||||
repositories:
|
|
||||||
- coop-cloud/auto-apps-json
|
|
||||||
depends_on:
|
|
||||||
- release a new version
|
|
|
@ -1,6 +1,10 @@
|
||||||
TYPE=gotosocial
|
TYPE=gotosocial
|
||||||
|
|
||||||
DOMAIN=gotosocial.example.com
|
DOMAIN=gotosocial.example.com
|
||||||
## Domain aliases
|
|
||||||
#EXTRA_DOMAINS=', `www.gotosocial.example.com`'
|
|
||||||
LETS_ENCRYPT_ENV=production
|
LETS_ENCRYPT_ENV=production
|
||||||
|
|
||||||
|
GTS_ACCOUNTS_OPEN_REGISTRATION=false
|
||||||
|
GTS_ACCOUNTS_APPROVAL_REQUIRED=true
|
||||||
|
GTS_ACCOUNTS_REASON_REQUIRED=true
|
||||||
|
|
||||||
|
SECRET_DB_PASSWORD_VERSION=v1
|
||||||
|
|
20
README.md
20
README.md
|
@ -1,16 +1,18 @@
|
||||||
# Gotosocial
|
# gotosocial
|
||||||
|
|
||||||
Golang fediverse server.
|
Golang fediverse server.
|
||||||
|
|
||||||
<!-- metadata -->
|
<!-- metadata -->
|
||||||
* **Category**:
|
|
||||||
* **Status**:
|
- **Category**:
|
||||||
* **Image**: [`gotosocial`](https://hub.docker.com/r/gotosocial/gotosocial)
|
- **Status**:
|
||||||
* **Healthcheck**:
|
- **Image**: [`decentral1se/gotosocial`](https://hub.docker.com/r/decentral1se/gotosocial)
|
||||||
* **Backups**:
|
- **Healthcheck**:
|
||||||
* **Email**:
|
- **Backups**:
|
||||||
* **Tests**:
|
- **Email**:
|
||||||
* **SSO**:
|
- **Tests**:
|
||||||
|
- **SSO**:
|
||||||
|
|
||||||
<!-- endmetadata -->
|
<!-- endmetadata -->
|
||||||
|
|
||||||
## Basic usage
|
## Basic usage
|
||||||
|
|
85
compose.yml
85
compose.yml
|
@ -3,29 +3,76 @@ version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: nginx:1.19.2
|
image: decentral1se/gotosocial:latest
|
||||||
|
secrets:
|
||||||
|
- db_password
|
||||||
|
environment:
|
||||||
|
- GTS_ACCOUNTS_APPROVAL_REQUIRED
|
||||||
|
- GTS_ACCOUNTS_OPEN_REGISTRATION
|
||||||
|
- GTS_ACCOUNTS_REASON_REQUIRED
|
||||||
|
- GTS_DB_ADDRESS=db
|
||||||
|
- GTS_DB_DATABASE=gotosocial
|
||||||
|
- GTS_DB_PASSWORD_FILE=/run/secrets/db_password
|
||||||
|
- GTS_DB_PORT=5432
|
||||||
|
- GTS_DB_TYPE=postgres
|
||||||
|
- GTS_DB_USER=gotosocial
|
||||||
|
- GTS_HOST=${DOMAIN}
|
||||||
|
- GTS_LETSENCRYPT_ENABLED=false
|
||||||
|
- GTS_STORAGE_SERVE_HOST=${DOMAIN}
|
||||||
|
configs:
|
||||||
|
- source: entrypoint
|
||||||
|
target: /entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
networks:
|
||||||
|
- proxy
|
||||||
|
- internal
|
||||||
|
command: server start
|
||||||
|
entrypoint: /entrypoint.sh
|
||||||
|
volumes:
|
||||||
|
- app:/gotosocial/storage
|
||||||
|
deploy:
|
||||||
|
update_config:
|
||||||
|
failure_action: rollback
|
||||||
|
order: start-first
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
|
||||||
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||||
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080"
|
||||||
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:10-alpine
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=gotosocial
|
||||||
|
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
|
||||||
|
- POSTGRES_DB=gotosocial
|
||||||
|
secrets:
|
||||||
|
- db_password
|
||||||
|
volumes:
|
||||||
|
- db:/var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- internal
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
|
||||||
condition: on-failure
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "coop-cloud.${STACK_NAME}.db.version=10-alpine-131220fe"
|
||||||
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
secrets:
|
||||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
db_password:
|
||||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
external: true
|
||||||
## Redirect from EXTRA_DOMAINS to DOMAIN
|
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
|
||||||
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
|
||||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
|
||||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-f", "http://localhost"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 10
|
|
||||||
start_period: 1m
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
internal:
|
||||||
|
internal: true
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
|
configs:
|
||||||
|
entrypoint:
|
||||||
|
name: ${STACK_NAME}_app_entrypoint_${APP_ENTRYPOINT_VERSION}
|
||||||
|
file: entrypoint.sh
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
app:
|
||||||
|
db:
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/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 "GTS_DB_PASSWORD"
|
||||||
|
|
||||||
|
exec "$@"
|
Loading…
Reference in New Issue