Project

General

Profile

Actions

Task #2259

closed

'Get help online' menu item points to 404 if there is no askbot for a language

Added by Gabor Kelemen almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
High
Category:
-
Target version:
Team - Q3/2017
Start date:
Due date:
% Done:

100%

Tags:

Description

I opened the 'Get help online' command in 5.5alpha with Hungarian locale, and got redirected to https://ask.libreoffice.org/hu/questions/ - which says there is no such page.
There is no askbot for Hungarian, so I think such links should redirect to the English Askbot start page.

Actions #1

Updated by Florian Effenberger almost 7 years ago

  • Assignee set to Guilhem Moulin
  • Target version set to Pool
Actions #2

Updated by Guilhem Moulin almost 7 years ago

The missing redirect to the English page is by design, see

https://redmine.documentfoundation.org/issues/1983#note-3

and

https://redmine.documentfoundation.org/issues/1983#note-8

if we change our mind it's easy to do though :-)

Actions #3

Updated by Florian Effenberger almost 7 years ago

  • Priority changed from Normal to High
  • Target version changed from Pool to Q3/2017

There's indeed some demand that we deal with this
AskBot currently does not allow customizing the 404 page, and in order to save budget:
Could we create a custom 404 page that lists all the available AskBot sites and redirect to that via nginx? Would that have any negative side-effect?

Actions #4

Updated by Guilhem Moulin almost 7 years ago

There is no technical blocker here. (But I don't this I'm able to write a fancy HTML page with a style matching that of our askbot instance.)

The only negative side effect I can think of is that we'll have to modify the nginx config and the custom 404 page when a new forum is deployed. The former might not even be necessary if instead of listing the list of supported locales in the nginx config we catch 404 from uwsgi and serve a custom page when the URI matches ^/[^/]+(?:/[^/]+)?/?$

Actions #5

Updated by Florian Effenberger almost 7 years ago

There is no technical blocker here. (But I don't this I'm able to write
a fancy HTML page with a style matching that of our askbot instance.)

I think Mike Saunders can help with that - can you poke him? :-)

The only negative side effect I can think of is that we'll have to
modify the nginx config and the custom 404 page when a new forum is
deployed. The former might not even be necessary if instead of listing
the list of supported locales in the nginx config we catch 404 from
uwsgi and serve a custom page when the URI matches |^/[^/]+(?:/[^/]+)?/?$|

Let's give it a try. There seem to be quite some requests to have these
improved 404 pages, and we can do it with nginx itself, I'd like to give
it a try first before we spend money on it.

Actions #6

Updated by Guilhem Moulin over 6 years ago

Florian Effenberger wrote:

There is no technical blocker here. (But I don't this I'm able to write
a fancy HTML page with a style matching that of our askbot instance.)

I think Mike Saunders can help with that - can you poke him? :-)

Added Mike to the list of watchers :-)

Actions #7

Updated by Mike Saunders over 6 years ago

Hello,

I can indeed create a HTML page using the Ask CSS with a list of all Ask sites. But the question is:

  • Where can I get a list of all sites?
  • Will we need to update the page whenever a new site comes online?

Just let me know the source for the text, and I'll wrap it all up in Ask-style HTML and CSS :-)

Actions #8

Updated by Guilhem Moulin over 6 years ago

Mike Saunders wrote:

  • Where can I get a list of all sites?

Taking the list of all AskBot locales and removing the ones our instance hasn't been localized for (ie, it returns a 404), I get

$ find /srv/ask/*/*/locale -maxdepth 1 -mindepth 1 -printf '%P\n' \
  | sort -u | while read l; do
      curl -sLf -o/dev/null \
        --resolve ask.libreoffice.org:443:127.0.0.1 \
        "https://ask.libreoffice.org/$l/" && echo "$l" 
  done                                                                                                  
ar
de
en
es
eu
hr
it
ja
ko
nl
pt
ro
tr
  • Will we need to update the page whenever a new site comes online?

Unfortunately, yes :-(

Actions #9

Updated by Mike Saunders over 6 years ago

Just a note that I'm working on this now, and will provide some HTML and CSS for a page tomorrow morning.

Actions #10

Updated by Mike Saunders over 6 years ago

  • Status changed from New to In Progress

OK, here's a page with fully validated and tested HTML and CSS - the image is pulled from the Ask site:

http://newdesign.libreoffice.org/ask_404.html

Let me know if this works, and we can close the ticket.

Actions #11

Updated by Guilhem Moulin over 6 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

Thanks, mike! I just forgot a tr '[A-Z_]' '[a-z-]' after the find, so I forgot to list cs-cz (now added; I'm not good with CSS I'm still able to edit HTML :-P).

In the end I chose not to hardcode the language list in nginx, so we don't need to modify two places when new languages are added. Instead, when the URI matches ^/[a-zA-Z\-_]+(?:/questions?)?/?$ 404 return code are intercepted and your page is served instead. (For instance /xy/questions/nonexistant returns the normal 404, while for /xy and /xy/questions/ it is intercepted and the custom 404 is served instead.) That way if a question is deleted, users are served the normal 404 page, not the language list.

Actions

Also available in: Atom PDF