forked from zotero/translation-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from ubtue/zts_integrate_updates
Zts integrate updates
- Loading branch information
Showing
51 changed files
with
7,561 additions
and
7,668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- run: git submodule update --init --depth=1 modules/translate | ||
- run: git submodule update --init --depth=1 modules/utilities | ||
- run: git submodule update --init --depth=1 modules/zotero-schema | ||
- run: git submodule update --init --depth=1 modules/translators | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
|
||
- run: npm ci | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
[submodule "modules/translators"] | ||
path = modules/translators | ||
url = https://github.com/ubtue/zotero-translators.git | ||
[submodule "modules/zotero"] | ||
path = modules/zotero | ||
url = https://github.com/ubtue/zotero.git | ||
url = https://github.com/zotero/translators | ||
[submodule "modules/utilities"] | ||
path = modules/utilities | ||
url = https://github.com/zotero/utilities.git | ||
[submodule "modules/translate"] | ||
path = modules/translate | ||
url = https://github.com/ubtue/translate.git | ||
[submodule "modules/zotero-schema"] | ||
path = modules/zotero-schema | ||
url = https://github.com/zotero/zotero-schema.git |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Zotero Translation Server | ||
|
||
[![Build Status](https://travis-ci.com/zotero/translation-server.svg?branch=master)](https://travis-ci.com/zotero/translation-server) | ||
[![Build Status](https://img.shields.io/github/actions/workflow/status/zotero/translation-server/ci.yml?branch=master)](https://github.com/zotero/translation-server/actions) | ||
|
||
|
||
The Zotero translation server lets you use [Zotero translators](https://www.zotero.org/support/translators) without the Zotero client. | ||
|
||
|
@@ -15,7 +16,8 @@ docker pull zotero/translation-server | |
docker run -d -p 1969:1969 --rm --name translation-server zotero/translation-server | ||
``` | ||
|
||
This will pull the latest image from Docker Hub and run it as a background process on port 1969. Use `docker kill translation-server` to stop it. | ||
This will pull the latest image [from Docker Hub](https://registry.hub.docker.com/r/zotero/translation-server) | ||
and run it as a background process on port 1969. Use `docker kill translation-server` to stop it. | ||
|
||
### Running from source | ||
|
||
|
@@ -61,11 +63,26 @@ Deploy: | |
./lambda_deploy lambda_config.env | ||
``` | ||
|
||
You can view the API Gateway endpoint in the Outputs section of the CloudFormation stack in the AWS Console. | ||
You can view the API Gateway endpoint in the Outputs section of the console output. | ||
|
||
## User-Agent | ||
|
||
By default, translation-server uses a standard Chrome `User-Agent` string to maximize compatibility. This is fine for personal usage, but for a deployed service, it’s polite to customize `User-Agent` so that sites can identify requests and contact you in case of abuse. | ||
|
||
You can do this by setting the `USER_AGENT` environment variable: | ||
|
||
`USER_AGENT='my-custom-translation-server/2.0 ([email protected])' npm start` | ||
|
||
If you find that regular requests are being blocked with a fully custom user-agent string, you can also add an identifier and contact information to the end of a standard browser UA string: | ||
|
||
``` | ||
export USER_AGENT='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 my-custom-translation-server/2.0 ([email protected])' | ||
npm start | ||
``` | ||
|
||
## Proxy Support | ||
|
||
You can configure `translation-server` to use a proxy server by setting the `HTTP_PROXY` and `HTTPS_PROXY` environment variables: | ||
You can configure translation-server to use a proxy server by setting the `HTTP_PROXY` and `HTTPS_PROXY` environment variables: | ||
|
||
`HTTP_PROXY=http://proxy.example.com:8080 HTTPS_PROXY=http://proxy.example.com:8080 npm start` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#!/bin/bash | ||
|
||
# will be deprecated when https://github.com/zotero/translation-server-v2/issues/1 will be released | ||
# will be deprecated when https://github.com/zotero/translation-server/issues/1 will be released | ||
echo "-> Updating zotero translators" | ||
cd /app/modules/translators/ | ||
git pull origin master | ||
git pull --ff-only origin master | ||
|
||
cd /app/ | ||
exec npm start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash -e | ||
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
if [ -z $1 ]; then | ||
echo "Usage: $0 config.env" >&2 | ||
exit 1 | ||
fi | ||
|
||
set -a | ||
. "$dir/$1" | ||
set +a | ||
|
||
./lambda_package | ||
|
||
j2 "$dir/lambda_template.yaml.j2" > "$dir/package/template.yaml" | ||
|
||
sam package --template-file "$dir/package/template.yaml" --s3-bucket $deployment_bucket_name --output-template-file "$dir/package/package.yaml" | ||
aws cloudformation deploy --template-file "$dir/package/package.yaml" --stack-name $stack_name --capabilities CAPABILITY_IAM | ||
aws cloudformation describe-stacks --stack-name $stack_name | ||
rm -rf "$dir/package" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule translators
updated
577 files
Submodule zotero
deleted from
81e44b
Submodule zotero-schema
added at
1f5331
Oops, something went wrong.