-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
Gitea support #640
Comments
There’s no reason it couldn’t work and I would be happy to help with a PR. A quick look at the Gitea API would indicate all the necessary parts are present. Like Gogs, this is the only request I’ve ever had for integration and as such I can help, but it’s not a primary integration. |
I'll happily provide a pull request but I'm a bit overwhelmed. So what would be a good approach to add Gitea support?
|
@marbetschar I’m more than happy to help along the way. Especially as there are likely some other areas that I’ll need to edit. What I would like to see is When I get a chance I’ll add a branch to work from. Additionally it would be very helpful if you could enable me to have an account on your Gitea installation. |
I've sent you an invitation to a test instance. |
Is that the invite from Cloudron? |
exactly. cause Gitea runs on top of Cloudron there. |
OK, I’ll see what I can figure out there. |
How can we take the next in adding Gitea support? |
I have to apologize. My new day job has an hour plus commute and doesn’t allow me the same opportunity in front of my personal computer. Also some family issues have come up. I haven’t forgotten. |
No worries, I absolutely understand. Maybe you can help by just pointing out the next steps and which plugin parts are involved and I'll try to get this done? |
@marbetschar I've updated the Just to test before I create an account, do you have a test plugin and a |
Gitea URL: |
Thanks. More bugs to fix now that I can proceed through the process. I’ll see what kind of progress I can make this weekend, but hoping to have something working and merge into |
@marbetschar so I believe I have a correct download link but when I put it in a browser window I get the following login screen.
What should happen is the zip of the repository should download. Any thoughts? |
@afragen seems like you're forced to use the api endpoints in order to have the access token allow you to download the repo. Here's the endpoint I found which seems to work as expected:
Seen in the Swagger API configuration here: |
I've asked the Gitea folks to bring the api docs back up&running to make things easier: Seems like they are migrating to another cloud instance and therefore the usual source is not reachable for now. |
That is making it a bit difficult. I’ll create a login and see what I can do this weekend. |
So I have the remote install working but accessing the API to retrieve the raw file data doesn't work if the user isn't logged in. The response asks for a login.
The above works if I have been logged in. If I try a similar URI for your I'm stuck. I need a way to retrieve the raw file. FWIW that URI works when placed into a browser window if I've previously logged in to Gitea. |
Found the endpoint which is working without being logged in: Have to digg a bit more to figure out how to pass the branch name. |
I'm making headway. BTW, your |
Updated the Gitea Theme URI |
@afragen do you need to be able to query the branch at all? or does the provided endpoint do the job? |
@marbetschar I just pushed an update to the |
Provided endpoint should do the job. |
@afragen awesome!! 😍 I‘ll give it a test drive today. |
Update: I've installed the theme using the builtin WordPress Theme Upload. I now installed it again using the "Install Theme" in GitHub Updater and now the Gitea Tab shows up. Seems like there is some kind of error in detecting newly installed plugins or themes - don't know if this is related to the Gitea changes though. |
First off: I think we are quite there, thank you so much for your efforts on this!! I really appreciate. 👍 Here's what I've found, testing the whole process through. Hope this info is helpful to finalize the Gitea integration. From what I can tell GitHub Updater recognizes Updates in a Gitea Hosted Theme, but it seems there are some glitches left. In the admin screen there are two fields for the token. A "Gitea Access Token" and a "Gitea Private Settings". Don't know what the difference is. After I installed the Theme update, GitHub Updater still claims there's an update available but also shows the new version number which was installed: And if I edit the so-called-updated-theme using the WordPress editor, it shows me still the version 1.0: |
It's possible you might be getting caught in some of my caching. If you select Refresh Cache hopefully everything should look more normal. I cache the local plugin/theme headers for 30 minutes and the API calls for 12 hours. Using the refresh cache button clears both. Themes are more picky than plugins. Sometimes if the theme isn't exactly named for the slug it doesn't show up in the list as WP has issues "seeing" it. I too have seen where "updates" show for the same version. I can't really explain it but it does go away and updating does update/reinstall to the correct version. The 2 areas for access tokens are because one allows for a site-wide token and one allows for a token associated with each repository. This allows you to have repositories from many users who only have to give you an access token. The access token only needs to be |
I just pushed an update to fix some of the issues I discovered to show all the appropriate parts of the Gitea Settings page. |
@afragen in terms of the tokens: I was aware of the difference between the two tokens, was just confused by their different naming. One is an "Access Token" the other one has something in common with "Private Settings". This felt like it may be used for something else. |
If you have a better idea for naming now is the time. 😉 Private settings are for repos with tokens and are required for private repos that aren't in the user's own Gitea directory. Not sure I'm explaining it well. Sorry. |
@afragen your changes are in the |
Absolutely, I need you to let me know what doesn’t work. If there are no big issues I’ll merge with develop and likely release a week or so after. |
HI @afragen, In my tests I just stumbled across the following error:
I got a setup script on my end which does the initial plugin/theme installation and configuration. This script uses GitHub Updater CLI commands to setup a custom theme, which now fails with the previous error if the theme is hosted on Gitea. This is the command I'm trying to execute:
|
Oops, I thought I got all the wp-cli stuff fixed. I tested the update but missed the install. Thanks. How’s it working for you otherwise? |
I've not yet had the chance to fully test the new branch, since we got quite a bunch of repos on our end to migrate from GitLab to Gitea. From what I've tested so far, GitHub Updater is able to successfully update installed themes. That's why my approach as of now is to test the full migration path from start to end in order to ensure a smooth movement towards Gitea without breaking existing sites. It'll be awesome if you can fix the install error. I'll keep on testing then 👍 |
So I'm using the latest root@06fbed83f729:/# wp theme install-git https://dev.mandelkind.work/marco/GitHubUpdaterTest --gitea --token=f7ec6678558c9d2cae26ebb5561f2fa91b883739
Success: Theme 'GitHubUpdaterTest' installed. It seems to work. This is what I get for a public repo, though GHU may still have the token cached. root@06fbed83f729:/# wp plugin install-git https://dev.mandelkind.work/afragen/test-gitea-plugin --gitea
Success: Plugin 'test-gitea-plugin' installed. You might try adding the token to each command. |
So I've removed the prior theme and refreshed the cache and now I get an error.
I think there's an issue with SSL cert at |
It seems that the site is loading again and I get the following. root@06fbed83f729:/# wp theme install-git https://dev.mandelkind.work/marco/GitHubUpdaterTest --gitea --token=f7ec6678558c9d2cae26ebb5561f2fa91b883739
Success: Theme 'GitHubUpdaterTest' installed. |
@afragen oh men, this one totally goes on me: I forgot to update my script to use the Gitea branch. I keep on with testing 👍 |
my tests were completely successful 🎉 - apart from some caching issues, were GitHub Updater shows an already installed update. But this disappears after some time. That said, I encountered this kind of issue earlier already so my guess is, that this is not in any way related to the Gitea changes. Can't wait to see the Gitea changes in the official release! 🎉👍🏼🎉 |
Merged into |
@afragen any eta of a new stable release containing Gitea support? |
|
Is it possible to use Gitea together with GitHub Updater?
Gitea is a lightweight alternative to GitLab for a self hosted environment. It's small, its fast and it's very similar to GitHub :)
The text was updated successfully, but these errors were encountered: