mbecker20 / komodo

🦎 a tool to build and deploy software on many servers 🦎
GNU General Public License v3.0
1.28k stars 21 forks source link

Can't select git account? #10

Closed slient2010 closed 2 months ago

slient2010 commented 2 months ago

I used latest source compiled and tried to use self-hosted git server. but can't select git account. may I know how to set it or where I can set it? Thanks.

BTW, I have set core config.toml like below.

[[git_provider]]
domain = "git.myselfhosted.dev" # use a custom provider, like self-hosted gitea
accounts = [
    { username = "mbecker20", token = "access_token_for_account" },
]
mbecker20 commented 2 months ago

Hi, when Monitor starts up, it will log the configuration. Can you ensure this log matches your configuration file? If not, ensure the file is correctly mounted to the container, see the example command here.

If the configuration is correct, then you can go to the Resource page Git section, and first select your provider from the dropdown:

Screenshot 2024-07-30 at 2 22 37 PM

After you select your custom provider domain, you should see the account in the dropdown here:

Screenshot 2024-07-30 at 2 22 48 PM

Let me know if this solves the issue

slient2010 commented 2 months ago

Thank @mbecker20. Yeah, I can see the git_providers configuration while the core starts up. I can select git Provider on web page, but still can't select the account since there is no any accounts show up.

mbecker20 commented 2 months ago

Hm. Is there anything in the browser console log? Does anyone else have this issue?

Keep in mind the accounts in dropdown are filtered to only show ones available on the selected provider

slient2010 commented 2 months ago

yes. I got 500 error from the browser console.

image
mbecker20 commented 2 months ago

Thanks, very helpful. This is a monitor_core bug and I'll release a patch to the Core Image

mbecker20 commented 2 months ago

Fixed with this commit https://github.com/mbecker20/monitor/commit/59cb86d5990ffc4e8959624122c4a8bed6d74352.

Pushed to monitor_core version 1.12.6 image (latest). Just restart with the latest image and it should work.

LawMixer commented 2 months ago

On the latest version, I'm getting an error: https://i.imgur.com/zyvfFjO.png

mbecker20 commented 2 months ago

I'll need more information to debug this, its coming from the db client and I haven't seen it before. It also won't stop the core api from running, the easy fix would be to delete and recreate the repos in the UI and it should fix it.

if you'd like to help debug it more, you could install Mongo compass, connect to the db, open the repos collection, and send a screenshot.

LawMixer commented 2 months ago

https://i.imgur.com/hjgCM0P.png https://i.imgur.com/d64h4yd.png https://i.imgur.com/xhrHiTv.png

mbecker20 commented 2 months ago

Ah, I see you came from v1.11, nice to see.

I still not sure of the issue. The only time I have seen error like this is for "duplicate key insert". But shouldn't be related to field git_account. Could you send a screenshot of the "indexes" tab?

LawMixer commented 2 months ago

https://i.imgur.com/PkdG74U.png

mbecker20 commented 2 months ago

thanks, all looks correct.

I see the issue now. This is the offending code: link

The github_account alias (meant for backward compatability) causes deserialization error when you have both github_account and git_account field defined. In compass, just delete the config.github_account field on the Repos which still have it. The next release will remove these aliases.

This is a failure of the migration procedure in upgrading from v1.11, apologies as this is my first release of the migrator. I will take this into account if a migration is necessary in the future. Note that this only affects the Repo resource. Builds and Deployments were migrated correctly.

Thanks @LawMixer !!

mbecker20 commented 2 months ago

Also, keep in mind best practice is to keep all your configs defined in a resource sync. This way, all configs are external to the db, and can be deleted and synced back in. Also, you can make testing changes in the UI and it will track whats changes, so you can return to how things were in case you don't like the change.

LawMixer commented 2 months ago

Thank you! I'm switching to monitor from Pterodactyl and so far, it has not been easy, but we learn and move on!

Everything is on the same server, but it's on different networks; Wish I could just switch networks from pyero to monitor and be done...hahhah

mbecker20 commented 2 months ago

Thats really awesome to hear. Stay tuned for the next Monitor release, which i will call v1.13 Komodo. Theres going to be a lot of improvements and its getting close. And will be super easy to update, this is why I did the git provider changes before this one, to get the migrator out of the way. So no migrator, will just pull latest and restart core (and run periphery install again... still need to figure out easy way to keep periphery updated. I use puppet for this but the setup of that is not so easy)

slient2010 commented 2 months ago

Thanks very much. it worked. @mbecker20

image