sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
819 stars 38 forks source link

GitLab backend #22

Closed almereyda closed 5 months ago

almereyda commented 1 year ago

For self-hosted deployments of websites, it sometimes can be useful or required to choose to work with git repositories in GitLab instead of GitHub.

As a Sveltia CMS user, I need to use it with a custom GitLab instance, in order to deploy to our own GitLab Pages environment.

This could extend the availability of Sveltia CMS by large means to wide user groups.

The GitLab GraphQL API is documented in:

If no custom instance is available, their hosted https://gitlab.com instance provides the same interfaces and allows GitHub login.

kyoshino commented 1 year ago

Thanks for filing the issue! Yes, I do have a plan to implement the GitLab support, assuming it’s possible to retrieve multiple files at once like GitHub. I have some other priorities so I don’t have the ETA, though.

almereyda commented 1 year ago

Thanks for keeping this on the radar.

Where do priorities lie right now, if one wanted to help out?

kyoshino commented 1 year ago

I’ve recently fixed an image preview issue with the GitHub backend, and I think the current implementation is in good shape to be converted to the GitLab backend. I’ll finish this next month.

almereyda commented 8 months ago

Could this be considered a reasonable target for the impending v1 release?

It will be good to support PKCE authentication from the start.

kyoshino commented 8 months ago

I’m so sorry for the prolonged delay. I’ll work on this once #32 is done, of course before the 1.0. release. (Note: I’m not going to bump the major version until the Netlify CMS compatibility reaches the maximum. The next release of v0.9.5 will be v0.10.0, not v1.0.0.)

I’ve already created a GitLab account to play around. Well yes, the auth part may be a bit tricky because there are two ways to do so except for the deprecated one, but I’ll try to implement both anyway for better compatibility.

almereyda commented 8 months ago

Thanks for the heads up! Glad to hear this is still in the pipeline, eager to switch when due. And yes, maybe I got a bit excited by the drums rolling with the recent v0.9.x series. Didn't know the versioning scheme or release schedule until know, so thanks again for the details.

kyoshino commented 8 months ago

Yeah, traditionally the next of v0.9 would be v1.0, but it doesn’t have to be like that. Hugo is now v0.121.1 🙀 Hope it won’t happen to Sveltia CMS!

josineto commented 5 months ago

Hi, is this in your radar yet? I'm eager to use Sveltia CMS, but I need GitLab support to use it...

kyoshino commented 5 months ago

I should have some spare time this week. Let’s get it done, finally...

kyoshino commented 5 months ago

The wait is over! Just shipped v0.16.0 to support GitLab. Thanks for your patience. 🦊

almereyda commented 5 months ago

Congratulations! Thanks for the effort.

Unfortunately I'm unable to find instructions on how to use it in a self-hosted environment, e.g. one that does not use Cloudflare Workers to run the authentication component.

Please excuse the uninformed question, because I don't know commercial deployment environments, but would it be possible to deploy sveltia-cms-auth as an independent webservice, in a container, for example?

And is there a chance to avoid using a separately run service for this static website editor, e.g. by using the PKCE authorization scheme, which can work completely client side?

kyoshino commented 5 months ago

Sveltia CMS supports PKCE auth flow! We don’t have any documentation yet, but in the meantime you can refer to the Decap CMS document: see the Client-Side PKCE Authorization section on their GitLab backend page to set up your configuration, and let me know if you have any questions. 😄

almereyda commented 5 months ago

Yes, I can confirm that the PKCE authentication flow is supported, as expected.