Compare commits

...

20 Commits

Author SHA1 Message Date
Renovate Bot 6b59677976 Update wordpress Docker tag to v5.8.0
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
2021-07-21 07:03:37 +00:00
3wc 08fc5fe2c6 Fix README formatting
continuous-integration/drone/push Build is failing Details
2021-07-11 17:14:52 +02:00
decentral1se de33fac3d3
Use new image namespace
continuous-integration/drone/push Build is failing Details
2021-06-21 12:32:21 +02:00
decentral1se d6125ba37a
Remove trigger, we make the tags [ci skip] 2021-06-04 00:15:45 +02:00
decentral1se 6551fd8f8c
Fix bad name in batch update script [ci skip] 2021-06-03 23:07:29 +02:00
decentral1se 14d50b851e
Add release logic to CI [ci skip] 2021-06-03 23:01:37 +02:00
decentral1se acd5e93a4b
Add some docs
continuous-integration/drone/push Build is passing Details
2021-06-02 11:26:03 +02:00
decentral1se f7600b9bc8
Merge commit 'febd250'
continuous-integration/drone/push Build is passing Details
2021-06-02 11:23:10 +02:00
decentral1se febd2500b4
Fix syntax 2021-06-02 11:22:54 +02:00
decentral1se a330574682
Remove old configs 2021-06-02 11:22:22 +02:00
decentral1se be6cf302d0
Unbreak mailrelay config
continuous-integration/drone/push Build is passing Details
2021-06-02 11:20:24 +02:00
decentral1se 8af9be6a40
Ensure default
continuous-integration/drone/push Build is passing Details
2021-06-02 09:57:25 +02:00
decentral1se a550017071
Add missing from
continuous-integration/drone/push Build is passing Details
2021-06-02 08:36:52 +02:00
decentral1se 9fa2b2d1b7
Support SMTP relay configuration
continuous-integration/drone/push Build is passing Details
Hopefully this doesn't bork existing relay configs
2021-06-02 08:24:33 +02:00
3wc 8399631c81 Another lap of the Wordpress arms race..
continuous-integration/drone/push Build is passing Details
2021-05-25 09:28:57 +02:00
3wc e5c41fa027 Version 5.7.2; sync labels
continuous-integration/drone/push Build is passing Details
2021-05-15 22:08:17 +02:00
3wordchant 0df2a556e8 Merge pull request 'Update wordpress Docker tag to v5.7.2 (master)' (#24) from renovate/master-docker-wordpress-5.x into master
continuous-integration/drone/push Build is passing Details
Reviewed-on: #24
2021-05-15 22:07:11 +02:00
Renovate Bot 4d4befc9e1 Update wordpress Docker tag to v5.7.2
continuous-integration/drone/pr Build is failing Details
2021-05-14 07:02:27 +00:00
decentral1se e8aa34c7e3
Remove unused env vars
continuous-integration/drone/push Build is failing Details
2021-05-10 07:12:05 +02:00
decentral1se 421c01e78a
Formatting and remove backup bot docs
continuous-integration/drone/push Build is passing Details
2021-05-10 07:09:52 +02:00
9 changed files with 76 additions and 108 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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_[*]}
}

View File

@ -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" }}

View File

@ -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

18
compose.smtp.yml Normal file
View File

@ -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

View File

@ -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:

View File

@ -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 }}