CLI: admin auth list and delete are broken #4561

Closed
opened 2025-11-02 05:54:40 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @markus-seidl on GitHub (Dec 28, 2019).

  • Gitea version (or commit ref): Gitea version 1.11.0+dev-479-g8149ed704 built with GNU Make 4.2.1, go1.13.5 : bindata, sqlite, sqlite_unlock_notify
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Executing auth list via CLI returns a tab separated list without enter between entries, which makes it not only unreadable but also very difficult to parse with ansible (e.g.)
Delete doesn't work at all.

auth list:

bash-5.0# /app/gitea/gitea admin auth list
2019/12/28 19:03:34 ...dules/setting/git.go:87:newGit() [I] Git Version: 2.22.2, Wire Protocol Version 2 Enabled
2019/12/28 19:03:34 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT "id", "type", "name", "is_actived", "is_sync_enabled", "cfg", "created_unix", "updated_unix" FROM "login_source" - took: 2.574436ms
 ID Name Type Enabled4 ldap LDAP (via BindDN)truebash-5.0# 

delete:

bash-5.0# /app/gitea/gitea admin auth delete --id 4
Incorrect Usage: flag provided but not defined: -id

NAME:
   Gitea admin auth delete - Delete specific auth source

USAGE:
   Gitea admin auth delete [command options] [arguments...]

OPTIONS:
   --custom-path value, -C value  Custom path file path (default: "/data/gitea")
   --config value, -c value       Custom configuration file path (default: "/data/gitea/conf/app.ini")
   --version, -v                  print the version
   --work-path value, -w value    Set the gitea working path (default: "/app/gitea")
   

DEFAULT CONFIGURATION:
     CustomPath:  /data/gitea (GITEA_CUSTOM)
     CustomConf:  /data/gitea/conf/app.ini
     AppPath:     /app/gitea/gitea
     AppWorkPath: /app/gitea

2019/12/28 19:04:04 main.go:111:main() [F] Failed to run app with [/app/gitea/gitea admin auth delete --id 4]: flag provided but not defined: -id
bash-5.0# 

Also using -id 4 doesn't work.

Screenshots

Originally created by @markus-seidl on GitHub (Dec 28, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): Gitea version 1.11.0+dev-479-g8149ed704 built with GNU Make 4.2.1, go1.13.5 : bindata, sqlite, sqlite_unlock_notify - Git version: - Operating system: - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description Executing auth list via CLI returns a tab separated list without enter between entries, which makes it not only unreadable but also very difficult to parse with ansible (e.g.) Delete doesn't work at all. auth list: ```bash bash-5.0# /app/gitea/gitea admin auth list 2019/12/28 19:03:34 ...dules/setting/git.go:87:newGit() [I] Git Version: 2.22.2, Wire Protocol Version 2 Enabled 2019/12/28 19:03:34 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT "id", "type", "name", "is_actived", "is_sync_enabled", "cfg", "created_unix", "updated_unix" FROM "login_source" - took: 2.574436ms ID Name Type Enabled4 ldap LDAP (via BindDN)truebash-5.0# ``` delete: ```bash bash-5.0# /app/gitea/gitea admin auth delete --id 4 Incorrect Usage: flag provided but not defined: -id NAME: Gitea admin auth delete - Delete specific auth source USAGE: Gitea admin auth delete [command options] [arguments...] OPTIONS: --custom-path value, -C value Custom path file path (default: "/data/gitea") --config value, -c value Custom configuration file path (default: "/data/gitea/conf/app.ini") --version, -v print the version --work-path value, -w value Set the gitea working path (default: "/app/gitea") DEFAULT CONFIGURATION: CustomPath: /data/gitea (GITEA_CUSTOM) CustomConf: /data/gitea/conf/app.ini AppPath: /app/gitea/gitea AppWorkPath: /app/gitea 2019/12/28 19:04:04 main.go:111:main() [F] Failed to run app with [/app/gitea/gitea admin auth delete --id 4]: flag provided but not defined: -id bash-5.0# ``` Also using -id 4 doesn't work. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/bug label 2025-11-02 05:54:40 -06:00
Author
Owner

@bagasme commented on GitHub (Dec 29, 2019):

Perhaps for auth delete currently --id option not supported?

@bagasme commented on GitHub (Dec 29, 2019): Perhaps for `auth delete` currently `--id` option not supported?
Author
Owner

@markus-seidl commented on GitHub (Dec 29, 2019):

@bagasme Then how should the record to be deleted then be selected?

@markus-seidl commented on GitHub (Dec 29, 2019): @bagasme Then how should the record to be deleted then be selected?
Author
Owner

@techknowlogick commented on GitHub (Dec 29, 2019):

Seems docs are incorrect for this option, as they recommend --id

@techknowlogick commented on GitHub (Dec 29, 2019): Seems [docs](https://docs.gitea.io/en-us/command-line/#admin) are incorrect for this option, as they recommend `--id`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4561