lobid / lodmill

This repo is replaced by i.a. https://github.com/hbz/lobid-resources/
19 stars 8 forks source link

Shut down old lobid-resources #802

Closed acka47 closed 5 years ago

acka47 commented 6 years ago

The main user of the old service is @jschnasse. Here are some current statistics from emphytos:

# grep "GET /resource" /files/weywot1/logs_apache_emphytos/access_log-20180401 | awk '{print $1}' | sort -n | uniq -c | sort -nr | head -n10
1971822 193.30.112.170
 360178 193.30.112.176
 322817 193.30.112.174
 162238 10.9.0.11
 149207 10.9.0.10
  52960 40.65.117.118
  37091 10.6.4.81
  10110 10.1.1.4
   7221 10.1.1.111
   5926 10.1.1.174

As this almost exclusively traffic from inside the hbz, we can shut down access from outside hbz in May as discussed offline.

jschnasse commented 6 years ago

I'm on a good way towards lobid v2. My plan is to remove the last dependency in June 2018. I'll let you know.

acka47 commented 5 years ago

Shutdown is scheduled for 2018-10-31, see http://blog.lobid.org/2018/07/19/lobid-1-shutdown.html

acka47 commented 5 years ago

To do:

acka47 commented 5 years ago

We also have to:

One option for redirecting the searches is to redirect them to the search endpoint of the respective new service:

Another option is to redirect them to the respective API documentation, e.g.:

Regarding the HTTP Status code I could not find a fitting code when redirecting multiple pages to one target page. My feeling is that 301 is probably the right code as well.

It probably would also make sense to somehow give developers some information during the redirect that the old API has shut down. But I don't know what is the best way to do this.

dr0i commented 5 years ago

Did the rewriting. Note my two edits in the comment above. Re: redirect search URLs: went with the second's proposal

/resource?{anything} --> resources/api

Summary:

  1. ID lookups are redirected to their API 2.0 pendants
  2. searches redirected to the API 2.0 documentation
fsteeg commented 5 years ago

Some samples:

fsteeg commented 5 years ago

+1

dr0i commented 5 years ago

This adds to the apache-conf, for 80 and 443:

     # API 1.0 redirects
    RewriteRule ^/resource/(.*)/about /resources/$1 [R=301,NE,L]
    RewriteRule ^/resource/(.*) /resources/$1#! [R=301,NE,L]
    RewriteCond  %{QUERY_STRING}  ^id=(.*)$
    RewriteRule ^/resource$ /resources/%1#! [QSD,R=301,L,NE]
    RewriteCond  %{QUERY_STRING}  ^.*$
    RewriteRule ^/resource$ /resources/api [QSD,R=301,L]

    RewriteRule ^/item/(.*)/about /items/$1 [R=301,NE,L]
    RewriteRule ^/item/(.*) /items/$1#! [R=301,NE,L]
    RewriteCond  %{QUERY_STRING}  ^id=(.*)$
    RewriteRule ^/item$ /items/%1#! [QSD,R=301,L,NE]
    RewriteCond  %{QUERY_STRING}  ^q=(.*)$
    RewriteRule ^/item$ /resources/api [QSD,R=301,L,NE]
    RewriteCond  %{QUERY_STRING}  ^.*$
    RewriteRule ^/item$ /items/api [QSD,R=301,L]

    RewriteRule ^/organisation/(.*)/about /organisations/$1 [R=301,NE,L]
    RewriteRule ^/organisation/(.*) /organisations/$1#! [R=301,NE,L]
    RewriteCond  %{QUERY_STRING}  ^id=(.*)$
    RewriteRule ^/organisation$ /organisations/%1#! [QSD,R=301,L,NE]
    RewriteCond  %{QUERY_STRING}  ^.*$
    RewriteRule ^/organisation$ /organisations/api [QSD,R=301,L]

    RewriteRule ^/(subject|person)/(.*)/about /gnd/$2 [R=301,NE,L]
    RewriteRule ^/(subject|person)/(.*) /gnd/$2#! [R=301,NE,L]
    RewriteCond  %{QUERY_STRING}  ^id=(.*)$
    RewriteRule ^/(subject|person)$ /gnd/%1#! [QSD,R=301,L,NE]
    RewriteCond  %{QUERY_STRING}  ^.*$
    RewriteRule ^/(subject|person)$ /gnd/api [QSD,R=301,L]

    RewriteCond  %{QUERY_STRING}  ^.*$
    RewriteRule ^/search.* / [QSD,R=301,L]

    RewriteRule ^/api / [R=301,L]
dr0i commented 5 years ago

Note: ES-cluster at quaoar2/3 is stopped. Resolving https://github.com/hbz/lobid-resources/issues/947 the play instance is now also stopped.

acka47 commented 5 years ago

Great to see that you shut down the old services. Can this issue now be closed or is something still missing?

dr0i commented 5 years ago

With resolving https://github.com/hbz/lobid/issues/390 this issue can be closed.