Adds gancio app.

This commit is contained in:
2026-06-19 21:33:05 +00:00
parent b42f048f5c
commit 777bab792c
10 changed files with 283 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
# Gancio
Gancio is a shared agenda for local communities, federated via ActivityPub. It allows groups to publish and discover local events.
## Dependencies
- **PostgreSQL** - Database for storing events and users
## Configuration
Key settings in `config.yaml`:
- **domain** - Where Gancio will be accessible
- **storage** - Persistent volume size (default: `2Gi`)
- **db.name** - Database name (default: `gancio`)
## First-Time Setup
1. Add and deploy the app:
```bash
wild app add gancio
wild app deploy gancio
```
2. Visit the app URL — on first load, a setup wizard will run to create the admin account and configure the instance.
3. After setup, you can start publishing events and inviting community members.
## Notes
- **Re-deploy warning**: If the app is deleted and redeployed with an existing database, Gancio will refuse to start with a "Non empty db" error. Fix by dropping and recreating the public schema in the `gancio` database before restarting. See ADDING-APPS-NOTES.md note 18 for the exact commands.
- Gancio stores its setup state in `config.json` on the data PVC — do not delete the PVC without also clearing the database
- Events are federated to Mastodon and other ActivityPub platforms

View File

@@ -0,0 +1,63 @@
apiVersion: batch/v1
kind: Job
metadata:
name: gancio-db-init
labels:
component: db-init
spec:
template:
metadata:
labels:
component: db-init
spec:
restartPolicy: OnFailure
securityContext:
runAsNonRoot: true
runAsUser: 999
runAsGroup: 999
seccompProfile:
type: RuntimeDefault
containers:
- name: db-init
image: postgres:17
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
command: ["/bin/bash", "-c"]
args:
- |
PGPASSWORD=${POSTGRES_ADMIN_PASSWORD} psql -h ${DB_HOSTNAME} -U postgres <<EOF
DO \$\$
BEGIN
IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = '${DB_USERNAME}') THEN
CREATE USER ${DB_USERNAME} WITH ENCRYPTED PASSWORD '${DB_PASSWORD}';
ELSE
ALTER USER ${DB_USERNAME} WITH ENCRYPTED PASSWORD '${DB_PASSWORD}';
END IF;
END
\$\$;
SELECT 'CREATE DATABASE ${DB_DATABASE_NAME}' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = '${DB_DATABASE_NAME}')\gexec
ALTER DATABASE ${DB_DATABASE_NAME} OWNER TO ${DB_USERNAME};
GRANT ALL PRIVILEGES ON DATABASE ${DB_DATABASE_NAME} TO ${DB_USERNAME};
EOF
env:
- name: POSTGRES_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secrets
key: password
- name: DB_HOSTNAME
value: "{{ .db.host }}"
- name: DB_DATABASE_NAME
value: "{{ .db.name }}"
- name: DB_USERNAME
value: "{{ .db.user }}"
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: gancio-secrets
key: dbPassword

View File

@@ -0,0 +1,92 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: gancio
namespace: gancio
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: web
template:
metadata:
labels:
component: web
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: gancio
image: cisti/gancio:1.28.2
ports:
- name: http
containerPort: 13120
protocol: TCP
env:
- name: NODE_ENV
value: production
- name: GANCIO_DATA
value: /home/node/data
- name: GANCIO_DB_DIALECT
value: postgres
- name: GANCIO_DB_HOST
value: {{ .db.host }}
- name: GANCIO_DB_PORT
value: "{{ .db.port }}"
- name: GANCIO_DB_DATABASE
value: {{ .db.name }}
- name: GANCIO_DB_USERNAME
value: {{ .db.user }}
- name: GANCIO_DB_PASSWORD
valueFrom:
secretKeyRef:
name: gancio-secrets
key: dbPassword
- name: GANCIO_PORT
value: "13120"
resources:
limits:
cpu: 1000m
ephemeral-storage: 1Gi
memory: 1Gi
requests:
cpu: 50m
ephemeral-storage: 50Mi
memory: 256Mi
volumeMounts:
- name: gancio-data
mountPath: /home/node/data
livenessProbe:
httpGet:
path: /
port: 13120
initialDelaySeconds: 60
timeoutSeconds: 5
periodSeconds: 15
failureThreshold: 6
readinessProbe:
httpGet:
path: /
port: 13120
initialDelaySeconds: 30
timeoutSeconds: 3
periodSeconds: 10
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
volumes:
- name: gancio-data
persistentVolumeClaim:
claimName: gancio-data
restartPolicy: Always

View File

@@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: gancio
namespace: gancio
annotations:
external-dns.alpha.kubernetes.io/target: {{ .externalDnsDomain }}
external-dns.alpha.kubernetes.io/cloudflare-proxied: "false"
external-dns.alpha.kubernetes.io/ttl: "60"
spec:
ingressClassName: traefik
rules:
- host: {{ .domain }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: gancio
port:
number: 80
tls:
- hosts:
- {{ .domain }}
secretName: {{ .tlsSecretName }}

View File

@@ -0,0 +1,16 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: {{ .namespace }}
labels:
- includeSelectors: true
pairs:
app: gancio
managedBy: kustomize
partOf: wild-cloud
resources:
- namespace.yaml
- deployment.yaml
- service.yaml
- ingress.yaml
- pvc.yaml
- db-init-job.yaml

View File

@@ -0,0 +1,20 @@
version: 1.28.2-1
requires:
- name: postgres
defaultConfig:
namespace: gancio
externalDnsDomain: '{{ .cloud.domain }}'
domain: gancio.{{ .cloud.domain }}
tlsSecretName: wildcard-wild-cloud-tls
storage: 2Gi
db:
host: '{{ .apps.postgres.host }}'
port: '5432'
name: gancio
user: gancio
defaultSecrets:
- key: dbPassword
- key: dbUrl
default: 'postgresql://{{ .app.db.user }}:{{ .secrets.dbPassword }}@{{ .app.db.host }}:{{ .app.db.port }}/{{ .app.db.name }}?sslmode=disable'
requiredSecrets:
- postgres.password

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ .namespace }}

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gancio-data
namespace: gancio
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .storage }}

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: gancio
namespace: gancio
spec:
selector:
component: web
ports:
- name: http
port: 80
targetPort: 13120
protocol: TCP