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

[admin]: Trailing slash in public-endpoint (was: 404 on admin page) #498

Closed
angristan opened this issue Nov 11, 2018 · 13 comments · Fixed by #877
Closed

[admin]: Trailing slash in public-endpoint (was: 404 on admin page) #498

angristan opened this issue Nov 11, 2018 · 13 comments · Fixed by #877
Labels
bug needs-contributor Someone needs to implement this. Help wanted! needs-decision Architectural/Behavioral decision by maintainers needed server (Python) server code
Milestone

Comments

@angristan
Copy link

angristan commented Nov 11, 2018

I am running 0.11.1, and I get this error on my admin page:

Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

I try to access https://my-isso.tld/admin/. I have admin_password and public-endpoint set in my config.

@jelmer
Copy link
Member

jelmer commented Nov 14, 2018

Note that public-endpoint doesn't determine where the admin page gets served, it's just used when isso redirects to itself.

@angristan
Copy link
Author

OK, what else should I be checking?

@jelmer
Copy link
Member

jelmer commented Nov 14, 2018 via email

@angristan
Copy link
Author

angristan commented Nov 17, 2018

Yes it's still working great, it's been running for months on my blog. I've upgraded to the latest version so 10.11.1.

@jelmer
Copy link
Member

jelmer commented Nov 17, 2018

Do you mean 0.11.1 ? There is no 1.11.1 release.

@angristan
Copy link
Author

Oops, yes, 0.11.1

@frenchvandal
Copy link
Contributor

I have a different issue: I can access the admin interface (no 404 error) but when I type the password (the one set in the conf file) I am still on the login page. Same version as @angristan and no other issues (comments are showing fine on my Ghost posts).

isso

@blatinier
Copy link
Collaborator

@frenchvandal what does the Network panel tells you when you try to log in? (F12 → click on network to access this panel)

@angristan
Copy link
Author

Adding:

[admin]
enabled = true
password = xxxx

While keeping

[generic]
admin_password = xxxxx

I get

isso    | 2018-12-10 23:33:08,453 WARNING: no such option: [admin] password
isso    | 2018-12-10 23:33:08,453 WARNING: no such option: [admin] enabled

But I don't have a 404 anymore:

screenshot 2018-12-11 at 00 36 16

Trying to login:
screenshot 2018-12-11 at 00 38 36

I read in #506 that

The configuration variable name has changed slightly since 0.11.1; in master the name is admin/password, in 0.11.1 the name was general/admin_password.

I'm confused 🤷‍♂️

@frenchvandal
Copy link
Contributor

@blatinier thanks to @angristan I did what was said in #506 (in the conf, removed password from [admin] , added admin_password in [general]).
Now the interface access is just fine.
Sorry for the thread hijacking!

@angristan
Copy link
Author

angristan commented Dec 14, 2018

Removing the trailing / in my public-endpoint fixed the issue in my last comment.

@jelmer jelmer reopened this Dec 15, 2018
@jelmer
Copy link
Member

jelmer commented Dec 15, 2018

isso should probably either

  1. Fix that trailing slash for you
  2. Warn you

@ix5
Copy link
Member

ix5 commented Dec 27, 2021

Relevant: #519, but this truncation should also be applied more widely

@ix5 ix5 added bug needs-contributor Someone needs to implement this. Help wanted! needs-decision Architectural/Behavioral decision by maintainers needed server (Python) server code labels Dec 27, 2021
@ix5 ix5 changed the title 404 on admin page [admin]: Trailing slash in public-endpoint (was: 404 on admin page) Mar 23, 2022
ix5 added a commit to ix5/isso that referenced this issue May 17, 2022
ix5 added a commit to ix5/isso that referenced this issue May 17, 2022
See https://werkzeug.palletsprojects.com/en/2.1.x/routing/#werkzeug.routing.Rule

`strict_slashes=False` means both `/new` and `/new/` are
accepted as route endpoints.

Contributes to isso-comments#498
ix5 added a commit to ix5/isso that referenced this issue May 27, 2022
ix5 added a commit to ix5/isso that referenced this issue May 27, 2022
See https://werkzeug.palletsprojects.com/en/2.1.x/routing/#werkzeug.routing.Rule

`strict_slashes=False` means both `/new` and `/new/` are
accepted as route endpoints.

Contributes to isso-comments#498
@ix5 ix5 modified the milestones: 0.14, 0.13 Jun 4, 2022
ix5 added a commit to ix5/isso that referenced this issue Jun 5, 2022
ix5 added a commit to ix5/isso that referenced this issue Jun 5, 2022
@ix5 ix5 closed this as completed in #877 Jun 5, 2022
ix5 added a commit to ix5/isso that referenced this issue Jun 5, 2022
```
/admin -> /admin/
/login  -> /login/
```

Since any non-API page can reasonably be expected to end in
a trailing slash by visitors (it is a path, not a file),
set the trailing slash version as canonical.

This has another positive side-effect:
Visiting `isso.dev/admin` (without trailing slash) will
redirect to `/admin/` automatically, thus obviating issues
like isso-comments#489 [^1]. Any Javascript or CSS files are not affected
as they are served throught the `SharedDataMiddleware` in
`__init__.py`` anyway.

[^1]: isso-comments#498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-contributor Someone needs to implement this. Help wanted! needs-decision Architectural/Behavioral decision by maintainers needed server (Python) server code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants