2017 © Pedro PelĂĄez
 

drupal-module contentpool-client

Connects the site to a contentpool.

image

drunomics/contentpool-client

Connects the site to a contentpool.

  • Thursday, July 19, 2018
  • by fago
  • Repository
  • 2 Watchers
  • 0 Stars
  • 36 Installations
  • Shell
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 3 Versions
  • 350 % Grown

The README.md

Contentpool client module

The contentpool distribution combines the publishing features of the Thunder distribution with powerful content API & replication features! https://www.drupal.org/project/contentpool, (*1)

Build Status, (*2)

Status

The distribution proved itself very valuable, but it turned out that replication via multiversion is too complex for our use-case - so we switched to a simpler approach., (*3)

If you like to continue maintaining the distribution, please get in touch!, (*4)

Overview

This repository is a Drupal client module that can connect to a contentpool server. You'll need a drupal project for installing it. Refer to "Installation" for details., (*5)

Installation

Quick installation

Please refer to the quick installation instructions of the distribution at https://github.com/drunomics/contentpool#quick-installation., (*6)

Regular installation

  • Install the module and it's dependencies as usual. It's recommended to do so via composer. This requires a composer-enabled Drupal projects, e.g. as provided by http://github.com/drunomics/drupal-project., (*7)

    composer require drunomics/contentpool-client
    drush en contentpool_client -y
  • Configure the module to point to your contentpool instance. This can be done via the automated configruation or manually as following., (*8)

Automated configuration

Just run the provided drush command and provide it with the contentpool URL. Be sure to provide correct authentication credentials of the replicator user and to append the path /relaxed to your contentpool's base URL:, (*9)

drush cps http://replicator:YOURPASS@example.contentpool-project.localdev.space/relaxed

The drush command will check the connection to the contentpool and output errors if there are connection issues., (*10)

Manual configuration

  • Add a new "replicator" user for replication and grant it the "replicator" role. It will be used by the replication process to create the data via the CouchDB compatible /relaxedws API endpoint., (*11)

  • Set the "replicator" user and its password admin/config/relaxed/settings. Do not change the API root., (*12)

  • Add a new remote service "Contentpool" at admin/config/services/relaxed/add and enter the remote URL, including the /relaxedws suffix. After submitting the form, the connection will be checked. If there are no inidicated problems, it worked fine., (*13)

  • Configure the live workspace at admin/structure/workspace/ as follows:, (*14)

    • Set "Assign default target workspace" to "Contentpool - Live".
    • Set "Replication settings on update" to "Replicate contentpool entities"
    • Set "Replication settings on update" to "None"

That's it!, (*15)

Vue.js

For the contentpool filter selection, there is a dependency on Vue 2.5.17 or later. Vue.js is loaded automatically via the pre-configured library of the vuejs module., (*16)

Usage

The module configures all dependencies needed to replicate content from the contentpool. That is, the necessary data model and the modules needed for the replication. See http://www.drupaldeploy.org/ for more info about this modules., (*17)

The client can pull data automatically on a regular basis, or one can initiate the data replication process manually. Finally, the client provides an API endpoint which allows the contentpool to initiate an update instantly after changes occurred., (*18)

Pull data via the drush command

Just run the following command (requires Drush 9):, (*19)

drush cppull

Pull data via the UI

  • As admin you should see an "Update" button in the top right corner of the toolbar. Use it to initiate an update., (*20)

  • Once done so, cron must be invoked to actually perform the replication. Do so; e.g. via the "Run cron" button at admin/reports/status., (*21)

Automatic updates

The contentpool client can be configured to update content from configured contentpool remote servers. The following options are possible:, (*22)

Automatic pulls via Drupal's cron

In the configuration for a remote a pull interval can be specified. On a cron run the interval will be checked and a pull scheduled if necessary. The pull will run automatically at the end of cron execution, when Drupal processes the workspace replication queue., (*23)

Automatic pulls via a manual cron entry

The update can be triggered manually using the contentpool-client:pull-content command. It will pull from all remote servers that are marked as a Contentpool., (*24)

For example:, (*25)

drush cppull

Provided drush commands

# Pull content from contentpool:
drush cppull

# Show last replication status:
drush cpst

# Unblock replication status:
drush cpun

# Check whether somethings needs to be pulled:
drush contentpool-client:check

# Reset replication history, i.e. re-replicate everything:
drush cpr

# Remove conflicting revisions:
drush contentpool-client:remove-conflicts

Troubleshooting

When there are replication problems, be sure to:, (*26)

  • check status report. If there is an connection issues with the contentpool or replication errors it will be reported there.
  • check the recent log messages (watchdog) for replication errors.
  • if there are API connection or authentication issues, check whether the replicator users has sucessfully logged in by checking the last-login date of the user at the admin/people screen of both sites.
  • check the contentpool webserver access logs for the API URLs being accessed and try accessing them manually via curl while provided the replicator user access credenitials as HTTP auth
  • clear the flood history on the contentpool when you have authentication troubles; e.g. run the query DELETE FROM flood;.

Development

Via the provided development setup

For development purposes one can use the provided docker-compose setup. This is exactly the same setup as it's used by automated tests., (*27)

First, ensure do you do not use docker-composer version 1.21, as it contains this regression: https://github.com/docker/compose/issues/5874, (*28)

  docker-compose --version

If so, update to version 1.22 which is known to work. See https://github.com/docker/compose/releases/tag/1.22.0, (*29)

   ./scripts/create-project.sh
   ./scripts/run-server.sh
   ./scripts/init-project.sh
   # Optionally, launch a pool instance.
   ./scripts/launch-contentpool.sh

On a custom site

Just follow the above installation instructions and edit the module content at web/modules/contrib/contentpool-client. You can make sure it's a Git checkout by doing:, (*30)

  rm -rf web/modules/contrib/contentpool-client
  composer install --prefer-source

Running tests

Locally, via provided scripts

After installation with the provided scripts (see above) you can just launch the tests as the following:, (*31)

 ./scripts/create-project.sh
 ./scripts/run-server.sh
 ./scripts/init-project.sh
 ./scripts/launch-contentpool.sh
 ./scripts/run-tests.sh

Manually

Based upon the manual installation instructions you can launch tests with the following helper script:, (*32)

./web/modules/contrib/contentpool-client/tests/behat/run.sh

You might have to set some environment variables for it to work. It needs a running a chrome with remote debugging enabled. Set the CHROME_URL variable., (*33)

Credits

The Versions

19/07 2018

dev-feature/automated-pull

dev-feature/automated-pull

Connects the site to a contentpool.

  Sources   Download

GPL-2.0-or-later

The Requires

  • drupal/replication ^1.0@beta
  • drupal/relaxed ^1.0@beta
  • drupal/workspace ^1.0@beta

 

by drunomics GmbH

26/06 2018

dev-feature/automated-registration

dev-feature/automated-registration

Connects the site to a contentpool.

  Sources   Download

GPL-2.0-or-later

The Requires

  • drupal/replication ^1.0@beta
  • drupal/relaxed ^1.0@beta
  • drupal/workspace ^1.0@beta

 

by drunomics GmbH

08/05 2018

dev-8.x-1.x

dev-8.x-1.x

Connects the site to a contentpool.

  Sources   Download

GPL-2.0-or-later

by drunomics GmbH