How to configure Serf with plugin CloudUpload to send files from a Dynaform to an external filesystem, in this case, an MS Sharepoint site.
...
• run composer install
on /serf
• run php artisan key:generate
• Edit .env with MySQL credentials to blank Db
• Edit .env with redis url and any credentials
• Edit .env by adding these variables with ProcessMaker credentials:
PROCESSMAKER_HOST=https://url/to/processmaker
PROCESSMAKER_WORKSPACE=workspace_name
PROCESSMAKER_CLIENT_ID=XXX
...
(as
...
obtained
...
in
...
step
...
1)
PROCESSMAKER_CLIENT_SECRET=YYY(
...
as
...
obtained
...
in
...
step
...
1)
PROCESSMAKER_USERNAME=username
PROCESSMAKER_PASSWORD=password
...
...
• composer update
...
on
...
/serf
...
• php artisan migrate on /serf
This part is now obsolete as of 02/2019 per Taylor's Serf driver update. Instead refer below (step 4) for instructions on how to configure the new serf plugin.
• Edit config/filesystems.php,
...
add
...
clouduploads-sharepoint
...
entry
...
as
...
per
...
below
'clouduploads-sharepoint' => [ 'driver' => 'sharepoint', 'url' => 'https://pmaker.sharepoint.com/sites/ImmochanSite', 'host' => 'https://pmaker.sharepoint.com', 'username' => 'processmaker@pmaker.onmicrosoft.com', 'password' => 'processmaker' ]
•
composer update
on serf dir (as sudo)
• install supervisor sudo pip install supervisor
• edit /etc/supervisord.conf
with program as below:
...
• run supervisord
from terminal.• To ensure supervisor keeps the process running at all times, create a cron job entry to force restart the job every 30 minutes, or as needed. Edit /etc/crontab
adding */30 * * * * username /usr/local/bin/supervisorcrtl restart all
. Mind the actual username and bin path.
3 Install serf helper plugin in PM
• Copy plugin folder to workflow/engine/plugins
• either setenv
REDIS_HOST or edit asynchelper.php directly on line 44, to redis server URL
• no password in AWS elasticache case, but must be in same security group
• mv asynchelper.php up to plugins folder
• another sudo composer update
(should create vendor dir, or mkdir maually)
• In PM -> Admin -> Plugins -> Plugin Manager, find and Enable
4. Configure the Azure Application in order to allow the serf driver to connect via MS Graph API.
The new Serf plugin based on MS Graph needs an Application Secret and an Application ID. Plus, you need to enable API access into MS through these Application credentials an proper permissions. Follow these instructions to obtain the credentials and enable access:
- Go to https://apps.dev.microsoft.com/ and log in with the target MS credentials (⚠️ Microsoft will change App Registration steps, so this guide will need to be updated as well!!)
- Click on Add an App, and create an Application.
- Make note of the Application ID displayed under Properties.
- Under Application Secrets, generate a new Password. Copy it.
- Save the Application
- Visit https://portal.azure.com/
- Click on the Azure Active Directory section link in the left hand menu
- Under Manage, click on App Registrations
- Click on the Application you created, to open its Registration details.
- Undell Call API, click on View API Permissions
- Under API Permissions, click on Add a Permission
- Click on Microsoft Graph and add these two Application Permissions: File.ReadWrite.All and Sites.FullControl.All
- Click on Grant Admin Consent
5 In-Process use
• Upload using Multiple File Uploader control in Form
• ~make sure worker is running with Supervisor or call manually with ~ replaced with supervisord, see abovephp artisan queue:work
on serf dir
• After dynaform, call in trigger as follows:
...
Page Properties | ||
---|---|---|
| ||
|