Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global Content (#2) #8

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

adrienne
Copy link

@adrienne adrienne commented Oct 18, 2023

Pull request for issue: #2

This is a pull request for the following functionalities:

  • Implementing basic setup of CMS
  • Implementing global content container and fields
  • Implementing basic navigation container

How to test?

Project config must be applied in the container; to do that, run the command

php craft project-config/apply

Reviewers can add text and images in the global content; they can also add items to the nav.

  1. Go to the CMS dashboard at /admin
  2. Log in to the CMS with admin credentials (these will be set by the GigaScience devops folks)
  3. Click the Entries menu item on the left-hand nav
  4. Click Global Content to open the entry with the globals
  5. Add and edit content accordingly.

How have functionalities been implemented?

This is all implemented through Craft CMS; the fields and sections are created through the admin interface by using the Settings menu and various submenus. Using the Content Audit document as the source of truth, I did the following:

  1. Created a field group using Settings -> Fields
  2. Created the fields within the group
  3. Created a Single-type section using Settings -> Sections (a Single section only allows one entry; since we are using it as a global content container, we don't want more than one)
  4. Created the field layout (this is done via the Entry Type for the Section)
  5. Added the "Expanded Singles" plugin by Verbb (it is a free plugin) to make navigating to the section a little easier

Issues with your implementation

The Wasabi bucket does not currently seem to be working as an S3 alternative; more investigation may be required.

@adrienne adrienne requested review from pli888 and rija as code owners October 18, 2023 23:46
OBJECT_STORAGE_KEY="xxx"
OBJECT_STORAGE_SECRET_KEY="xxx"
OBJECT_STORAGE_REGION="xxx"
OBJECT_STORAGE_REGION="ap-northeast-1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps only one OBJECT_STORAGE_REGION variable is required here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, correct; I must have miscopied something. I can fix this.

Copy link
Member

@pli888 pli888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Work has started on implementing the content model for GigaDB in CraftCMS.
issue (non-blocking): Without experience of using CraftCMS, it's difficult to understand the work done in this PR.
suggestion: For CraftCMS newbies like me, it's worthwhile doing the CraftCMS tutorial to understand how the CMS application works before reviewing PR.
praise: Plugins required in our CraftCMS instance are listed in composer.json and can be installed for use in local CraftCMS.
suggestion: Update README.md with docker-compose run --rm console composer install as the command to install PHP dependencies
question: There is a message at the bottom of the CraftCMS webpage which says Navigation is installed as a trial. Purchase licence. This relates to the https://plugins.craftcms.com/navigation plugin?
suggestion: Update README.md with docker-compose run --rm console php craft project-config/apply as the command to apply config/project/project.yaml
issue: It seems I'm not able to get Wasabi and CraftCMS to work together. I try to create a new Global for a main logo by uploading an image file as an asset which I select and provide a summary text. However, when I click Save button then I am on the /admin/entries/singleGlobalContent/1-global-content page but it displays an error:

Aws\Sts\Exception\StsException - Error executing "GetSessionToken" on "https://sts.amazonaws.com"; AWS HTTP error: Client error: `POST https://sts.amazonaws.com` resulted in a `403 Forbidden` response

I'm not able to fix this problem when adding the required values for the OBJECT_STORAGE_KEY and OBJECT_STORAGE_SECRET_KEY variables in .env. I confirm these credentials work with $ rclone ls cms:cms-assets/dev when I list the contents of the dev directory in cms-assets bucket.
question: Is creating a new team member entry ready for testing?

@adrienne
Copy link
Author

adrienne commented Nov 9, 2023

@pli888 - Unfortunately I am in fact still trying to figure out what to do about the Wasabi bucket. I was able to test locally using an arbitrary S3 bucket, but something is going wrong with the Wasabi authentication and I do not know if it's something we will have to fix with custom code or if it's simply a configuration issue somewhere. I'm currently in a conversation with the upstream Craft CMS devs to try to figure that out!

Question: does anyone on your team use Discord? That's the primary chat-support platform used by the Craft CMS devs and it might help to be able to pull someone in for a synchronous chat with them.

Adding/editing team members should be ready for testing except that you cannot add an image.

@pli888
Copy link
Member

pli888 commented Nov 10, 2023

Unfortunately I am in fact still trying to figure out what to do about the Wasabi bucket. I was able to test locally using an arbitrary S3 bucket, but something is going wrong with the Wasabi authentication and I do not know if it's something we will have to fix with custom code or if it's simply a configuration issue somewhere. I'm currently in a conversation with the upstream Craft CMS devs to try to figure that out!

@adrienne I've done more testing and can confirm I too can upload image files into an AWS S3 bucket from my local CraftCMS installation. Re: the error executing "GetSessionToken" on "https://sts.amazonaws.com" message, Wasabi documentation says it supports GetSessionToken which suggests CraftCMS needs to call GetSessionToken on http://sts.wasabisys.com.

I can look into using Discord.

@adrienne
Copy link
Author

@pli888 - Peter, that's actually great information, about the token provider URL, thank you so much! Let me talk to the Craft folks, it's quite possible there's a way to just plug that in. (If not, I can fork the plugin and change that.)

@rija rija added the Rija label Nov 14, 2023
Copy link
Collaborator

@rija rija left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @adrienne,

praise: overall, the global content entry type is setup as expected based on the content audit description
issue: However, in the content audit, you use Utility text, but in this PR it's called Summary
suggestion: Ensure the naming of that field is consistent
issue: This PR is about global content and navigation, but there is Team member channel that is also setup, which is not expected nor documented
suggestion: make sure this PR installs only global content and navigation container
issue: the command to apply project config docker-compose run --rm console php craft help project-config/apply is not in the README
suggestion: add the command line above in the README file alongside a brief explanation on why we would run it.
issue: There is an error when trying to add an asset to the global content entry, related to the interaction with Wasabi
suggestion: Set up the "Image Files" asset with a new serverStorage based filesystem:

  • We don't want to fork the aws-s3 plugin, because until the issue is fixed, we would have to maintain the forked code, automate-test it, and keep it in sync for changes (esp. security related), which is burden we don't want to take and time we don't want to spend on
  • The "/site/" section of the website has a finite number of content, and will have a small number, small size and finite/very slow growing number of images.
  • We are not planning to scale the CMS server horizontally on multiple nodes
  • For now, the only planned future milestone for this project is a demo server for us get familiar with and evaluate the tool, not production

Therefore in the interim period until an eventual fix, it's fine using server storage for the assets.

note (docs): Given the UI heavy nature of the tool and the changes, do consider adding screenshots alongside your description in pull request's description

@rija rija removed the Rija label Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants