Commit Graph

16 Commits

Author SHA1 Message Date
John Olheiser c8c8e9758b Add OTP and scopes to login (#546)
Resolves #542

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/546
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: John Olheiser <john+gitea@jolheiser.com>
Co-committed-by: John Olheiser <john+gitea@jolheiser.com>
2024-02-14 16:49:29 +00:00
techknowlogick b868d30434 spdx (#581)
Co-authored-by: techknowlogick <hello@techknowlogick.com>
Co-committed-by: techknowlogick <hello@techknowlogick.com>
2023-09-08 01:40:02 +00:00
Wim 6a848cb72a Add option to disable version checking (#520)
Fixes "Only signed in user is allowed to call APIs." as the
/api/v1/version returns a 403 when running a gitea where
REQUIRE_SIGNIN_VIEW is enabled

Co-authored-by: Wim <wim@42.be>
Reviewed-on: https://gitea.com/gitea/tea/pulls/520
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Wim <42wim@noreply.gitea.io>
Co-committed-by: Wim <42wim@noreply.gitea.io>
2022-10-31 09:56:23 +08:00
Wim 6a4ba6a689 Add support for authentication via ssh certificates and pub/privatekey (#442)
This adds support for authentication using a SSH certificate and normal public keys when you've got an ssh-agent running that has this certificate or your public key loaded.

First question when creating a new login is to ask about the ssh certificates or public keys, when the answer is yes, we don't need to ask about tokens/usernames anymore.

Co-authored-by: Wim <wim@42.be>
Reviewed-on: https://gitea.com/gitea/tea/pulls/442
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-authored-by: Wim <42wim@noreply.gitea.io>
Co-committed-by: Wim <42wim@noreply.gitea.io>
2022-09-15 03:00:08 +08:00
Norwin 5e7c702e07 Clarify command descriptions when no arguments are taken (#496)
This changes the command help string from eg
```
NAME:
   tea label create - Create a label

USAGE:
   tea label [command options] [arguments...]
```
to
```
NAME:
   tea label create - Create a label

USAGE:
   tea label [command options]
```

Hopefully improving usability.

---

edit: this also changes `tea release create` to take the `--tag` flag value optionally via the first argument, as this seems to be a clear UX improvement.

fixes #483

Co-authored-by: Norwin <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/496
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: delvh <delvh@noreply.gitea.io>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
2022-09-14 02:14:02 +08:00
Norwin 782a6318f3 Add more command shorthands (#307)
add more command aliases

breaking: s/notif/n

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/307
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
2020-12-17 00:47:40 +08:00
Norwin a948fd7e10 Refactor error handling (#308)
use fmt instead of log

log.Fatal -> return err

set non-zero exit code on error

print to default err log

cleanup

fix vet

Co-authored-by: Norwin Roosen <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/308
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
2020-12-17 00:18:10 +08:00
Norwin dc67630b64 replace flag globals, require context for commands (#291)
introduce TeaContext

clean up InitCommand

move GetListOptions to TeaContext

ensure context for each command

so we fail early with a good error message instead of "Error: 404" etc

make linter happy

Merge branch 'master' into refactor-global-flags

move TeaContext & InitCommand to modules/context

Merge branch 'master' into refactor-global-flags

CI.restart()

Merge branch 'master' into refactor-global-flags

Merge branch 'master' into refactor-global-flags

Co-authored-by: Norwin Roosen <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/291
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: khmarbaise <khmarbaise@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
2020-12-16 01:38:22 +08:00
Norwin 5a41c79d7d Add `tea login delete` (#296)
add `tea login delete`

alias to tea logout

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/296
Reviewed-by: khmarbaise <khmarbaise@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
2020-12-14 18:28:54 +08:00
6543 c063329e9a [Refactor] unexport config.Config var & move login tasks to task module (#288)
Unexport generateToken()

move CreateLogin into task

Create func config.SetDefaultLogin()

Unexport loadConfig() & saveConfig

unexport config var

make SetDefaultLogin() case insensitive

update func descriptions

move FindSSHKey to task module

Reviewed-on: https://gitea.com/gitea/tea/pulls/288
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-Authored-By: 6543 <6543@obermui.de>
Co-Committed-By: 6543 <6543@obermui.de>
2020-12-12 21:28:37 +08:00
Norwin 0f38da068c Improve ssh handling (#277)
checkout: use configured protocol for PR checkout

instead of defaulting to ssh if that is enabled
this might fix #262

login add: try to find a matching ssh key & store it in config

possibly expensive operation should be done once

pr checkout: don't fetch ssh keys

As a result, we don't try to pull via ssh, if no privkey was configured.
This increases chances of a using ssh only on a working ssh setup.

fix import order

remove debug print statement

improve ssh-key value docs

rm named return & fix pwCallback nil check

Co-authored-by: Norwin Roosen <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/277
Reviewed-by: khmarbaise <khmarbaise@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: 6543 <6543@obermui.de>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
2020-12-11 21:42:41 +08:00
6543 5cb3e1ded5 Refactor: Move list print functions into print package (#273)
MV list issues -> print.IssuesList

MV list labels -> print.LabelsList & task.LabelsExport

MV list logins -> print.LoginsList

MV list miles -> print.MilestonesList

MV list pulls -> print.PullsList

MV list releases -> print.ReleasesList

MV list issues&pulls of mile -> print.IssuesPullsList

MV list notification threads -> print.NotificationsList

Unexport print.outputList

Unexport print.outputMarkdown

remove comd/flags dependency in print module

Reviewed-on: https://gitea.com/gitea/tea/pulls/273
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Andrew Thornton <art27@cantab.net>
Co-Authored-By: 6543 <6543@obermui.de>
Co-Committed-By: 6543 <6543@obermui.de>
2020-12-08 18:28:54 +08:00
6543 136688997c Fix `login add` always go interactive (#221)
Flags are not Args

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/221
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-10-05 18:34:10 +00:00
6543 e23f56e81c Add Detail View for Login (#212)
Impruve & Refactor AddLogin

Impruve login comands

Remove unused Package + Vars

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/212
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
2020-10-02 15:57:48 +00:00
Norwin 3ee5501257 Common subcommand naming scheme (#208)
drop tea mile alias

document command schema in CONTRIBUTING.md

and update this file, its a plain copy from gitea

add "list" as alias for "ls" subcommand

add singular command aliases

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/208
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: techknowlogick <techknowlogick@gitea.io>
2020-10-02 15:46:51 +00:00
6543 f445ac7521 Refactor: apply new internal structurs (#206)
fix lint

fix lint

Move print TrackedTimesList to print package

Move AbsPathWithExpansion to utils/path.go

rename module intern to config

Move Subcomands into it's own Packages

Split times subcomands into own sourcefiles

Split repos subcomands into own sourcefiles

Split releases subcomands into own sourcefiles

Split pulls subcomands into own sourcefiles

Split milestones subcomands into own sourcefiles

Split login subcomands into own sourcefiles

Split labels subcomands into own sourcefiles

split issues subcomands into own sourcefiles

mv

Move Interactive Login Creation to interact package

Move Add Login function to intern/login.go

apply from review

lint: add description to exported func

smal nits

Move DetailViews stdout print func to print package

Refactor:
* Move Config & Login routines into intern package
* rename global var in cmd
* Move help func to utils

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/206
Reviewed-by: Norwin <noerw@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-09-30 05:11:33 +00:00