diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3b056fd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM php:7.4-alpine3.13 + +RUN mkdir /app + +WORKDIR /app + +# Install Git, NPM & needed libraries +RUN apk update \ + && apk add bash git nodejs npm gettext subversion mysql mysql-client zip \ + && rm -f /var/cache/apk/* + +RUN docker-php-ext-install mysqli + +# Install Composer +RUN EXPECTED_CHECKSUM=$(curl -s https://composer.github.io/installer.sig) \ + && curl https://getcomposer.org/installer -o composer-setup.php \ + && ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" \ + && if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then >&2 echo 'ERROR: Invalid installer checksum'; rm composer-setup.php; exit 1; fi \ + && php composer-setup.php --quiet \ + && php -r "unlink('composer-setup.php');" \ + && mv composer.phar /usr/local/bin/composer + +RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \ + chmod +x wp-cli.phar && \ + mv wp-cli.phar /usr/local/bin/wp + +RUN chmod +x -R ./ diff --git a/README.md b/README.md index 465949e..65d73c5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Tags:** OStatus, fediverse, activitypub, activitystream **Requires at least:** 4.7 **Tested up to:** 6.1 -**Stable tag:** 0.14.3 +**Stable tag:** 0.15.0 **Requires PHP:** 5.6 **License:** MIT **License URI:** http://opensource.org/licenses/MIT @@ -88,6 +88,16 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). +### v.next ### + +* Add configuration item for number of images to attach. props [@mexon](https://github.com/mexon) + +### 0.15.0 ### + +* Enable ActivityPub only for users that can `publish_posts` +* Persist only public Activities +* Fix remote-delete + ### 0.14.3 ### * Better error handling. props [@akirk](https://github.com/akirk) @@ -102,7 +112,7 @@ Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github ### 0.14.0 ### -* Friends support: https://wordpress.org/plugins/friends/ . props [@akirk](https://github.com/akirk) +* Friends support: https://wordpress.org/plugins/friends/ props [@akirk](https://github.com/akirk) * Massive guidance improvements. props [mediaformat](https://github.com/mediaformat) & [@akirk](https://github.com/akirk) * Add Custom Post Type support to outbox API. props [blueset](https://github.com/blueset) * Better hash-tag support. props [bocops](https://github.com/bocops) diff --git a/activitypub.php b/activitypub.php index 2bbe195..d0ae3b6 100644 --- a/activitypub.php +++ b/activitypub.php @@ -19,10 +19,12 @@ namespace Activitypub; * Initialize plugin */ function init() { + \defined( 'ACTIVITYPUB_EXCERPT_LENGTH' ) || \define( 'ACTIVITYPUB_EXCERPT_LENGTH', 400 ); + \defined( 'ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS' ) || \define( 'ACTIVITYPUB_MAX_IMAGE_ATTACHMENTS', 3 ); \defined( 'ACTIVITYPUB_HASHTAGS_REGEXP' ) || \define( 'ACTIVITYPUB_HASHTAGS_REGEXP', '(?:(?<=\s)|(?<=

)|(?<=
)|^)#([A-Za-z0-9_]+)(?:(?=\s|[[:punct:]]|$))' ); + \defined( 'ACTIVITYPUB_USERNAME_REGEXP' ) || \define( 'ACTIVITYPUB_USERNAME_REGEXP', '(?:([A-Za-z0-9_-]+)@((?:[A-Za-z0-9_-]+\.)+[A-Za-z]+))' ); \defined( 'ACTIVITYPUB_ALLOWED_HTML' ) || \define( 'ACTIVITYPUB_ALLOWED_HTML', '