Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Conversation

@denyskon
Copy link
Contributor

@denyskon denyskon commented Jan 10, 2023

See #310

@netlify
Copy link

netlify bot commented Jan 10, 2023

Deploy Preview for demo-staticjscms ready!

Name Link
🔨 Latest commit 8028d75
🔍 Latest deploy log https://app.netlify.com/sites/demo-staticjscms/deploys/63c716cf9bcf7f0008ee210e
😎 Deploy Preview https://deploy-preview-325--demo-staticjscms.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jan 10, 2023

Deploy Preview for staticjscms ready!

Name Link
🔨 Latest commit 8028d75
🔍 Latest deploy log https://app.netlify.com/sites/staticjscms/deploys/63c716cff5ca7e000859891f
😎 Deploy Preview https://deploy-preview-325--staticjscms.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@denyskon
Copy link
Contributor Author

Login, initial collection loading and media library are working. When opening a collection item, I get some weird issue where the media_folder gets split into single characters and sent as single requests, I'll take another look at it tomorrow......

@KaneFreeman
Copy link
Collaborator

I get some weird issue where the media_folder gets split into single characters and sent as single requests

That was a different bug that was fixed in beta 11. Please update your branch and test again.

@denyskon
Copy link
Contributor Author

I get some weird issue where the media_folder gets split into single characters and sent as single requests

That was a different bug that was fixed in beta 11. Please update your branch and test again.

Thanks, that is working now. I had a temporary fix, for that, but I rebased to main now.

I have two issues I don't know the structure good enough to understand them:

  1. Loading the collection items works fine, but the link to the item when clicking on a tile has the folder path in it for some reason. Example:
  1. The media tab on the homepage is working fine, but any media library popup when editing an entry says no media found.

Do you have any ideas what the reason could be? @KaneFreeman

@denyskon denyskon changed the title WIP: Feature/gitea feat: Feature/gitea [WIP] Jan 12, 2023
expect(fetch).toHaveBeenCalledWith('https://api.github.com/some-path', {
cache: 'no-cache',
headers: {
Authorization: 'token token',

Check failure

Code scanning / CodeQL

Hard-coded credentials

The hard-coded value "token token" is used as [authorization header](1).
const api = new API({ branch: 'gh-pages', repo: 'my-repo', token: 'token' });

api.requestHeaders = jest.fn().mockResolvedValue({
Authorization: 'promise-token',

Check failure

Code scanning / CodeQL

Hard-coded credentials

The hard-coded value "promise-token" is used as [authorization header](1).
expect(fetch).toHaveBeenCalledWith('https://api.github.com/some-path', {
cache: 'no-cache',
headers: {
Authorization: 'promise-token',

Check failure

Code scanning / CodeQL

Hard-coded credentials

The hard-coded value "promise-token" is used as [authorization header](1).
@denyskon denyskon changed the title feat: Feature/gitea [WIP] feat: Feature/gitea Jan 15, 2023
@denyskon denyskon changed the title feat: Feature/gitea feat: gitea backend Jan 15, 2023
@denyskon
Copy link
Contributor Author

Tests are a hell, but seems like it's ready. @KaneFreeman could you take a look, and merge if everything is okay?

Copy link
Collaborator

@KaneFreeman KaneFreeman left a comment

Choose a reason for hiding this comment

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

Looks like you have a few linting/formatting issues. Please run yarn format to correct those.

| branch | string | `main` | _Optional_. The branch where published content is stored. All CMS commits and PRs are made to this branch |
| api_root | string | GitHub<br />`https://api.github.com`<br /><br />GitLab<br/>`https://gitlab.com/api/v4`<br /><br />Bitbucket<br />`https://api.bitbucket.org/2.0`<br />Gitea<br />`https://try.gitea.io/api/v1` | _Optional_. The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab |
| site_domain | string | `location.hostname`<br /><br />On `localhost`<br />`cms.netlify.com` | _Optional_. Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly |
| base_url | string | GitHub or Bitbucket<br />`https://api.netlify.com`<br /><br />GitLab<br />`https://gitlab.com` | _Optional_. OAuth client hostname (just the base domain, no path). **Required** when using an external OAuth server or self-hosted GitLab/GiteaAuthenticationPage|
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
| base_url | string | GitHub or Bitbucket<br />`https://api.netlify.com`<br /><br />GitLab<br />`https://gitlab.com` | _Optional_. OAuth client hostname (just the base domain, no path). **Required** when using an external OAuth server or self-hosted GitLab/GiteaAuthenticationPage|
| base_url | string | GitHub or Bitbucket<br />`https://api.netlify.com`<br /><br />GitLab<br />`https://gitlab.com` | _Optional_. OAuth client hostname (just the base domain, no path). **Required** when using an external OAuth server or self-hosted GitLab/Gitea|

| name | 'git-gateway'<br />\| 'github'<br />\| 'gitlab'<br />\| 'bitbucket'<br />\| 'gitea'<br />\|'test-repo'<br />\| 'proxy' | | The backend git provider |
| repo | string | | Required for `github`, `gitlab`, `gitea` and `bitbucket` backends. Ignored by `git-gateway`. Follows the pattern `[org-or-username]/[repo-name]` |
| branch | string | `main` | _Optional_. The branch where published content is stored. All CMS commits and PRs are made to this branch |
| api_root | string | GitHub<br />`https://api.github.com`<br /><br />GitLab<br/>`https://gitlab.com/api/v4`<br /><br />Bitbucket<br />`https://api.bitbucket.org/2.0`<br />Gitea<br />`https://try.gitea.io/api/v1` | _Optional_. The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Small formatting issue here.

Suggested change
| api_root | string | GitHub<br />`https://api.github.com`<br /><br />GitLab<br/>`https://gitlab.com/api/v4`<br /><br />Bitbucket<br />`https://api.bitbucket.org/2.0`<br />Gitea<br />`https://try.gitea.io/api/v1` | _Optional_. The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab |
| api_root | string | GitHub<br />`https://api.github.com`<br /><br />GitLab<br/>`https://gitlab.com/api/v4`<br /><br />Bitbucket<br />`https://api.bitbucket.org/2.0`<br /><br />Gitea<br />`https://try.gitea.io/api/v1` | _Optional_. The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab |

---
title: Gitea
group: Backends
weight: 70
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should appear before Local Backend (which has a weight of 50).

Suggested change
weight: 70
weight: 45

// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare const global: any;

describe('github backend implementation', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we clean up the use of github throughout the tests.

@@ -0,0 +1,47 @@
---
title: Gitea
group: Backends
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add

beta: true

This will mark this whole documentation page (and the gitea backend) as beta.

@KaneFreeman KaneFreeman merged commit 63496b0 into StaticJsCMS:main Jan 17, 2023
@denyskon denyskon deleted the feature/gitea branch January 19, 2023 22:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants