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

Netlify backend for CMS #262

Open
jimafisk opened this issue Jan 13, 2023 · 6 comments
Open

Netlify backend for CMS #262

jimafisk opened this issue Jan 13, 2023 · 6 comments
Labels
cms Git-backed content editing

Comments

@jimafisk
Copy link
Member

We currently have a GitLab backend for the CMS and would like to add a GitHub backend as well, but that is held up until they support PKCE. Another popular option for backend provider who be Netlify since they have their own Git and OAuth.

Netlify can be used as an OAuth provider. It sounds like they support Implicit Grant, but not sure about PKCE - we'd want to verify this before attempting to implement.

Another strange thing is Netlify's build process. You can't actually specify a custom image as shown here and discussed here. We'd have to get a PR accepted to their build image, similar to the Hugo setup in order to build Plenti sites in their CI (otherwise you have to build elsewhere and copy the files over). Seems like a very strange approach, their Hugo build version is set manually and already many versions behind the current release.

@jimafisk jimafisk added the cms Git-backed content editing label Jan 13, 2023
@jamestagal
Copy link
Sponsor

jamestagal commented Feb 6, 2024

Hi Jim,

I just wanted to follow up on this post and see whether it is worth looking further into this. I was interest in using Netlify only because they manage a nice easy solution for web forms. And I think you can even forward them on for clients.

I had a quick look in Netlify's docs https://docs.netlify.com/security/secure-access-to-sites/oauth-provider-tokens/
but I didn't see any reference to PKCE auth and then there is the other complication you mentioned about their build process.

I guess this is not a very good reason to pursue Netlify as a backend for Plenti's CMS but I am just having issues implementing a simple and robust web form submission solution. 😞

Best regards,
Ben

@jimafisk
Copy link
Member Author

jimafisk commented Feb 6, 2024

Hi @jamestagal,

You should be able to use Netlify as your website host if you prefer that to GitLab Pages, you'd just still need to use GitLab for your CI/CD builds and OAuth. This video has some basic instructions on how to set that up: https://youtu.be/TmWIeUOsERY?si=wWjjoYzvCRokCgIG&t=574

Things to note:

@jamestagal
Copy link
Sponsor

Thanks Jim.

I will take a look and see if I can set it up.

BTW. It wouldn't be that I prefer one over the other it's just a case of getting a web form solution that just works. :)
I have been trying to get a Google Form which is connected to the site and to the clients Gmail to work and I have had mixed results and nothing that is working consistently.

Thanks for posting here Jim.
Appreciate it.
Regards,

Ben

@jamestagal
Copy link
Sponsor

jamestagal commented Feb 7, 2024

Hi @jimafisk
I have a couple of follow up questions:

  1. Would the following be ok for a possible buildnetlify-deploy.yml file?
name: netlify deployment

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Build
        uses: docker://plentico/plenti:latest
        with:
          entrypoint: /plenti
          args: build  --output=build

      - name: Setup Node
        uses: actions/setup-node@v2-beta
        with:
          node-version: '16'

      - name: Deploy to Netlify
        run: |
          npm install netlify-cli -g
          netlify deploy --prod --dir deploy/public --site=${{ secrets.NETLIFY_SITE_ID }} --auth=${{ secrets.NETLIFY_AUTH_TOKEN }} --timeout=600 --message "Deployed on $(date)"
  1. So clarify the Actions for GitLab, would I just generate an access token and Site ID in Netlify and save them in a .gitlab-ci.yml file in GitLab? I'm not completely sure of how to format it correctly.
  2. Another question would be would the code sit in Netlify and be connected to the auth CD/CI in GitLab?

Thanks Ben

@jimafisk
Copy link
Member Author

Would the following be ok for a possible buildnetlify-deploy.yml file?

I'm honestly not sure, the best bet would be to try running it and seeing if there any errors

So clarify the Actions for GitLab, would I just generate an access token and Site ID in Netlify and save them in a .gitlab-ci.yml file in GitLab? I'm not completely sure of how to format it correctly.

Yeah exactly, the video I referenced above should show where to do that

Another question would be would the code sit in Netlify and be connected to the auth CD/CI in GitLab?

The code would live in the GitLab repo and the OAuth app would be in GitLab as well. Only the compiled static site would get sent to Netlify.

@jimafisk
Copy link
Member Author

jimafisk commented May 6, 2024

Just wanted to drop @jamestagal's new video about deploying Plenti to Netlify: https://youtu.be/MQrXo1a0PtU?si=5P_gilK-wrCDYUwx <-- This is the best resource for how to do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cms Git-backed content editing
Projects
None yet
Development

No branches or pull requests

2 participants