Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cli
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
funkwhale
cli
Commits
b1268507
Verified
Commit
b1268507
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Make it possible to force anonymous connection
parent
df59ca94
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!5
Resolve "Provide precompiled binaries for easier install"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
funkwhale_cli/cli.py
+10
-3
10 additions, 3 deletions
funkwhale_cli/cli.py
with
10 additions
and
3 deletions
funkwhale_cli/cli.py
+
10
−
3
View file @
b1268507
...
@@ -118,14 +118,14 @@ class lazy_credential():
...
@@ -118,14 +118,14 @@ class lazy_credential():
return
bool
(
self
.
value
)
return
bool
(
self
.
value
)
def
set_server
(
ctx
,
url
,
token
):
def
set_server
(
ctx
,
url
,
token
,
use_auth
=
True
):
ctx
.
ensure_object
(
dict
)
ctx
.
ensure_object
(
dict
)
ctx
.
obj
[
"
SERVER_URL
"
]
=
url
ctx
.
obj
[
"
SERVER_URL
"
]
=
url
parsed
=
urllib
.
parse
.
urlparse
(
url
)
parsed
=
urllib
.
parse
.
urlparse
(
url
)
ctx
.
obj
[
"
SERVER_NETLOC
"
]
=
parsed
.
netloc
ctx
.
obj
[
"
SERVER_NETLOC
"
]
=
parsed
.
netloc
ctx
.
obj
[
"
SERVER_PROTOCOL
"
]
=
parsed
.
scheme
ctx
.
obj
[
"
SERVER_PROTOCOL
"
]
=
parsed
.
scheme
try
:
try
:
token
=
token
or
lazy_credential
(
url
,
"
_
"
)
token
=
(
token
or
lazy_credential
(
url
,
"
_
"
)
)
if
use_auth
else
None
except
ValueError
as
e
:
except
ValueError
as
e
:
raise
click
.
ClickException
(
"
Error while retrieving password from keyring: {}. Your password may be incorrect.
"
.
format
(
e
.
args
[
0
]))
raise
click
.
ClickException
(
"
Error while retrieving password from keyring: {}. Your password may be incorrect.
"
.
format
(
e
.
args
[
0
]))
except
Exception
as
e
:
except
Exception
as
e
:
...
@@ -154,6 +154,13 @@ def set_server(ctx, url, token):
...
@@ -154,6 +154,13 @@ def set_server(ctx, url, token):
default
=
False
,
default
=
False
,
help
=
"
Disable logging
"
,
help
=
"
Disable logging
"
,
)
)
@click.option
(
"
--no-login
"
,
envvar
=
"
FUNKWHALE_NO_LOGIN
"
,
is_flag
=
True
,
default
=
False
,
help
=
"
Disable authentication/keyring
"
,
)
@SERVER_DECORATOR
@SERVER_DECORATOR
@TOKEN_DECORATOR
@TOKEN_DECORATOR
@click_log.simple_verbosity_option
(
logs
.
logger
,
expose_value
=
True
)
@click_log.simple_verbosity_option
(
logs
.
logger
,
expose_value
=
True
)
...
@@ -161,7 +168,7 @@ def set_server(ctx, url, token):
...
@@ -161,7 +168,7 @@ def set_server(ctx, url, token):
def
cli
(
ctx
,
env_file
,
url
,
verbosity
,
token
,
quiet
):
def
cli
(
ctx
,
env_file
,
url
,
verbosity
,
token
,
quiet
):
ctx
.
ensure_object
(
dict
)
ctx
.
ensure_object
(
dict
)
logs
.
logger
.
disabled
=
quiet
logs
.
logger
.
disabled
=
quiet
set_server
(
ctx
,
url
,
token
)
set_server
(
ctx
,
url
,
token
,
use_auth
=
not
no_login
)
@cli.command
()
@cli.command
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment