Adds writefreely app.

This commit is contained in:
2026-06-19 21:33:33 +00:00
parent be035c7a85
commit cb5f3d66ff
10 changed files with 299 additions and 0 deletions

5
writefreely/app.yaml Normal file
View File

@@ -0,0 +1,5 @@
name: writefreely
is: writefreely
description: WriteFreely is a clean, minimalist publishing platform made for writers who value simplicity and federation via ActivityPub.
icon: https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/writefreely.svg
latest: "0"

View File

@@ -0,0 +1,38 @@
# WriteFreely
WriteFreely is a minimalist, federated blogging platform built on ActivityPub.
## Dependencies
- **MySQL** - Database for storing posts and accounts
## Configuration
Key settings in `config.yaml`:
- **domain** - Where WriteFreely will be accessible
- **storage** - Persistent volume size (default: `1Gi`)
- **siteName** - Display name for the instance (default: `WriteFreely`)
- **adminUser** - Admin username (default: `admin`)
## First-Time Setup
1. Add and deploy the app:
```bash
wild app add writefreely
wild app deploy writefreely
```
2. Log in at `/admin/login` with:
- **Username**: value of `adminUser` in your config (default: `wildadmin`)
- **Password**: value of `adminPassword` in your `secrets.yaml`
Note: WriteFreely reserves the username `admin` — the default and any configured `adminUser` must not be `admin`.
3. From the admin dashboard you can manage users, customize the instance, and create your first blog.
## Notes
- Each user gets their own blog at `/{username}`
- ActivityPub federation allows posts to be followed from Mastodon and other fediverse platforms
- New user registration can be enabled or restricted via the admin dashboard

View File

@@ -0,0 +1,64 @@
apiVersion: batch/v1
kind: Job
metadata:
name: writefreely-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: mysql-init
image: mysql:9.1.0
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: writefreely-secrets
key: mysql.rootPassword
- name: DB_HOSTNAME
value: {{ .db.host }}
- name: DB_PORT
value: "{{ .db.port }}"
- name: DB_DATABASE_NAME
value: {{ .db.name }}
- name: DB_USERNAME
value: {{ .db.user }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: writefreely-secrets
key: dbPassword
command:
- /bin/bash
- -c
- |
set -e
until mysql -h ${DB_HOSTNAME} -P ${DB_PORT} -u root -p${MYSQL_ROOT_PASSWORD} -e "SELECT 1" 2>/dev/null; do
echo "Waiting for MySQL..."
sleep 2
done
mysql -h ${DB_HOSTNAME} -P ${DB_PORT} -u root -p${MYSQL_ROOT_PASSWORD} <<EOF
CREATE DATABASE IF NOT EXISTS ${DB_DATABASE_NAME};
CREATE USER IF NOT EXISTS '${DB_USERNAME}'@'%' IDENTIFIED BY '${DB_PASSWORD}';
ALTER USER '${DB_USERNAME}'@'%' IDENTIFIED BY '${DB_PASSWORD}';
GRANT ALL PRIVILEGES ON ${DB_DATABASE_NAME}.* TO '${DB_USERNAME}'@'%';
FLUSH PRIVILEGES;
EOF
echo "Done"

View File

@@ -0,0 +1,101 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: writefreely
namespace: writefreely
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: web
template:
metadata:
labels:
component: web
spec:
securityContext:
runAsUser: 0
runAsNonRoot: false
seccompProfile:
type: RuntimeDefault
containers:
- name: writefreely
image: jrasanen/writefreely:latest
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
- name: WRITEFREELY_HOST
value: https://{{ .domain }}
- name: WRITEFREELY_SITE_NAME
value: {{ .siteName }}
- name: WRITEFREELY_BIND_PORT
value: "8080"
- name: WRITEFREELY_DATABASE_DATABASE
value: mysql
- name: WRITEFREELY_DATABASE_HOST
value: {{ .db.host }}
- name: WRITEFREELY_DATABASE_PORT
value: "{{ .db.port }}"
- name: WRITEFREELY_DATABASE_NAME
value: {{ .db.name }}
- name: WRITEFREELY_DATABASE_USERNAME
value: {{ .db.user }}
- name: WRITEFREELY_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: writefreely-secrets
key: dbPassword
- name: WRITEFREELY_ADMIN_USER
value: {{ .adminUser }}
- name: WRITEFREELY_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: writefreely-secrets
key: adminPassword
- name: WRITEFREELY_FEDERATION
value: "true"
- name: WRITEFREELY_OPEN_REGISTRATION
value: "false"
resources:
limits:
cpu: 500m
ephemeral-storage: 1Gi
memory: 512Mi
requests:
cpu: 50m
ephemeral-storage: 50Mi
memory: 128Mi
volumeMounts:
- name: writefreely-data
mountPath: /data
livenessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 60
timeoutSeconds: 5
periodSeconds: 15
failureThreshold: 6
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 30
timeoutSeconds: 3
periodSeconds: 10
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
volumes:
- name: writefreely-data
persistentVolumeClaim:
claimName: writefreely-data
restartPolicy: Always

View File

@@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: writefreely
namespace: writefreely
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: writefreely
port:
number: 80
tls:
- hosts:
- {{ .domain }}
secretName: {{ .tlsSecretName }}

View File

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

View File

@@ -0,0 +1,21 @@
version: 0.16.0-1
requires:
- name: mysql
defaultConfig:
namespace: writefreely
externalDnsDomain: '{{ .cloud.domain }}'
domain: writefreely.{{ .cloud.domain }}
tlsSecretName: wildcard-wild-cloud-tls
storage: 1Gi
siteName: WriteFreely
adminUser: wildadmin
db:
host: '{{ .apps.mysql.host }}'
port: '3306'
name: writefreely
user: writefreely
defaultSecrets:
- key: adminPassword
- key: dbPassword
requiredSecrets:
- mysql.rootPassword

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: writefreely

View File

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

View File

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