-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Can not create first user (admin) with API #5376
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
Comments
API will not work without any user as it requires authorization, you can use command line on server to create first user |
Hi @lafriks how can I do that? perhaps via sqlite3 The only I have is the schema. CREATE TABLE `user` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `lower_name` TEXT NOT NULL, `name` TEXT NOT NULL, `full_name` TEXT NULL, `email` TEXT NOT NULL, `keep_email_private` INTEGER NULL, `passwd` TEXT NOT NULL, `must_change_password` INTEGER DEFAULT 0 NOT NULL, `login_type` INTEGER NULL, `login_source` INTEGER DEFAULT 0 NOT NULL, `login_name` TEXT NULL, `type` INTEGER NULL, `location` TEXT NULL, `website` TEXT NULL, `rands` TEXT NULL, `salt` TEXT NULL, `language` TEXT NULL, `created_unix` INTEGER NULL, `updated_unix` INTEGER NULL, `last_login_unix` INTEGER NULL, `last_repo_visibility` INTEGER NULL, `max_repo_creation` INTEGER DEFAULT -1 NOT NULL, `is_active` INTEGER NULL, `is_admin` INTEGER NULL, `allow_git_hook` INTEGER NULL, `allow_import_local` INTEGER NULL, `allow_create_organization` INTEGER DEFAULT 1 NULL, `prohibit_login` INTEGER DEFAULT 0 NOT NULL, `avatar` TEXT NOT NULL, `avatar_email` TEXT NOT NULL, `use_custom_avatar` INTEGER NULL, `num_followers` INTEGER NULL, `num_following` INTEGER DEFAULT 0 NOT NULL, `num_stars` INTEGER NULL, `num_repos` INTEGER NULL, `description` TEXT NULL, `num_teams` INTEGER NULL, `num_members` INTEGER NULL, `diff_view_style` TEXT DEFAULT '' NOT NULL); But I don't know how gitea is doing the "shadowing" process on the passwd field... |
Hi @lafriks I've found the methods in golang code, but not sure how to make the same hash with a shell script .. Lines 412 to 420 in 801843b
Here a real password generated with the ui. sqlite> select id,passwd,salt from user;
1|67acb09b94a9154e756212a3f93b5d5ff4e073d31227d72ebbba0eed3074ea16e919eb3eb9c6d9a1eb63980ac80f7e42db56|Zw5R87ort1 |
@toni-moreno in command line, type |
Command line docs: https://docs.gitea.io/en-us/command-line/ |
ups!!! sorry I didn't know about the command line tool!!! Thank you !! |
Hi @lafriks After created the admin user Can not use the password , gitea is redirecting to a new Location /user/settings/change_password , ¿ How can disable this behaviour? |
There is argument to not require password change |
@lafriks that functionality is not in Or Maybe the first user (admin) should not be required to change his/her password? |
Accounts created via the command line are required to update their passwords. We could maybe not require the first user ( admin) to change his/her password. |
Oh, sorry flag will be only in 1.7.0. #4955 implements this |
[x]
):Description
I'm working in a automated gitea provisioning script , and the admin user and password is provided as parameter to this script.
I've tested with as auth token the security.SECRET_KEY and security.INTERNAL_TOKEN configured in my app.ini but It doesn't work. ( as you can see below)
Which token should I use to create the first gitea user (the admin user) ?
The text was updated successfully, but these errors were encountered: