aboutsummaryrefslogtreecommitdiffstats
path: root/fatcat_scholar/web.py
Commit message (Collapse)AuthorAgeFilesLines
* enable initial Korean (ko) web interface translationBryan Newbold2021-04-301-0/+1
|
* web: sitemap.xml servingBryan Newbold2021-04-291-0/+6
|
* iterate on access redirects and landing page implementationBryan Newbold2021-04-271-0/+1
| | | | Small code refactors and minimal test coverage
* web: initial implementation of work landing page and citation_pdf_url access ↵Bryan Newbold2021-04-231-2/+90
| | | | | | | | | | | | redirect The initial intent is to have something that can be used by indexing services to pull the citation_pdf_url meta tag and bounce to a direct IA PDF access URL. For now the landing page stubs are just formatted as SERP results. Presumbably these will get re-styled at some point and include citation graph links, etc.
* change health check from .exists(index) to .mapping(index)Bryan Newbold2021-04-061-2/+2
| | | | | | | | | | | | In cases where the cluser leader node is unavilable, the health check was returning false even when the local node had full shard replicas and could return requests. A refinement of this change would be to use the /<index>/_count API endpoint to ensure that the "failed" and "skipped" shard numbers are 0 (aka, "successful == total"). However, not sure where that endpoint is exposed in the elasticsearch-py API. the CatClient method doesn't seem right.
* make fmtBryan Newbold2021-03-291-1/+10
|
* don't use async endpoints for sync implementationsBryan Newbold2021-03-291-3/+3
| | | | | | | | | | Embarassingly, I didn't know this was an option in FastAPI! Knew that running `await` on a function that was internally doing blocking calls was really bad, but didn't know the framework had such a simple way to avoid the problem. This significantly resolves operational concerns with the current service.
* web and API health check endpointBryan Newbold2021-03-291-4/+6
| | | | | | Because scholar is primarily a search service, the endpoint does a pass-through health check to the elasticsearch backend (aka, es-public-proxy).
* web: small typosBryan Newbold2021-03-251-2/+14
| | | | Thanks for catching these gio
* implement additional translation languagesBryan Newbold2021-03-231-1/+14
|
* update to v0.2.0v0.2.0Bryan Newbold2021-03-231-1/+1
|
* web: respond to HTTP HEAD / (for uptime monitoring)Bryan Newbold2021-03-051-0/+7
| | | | | Proper HTTP HEAD support for all endpoints would be better, but don't want to break CORS stuff by hacking it.
* Revert undesirable changesChristian Clauss2021-02-231-4/+4
|
* Modernize Python syntax with pyupgrade --py38-plus **/*.pyChristian Clauss2021-02-231-4/+4
|
* fmt and lint fixes (including one actual bug)Bryan Newbold2021-02-151-2/+2
|
* allow simple GET CORS requestsBryan Newbold2021-02-111-0/+9
|
* api: handle null 'q' parameter on search endpointBryan Newbold2021-02-111-0/+2
|
* i18n: use babel.numbers.format_number() in web interfaceBryan Newbold2021-01-251-0/+2
|
* revert jinja2 i18n trimmed flag (not correct place)Bryan Newbold2021-01-221-2/+0
| | | | | This doesn't seem to be the right place to add this field, getting a type checking warning.
* jinja2: attempt to enable trans trimming by defaultBryan Newbold2021-01-221-0/+2
| | | | Not sure this is actually working
* add citation query feature (disabled by default)Bryan Newbold2021-01-191-3/+3
| | | | | | This is operationally complex (queries hit 3x backend services!), so not enabled by default. Will need more testing; possibly circuit-breaking. Though haproxy should provide some of that automatically at this point.
* lint: fix small bugs and type annotationsBryan Newbold2021-01-181-3/+3
|
* make fmtBryan Newbold2021-01-151-8/+13
|
* api: fix /search test, and mypy error on implementationBryan Newbold2021-01-151-11/+11
|
* api: add type annotations for /search responseBryan Newbold2021-01-141-4/+29
|
* fastapi: /favicon.ico handlerBryan Newbold2021-01-141-1/+5
| | | | | | | HTML responses in the browser should use the indicated path (/static/ia-favicon.ico), but some other responses fall through (like API docs, I think? or unhandled exceptions), so giving up and just handling this route. haproxy should cache if it gets lots of hits.
* fastapi: add basic error/exception handler and pageBryan Newbold2021-01-141-1/+30
|
* i18n: add web interface support for 'hr' (Croatian)Bryan Newbold2020-11-181-1/+1
| | | | Thanks to @milotype for starting this new translation on weblate!
* web: fix ngettext() i18n wrapperBryan Newbold2020-11-051-2/+2
|
* web: fix lang detection (include 'en')Bryan Newbold2020-10-281-1/+1
| | | | | If a user had any non-english language preference, was defaulting to that, even if 'en' had higher preference.
* basic test for issue-db pipelineBryan Newbold2020-10-231-12/+17
|
* web: basic Accept-Language HTTP negotiationBryan Newbold2020-10-221-1/+12
|
* remove minor unused importsBryan Newbold2020-10-221-1/+0
|
* remove spurious debugging print() in robots.txt handlerBryan Newbold2020-10-211-1/+0
|
* set up sentry exception handlingBryan Newbold2020-10-211-3/+26
|
* enable Norwegian (nb) in web interfaceBryan Newbold2020-10-191-1/+1
|
* i18n: enable French and Spanish (fr, es)Bryan Newbold2020-10-151-1/+1
|
* i18n: enable arabic (ar)Bryan Newbold2020-10-141-1/+1
| | | | | There are no existing translated strings, but enabling to develop/demonstrate RTL design.
* Upgrade Dynaconf to 3+Bruno Rocha2020-10-051-1/+1
| | | | | | In dynaconf 3+ it is no more recommended to use `from dynaconf import settings` now the recommendation is to create your own instance of the settings object based on Dynaconf class.
* add Russian (ru) as interface optionBryan Newbold2020-10-051-1/+1
|
* small lint fixBryan Newbold2020-09-171-1/+1
|
* web robots.txtBryan Newbold2020-09-151-0/+13
| | | | Two variants depending on environment.
* fmt/lint tweaksBryan Newbold2020-08-121-1/+0
|
* don't print config; make fmtBryan Newbold2020-08-061-3/+7
|
* report ES API query time as server-timing headerBryan Newbold2020-08-061-1/+9
|
* fix lint errors (and some small bugs)Bryan Newbold2020-06-291-7/+7
|
* start some annotaition fixes for pytypeBryan Newbold2020-06-031-2/+2
|
* flake8-annotation lintingBryan Newbold2020-06-031-7/+7
| | | | Added some new annotations; need to finish more.
* flake8 fixes (partial)Bryan Newbold2020-06-031-4/+2
|
* reformat python code with blackBryan Newbold2020-06-031-19/+45
|