
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
contentful-moderator
Advanced tools
Moderator Server listens for incoming webhooks from Contentful to manage moderation workflows of entries.
Contentful is a content management platform for web applications, mobile apps and connected devices. It allows you to create, edit & manage content in the cloud and publish it anywhere via powerful API. Contentful offers tools for managing editorial teams and enabling cooperation between organizations.
contentful-moderator
do?The aim of contentful-moderator
is to have developers setting up their Contentful
entries for moderated authoring workflows.
We'll explain this with a step-by-step example:
contentful-moderator
sends email to Reviewer Teamcontentful-moderator
sends email to Authoring Teamcontentful-moderator
provides a web endpoint to receive webhook calls from Contentful.
Every time the endpoint recieves a call it looks for the value of the fields defined in the configuration.
If any of the values match the configuration, it will send an email to the specified queue (authors or editors).
You can add multiple content types to your configuration.
postfix
or a GMail/Yahoo/MSN account with SMTP support)Add this line to your application's Gemfile:
gem 'contentful-moderator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install contentful-moderator
You can base your configuration file from the example config.yml
---
endpoint: '/moderator' # Optional - defaults to '/moderator'
port: 33123 # Optional - defaults to ENV['PORT'] or 33123
content_types:
post: # ID of your Content Type (multiple Content Types can be set here)
author_field: # Required
field_id: 'author_field'
notify_reviewer_on: 'Ready for review' # Value to match - this is Exact match
email_subject: 'A submission requires review'
email_body: > # 'webhook_url' will get replaced with the Entry URL in the Contentful Web App
Dear Editor Team,
The entry 'webhook_url' is ready for review.
Cordially,
Moderator Bot
reviewer_field: # Required
field_id: 'reviewer_field'
notify_author_on: 'Needs further editing'
email_subject: 'A submission requires further editing'
email_body: >
Dear Authoring Team,
The entry 'webhook_url' requires further editing.
Cordially,
Moderator Bot
authors: # Required - List of Author Emails
- 'author@example.com'
editors: # Required - List of Editor Emails
- 'editor@example.com'
mail_origin: 'admin@example.com' # Required - Email from which the messages will be sent (on GMail this does not take effect)
mailer_settings: # Required
connection_type: 'smtp'
address: 'smtp.gmail.com'
port: 587
domain: 'example.com'
user_name: "'env_mailer_username'" # Username can be Plain-Text. But 'env_mailer_username' will get replaced with ENV['ENV_MAILER_USERNAME']
password: "'env_mailer_password'" # Same as for user_name. 'env_mailer_password' will get replaced with ENV['ENV_MAILER_PASSWORD']
authentication: 'plain'
enable_starttls_auto: true
$ contentful_moderator config.yml
Under the space settings menu choose webhook and add a new webhook pointing to http://YOUR_SERVER:33123/moderator
.
Keep in mind that if you modify the defaults, the URL should be changed to the values specified in the configuration.
Procfile
containing:web: PORT=$PORT env bundle exec contentful_moderator config.yml
That will allow Heroku to set it's own Port according to their policy.
Make sure to set your Username/Password environment variables (if you're using them).
Then proceed to git push heroku master
.
The URL for the webhook then will be on port 80, so you should change it to: http://YOUR_APPLICATION/moderator
.
Bug reports and pull requests are welcome on GitHub at https://github.com/contentful/contentful-moderator.rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that contentful-moderator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.