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

263 vocabs without apache #279

Merged
merged 38 commits into from
Jan 25, 2024
Merged

263 vocabs without apache #279

merged 38 commits into from
Jan 25, 2024

Conversation

sroertgen
Copy link
Contributor

@sroertgen sroertgen commented Nov 7, 2023

SkoHub Vocabs is now no longer dependent on an Apache Webserver to be delivered through.
The language is now chosen through the browser language.

All End-2-End tests and unit/integration tests are going through.

I deployed to dev and you can use the test webhook to test: https://test.skohub.io/sroertgen/test-vocabs/heads/main/

Benefits of this:

  • Independence of web server
  • GitHub Pages can now find the index page (no pointing to a specific language required)
  • Build size is reduced (e.g. from 45MB and 1074 pages to 25MB for 368 pages for the test data sets)

Open question:

  • Should the language be choosable via query parameter or similar? If so how, exactly?

Before merge:

  • set up redirects of de.html pages to html (maybe with adding the language param, depending on open question)
  • update documentation of skohub-vocabs-docker after PR

Fixes #263
Fixes #270
Fixes #283

@sroertgen sroertgen linked an issue Nov 7, 2023 that may be closed by this pull request
@sroertgen sroertgen requested a review from acka47 November 7, 2023 14:13
@sroertgen sroertgen marked this pull request as ready for review November 7, 2023 14:14
@acka47
Copy link
Member

acka47 commented Nov 14, 2023

See #280 for a problem introduced on with this PR on the test system.

@acka47
Copy link
Member

acka47 commented Dec 7, 2023

I did some functional review, Overall this looks very mature, but I noticed one thing:

Otherwise this looks good. Wrt the direct language links, I thin we should have them. At least fpr bug fixing in SkoHub or by a vocab's editors it will be useful to directly link to a page in a specific language. For me it would be ok to implement this by a query parameter, e.g. ?lang=de. And of course this should be set in the URL bar latest when I select a specific language. Probably it should already be set when the display ist set to the language requested by the browser or – if this is not available – when displaying the default language.

@acka47 acka47 removed their assignment Dec 7, 2023
@sroertgen
Copy link
Contributor Author

Parsing for an URL parameter lang= is implemented, see e.g.

https://test.skohub.io/sroertgen/test-vocabs/heads/main/?lang=nl
https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/scheme.html?lang=uk

If language from URL parameter does not exist, a default language is chosen:

https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/scheme.html?lang=bla

Also the use of the browsers "Go Back" function should now remove the concept scheme info in the header.

Assigning @acka47 for testing.

@acka47
Copy link
Member

acka47 commented Jan 17, 2024

I build a new version on test with my testing repo to have a look at this: https://test.skohub.io/build/?id=58f2d04b-e0b7-4dc9-8cfd-97e13c088d3d

Parsing for an URL parameter lang= is implemented, see e.g.

https://test.skohub.io/sroertgen/test-vocabs/heads/main/?lang=nl

Yes, it works. See also https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/?lang=en

https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/scheme.html?lang=uk

Hmm, this does not work for me: https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/w3id.org/kim/hcrt/assessment.html&lang=de Am I doing something wrong?

If language from URL parameter does not exist, a default language is chosen:
https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/scheme.html?lang=bla

Works here: https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/?lang=foo
but not here: https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/w3id.org/kim/hcrt/assessment.html&lang=foo

Also the use of the browsers "Go Back" function should now remove the concept scheme info in the header.

Yes, this works now.

I have noticed that the URL does not change when switching the language. I think we have already discussed this. Did we settle on not representing the current language state anymore at all in the URL?

@acka47
Copy link
Member

acka47 commented Jan 17, 2024

So, this looks good. +1

I have noticed that the URL does not change when switching the language. I think we have already discussed this. Did we settle on not representing the current language state anymore at all in the URL?

This is ok. We will mainly use direct links to a language for debugging and now about how to create them. Others won't need this.

@sroertgen sroertgen assigned Phu2 and unassigned acka47 Jan 18, 2024
@sroertgen
Copy link
Contributor Author

sroertgen commented Jan 18, 2024

Assigning @Phu2 for setting up redirects:

If someone comes with ...index.de.html or ...scheme.de.html it needs to be redirected to index.html?lang=en or scheme.html?lang=de etc

@Phu2
Copy link
Contributor

Phu2 commented Jan 18, 2024

Added

        # Redirect from ...filename.LANGCODE.html to ...filename.html?lang=LANGCODE
        RewriteRule ^(.+)\.([a-z]{2})\.html$ $1.html?lang=$2 [L,R=301]

to Apache vhost config test.skohub.io.conf and reloaded.

@sroertgen
Copy link
Contributor Author

sroertgen commented Jan 24, 2024

With skohub-io/skohub-webhook#20 we tested to rebuild vocabularies on the test environment and it seems to work.

The redirect is also configured, so https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/application.de.html will redirect to https://test.skohub.io/sroertgen/test-vocabs/heads/main/w3id.org/kim/hcrt/application.html?lang=de

Next steps will be:

What do you think @Phu2 @acka47 ?

@Phu2
Copy link
Contributor

Phu2 commented Jan 24, 2024

+1

@acka47
Copy link
Member

acka47 commented Jan 24, 2024

Sounds good to me.

Last step:

  • Write a blog post and make people aware about this breaking change who host their own instances (WLO, IQB, FWU).

@sroertgen
Copy link
Contributor Author

Fallback if it would not work for any reason:

  • Mount the backup dist directory
  • change the docker tag in skohub-webhook to with-apache
  • remove the apache rewrite rule

@sroertgen sroertgen merged commit 1c954b0 into main Jan 25, 2024
3 checks passed
@sroertgen sroertgen deleted the 263-vocabs-without-apache branch February 7, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
3 participants