Compare commits

..

12 Commits

Author SHA1 Message Date
40300fd47f Merge upstream/main 2026-06-03 21:52:47 +01:00
10480ed868 Implemented wip management of plug-ins and themes 2026-06-03 21:51:45 +01:00
6f23a5dfae Merge pull request 'Improve README' (#69) from kawaiipunk/wordpress:main into main
Reviewed-on: coop-cloud/wordpress#69
2026-06-03 20:43:00 +00:00
6d1b370cde merge upstream 2026-06-03 20:16:22 +00:00
c5fb2ebaf3 Improve readme 2026-06-03 21:15:54 +01:00
a34d7af280 revert 12d1e4e371
revert Merge pull request 'Improved README' (#68) from improve-readme into main

So sorry, that was a mistake!

Reviewed-on: coop-cloud/wordpress#68
2026-06-03 20:14:21 +00:00
12d1e4e371 Merge pull request 'Improved README' (#68) from improve-readme into main
Reviewed-on: coop-cloud/wordpress#68
2026-06-03 20:13:38 +00:00
8407a00942 Improved README 2026-06-03 21:12:32 +01:00
47fbba1505 Added additional instructions for running wp-cli 2026-06-03 20:08:20 +01:00
32062bff94 Merge pull request 'fix/3wc/wp-cli' (#64) from kawaiipunk/wordpress:fix/3wc/wp-cli into main
Reviewed-on: coop-cloud/wordpress#64
2026-06-03 18:55:12 +00:00
c7f500c428 Merge pull request 'tests' (#62) from kawaiipunk/wordpress:tests into main
Reviewed-on: coop-cloud/wordpress#62
2026-06-03 18:36:32 +00:00
3wc
15dd324102 fix: $* instead of $@, seems to fix #49?
Closes #49
2026-06-02 23:37:23 +01:00
3 changed files with 80 additions and 43 deletions

View File

@ -16,6 +16,17 @@ LETS_ENCRYPT_ENV=production
# Setup Wordpress settings on each deploy:
#POST_DEPLOY_CMDS="app core_install"
# Install plugins and themes on deploy (space-separated slugs)
# Ensure POST_DEPLOY_CMDS includes "app install_plugins" and/or "app install_themes"
#WORDPRESS_PLUGINS="wordpress-importer two-factor"
#WORDPRESS_THEMES="twentytwentyfive"
# Remove plugins on deploy (space-separated slugs)
# Ensure POST_DEPLOY_CMDS includes "app remove_plugins"
#WORDPRESS_REMOVE_PLUGINS="akismet hello"
# Or remove the default Akismet and Hello Dolly plugins
#POST_DEPLOY_CMDS="app remove_default_plugins"
# Optional settings, otherwise can be set in the installer
# (Required for `app core_install`
#TITLE="My Example Blog"

View File

@ -13,52 +13,18 @@ Coöp Cloud + [Wordpress](https://wordpress.org) = 🥳
* **Backups**: Yes
* **Email**: 3
* **Tests**: 2
* **SSO**: No
* **SSO**: 2
<!-- endmetadata -->
## Quick start
* `abra app new wordpress`
* `abra app config <app-name>`
* `abra app secret generate -a <app-name>`
* `abra app deploy <app-name>`
* `abra app cmd <app-name> app core_install`
### Authentik Integration
`abra app config <app-name>`
Configure the following envs:
```
COMPOSE_FILE="$COMPOSE_FILE:compose.authentik.yml"
AUTHENTIK_DOMAIN=authentik.example.com
AUTHENTIK_SECRET_NAME=authentik_example_com_wordpress_secret_v1 # the same as in authentik
AUTHENTIK_ID_NAME=authentik_example_com_wordpress_id_v1 # the same as in authentik
```
`abra app cmd <app-name> app set_authentik`
## Running WP-CLI
`abra app cmd <app-name> app wp -- core check-update --major`
## Network (Multi-site)
1. Set up as above
2. `abra app config <app-name>`, and uncomment `#MULTISITE=enable`
3. `abra app deploy <app-name>`
4. Log into the Wordpress admin dashboard, go to Tools » Network Setup
5. Don't worry about the suggested file changes
6. `abra app config <app-name>` again and set `MULTISITE` to either `subdomain` or `subfolder` depending on your setup.
7. `abra app deploy <app-name>`
## Installing a custom theme
`abra app cp <app-name> ~/path/to/local/theme wordpress:/var/www/html/wp-content/themes/`
## Email
There is a local or remote SMTP relay configuration available.
@ -74,9 +40,46 @@ Below are the instructions for the local relay.
`$DOMAIN` or in its `$EXTRA_SENDER_DOMAINS`
3. `abra app deploy <app-name>`
## WP-CLI
You can either run using `abra app cmd`:
```bash
abra app cmd <app-name> app wp -- core check-update --major
```
Or by entering the app shell:
1. `abra app run <app-name> app bash`
2. `su -s /bin/bash www-data -c "wp core check-update --major"`
## Network (Multi-site)
1. Set up as above
2. `abra app config <app-name>`, and uncomment `#MULTISITE=enable`
3. `abra app deploy <app-name>`
4. Log into the WordPress admin dashboard, go to **Tools → Network Setup**
5. Don't worry about the suggested file changes
6. `abra app config <app-name>` again and set `MULTISITE` to either `subdomain` or `subfolder` depending on your setup.
7. `abra app deploy <app-name>`
## Installing a custom theme
`abra app cp <app-name> ~/path/to/local/theme wordpress:/var/www/html/wp-content/themes/`
## Authentik Integration
Configure the following envs via `abra app config <app-name>`:
```bash
COMPOSE_FILE="$COMPOSE_FILE:compose.authentik.yml"
AUTHENTIK_DOMAIN=authentik.example.com
AUTHENTIK_SECRET_NAME=authentik_example_com_wordpress_secret_v1 # the same as in authentik
AUTHENTIK_ID_NAME=authentik_example_com_wordpress_id_v1 # the same as in authentik
```
`abra app cmd <app-name> app set_authentik`
## Tests
Run the full test suite:
Run the full test suite for this repository:
```sh
bash tests/run.sh
@ -91,11 +94,9 @@ brew install shellcheck gomplate
```
Some tests skip gracefully if their dependencies are missing.
[abra]: https://git.autonomic.zone/autonomic-cooperative/abra
## Migrate from a non-Co-op Cloud WordPress install
## Migrate from a non-Co-op Cloud Wordpress install
Make a .tar.gz backup of the site's wp-content dir and an .sql.gz backup of the database.
Make a `.tar.gz` backup of the site's `wp-content` dir and a `.sql.gz` backup of the database.
1. `abra app wp.example.com restore app wp-content.tar.gz`
2. `abra app wp.example.com restore db wordpress.sql.gz`
@ -103,5 +104,6 @@ Make a .tar.gz backup of the site's wp-content dir and an .sql.gz backup of the
Lastly, if there's a domain name change, run a search and replace:
`abra app wp.example.com wp "search-replace https://old.example.com https://wp.example.com"`
[abra]: https://git.autonomic.zone/autonomic-cooperative/abra
[cc-traefik]: https://git.autonomic.zone/coop-cloud/traefik
[cc-postfix-relay]: https://git.autonomic.zone/coop-cloud/traefik
[cc-postfix-relay]: https://git.autonomic.zone/coop-cloud/postfix-relay

28
abra.sh
View File

@ -1,12 +1,12 @@
export PHP_UPLOADS_CONF_VERSION=v4
export ENTRYPOINT_CONF_VERSION=v9
export ENTRYPOINT_CONF_VERSION=v10
export ENTRYPOINT_MAILRELAY_CONF_VERSION=v2
export MSMTP_CONF_VERSION=v4
export HTACCESS_CONF_VERSION=v3
export USERS_CONF_VERSION=v1
wp() {
su -p www-data -s /bin/bash -c "/usr/local/bin/wp $@"
su -p www-data -s /bin/bash -c "/usr/local/bin/wp $*"
}
update() {
@ -107,3 +107,27 @@ fix_mysql() {
show_plugins() {
wp "plugin list --fields=name,status,wporg_status,version,update_version,auto_update,tested_up_to,wporg_last_updated"
}
install_plugins() {
for plugin in $WORDPRESS_PLUGINS; do
wp "plugin install --activate $plugin"
done
}
install_themes() {
for theme in $WORDPRESS_THEMES; do
wp "theme install --activate $theme"
done
}
remove_plugins() {
for plugin in $WORDPRESS_REMOVE_PLUGINS; do
wp "plugin is-installed $plugin" && wp "plugin uninstall $plugin"
done
}
remove_default_plugins() {
for plugin in akismet hello; do
wp "plugin is-installed $plugin" && wp "plugin uninstall $plugin"
done
}