Compare commits
20 Commits
Author | SHA1 | Date |
---|---|---|
Renovate Bot | 6b59677976 | |
3wc | 08fc5fe2c6 | |
decentral1se | de33fac3d3 | |
decentral1se | d6125ba37a | |
decentral1se | 6551fd8f8c | |
decentral1se | 14d50b851e | |
decentral1se | acd5e93a4b | |
decentral1se | f7600b9bc8 | |
decentral1se | febd2500b4 | |
decentral1se | a330574682 | |
decentral1se | be6cf302d0 | |
decentral1se | 8af9be6a40 | |
decentral1se | a550017071 | |
decentral1se | 9fa2b2d1b7 | |
3wc | 8399631c81 | |
3wc | e5c41fa027 | |
3wordchant | 0df2a556e8 | |
Renovate Bot | 4d4befc9e1 | |
decentral1se | e8aa34c7e3 | |
decentral1se | 421c01e78a |
10
.drone.yml
10
.drone.yml
|
@ -22,3 +22,13 @@ steps:
|
|||
trigger:
|
||||
branch:
|
||||
- master
|
||||
---
|
||||
kind: pipeline
|
||||
name: recipe release
|
||||
steps:
|
||||
- name: release a new version
|
||||
image: thecoopcloud/drone-abra:latest
|
||||
settings:
|
||||
command: recipe wordpress release
|
||||
deploy_key:
|
||||
from_secret: abra_bot_deploy_key
|
||||
|
|
14
.env.sample
14
.env.sample
|
@ -29,10 +29,16 @@ SECRET_DB_PASSWORD_VERSION=v1
|
|||
# define('FORCE_SSL_ADMIN', true );\
|
||||
# define('COOKIE_DOMAIN', \$_SERVER['HTTP_HOST']);"
|
||||
|
||||
# Backups
|
||||
#COMPOSE_FILE="compose.yml:compose.backup.yml"
|
||||
|
||||
# SMTP
|
||||
# Local SMTP relay
|
||||
#COMPOSE_FILE="compose.yml:compose.mailrelay.yml"
|
||||
#SMTP_HOST="postfix_relay_app"
|
||||
#MAIL_FROM="wordpress@example.com"
|
||||
|
||||
# Remote SMTP relay
|
||||
#COMPOSE_FILE="compose.yml:compose.mailrelay.yml:compose.smtp.yml"
|
||||
#SMTP_HOST="mail.example.com"
|
||||
#MAIL_FROM="wordpress@example.com"
|
||||
#SMTP_PORT=587
|
||||
#SMTP_AUTH=on
|
||||
#SMTP_TLS=on
|
||||
#SECRET_SMTP_PASSWORD_VERSION=v1
|
||||
|
|
36
README.md
36
README.md
|
@ -5,14 +5,16 @@
|
|||
Coöp Cloud + [Wordpress](https://wordpress.org) = 🥳
|
||||
|
||||
<!-- metadata -->
|
||||
* **Category**: Apps
|
||||
* **Status**: ❶💚
|
||||
* **Image**: [`wordpress`](https://hub.docker.com/_/wordpress), ❶💚, upstream
|
||||
* **Healthcheck**: Yes
|
||||
* **Backups**: Yes
|
||||
* **Email**: ❶💚
|
||||
* **Tests**: ❷💛
|
||||
* **SSO**: No
|
||||
|
||||
- **Category**: Apps
|
||||
- **Status**: ❶💚
|
||||
- **Image**: [`wordpress`](https://hub.docker.com/_/wordpress), ❶💚, upstream
|
||||
- **Healthcheck**: Yes
|
||||
- **Backups**: Yes
|
||||
- **Email**: ❶💚
|
||||
- **Tests**: ❷💛
|
||||
- **SSO**: No
|
||||
|
||||
<!-- endmetadata -->
|
||||
|
||||
## Basic usage
|
||||
|
@ -23,9 +25,9 @@ Coöp Cloud + [Wordpress](https://wordpress.org) = 🥳
|
|||
to save secrets in `pass`)
|
||||
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
|
||||
your Docker swarm box
|
||||
6. `abra app YOURAPPDOMAIN deploy`
|
||||
7. Open the configured domain in your browser to finish set-up
|
||||
8. `abra app YOURAPPDOMAIN run app chown www-data:www-data /var/www/html/wp-content` to fix
|
||||
5. `abra app YOURAPPDOMAIN deploy`
|
||||
6. Open the configured domain in your browser to finish set-up
|
||||
7. `abra app YOURAPPDOMAIN run app chown www-data:www-data /var/www/html/wp-content` to fix
|
||||
file permissions (see #3)
|
||||
|
||||
## Running WP-CLI
|
||||
|
@ -53,13 +55,15 @@ _(Only tested using subdomains)_
|
|||
|
||||
`abra app YOURAPPDOMAIN cp ~/path/to/local/theme wordpress:/var/www/html/wp-content/themes/`
|
||||
|
||||
## Backups (using backup-bot)
|
||||
|
||||
1. `abra app YOURAPPDOMAIN config`, and uncomment the `export COMPOSE_FILE="compose.yml:compose.backup.yml"` line
|
||||
2. `abra app YOURAPPDOMAIN deploy`
|
||||
|
||||
## Email
|
||||
|
||||
There is a local or remote SMTP relay configuration available.
|
||||
|
||||
- **local**: `COMPOSE_FILE=compose.yml:compose.mailrelay.yml`
|
||||
- **remote**: `COMPOSE_FILE=compose.yml:compose.mailrelay.yml:compose.smtp.yml`
|
||||
|
||||
Below are the instructions for the local relay.
|
||||
|
||||
1. Deploy [`postfix-relay`][cc-postfix-relay]
|
||||
2. `abra app YOURAPPDOMAIN config`, and uncomment the email lines; change
|
||||
`MAIL_FROM` to make sure the domain is the same as `postfix-relay`'s
|
||||
|
|
7
abra.sh
7
abra.sh
|
@ -1,7 +1,7 @@
|
|||
export PHP_UPLOADS_CONF_VERSION=v3
|
||||
export ENTRYPOINT_CONF_VERSION=v2
|
||||
export ENTRYPOINT_MAILRELAY_CONF_VERSION=v1
|
||||
export MSMTP_CONF_VERSION=v1
|
||||
export MSMTP_CONF_VERSION=v3
|
||||
|
||||
sub_wp() {
|
||||
CONTAINER=$(docker container ls -f "Name=${STACK_NAME}_app" --format '{{ .ID }}')
|
||||
|
@ -30,11 +30,12 @@ sub_wp() {
|
|||
docker run -it \
|
||||
--volumes-from "$CONTAINER" \
|
||||
--network "container:$CONTAINER" \
|
||||
-u xfs:xfs \
|
||||
-e WORDPRESS_DB_HOST=db \
|
||||
-e WORDPRESS_DB_USER=wordpress \
|
||||
-e WORDPRESS_DB_PASSWORD=${DB_PASSWORD} \
|
||||
-e WORDPRESS_DB_PASSWORD="${DB_PASSWORD}" \
|
||||
-e WORDPRESS_DB_NAME=wordpress \
|
||||
-e WORDPRESS_CONFIG_EXTRA=${WORDPRESS_CONFIG_EXTRA} \
|
||||
-e WORDPRESS_CONFIG_EXTRA="${WORDPRESS_CONFIG_EXTRA}" \
|
||||
wordpress:cli wp ${abra__args_[*]}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
location:
|
||||
source_directories:
|
||||
- /var/www/html/wp-content
|
||||
repositories:
|
||||
- {{ env "BORGBASE_REPO" }}
|
||||
|
||||
storage:
|
||||
compression: auto,zstd
|
||||
encryption_passphrase: {{ secret "backup_bot_password" }}
|
||||
archive_name_format: "{hostname}-{now}"
|
||||
ssh_command: "ssh -o 'StrictHostKeyChecking no' -i /run/secrets/backup_bot_ssh_key"
|
||||
|
||||
retention:
|
||||
keep_daily: 3
|
||||
keep_weekly: 4
|
||||
keep_monthly: 12
|
||||
keep_yearly: 2
|
||||
prefix: "{hostname}-"
|
||||
|
||||
consistency:
|
||||
checks:
|
||||
- disabled
|
||||
check_last: 3
|
||||
prefix: "{hostname}-"
|
||||
|
||||
hooks:
|
||||
before_backup:
|
||||
- echo "`date` - Starting backup"
|
||||
after_backup:
|
||||
- echo "`date` - Finished backup"
|
||||
mysql_databases:
|
||||
- name: {{ env "DB_TABLE" }}
|
||||
hostname: {{ env "DB_HOST" }}
|
||||
port: 3306
|
||||
username: {{ env "DB_USER" }}
|
||||
password: {{ secret "db_password" }}
|
|
@ -1,47 +0,0 @@
|
|||
---
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
backupbot:
|
||||
image: "decentral1se/backup-bot:latest"
|
||||
networks:
|
||||
- backend
|
||||
volumes:
|
||||
- "wordpress_content:/var/www/html/wp-content/"
|
||||
secrets:
|
||||
- source: backup_bot_ssh_key
|
||||
mode: 0400
|
||||
- backup_bot_password
|
||||
- db_password
|
||||
configs:
|
||||
- source: borgmatic_config_yml
|
||||
target: /etc/borgmatic/config.yaml
|
||||
environment:
|
||||
- BORGBASE_REPO="bp5oj726@bp5oj726.repo.borgbase.com:repo"
|
||||
- DB_HOST=db
|
||||
- DB_TABLE=wordpress
|
||||
- DB_USER=wordpress
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 0
|
||||
labels:
|
||||
- "swarm.cronjob.enable=true"
|
||||
- "swarm.cronjob.schedule=0 2 * * *" # At 02:00
|
||||
restart_policy:
|
||||
condition: none
|
||||
networks:
|
||||
- backend
|
||||
|
||||
configs:
|
||||
borgmatic_config_yml:
|
||||
name: borgmatic_config_yml_v1
|
||||
file: backup.d/borgmatic.yml
|
||||
template_driver: golang
|
||||
|
||||
secrets:
|
||||
backup_bot_ssh_key:
|
||||
name: backup_bot_ssh_key_v1
|
||||
external: true
|
||||
backup_bot_password:
|
||||
name: backup_bot_multisite_passwd_v1
|
||||
external: true
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
app:
|
||||
secrets:
|
||||
- smtp_password
|
||||
environment:
|
||||
- SMTP_HOST=${SMTP_HOST}
|
||||
- SMTP_PORT=${SMTP_PORT:-25}
|
||||
- SMTP_AUTH=${SMTP_AUTH}
|
||||
- SMTP_TLS=${SMTP_TLS}
|
||||
- MAIL_FROM=${MAIL_FROM}
|
||||
|
||||
secrets:
|
||||
smtp_password:
|
||||
name: ${STACK_NAME}_smtp_password_${SECRET_SMTP_PASSWORD_VERSION}
|
||||
external: true
|
|
@ -1,7 +1,7 @@
|
|||
version: "3.8"
|
||||
services:
|
||||
app:
|
||||
image: "wordpress:5.7.1"
|
||||
image: "wordpress:5.8.0"
|
||||
volumes:
|
||||
- "wordpress_content:/var/www/html/wp-content/"
|
||||
networks:
|
||||
|
@ -46,7 +46,7 @@ services:
|
|||
#- "traefik.http.routers.${STACK_NAME}.rule=HostRegexp(`{subdomain:.+}.${DOMAIN}`, `${DOMAIN}`)"
|
||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||
- coop-cloud.${STACK_NAME}.app.version=5.7.1-6ac2321c
|
||||
- coop-cloud.${STACK_NAME}.app.version=5.7.2-92fac7ac
|
||||
db:
|
||||
image: "mariadb:10.6"
|
||||
volumes:
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
account default
|
||||
host {{ env "SMTP_HOST" }}
|
||||
from {{ env "MAIL_FROM" }}
|
||||
user {{ env "MAIL_FROM" }}
|
||||
port {{ env "SMTP_PORT" }}
|
||||
|
||||
{{ if eq (env "SMTP_AUTH") "on" }}
|
||||
auth {{ env "SMTP_AUTH" }}
|
||||
passwordeval "cat /run/secrets/smtp_password"
|
||||
{{ end }}
|
||||
|
||||
{{ if eq (env "SMTP_TLS") "on" }}
|
||||
tls {{ env "SMTP_TLS" }}
|
||||
tls_trust_file /etc/ssl/certs/ca-certificates.crt
|
||||
{{ end }}
|
||||
|
|
Reference in New Issue