decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.66k stars 3.02k forks source link

Gitea API Problem #6997

Open ykorzikowski opened 7 months ago

ykorzikowski commented 7 months ago

Hi,

I am trying to set up decap with gitea. But I guess there is a bug with the usage of the repos/git/trees API.

Example: I try to list my assets.

There is always a 404 for all content defined in netlify. In browser console, I can see, that a GET to https://git.***.dev/api/v1/repos/***/blog-ng/git/trees/dev:elegantstack%2Fsite%2Fcontent%2Fassets is fired.

When I do a curl to https://git.***.dev/api/v1/repos/***/blog-ng/git/trees/dev:elegantstack, I get a response. But I cant add any more subdirectories. curl to https://git.***.dev/api/v1/repos/***/blog-ng/git/trees/dev:elegantstack%2Fsite will result in a 404 again.

The path for the assets is correct of course. Maybe the api usage need to be changed to query the root path wit recursive=1?

Edit:

I am using Gitea API 1.21.1.

Screenshot 2023-11-29 at 10 46 28

Seems that there is also no file-path option for the api you use (or they removed it).

Example: this request is working:

curl 'https://git.***.dev/api/v1/repos/***/blog-ng/contents/elegantstack/site/content/assets?ref=dev'
derBlume commented 1 month ago

Hey everyone! Any news on this? I have the exact same problem @ykorzikowski describes (I'm on Gitea 1.20.5). Maybe @denyskon has thoughts on this, as he authored the gitea plugin for Decap and is also involved with gitea itself.