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

Peertube CLI auth got forbidden #3091

Closed
gai00 opened this issue Aug 15, 2020 · 2 comments
Closed

Peertube CLI auth got forbidden #3091

gai00 opened this issue Aug 15, 2020 · 2 comments
Labels
Status: Waiting for answer Waiting issue author answer

Comments

@gai00
Copy link

gai00 commented Aug 15, 2020

Environment: docker - chocobozzz/peertube:production-buster
Version: 2.3.0

config:

listen:
  hostname: '0.0.0.0'
  port: 9000
webserver:
  https: true
  hostname: my.host.name
  port: 443
# ...

Problem:
I try to upload my video via CLI, but got forbidden.
exec command in container.
(docker exec -it {container_id} bash)

$ peertube auth add
prompt: instance url:  http://localhost:9000
prompt: username:  root
prompt: password:  ************

expected 200 "OK", got 403 "Forbidden"

curl localhost:9000
>> peertube html content

I tried https://my.host.name, lost certs in container...
I think https is no problem. but I want to upload without ssl. (maybe faster)

@Chocobozzz
Copy link
Owner

Please fill the template. We need server logs

@Chocobozzz Chocobozzz added the Status: Waiting for answer Waiting issue author answer label Aug 17, 2020
@hopeseekr
Copy link
Contributor

It took me FOREVER to figure out:

prompt: instance url:  https://www.example.com
prompt: username:  hopeseekr
prompt: password:  ************

You MUST NOT have a trailing / in your instance url, or it will always say expected 200 "OK", got 404 "Not Found".

It'd be very very helpful for PeerTube to autoremove everything after and including the domain name:port.

I am going to submit a PR for this.

hopeseekr added a commit to hopeseekr-contribs/PeerTube that referenced this issue Dec 27, 2020
…raneous characters.

**The Solution:**
I have hardened `auth add` by stripping out everything from the third '/' to the end of the instance URL.

**The Problem:**
When adding an authorization for the peertube-cli, before this commit you could not have anything after the domain_name:port.

For instance, if there was a trailing / in your instance URL, before this commit it will always fail with

    expected 200 "OK", got 404 "Not Found".

It took me over 20 minutes to figure out that this was the problem.

See Issue Chocobozzz#3091.
hopeseekr added a commit to hopeseekr-contribs/PeerTube that referenced this issue Dec 27, 2020
…raneous characters.

**The Solution:**
I have hardened `auth add` by stripping out everything from the third '/' to the end of the instance URL.

**The Problem:**
When adding an authorization for the peertube-cli, before this commit you could not have anything after the domain_name:port.

For instance, if there was a trailing / in your instance URL, before this commit it will always fail with

    expected 200 "OK", got 404 "Not Found".

It took me over 20 minutes to figure out that this was the problem.

See Issue Chocobozzz#3091.
hopeseekr added a commit to hopeseekr-contribs/PeerTube that referenced this issue Dec 27, 2020
…raneous characters.

**The Solution:**
I have hardened `auth add` by stripping out everything from the third '/' to the end of the instance URL.

**The Problem:**
When adding an authorization for the peertube-cli, before this commit you could not have anything after the domain_name:port.

For instance, if there was a trailing / in your instance URL, before this commit it will always fail with

    expected 200 "OK", got 404 "Not Found".

It took me over 20 minutes to figure out that this was the problem.

See Issue Chocobozzz#3091.
hopeseekr added a commit to hopeseekr-contribs/PeerTube that referenced this issue Dec 27, 2020
…raneous characters.

**The Solution:**
I have hardened `auth add` by stripping out everything from the third '/' to the end of the instance URL.

**The Problem:**
When adding an authorization for the peertube-cli, before this commit you could not have anything after the domain_name:port.

For instance, if there was a trailing / in your instance URL, before this commit it will always fail with

    expected 200 "OK", got 404 "Not Found".

It took me over 20 minutes to figure out that this was the problem.

See Issue Chocobozzz#3091.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Waiting for answer Waiting issue author answer
Projects
None yet
Development

No branches or pull requests

3 participants