Skip to content
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

Set user avatar with CLI or API #25344

Closed
lonix1 opened this issue Jun 18, 2023 · 6 comments · Fixed by #25369
Closed

Set user avatar with CLI or API #25344

lonix1 opened this issue Jun 18, 2023 · 6 comments · Fixed by #25369
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@lonix1
Copy link
Contributor

lonix1 commented Jun 18, 2023

Feature Description

We use automation (ansible) to setup multiple servers, each has gitea and our ci/cd stuff. We create the same users each time for our team members.

One can create a user with the CLI: username, password, email, is_admin.

But it's not possible to specify the avatar. It would be nice to do that with the CLI (or some other method, maybe just put the images in a certain directory using a certain filename?).

Screenshots

No response

@lonix1 lonix1 added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Jun 18, 2023
@lonix1
Copy link
Contributor Author

lonix1 commented Jun 18, 2023

On second thought, I think this could be too complex with the cli.

Maybe instead just copy the image into the avatars directory and let gitea find it - is that possible? I guess the The filename must be hashed somehow so gitea knows about it?

If out of scope, please close this issue.

@silverwind
Copy link
Member

I guess it could be added, but 5 arguments on a CLI is already pushing the complexity. It may already be possible via API to set the avatar, and your use case does sound like it may be better done with an API client.

@lonix1
Copy link
Contributor Author

lonix1 commented Jun 18, 2023

I didn't know there was an API... Thanks for letting me know!

I will tinker with this and report back my solution.

@lonix1
Copy link
Contributor Author

lonix1 commented Jun 18, 2023

UPDATE:

I checked on https://try.gitea.io/api/swagger, but unfortunately there is no endpoint for avatars. 😞

@silverwind
Copy link
Member

Yeah, it seems we are lacking both a POST /user and a PATCH /user.

@lonix1 lonix1 changed the title Set user avatar with CLI Set user avatar with CLI or API Jun 19, 2023
@JakobDev
Copy link
Contributor

I will start working on this

silverwind added a commit that referenced this issue Jun 29, 2023
This adds an API for uploading and Deleting Avatars for of Users, Repos
and Organisations. I'm not sure, if this should also be added to the
Admin API.

Resolves #25344

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants