-
Notifications
You must be signed in to change notification settings - Fork 297
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
Process all Shaarli pages through Slim controllers #1511
Conversation
And update dependencies and tests. Note that SESSION['tags'] has been removed a log ago
The daily RSS template has been entirely rewritten to handle the whole feed through the template engine.
Also it was missing on the default template feeds
Including: - visibility - links per page - untagged only
- Reorganize visitor controllers - Fix redirection with Slim's requests base path - Fix daily links
Shaarlier is able to use the REST API so this should keep working. But it also supports username/password-based logins which will stop working due to |
ShaarliOS just follows the redirects from Please confirm this process is supposed to continue to work. |
It should work. Or maybe not :) I don't have an iOS device to test. Can you check that the app works against https://shaarli-next.hoa.ro/ ? |
Hi guys, I'm amazed by this wonderful work, kudos to everybody involved! I've just tested Shaarlier against https://shaarli-next.hoa.ro/ and as expected, it works well with the API. I won't make any update to support the new |
Thanks for the feedback!
For tests purposes you can currently use @mro Most previous routes has been kept, including |
shaarli-related has been fixed, in a retro-compatible fashion. Thanks for the heads up. |
Thanks for being first @ilesinge and for the elegant solution of not breaking older Shaarlies, I'll use your PR as reference for fixing my (probably) broken plugins at the weekend :) https://github.com/ilesinge/shaarli-related/pull/4/files |
@immanuelfodor The code is not so clean, mostly straightforward given the time I had, but yes, the compatibility is important. You may also be interested in checking ilesinge/shaarli-related#5 (thanks @ArthurHoaro ) |
How long will the |
I think I've found a bug. Here I need to check if I'm on an edit page or not: https://github.com/immanuelfodor/shaarli-markdown-toolbar/blob/slim-v0.12.0-beta/markdown_toolbar/markdown_toolbar.php#L92 However, this condition is never true as the Is this undocumented change intentional? If yes, I should strip the underscores from any router constants and data page values and check against the stripped values to keep compatibility with older Shaarlies.
Edit: Fixed the above link after pushing the strip underscores logic. It should work on my end whether it is a bug or not in Shaarli. |
I just wanted to report back that all my plugins are now compatible with the 0.12.0-beta release (latest master), I'm using the new version from now on. Also released two new plugins in the meantime, see PR #1528
|
Hi there, on the way to migrate the Material theme, I noticed an issue with the untagged links filter which redirects to |
No you're right it wasn't intentional. I will change it to use
I'm glad to hear that, and good job for the new plugins 👍
Thanks for the report, I will open a dedicated issue. |
https://shaarli-next.hoa.ro/?post=https://github.com/mro/ShaarliOS/issues/47 redirects to the login form as expected but after login does not redirect back to present the `linkform´. @ArthurHoaro can you fix the redirect? |
@ArthurHoaro and the https://shaarli-next.hoa.ro/?do=configure is important for ShaarliOS, because it looks for the name of the shaarli inside the |
Thanks for the report, I have open a PR to fix this redirection. |
@ArthurHoaro can you ping me once you deployed |
@mro I have switched that instance to the root Docker image |
thanks a lot, things improve but there's still an issue I'm examining at https://github.com/mro/ShaarliOS/issues/47 |
@ArthurHoaro uh, and url fragments seem to get lost along the way, so https://shaarli-next.hoa.ro/?post=https://github.com/mro/ShaarliOS/issues/47%23i-get-lost end up without |
Good catch, it should be fixed by #1541 (deployed). |
@ArthurHoaro I think I have another one https://shaarli-next.hoa.ro/?post=http://idlewords.com/talks/website_obesity.htm?foo%3Db+ar%23minimalism unescapes the P.S.: what happens to the form action |
It should work properly and redirect using the subdir. Please open a separate issue if you encounter any other bug. It'll be easier to handle. |
What is this?
All Shaarli pages are know process through Slim framework controllers. It means:
index.php
no longer existsThat's also the last piece of major refactoring that was planned for Shaarli.
It means that we will be able to focus on new features later, and in a safer way thanks to unit tests.
Demo
Please feel free to test it here (login
demo
/demo
): https://shaarli-next.hoa.roIn the meantime, you can use https://shaarli-current.hoa.ro/ if you need to compare behaviours.
Here is an export of the demo links if you need to delete/re-import existing links: https://gist.github.com/ArthurHoaro/853243091d5f296d897907c52dae8f1a
Routing
Besides everything that changed under the hood, the major change here is new URLs. I chose the new routes one by one over the past few months, so they're is definitely room for improvement.
If you think that a route should changed or improved, please submit your suggestion now, as it will be way harder to change it later.
Existing public routes have been mostly preserved (using a redirection to the new route), but most admin ones have been dropped. The reasoning behind this it that we don't want to break external permalinks, while admin ones are not public anyway.
/install
/?{hash}
/shaare/{hash}
/?do=login
/login
/?do=picwall
/picture-wall
/?do=tagcloud
/tags/cloud
/?do=taglist
/tags/list
/?do=daily
/daily
/?do=dailyrss
/daily-rss
/?do=atom
/feed/atom
/?do=rss
/feed/rss
/?do=opensearch
/open-search
/?do=addtag
/add-tag/{tag}
/?do=removetag
/remove-tag/{tag}
/?do=logout
/logout
/?do=tools
/admin/tools
/?do=changepasswd
/admin/password
/?do=configure
/admin/configure
/?do=addlink
/admin/add-shaare
/?post
/admin/shaare
/?edit_link
/admin/shaare/{id}
/?delete_link
/admin/shaare/{id}/delete
/?do=export
/admin/export
/?do=import
/admin/import
/?do=thumbs_update
/admin/thumbnails
I have omitted routes which are only redirecting to other routes.
Performances
Don't worry, Shaarli is still fast, that's why we chose a micro-framework.
Current master (1000 requests, per batch of 10 concurrent requests)
With Slim (1000 requests, per batch of 10 concurrent requests)
3rd party
Themes
Unfortunately, there is quite a few breaking changes for 3rd party theme maintainers.
{$base_path}
{$asset_path}
method=GET
form.linksperpage
input name is nownb
$global_errors
,$global_warnings
,$global_successes
.Plugins
Router
class is no longer supported and must be replaced byTemplatePage
(orLegacyRouter
).Release
This contains A LOT of refactoring. I will release a BETA version of Shaarli to make it clear that it still requires some testing.
I will probably merge this in a couple of weeks, if that's OK with everyone.