This repository has been archived by the owner on Sep 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Bug where files could not be added to drafts #742 [FIX] Remove test comparing datetime objects #744 [FIX] Draft validation issues #740 [ADD] Support for DOI as preferred identifier #741 [ADD] Support for bulk-delete api operations #725 [ADD] Enable V2 endpoints
- Loading branch information
Toni Nurmi
authored
Jan 28, 2021
1 parent
046fa6a
commit f098d9c
Showing
379 changed files
with
14,127 additions
and
2,063 deletions.
There are no files selected for viewing
Empty file.
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 |
---|---|---|
|
@@ -13,3 +13,8 @@ | |
ubuntu-xenial-16.04-cloudimg-console.log | ||
.ropeproject/ | ||
.venv_metax/ | ||
.env | ||
.env.* | ||
!.env.template | ||
*.pem | ||
/src/log |
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 |
---|---|---|
|
@@ -3,39 +3,63 @@ dist: trusty | |
language: python | ||
python: 3.6 | ||
|
||
branches: | ||
only: | ||
- test | ||
- stable | ||
|
||
cache: pip | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- xqilla | ||
- libxqilla-dev | ||
postgresql: '9.6' | ||
|
||
services: | ||
- postgresql | ||
- postgresql | ||
- redis-server | ||
|
||
before_install: | ||
- openssl aes-256-cbc -K $encrypted_62ed3fb8af4c_key -iv $encrypted_62ed3fb8af4c_iv -in deploy-key.enc -out deploy-key -d | ||
- rm deploy-key.enc | ||
- chmod 600 deploy-key | ||
- mv deploy-key ~/.ssh/id_rsa | ||
- eval "$(ssh-agent -s)" | ||
- ssh-add ~/.ssh/id_rsa | ||
- sudo apt-get install xqilla libxqilla-dev | ||
env: | ||
global: | ||
- AUTH_SERVER_LOGOUT_URL=http://logout | ||
- DATACITE_PREFIX=10.12345 | ||
- DATACITE_URL=http://mockurl.com | ||
- DATACITE_ETSIN_URL_TEMPLATE=http://mockurl.com/%s | ||
- DATACITE_PASSWORD=not_set | ||
- DATACITE_USERNAME=not_set | ||
- DEBUG=false | ||
- DJANGO_ENV=travis | ||
- DJANGO_SECRET_KEY=lxpRfm8.JOUa7K.eOxZGtL*o+.zt.ybj | ||
- DRAFT_ENABLED=true | ||
- ELASTIC_SEARCH_HOSTS=https://metax.fd-test.csc.fi/es | ||
- ELASTIC_SEARCH_USE_SSL=true | ||
- METAX_DATABASE=metax_db_test | ||
- METAX_DATABASE_PASSWORD= | ||
- METAX_DATABASE_USER=metax_test | ||
- OAI_BASE_URL=http://mockurl.com | ||
- OAI_ETSIN_URL_TEMPLATE=http://mockurl.com/%s | ||
- [email protected] | ||
- REMS_ENABLED=true | ||
- REMS_API_KEY=not_set | ||
- REMS_BASE_URL=http://mockurl.com | ||
- REMS_ETSIN_URL_TEMPLATE=http://mockurl.com/%s | ||
- REMS_METAX_USER=not_set | ||
- REMS_REPORTER_USER=not_set | ||
- REMS_AUTO_APPROVER=not_set | ||
- REMS_FORM_ID=99 | ||
- ENABLE_V1_ENDPOINTS=true | ||
- ENABLE_V2_ENDPOINTS=true | ||
|
||
install: | ||
- pip install -r requirements.txt | ||
- sudo service postgresql restart | ||
|
||
before_script: | ||
- psql -U postgres < resources/sql/init_test.sql | ||
- sudo mkdir /var/log/metax-api | ||
- sudo chown -R $USER:$USER /var/log/metax-api | ||
- sudo mkdir -p src/log | ||
- sudo chown -R $USER:$USER src/log | ||
|
||
script: | ||
- cd src && flake8 . && python manage.py migrate metax_api && coverage run --source="." manage.py test metax_api && COVERALLS_REPO_TOKEN=$coveralls_token coveralls && $TRAVIS_BUILD_DIR/.travis-deploy.sh | ||
- cd src && flake8 . | ||
- python manage.py migrate metax_api | ||
- coverage run --source="." manage.py test metax_api | ||
- COVERALLS_REPO_TOKEN=$coveralls_token coveralls | ||
|
||
notifications: | ||
flowdock: | ||
|
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,33 @@ | ||
FROM python:3.6 | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
|
||
WORKDIR /code | ||
|
||
COPY requirements.txt /code/ | ||
|
||
RUN apt-get update && apt install xqilla libxerces-c-dev build-essential libssl-dev libffi-dev python-dev libxqilla-dev -y | ||
|
||
RUN pip install --upgrade pip wheel | ||
RUN pip install -r requirements.txt | ||
|
||
EXPOSE 8008 | ||
EXPOSE 8006 | ||
|
||
ARG METAX_DATABASE_HOST | ||
ARG REDIS_HOST | ||
ARG RABBITMQ_HOST | ||
ARG RABBIT_MQ_PASSWORD=guest | ||
ARG RABBIT_MQ_USER=guest | ||
ARG ELASTIC_SEARCH_HOST | ||
|
||
ENV METAX_DATABASE_HOST $METAX_DATABASE_HOST | ||
ENV REDIS_HOST $REDIS_HOST | ||
ENV RABBIT_MQ_HOSTS $RABBITMQ_HOST | ||
ENV RABBIT_MQ_PASSWORD $RABBIT_MQ_PASSWORD | ||
ENV RABBIT_MQ_USER $RABBIT_MQ_USER | ||
ENV ELASTIC_SEARCH_HOSTS $ELASTIC_SEARCH_HOST | ||
|
||
# CMD ["python", "/code/manage.py", "runserver", "0.0.0.0:8008"] | ||
CMD ["python", "manage.py", "runsslserver", "--certificate", ".certs/cert.pem","--key", ".certs/key.pem", "0.0.0.0:8008"] |
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,62 @@ | ||
# Required environmental variables | ||
|
||
copy .env.template to .env and fill the required values from below table. Required column tells if you have to have the variable in the .env file | ||
|
||
| Name | Required | Default | Description | | ||
| ------------------------------ | -------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | ||
| ADDITIONAL_USER_PROJECTS_PATH | unknown | "" | No clue if this is important | | ||
| ALLOWED_HOSTS | no | | defines which IP-addresses are allowed to access metax, DJANGO_ENV=local overrides this | | ||
| AUTH_SERVER_LOGOUT_URL | unknown | | Requires testing if this is needed | | ||
| DATACITE_ETSIN_URL_TEMPLATE | yes | | | ||
| DATACITE_PASSWORD | yes | | | ||
| DATACITE_PREFIX | yes | | | ||
| DATACITE_URL | yes | | | ||
| DATACITE_USERNAME | yes | | | ||
| DEBUG | no | False | | ||
| DJANGO_ENV | no | local | Specifies the environment, corresponds with the environments found in src/metax_api/settings/environments/ | | ||
| DJANGO_SECRET_KEY | yes | | | ||
| DRAFT_ENABLED | no | | | ||
| ELASTIC_SEARCH_HOSTS | yes | | Elastic Search instance IP and port | | ||
| ELASTIC_SEARCH_PORT | no | 9200 | Is not used currently, but should be in the future | | ||
| ELASTIC_SEARCH_USE_SSL | yes | | Should Elastic Search queries use https | | ||
| ERROR_FILES_PATH | no | src/log/errors | Error file folder | | ||
| ES_CONFIG_DIR | no | src/metax_api/tasks/refdata/refdata_indexer/resources/es-config | metax-ops compatibility | | ||
| LOCAL_REF_DATA_FOLDER | no | src/metax_api/tasks/refdata/refdata_indexer/resources/local-refdata | metax-ops compatibility | | ||
| LOGGING_DEBUG_HANDLER_FILE | no | src/log/metax_api.log | metax-ops compatibility | | ||
| LOGGING_GENERAL_HANDLER_FILE | no | src/log/metax_api.log | metax-ops compatibility | | ||
| LOGGING_JSON_FILE_HANDLER_FILE | no | src/log/metax_api.json.log | metax-ops compatibility | | ||
| METAX_API_ROOT | yes | | Metax internal variable, must be https | | ||
| METAX_DATABASE | yes | | Postgres database name | | ||
| METAX_DATABASE_PASSWORD | yes | | Postgres database password | | ||
| METAX_DATABASE_PORT | no | 5432 | Postgres instance exposed port | | ||
| METAX_DATABASE_USER | yes | | Postgres user which owns the database | | ||
| METAX_ENV | no | local_development | Used by Metax internally, should be replaced with DJANGO_ENV in the future | | ||
| OAI_BASE_URL | yes | | | ||
| ORG_FILE_PATH | yes | src/metax_api/tasks/refdata/refdata_indexer/resources/organizations/organizations.csv | metax-ops compatibility | | ||
| RABBIT_MQ_HOSTS | yes | | RabbitMQ instance IP | | ||
| RABBIT_MQ_PASSWORD | no | guest | | ||
| RABBIT_MQ_PORT | no | 5672 | | ||
| RABBIT_MQ_TTV_ENABLED | no | | | ||
| RABBIT_MQ_USER | no | guest | | ||
| RABBIT_MQ_VHOST | no | | | ||
| RABBIT_MQ_VHOST_TTV | no | | | ||
| REDIS_HOST | yes | | Redis instance IP | | ||
| REDIS_LOCALHOST_PORT | unknown | 6379 | Not sure if all references to this are gone | | ||
| REDIS_PASSWORD | no | | | ||
| REDIS_PORT | no | 6379 | | ||
| REDIS_TEST_DB | yes | | Pick a number, any number | | ||
| REDIS_USE_PASSWORD | no | false | | ||
| REMS_API_KEY | no | | ||
| REMS_AUTO_APPROVER | no | | ||
| REMS_BASE_URL | no | | ||
| REMS_ENABLED | no | | ||
| REMS_ETSIN_URL_TEMPLATE | yes | | | ||
| REMS_FORM_ID | yes | | | ||
| REMS_METAX_USER | no | | ||
| REMS_REPORTER_USER | no | | ||
| SERVER_DOMAIN_NAME | no | | ||
| TRAVIS | no | false | Metax internal used to figure out if Metax is running on Travis virtual machine | | ||
| V1_ENABLED | no | | | ||
| V2_ENABLED | no | | | ||
| VALIDATE_TOKEN_URL | yes | | | ||
| WKT_FILENAME | no | src/metax_api/tasks/refdata/refdata_indexer/resources/uri_to_wkt.json | |
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
Oops, something went wrong.