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

Add domain property to project config and publish all content to S3 folder for that domain #85

Open
v79 opened this issue Feb 15, 2024 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@v79
Copy link
Owner

v79 commented Feb 15, 2024

In Cantilever.yaml add a required property domain.
When writing all content to S3 buckets (both the generated folder and the destination bucket) prepend all keys with that property.

@v79 v79 self-assigned this Feb 15, 2024
@v79 v79 added the enhancement New feature or request label Feb 15, 2024
@v79
Copy link
Owner Author

v79 commented Feb 16, 2024

Sources bucket structure will be something like - root folder contains all the project yaml files (cantilevers.yaml). Each project will then have a folder based on the domain specified (www.cantilevers.org), which will contain the usual sources, images, generated folder etc.

The destination bucket will have a folder for each domain, containing the published website content.

So next step is to build the project creation service and front end.

@v79
Copy link
Owner Author

v79 commented Feb 17, 2024

When loading and saving content, how do I specify the project? This will be needed to identify what source folder to save to. Options are:

  • change routes to be, eg. GET /posts/{projectKey}/{srcKey}
  • Put the {projectKey} into a Header
  • Do something with cookies?

@v79
Copy link
Owner Author

v79 commented Feb 17, 2024

A project definition requires a domain (like www.cantilevers.org) which gets treated as the 'domainKey', the name of the root folder in the S3 sources and destination buckets. It is set on project creation, but it's just part of the project yaml and can easily be modified. Which would break things. Ignoring that part for now, it's still a bit tricky to know what to name the '.yaml' file in the first place. It is currently set to a sluggified version of the original project name. I kinda what to make that more of a UUID.

@v79
Copy link
Owner Author

v79 commented Feb 17, 2024

I am going to experiment with headers and cookies. New territory for me. I don't really want to complicate my routes by passing the project key.

@v79
Copy link
Owner Author

v79 commented Feb 19, 2024

Project needs a proper testing but I think I've got all the core routes working with new cantilever-project-domain header.

@v79
Copy link
Owner Author

v79 commented Feb 20, 2024

Testing to be done:

  • posts
    • create new post
    • load post
    • save post
    • delete post
  • pages
    • load page list
    • create new page - works where a page template has sections; fails otherwise - template issue
    • load page
    • save page
    • save new page
    • delete page
    • create folder
    • delete folder
    • setting a page as the index/root for a folder?
    • manage page sections based on the template
  • templates
    • create new template
    • load template
    • save template
    • delete template
    • create, manage and delete template sections
    • trigger regeneration of pages based on template
  • media
    • load image gallery
    • upload new image
    • delete image
  • project configuration
    • load and save existing configuration
    • create, manage and delete custom attributes
    • create, manage and delete image resolutions
  • Generation menus
    • Rebuild metadata
    • Rebuild all pages
    • Rebuild all posts
    • Rebuild image resolutions

@v79
Copy link
Owner Author

v79 commented Feb 20, 2024

Bugs found:

  • switching projects does not clear posts store/list
  • images are uploaded to the wrong folder
  • can create a post even when there is no post template.
  • can attempt (but fail) to create a page when there is no non-post template
  • when creating the first template, it repeatedly checks for template usage - stop this for unsaved templates
  • when saving a new template, the template list is not updated afterwards
  • when saving the first 'post' template and then attempting to create a post, after having previously visited the Posts page, the new post dialog never fetches the newly updated template list so it's not possible to create a post. Log out and back in to resolve this. Same for pages.

Major problem:

  • File uploads no longer trigger the generation pipeline, because this was based on the key starting with sources/. This is no longer true. I'll probably need to return to a three-bucket solution.

@v79
Copy link
Owner Author

v79 commented Mar 18, 2024

I've done enough, for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant