
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
TrustyCMS is a branch of Radiant CMS. Its goal is to pull the Radiant framework into Rails 7 with minimal changes to its infrastructure.
TrustyCMS is a no-fluff, open source content management system designed for small teams. It is similar to Textpattern or MovableType, but is a general purpose content management system (not just a blogging engine). TrustyCMS is a Rails engine and is built to be installed into an existing Rails 7 application as a gem.
TrustyCMS features:
TrustyCMS is released under the MIT license. The Radiant portions of the codebase are copyright (c) John W. Long and Sean Cribbs; anything after the fork is copyright (c) Pittsburgh Cultural Trust. A copy of the MIT license can be found in the LICENSE file.
TrustyCMS is a traditional Ruby on Rails engine, meaning that you can configure and run it the way you would a normal gem, like Devise.
See the INSTALL.md file for more instructions.
Prerequisites:
Steps:
Fork this repository to your Github account.
Clone your fork to your machine.
cd
into the directory you just cloned into.
Follow the INSTALL.md instructions to setup an empty app with TrustyCMS installed. To modify TrustyCMS, point your dependency to the local path of your fork.
gem 'trusty-cms', path: '../trusty-cms'
Set up your databases in your Rails application:
bundle exec rake db:create
bundle exec rake db:migrate
Run the tests to make sure they pass (If they don't, file a bug!):
rspec
TrustyCMS supports a preview feature for standard page types. However, this functionality may not work out of the box for custom page types. To enable the preview feature for your custom page types, follow these steps:
In your application, create the following initializer file: config/initializers/preview_page_types.rb
Inside this file, define a PREVIEW_PAGE_TYPES
array constant with the names of the page types you’d like to enable the Preview button for, for example:
PREVIEW_PAGE_TYPES = %w[
BlogPage
FacilityPage
FileNotFoundPage
].freeze
Test the Preview button with each custom page type. If a page type does not preview correctly, remove it from the list.
Additional configuration is required to ensure correct URL generation in the admin interface — specifically for the "Edit Page" dropdown and the "Save and View Draft" functionality.
To enable this, create the following initializer: config/initializers/page_type_routes.rb
In this file, define a CUSTOM_PAGE_TYPE_ROUTES
hash constant that maps custom Page model class names to the corresponding route segments defined in your config/routes.rb
file. For example, the BlogPage model maps to the route get 'blog/:slug'
, so its route segment is 'blog'
.
For custom Page models that rely on default routing behavior, define a DEFAULT_PAGE_TYPE_ROUTES
array listing their class names. TrustyCMS will use these mappings to correctly build page URLs for use in the admin UI.
CUSTOM_PAGE_TYPE_ROUTES = {
BlogPage: 'blog',
DonationPage: 'donate',
ExhibitionPage: 'exhibit',
NonTicketedEventPage: 'event',
PackagePage: 'package',
PersonPage: 'biography',
ProductionPage: 'production',
VenuePage: 'venues',
}.freeze
DEFAULT_PAGE_TYPE_ROUTES = %w[
ConstituencyPage
FacilityPage
FileNotFoundPage
RailsPage
].freeze
To ensure Scheduled Pages automatically update their status to Published after their designated Publish Date & Time, follow these steps to set up an automated refresh using AWS Lambda and EventBridge.
1. Generate a Bearer Token
Open a Rails console and run the following command:
rails c
Then generate a token:
SecureRandom.base58(24)
2. Store the Token in Rails Credentials
To store your token securely, edit your Rails credentials by running the following command:
bin/rails encrypted:edit config/credentials.yml.enc
Then, add the token to your credentials file under the trusty_cms
namespace:
trusty_cms:
page_status_bearer_token: '<your bearer token>'
3. Add Google Tag Manager Container ID (Optional)
If you'd like to enable trusty-cms to submit Google Tag Manager data for tracking admin page activity (this does not include public-facing pages), add your Google Tag Manager Container ID to the trusty_cms
section of your credentials.yml.enc
file:
trusty_cms:
page_status_bearer_token: '<your bearer token>'
gtm_container_id: 'GTM-xxxxxx'
4. Create a Ruby Lambda Function in AWS
rbenv install 3.3.0
rbenv local 3.3.0
5. Write the Lambda Function Code
In your local development environment:
lambda_handler.rb
:require 'httparty'
def lambda_handler(event:, context:)
uri = ENV['API_ENDPOINT']
token = ENV['BEARER_TOKEN']
response = HTTParty.post(
uri,
headers: {
'Content-Type': 'application/json',
'Authorization': "Bearer #{token}"
}
)
if response.success?
puts "Success: #{response.body}"
else
puts "Error: #{response.code} - #{response.message}"
end
end
6. Install Dependencies
Run the following commands in your terminal:
gem install bundler
bundle init
Add the dependency to your Gemfile
:
gem 'httparty'
Install dependencies locally:
bundle config set --local path 'vendor/bundle'
bundle install
7. Package the Lambda Function
Archive your function and dependencies:
zip -r lambda_package.zip .
8. Upload to AWS Lambda
lambda_package.zip
file.9. Configure Environment Variables
In the AWS Lambda Configuration:
API_ENDPOINT
: <your-url>/page-status/refresh
BEARER_TOKEN
: <your bearer token>
10. Set Up EventBridge Trigger
Your setup is now complete, and Scheduled Pages will automatically update their status via the AWS Lambda and EventBridge integration.
When you're ready to make a change:
git remote add upstream https://github.com/pgharts/trusty-cms.git
so that you can keep up with changes that other
people make.git fetch upstream
.upstream/master
by running
git checkout -b fix-queries upstream/master
.git push origin fix-queries
.All of the development for TrustyCMS happens on Github:
https://github.com/pgharts/trusty-cms
TrustyCMS is supported in part by:
Enjoy!
-- The TrustyCMS Dev Team
FAQs
Unknown package
We found that trusty-cms demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.