diff --git a/i-form-data-repository/.dockerignore b/i-form-data-repository/.dockerignore new file mode 100644 index 0000000..4f2ad0e --- /dev/null +++ b/i-form-data-repository/.dockerignore @@ -0,0 +1,2 @@ +# Ignore local virtualenv (if present) +.venv/ diff --git a/i-form-data-repository/.gitignore b/i-form-data-repository/.gitignore new file mode 100644 index 0000000..8b4106d --- /dev/null +++ b/i-form-data-repository/.gitignore @@ -0,0 +1,75 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +test.db + +# Environments +.venv/ + +# Logs +logs/ + +# Invenio-cli per machine file +.invenio.private + +# S3 default bucket location +data/default/* +data/.minio.sys + +# Celery +celerybeat-schedule diff --git a/i-form-data-repository/.invenio b/i-form-data-repository/.invenio new file mode 100644 index 0000000..e30c9bf --- /dev/null +++ b/i-form-data-repository/.invenio @@ -0,0 +1,42 @@ +[cli] +flavour = RDM +logfile = /logs/invenio-cli.log + +[cookiecutter] +project_name = I-Form Data Repository +project_shortname = i-form-data-repository +package_name = i_form_data_repository +project_site = repo.i-form.ie +author_name = Cian Hughes +author_email = info@repo.i-form.ie +year = 2025 +database = postgresql +search = opensearch2 +file_storage = S3 +development_tools = yes +site_code = yes +use_reduced_vocabs = no +_template = https://github.com/inveniosoftware/cookiecutter-invenio-rdm.git +_output_dir = /home/cianh/Storage/Programming/Work_Projects/iform-invenio +_repo_dir = /home/cianh/.cookiecutters/cookiecutter-invenio-rdm +_checkout = v13.0 + +[files] +site = {'tests': {'.gitkeep': 'd4756cdf68d94c670c924f9d57d44718f666e457727701486435b57a97e52c5f'}, '.gitkeep': '7a0ab727bee27863bd144c4c473f832833d8952d56a83e54ad05a9ce9e73404d', 'pyproject.toml': 'e1acd833b38f03f26cc31439246cbeeb82e2edf56c751f28c3247cb44e95caca', 'setup.cfg': 'f6ac996bb751a7b02dfeca5faaca578151bdf4adb9b3ff1825d2443fa41109af', 'i_form_data_repository': {'templates': {'semantic-ui': {'i_form_data_repository': {'.gitkeep': 'd4756cdf68d94c670c924f9d57d44718f666e457727701486435b57a97e52c5f'}}}, '__init__.py': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'views.py': '039927b9ebcf3482b714559dd6fc9455b88a570bc5496af742ac7b23663c9547', 'webpack.py': '96b09a233bee5087e4329023dea3a363632372c100fdb790c6003cd6b04dba03', 'assets': {'semantic-ui': {'js': {'i_form_data_repository': {'.gitkeep': '3253a6fe7fc74a1279fb374e67ffd3383eded63cd28c4877afd77dffc8cc5da4'}}, 'less': {'i_form_data_repository': {'.gitkeep': 'de96a61fec5b6b168bced6dda58bd11e353f618ae9bee45aad9253cb0d6c5617'}}}}}, 'setup.py': '843ac26c38a41abae578250bc0f9419194b320a0f67327d941037a4268f6cfe7'} +dockerfile = 44e5c207cf3e82cddda086f73e6fa5f3bacfc06d11f55a95f954d744a773c605 +.dockerignore = 21241bc12cdf4ac5f209d6b191adc8f25eb89af93ce5c4c3f72c86661162d7b5 +static = {'images': {'logo-invenio-white.svg': '5af2c7b67a09798cba3d50cc2e811ca9fd2ff73b40d9d2a52a97237b9ed44008', 'invenio-rdm.svg': '50f09b4d83244a69c58f44aa436a3fa097726d9b47fd0e0782ea92d31f854b65'}} +templates = {'.gitkeep': 'd4756cdf68d94c670c924f9d57d44718f666e457727701486435b57a97e52c5f'} +pipfile = be67d4845f38cf90f681c5df8f69696333e302755fa05a2c13b80ce4033a86ac +docker-compose.full.yml = bd48fde383c673b84607e5ab99b01e688db6450e9bba4009ce079815223b51ea +invenio.cfg = f58cc1d00290ff85ad73824005d04fb8c6c42393fbced496fe922bb36a3e7fa3 +translations = {'babel.ini': '3fb6bff73460aa031d4f90fc1e1d16235cab84d2385c9831efacb2ce32e5409b'} +docker-compose.yml = b262b784dd6b5f144993319557c4295937d8dece2e92ddef502427517b037954 +docker = {'uwsgi': {'uwsgi_rest.ini': 'c36fc5021baf15f375b3b6c825f7753e5d166319c5fe38a85b604391ce5b37b6', 'uwsgi_ui.ini': 'aeb0797a1fadb462e0ed208c979d5152cc58a85958d4de9c4e989637c70b9005'}, 'pgadmin': {'servers.json': '405a1ade1eaf37d99301abb460fe49a9deacda13e5e5f2618cfc99e2e7bbe299'}, 'nginx': {'nginx.conf': '7ba045f9e5c94cbbe96653c0b2fdc0b58951642d488d5fcae1ace3eeca9253c0', 'Dockerfile': '541326766beaba2e8492255c99e11aa76640d71329ceab5bcab1c8d6a979bd5c', 'test.key': '5e8a6cdf7e53ef815148744b275f7f02d5f046b1582f347543caf95c81901092', 'test.crt': '61a088d23224f550806d05e671096375b68c679fad1745145c7d2520397f509b', 'conf.d': {'default.conf': '360a483a89dbea713f4138b8115d06558897f2419afef1347b50cd800ea16ccc'}}} +readme.md = f99f106a4aba1cb7143553c6516017c81a7c10e82bc909d30a6112550f2c4a16 +docker-services.yml = f9850f3abddcaa5285e5533502fc334238e111e6db6e66fa1804ec3d57133e7b +app_data = {'vocabularies.yaml': 'e860d2136df803dc05e67c8f1c32bc58aa4bdca348dcc2daf7aaa4aee67ecfbf', 'README.md': 'd58978488626bdeddc791a15a39e341a4ed06f202b84d0c0d4aa9ef49481c6d9', 'vocabularies': {'languages.yaml': 'd3bdb59940e8e6cd2401785ad55733f5fc6a1fb0bb0a2005a8fe4e5148e5f286', 'names.yaml': '6dc80984186ec960bcf53fbb6c482554d0aaf386d345bf82f504fdbd896e5848', 'cc_licences.csv': '19a8bfd2488c7adb90d1dbe1c70f57cf2e0a737cb11814cc814f917072843de7', 'subjects_oecd_fos.yaml': 'eef38714c506d956193c3be17e6004049525d252bf22424f4804dfc1ad46db44'}, 'pages': {'.gitkeep': '22818f8c9f68fb11b7ca893ad1c082f844ae9f691f082d2174e32738d9ae6114'}} +data = {'default': {'.gitkeep': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'}} +.gitignore = af1182c70588e583daeb35809e6cdfe3408425d438c3ceb282b1f4b8360290e2 +assets = {'templates': {'custom_fields': {'.gitkeep': 'd4756cdf68d94c670c924f9d57d44718f666e457727701486435b57a97e52c5f'}, 'search': {'.gitkeep': 'd4756cdf68d94c670c924f9d57d44718f666e457727701486435b57a97e52c5f'}}, 'js': {'invenio_app_rdm': {'overridableRegistry': {'mapping.js': '7fb63c1b801d11f1c1bb9b7d5cad6662ae475210df2bbba6919cda402684590a'}}}, 'less': {'site': {'globals': {'site.variables': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'site.overrides': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'}}, 'theme.config': 'ee68441b779400585a3a1ed4445ab5727e3a47a09aa708976dd506c0e081f0d8'}} + diff --git a/i-form-data-repository/Dockerfile b/i-form-data-repository/Dockerfile new file mode 100644 index 0000000..e6685cf --- /dev/null +++ b/i-form-data-repository/Dockerfile @@ -0,0 +1,29 @@ +# Dockerfile that builds a fully functional image of your app. +# +# This image installs all Python dependencies for your application. It's based +# on Almalinux (https://github.com/inveniosoftware/docker-invenio) +# and includes Pip, Pipenv, Node.js, NPM and some few standard libraries +# Invenio usually needs. +# +# Note: It is important to keep the commands in this file in sync with your +# bootstrap script located in ./scripts/bootstrap. + +FROM registry.cern.ch/inveniosoftware/almalinux:1 + +COPY site ./site +COPY Pipfile Pipfile.lock ./ +RUN pipenv install --deploy --system + +COPY ./docker/uwsgi/ ${INVENIO_INSTANCE_PATH} +COPY ./invenio.cfg ${INVENIO_INSTANCE_PATH} +COPY ./templates/ ${INVENIO_INSTANCE_PATH}/templates/ +COPY ./app_data/ ${INVENIO_INSTANCE_PATH}/app_data/ +COPY ./translations/ ${INVENIO_INSTANCE_PATH}/translations/ +COPY ./ . + +RUN cp -r ./static/. ${INVENIO_INSTANCE_PATH}/static/ && \ + cp -r ./assets/. ${INVENIO_INSTANCE_PATH}/assets/ && \ + invenio collect --verbose && \ + invenio webpack buildall + +ENTRYPOINT [ "bash", "-c"] diff --git a/i-form-data-repository/Pipfile b/i-form-data-repository/Pipfile new file mode 100644 index 0000000..5ea3ef1 --- /dev/null +++ b/i-form-data-repository/Pipfile @@ -0,0 +1,21 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] +check-manifest = ">=0.25" + +[packages] +invenio-app-rdm = {extras = ["opensearch2", "s3"], version = "~=13.0.0"} +i-form-data-repository = {editable = true, path="./site"} + +uwsgi = ">=2.0" +uwsgitop = ">=0.11" +uwsgi-tools = ">=1.1.1" + +[requires] +python_version = "3.12" + +[pipenv] +allow_prereleases = false diff --git a/i-form-data-repository/README.md b/i-form-data-repository/README.md new file mode 100644 index 0000000..f177096 --- /dev/null +++ b/i-form-data-repository/README.md @@ -0,0 +1,49 @@ +# I-Form Data Repository + +Welcome to your InvenioRDM instance. + +## Getting started + +Run the following commands in order to start your new InvenioRDM instance: + +```console +invenio-cli containers start --lock --build --setup +``` + +The above command first builds the application docker image and afterwards +starts the application and related services (database, Opensearch, Redis +and RabbitMQ). The build and boot process will take some time to complete, +especially the first time as docker images have to be downloaded during the +process. + +Once running, visit https://127.0.0.1 in your browser. + +**Note**: The server is using a self-signed SSL certificate, so your browser +will issue a warning that you will have to by-pass. + +## Overview + +Following is an overview of the generated files and folders: + +| Name | Description | +|---|---| +| ``Dockerfile`` | Dockerfile used to build your application image. | +| ``Pipfile`` | Python requirements installed via [pipenv](https://pipenv.pypa.io) | +| ``Pipfile.lock`` | Locked requirements (generated on first install). | +| ``app_data`` | Application data such as vocabularies. | +| ``assets`` | Web assets (CSS, JavaScript, LESS, JSX templates) used in the Webpack build. | +| ``docker`` | Example configuration for NGINX and uWSGI. | +| ``docker-compose.full.yml`` | Example of a full infrastructure stack. | +| ``docker-compose.yml`` | Backend services needed for local development. | +| ``docker-services.yml`` | Common services for the Docker Compose files. | +| ``invenio.cfg`` | The Invenio application configuration. | +| ``logs`` | Log files. | +| ``static`` | Static files that need to be served as-is (e.g. images). | +| ``templates`` | Folder for your Jinja templates. | +| ``.invenio`` | Common file used by Invenio-CLI to be version controlled. | +| ``.invenio.private`` | Private file used by Invenio-CLI *not* to be version controlled. | + +## Documentation + +To learn how to configure, customize, deploy and much more, visit +the [InvenioRDM Documentation](https://inveniordm.docs.cern.ch/). diff --git a/i-form-data-repository/app_data/README.md b/i-form-data-repository/app_data/README.md new file mode 100644 index 0000000..edad2f8 --- /dev/null +++ b/i-form-data-repository/app_data/README.md @@ -0,0 +1,6 @@ +# README + +Place in this directory the subdirectories containing application data. + +For example, you can create the `vocabularies/` folder to hold +your custom controlled vocabularies. diff --git a/i-form-data-repository/app_data/pages/.gitkeep b/i-form-data-repository/app_data/pages/.gitkeep new file mode 100644 index 0000000..b59eabf --- /dev/null +++ b/i-form-data-repository/app_data/pages/.gitkeep @@ -0,0 +1 @@ +# This file exists only to add pages/ folder to git repository. diff --git a/i-form-data-repository/app_data/vocabularies.yaml b/i-form-data-repository/app_data/vocabularies.yaml new file mode 100644 index 0000000..57d6604 --- /dev/null +++ b/i-form-data-repository/app_data/vocabularies.yaml @@ -0,0 +1,18 @@ +subjects: + pid-type: sub + schemes: + - id: FOS + name: Fields of Science and Technology + uri: "http://www.oecd.org/science/inno/38235147.pdf" + data-file: vocabularies/subjects_oecd_fos.yaml +# Minimal example vocabularies +# can be used for quick testing, or a basis for building your own customized vocabularies. +#names: +# pid-type: names +# data-file: vocabularies/names.yaml +#licenses: +# pid-type: lic +# data-file: vocabularies/cc_licences.csv +#languages: +# pid-type: lng +# data-file: vocabularies/languages.yaml diff --git a/i-form-data-repository/app_data/vocabularies/cc_licences.csv b/i-form-data-repository/app_data/vocabularies/cc_licences.csv new file mode 100644 index 0000000..e4cbb33 --- /dev/null +++ b/i-form-data-repository/app_data/vocabularies/cc_licences.csv @@ -0,0 +1,37 @@ +id;title__en;description__en;icon;tags;props__url;props__scheme;props__osi_approved +cc-by-1.0;Creative Commons Attribution 1.0 Generic;;cc-by-icon;all,data;https://creativecommons.org/licenses/by/1.0/legalcode;spdx; +cc-by-2.0;Creative Commons Attribution 2.0 Generic;;cc-by-icon;all,data;https://creativecommons.org/licenses/by/2.0/legalcode;spdx; +cc-by-2.5;Creative Commons Attribution 2.5 Generic;;cc-by-icon;all,data;https://creativecommons.org/licenses/by/2.5/legalcode;spdx; +cc-by-3.0;Creative Commons Attribution 3.0 Unported;;cc-by-icon;all,data;https://creativecommons.org/licenses/by/3.0/legalcode;spdx; +cc-by-3.0-at;Creative Commons Attribution 3.0 Austria;;cc-by-icon;all,data;https://creativecommons.org/licenses/by/3.0/at/legalcode;spdx; +cc-by-3.0-us;Creative Commons Attribution 3.0 United States;;cc-by-icon;all,data;https://creativecommons.org/licenses/by/3.0/us/legalcode;spdx; +cc-by-4.0;Creative Commons Attribution 4.0 International;The Creative Commons Attribution license allows re-distribution and re-use of a licensed work on the condition that the creator is appropriately credited.;cc-by-icon;recommended,all,data;https://creativecommons.org/licenses/by/4.0/legalcode;spdx; +cc-by-nc-1.0;Creative Commons Attribution Non Commercial 1.0 Generic;;cc-by-nc-icon;all,data;https://creativecommons.org/licenses/by-nc/1.0/legalcode;spdx; +cc-by-nc-2.0;Creative Commons Attribution Non Commercial 2.0 Generic;;cc-by-nc-icon;all,data;https://creativecommons.org/licenses/by-nc/2.0/legalcode;spdx; +cc-by-nc-2.5;Creative Commons Attribution Non Commercial 2.5 Generic;;cc-by-nc-icon;all,data;https://creativecommons.org/licenses/by-nc/2.5/legalcode;spdx; +cc-by-nc-3.0;Creative Commons Attribution Non Commercial 3.0 Unported;;cc-by-nc-icon;all,data;https://creativecommons.org/licenses/by-nc/3.0/legalcode;spdx; +cc-by-nc-4.0;Creative Commons Attribution Non Commercial 4.0 International;;cc-by-nc-icon;all,data;https://creativecommons.org/licenses/by-nc/4.0/legalcode;spdx; +cc-by-nc-nd-1.0;Creative Commons Attribution Non Commercial No Derivatives 1.0 Generic;;cc-by-nc-nd-icon;all,data;https://creativecommons.org/licenses/by-nd-nc/1.0/legalcode;spdx; +cc-by-nc-nd-2.0;Creative Commons Attribution Non Commercial No Derivatives 2.0 Generic;;cc-by-nc-nd-icon;all,data;https://creativecommons.org/licenses/by-nc-nd/2.0/legalcode;spdx; +cc-by-nc-nd-2.5;Creative Commons Attribution Non Commercial No Derivatives 2.5 Generic;;cc-by-nc-nd-icon;all,data;https://creativecommons.org/licenses/by-nc-nd/2.5/legalcode;spdx; +cc-by-nc-nd-3.0;Creative Commons Attribution Non Commercial No Derivatives 3.0 Unported;;cc-by-nc-nd-icon;all,data;https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode;spdx; +cc-by-nc-nd-3.0-igo;Creative Commons Attribution Non Commercial No Derivatives 3.0 IGO;;cc-by-nc-nd-icon;all,data;https://creativecommons.org/licenses/by-nc-nd/3.0/igo/legalcode;spdx; +cc-by-nc-nd-4.0;Creative Commons Attribution Non Commercial No Derivatives 4.0 International;;cc-by-nc-nd-icon;all,data;https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode;spdx; +cc-by-nc-sa-1.0;Creative Commons Attribution Non Commercial Share Alike 1.0 Generic;;cc-by-nc-sa-icon;all,data;https://creativecommons.org/licenses/by-nc-sa/1.0/legalcode;spdx; +cc-by-nc-sa-2.0;Creative Commons Attribution Non Commercial Share Alike 2.0 Generic;;cc-by-nc-sa-icon;all,data;https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode;spdx; +cc-by-nc-sa-2.5;Creative Commons Attribution Non Commercial Share Alike 2.5 Generic;;cc-by-nc-sa-icon;all,data;https://creativecommons.org/licenses/by-nc-sa/2.5/legalcode;spdx; +cc-by-nc-sa-3.0;Creative Commons Attribution Non Commercial Share Alike 3.0 Unported;;cc-by-nc-sa-icon;all,data;https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode;spdx; +cc-by-nc-sa-4.0;Creative Commons Attribution Non Commercial Share Alike 4.0 International;;cc-by-nc-sa-icon;all,data;https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode;spdx; +cc-by-nd-1.0;Creative Commons Attribution No Derivatives 1.0 Generic;;cc-by-nd-icon;all,data;https://creativecommons.org/licenses/by-nd/1.0/legalcode;spdx; +cc-by-nd-2.0;Creative Commons Attribution No Derivatives 2.0 Generic;;cc-by-nd-icon;all,data;https://creativecommons.org/licenses/by-nd/2.0/legalcode;spdx; +cc-by-nd-2.5;Creative Commons Attribution No Derivatives 2.5 Generic;;cc-by-nd-icon;all,data;https://creativecommons.org/licenses/by-nd/2.5/legalcode;spdx; +cc-by-nd-3.0;Creative Commons Attribution No Derivatives 3.0 Unported;;cc-by-nd-icon;all,data;https://creativecommons.org/licenses/by-nd/3.0/legalcode;spdx; +cc-by-nd-4.0;Creative Commons Attribution No Derivatives 4.0 International;;cc-by-nd-icon;all,data;https://creativecommons.org/licenses/by-nd/4.0/legalcode;spdx; +cc-by-sa-1.0;Creative Commons Attribution Share Alike 1.0 Generic;;cc-by-sa-icon;all,data;https://creativecommons.org/licenses/by-sa/1.0/legalcode;spdx; +cc-by-sa-2.0;Creative Commons Attribution Share Alike 2.0 Generic;;cc-by-sa-icon;all,data;https://creativecommons.org/licenses/by-sa/2.0/legalcode;spdx; +cc-by-sa-2.0-uk;Creative Commons Attribution Share Alike 2.0 England and Wales;;;all,data;https://creativecommons.org/licenses/by-sa/2.0/uk/legalcode;spdx; +cc-by-sa-2.5;Creative Commons Attribution Share Alike 2.5 Generic;;cc-by-sa-icon;all,data;https://creativecommons.org/licenses/by-sa/2.5/legalcode;spdx; +cc-by-sa-3.0;Creative Commons Attribution Share Alike 3.0 Unported;;cc-by-sa-icon;all,data;https://creativecommons.org/licenses/by-sa/3.0/legalcode;spdx; +cc-by-sa-3.0-at;Creative Commons Attribution-Share Alike 3.0 Austria;;cc-by-sa-icon;all,data;https://creativecommons.org/licenses/by-sa/3.0/at/legalcode;spdx; +cc-by-sa-4.0;Creative Commons Attribution Share Alike 4.0 International;Permits almost any use subject to providing credit and license notice. Frequently used for media assets and educational materials. The most common license for Open Access scientific publications. Not recommended for software.;cc-by-sa-icon;recommended,all,data;https://creativecommons.org/licenses/by-sa/4.0/legalcode;spdx; +cc-pddc;Creative Commons Public Domain Dedication and Certification;;cc-pddc-icon;all;https://creativecommons.org/licenses/publicdomain/;spdx; diff --git a/i-form-data-repository/app_data/vocabularies/languages.yaml b/i-form-data-repository/app_data/vocabularies/languages.yaml new file mode 100644 index 0000000..c2ec22a --- /dev/null +++ b/i-form-data-repository/app_data/vocabularies/languages.yaml @@ -0,0 +1,96 @@ +- id: ara + props: + alpha_2: ar + tags: + - macrolanguage + - living + title: + en: Arabic +- id: cym + props: + alpha_2: cy + tags: + - individual + - living + title: + en: Welsh +- id: deu + props: + alpha_2: de + tags: + - individual + - living + title: + en: German +- id: eng + props: + alpha_2: en + tags: + - individual + - living + title: + en: English +- id: fra + props: + alpha_2: fr + tags: + - individual + - living + title: + en: French +- id: ita + props: + alpha_2: it + tags: + - individual + - living + title: + en: Italian +- id: nor + props: + alpha_2: 'no' + tags: + - macrolanguage + - living + title: + en: Norwegian +- id: roh + props: + alpha_2: rm + tags: + - individual + - living + title: + en: Romansh +- id: spa + props: + alpha_2: es + tags: + - individual + - living + title: + en: Spanish +- id: tur + props: + alpha_2: tr + tags: + - individual + - living + title: + en: Turkish +- id: aag + props: + alpha_2: '' + tags: + - individual + - living + title: + en: Ambrak +- id: aah + props: + alpha_2: '' + tags: + - individual + - living + title: + en: Abu' Arapesh diff --git a/i-form-data-repository/app_data/vocabularies/names.yaml b/i-form-data-repository/app_data/vocabularies/names.yaml new file mode 100644 index 0000000..d4e3161 --- /dev/null +++ b/i-form-data-repository/app_data/vocabularies/names.yaml @@ -0,0 +1,20 @@ +- affiliations: + - name: University of Zurich + - name: Humboldt University of Berlin + - name: Kaiser Wilhelm Institute for Physics + family_name: Einstein + given_name: Albert + id: gnd:118529579 + identifiers: + - identifier: gnd:118529579 + scheme: gnd +- affiliations: + - name: University of Cambridge + - name: California Institute of Technology + - name: University of Oxford + family_name: Hawking + given_name: Stephen + id: 0000-0002-9079-593X + identifiers: + - identifier: https://orcid.org/0000-0002-9079-593X + scheme: orcid diff --git a/i-form-data-repository/app_data/vocabularies/subjects_oecd_fos.yaml b/i-form-data-repository/app_data/vocabularies/subjects_oecd_fos.yaml new file mode 100644 index 0000000..04a0e17 --- /dev/null +++ b/i-form-data-repository/app_data/vocabularies/subjects_oecd_fos.yaml @@ -0,0 +1,144 @@ +- id: "http://www.oecd.org/science/inno/38235147.pdf?1" + scheme: FOS + subject: "Natural sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?1.1" + scheme: FOS + subject: "Mathematics" +- id: "http://www.oecd.org/science/inno/38235147.pdf?1.2" + scheme: FOS + subject: "Computer and information sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?1.3" + scheme: FOS + subject: "Physical sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?1.4" + scheme: FOS + subject: "Chemical sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?1.5" + scheme: FOS + subject: "Earth and related environmental sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?1.6" + scheme: FOS + subject: "Biological sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?1.7" + scheme: FOS + subject: "Other natural sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2" + scheme: FOS + subject: "Engineering and technology" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.1" + scheme: FOS + subject: "Civil engineering" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.2" + scheme: FOS + subject: "Electrical engineering, electronic engineering, information engineering" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.3" + scheme: FOS + subject: "Mechanical engineering" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.4" + scheme: FOS + subject: "Chemical engineering" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.5" + scheme: FOS + subject: "Materials engineering" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.6" + scheme: FOS + subject: "Medical engineering" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.7" + scheme: FOS + subject: "Environmental engineering" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.8" + scheme: FOS + subject: "Environmental biotechnology" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.9" + scheme: FOS + subject: "Industrial biotechnology" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.10" + scheme: FOS + subject: "Nano technology" +- id: "http://www.oecd.org/science/inno/38235147.pdf?2.11" + scheme: FOS + subject: "Other engineering and technologies" +- id: "http://www.oecd.org/science/inno/38235147.pdf?3" + scheme: FOS + subject: "Medical and health sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?3.1" + scheme: FOS + subject: "Basic medicine" +- id: "http://www.oecd.org/science/inno/38235147.pdf?3.2" + scheme: FOS + subject: "Clinical medicine" +- id: "http://www.oecd.org/science/inno/38235147.pdf?3.3" + scheme: FOS + subject: "Health sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?3.4" + scheme: FOS + subject: "Health biotechnology" +- id: "http://www.oecd.org/science/inno/38235147.pdf?3.5" + scheme: FOS + subject: "Other medical sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?4" + scheme: FOS + subject: "Agricultural sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?4.1" + scheme: FOS + subject: "Agriculture, forestry, and fisheries" +- id: "http://www.oecd.org/science/inno/38235147.pdf?4.2" + scheme: FOS + subject: "Animal and dairy science" +- id: "http://www.oecd.org/science/inno/38235147.pdf?4.3" + scheme: FOS + subject: "Veterinary science" +- id: "http://www.oecd.org/science/inno/38235147.pdf?4.4" + scheme: FOS + subject: "Agricultural biotechnology" +- id: "http://www.oecd.org/science/inno/38235147.pdf?4.5" + scheme: FOS + subject: "Other agricultural sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?5" + scheme: FOS + subject: "Social science" +- id: "http://www.oecd.org/science/inno/38235147.pdf?5.1" + scheme: FOS + subject: "Psychology" +- id: "http://www.oecd.org/science/inno/38235147.pdf?5.2" + scheme: FOS + subject: "Economics and business" +- id: "http://www.oecd.org/science/inno/38235147.pdf?5.3" + scheme: FOS + subject: "Educational sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?5.4" + scheme: FOS + subject: "Sociology" +- id: "http://www.oecd.org/science/inno/38235147.pdf?5.5" + scheme: FOS + subject: "Law" +- id: "http://www.oecd.org/science/inno/38235147.pdf?5.6" + scheme: FOS + subject: "Political science" +- id: "http://www.oecd.org/science/inno/38235147.pdf?5.7" + scheme: FOS + subject: "Social and economic geography" +- id: "http://www.oecd.org/science/inno/38235147.pdf?5.8" + scheme: FOS + subject: "Media and communications" +- id: "http://www.oecd.org/science/inno/38235147.pdf?5.9" + scheme: FOS + subject: "Other social sciences" +- id: "http://www.oecd.org/science/inno/38235147.pdf?6" + scheme: FOS + subject: "Humanities" +- id: "http://www.oecd.org/science/inno/38235147.pdf?6.1" + scheme: FOS + subject: "History and archaeology" +- id: "http://www.oecd.org/science/inno/38235147.pdf?6.2" + scheme: FOS + subject: "Languages and literature" +- id: "http://www.oecd.org/science/inno/38235147.pdf?6.3" + scheme: FOS + subject: "Philosophy, ethics and religion" +- id: "http://www.oecd.org/science/inno/38235147.pdf?6.4" + scheme: FOS + subject: "Arts (arts, history of arts, performing arts, music)" +- id: "http://www.oecd.org/science/inno/38235147.pdf?6.5" + scheme: FOS + subject: "Other humanities" diff --git a/i-form-data-repository/assets/js/invenio_app_rdm/overridableRegistry/mapping.js b/i-form-data-repository/assets/js/invenio_app_rdm/overridableRegistry/mapping.js new file mode 100644 index 0000000..0d15027 --- /dev/null +++ b/i-form-data-repository/assets/js/invenio_app_rdm/overridableRegistry/mapping.js @@ -0,0 +1,11 @@ +// This file is part of InvenioRDM +// Copyright (C) 2023 CERN. +// +// Invenio App RDM is free software; you can redistribute it and/or modify it +// under the terms of the MIT License; see LICENSE file for more details. + +/** + * Add here all the overridden components of your app. + */ + +export const overriddenComponents = {} \ No newline at end of file diff --git a/i-form-data-repository/assets/less/site/globals/site.overrides b/i-form-data-repository/assets/less/site/globals/site.overrides new file mode 100644 index 0000000..e69de29 diff --git a/i-form-data-repository/assets/less/site/globals/site.variables b/i-form-data-repository/assets/less/site/globals/site.variables new file mode 100644 index 0000000..e69de29 diff --git a/i-form-data-repository/assets/less/theme.config b/i-form-data-repository/assets/less/theme.config new file mode 100644 index 0000000..1f7e5ce --- /dev/null +++ b/i-form-data-repository/assets/less/theme.config @@ -0,0 +1,96 @@ +/* + +████████╗██╗ ██╗███████╗███╗ ███╗███████╗███████╗ +╚══██╔══╝██║ ██║██╔════╝████╗ ████║██╔════╝██╔════╝ + ██║ ███████║█████╗ ██╔████╔██║█████╗ ███████╗ + ██║ ██╔══██║██╔══╝ ██║╚██╔╝██║██╔══╝ ╚════██║ + ██║ ██║ ██║███████╗██║ ╚═╝ ██║███████╗███████║ + ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝ + +*/ + +/******************************* + Theme Selection +*******************************/ + +/* To override a theme for an individual element + specify theme name below +*/ + +/* Global */ +@site : 'rdm'; +@reset : 'default'; + +/* Elements */ +@button : 'rdm'; +@container : 'rdm'; +@divider : 'rdm'; +@flag : 'rdm'; +@header : 'rdm'; +@icon : 'default'; +@image : 'rdm'; +@input : 'rdm'; +@label : 'rdm'; +@list : 'rdm'; +@loader : 'rdm'; +@placeholder : 'rdm'; +@rail : 'rdm'; +@reveal : 'rdm'; +@segment : 'rdm'; +@step : 'rdm'; + +/* Collections */ +@breadcrumb : 'rdm'; +@form : 'rdm'; +@grid : 'rdm'; +@menu : 'rdm'; +@message : 'rdm'; +@table : 'rdm'; + +/* Modules */ +@accordion : 'rdm'; +@checkbox : 'rdm'; +@dimmer : 'rdm'; +@dropdown : 'rdm'; +@embed : 'rdm'; +@modal : 'rdm'; +@nag : 'rdm'; +@popup : 'rdm'; +@progress : 'rdm'; +@rating : 'rdm'; +@search : 'rdm'; +@shape : 'rdm'; +@sidebar : 'rdm'; +@sticky : 'rdm'; +@tab : 'rdm'; +@transition : 'default'; + +/* Views */ +@ad : 'rdm'; +@card : 'rdm'; +@comment : 'rdm'; +@feed : 'rdm'; +@item : 'rdm'; +@statistic : 'rdm'; + +/******************************* + Folders +*******************************/ + +/* Path to theme packages */ +@themesFolder : '~semantic-ui-less/themes'; + +/* Path to site override folder */ +@siteFolder : '../../less/site'; +@imagesFolder : '../../images'; + + +/******************************* + Import Theme +*******************************/ + +@import (multiple) "themes/rdm/theme.less"; + +@fontPath : "../../../themes/@{theme}/assets/fonts"; + +/* End Config */ diff --git a/i-form-data-repository/assets/templates/custom_fields/.gitkeep b/i-form-data-repository/assets/templates/custom_fields/.gitkeep new file mode 100644 index 0000000..327361e --- /dev/null +++ b/i-form-data-repository/assets/templates/custom_fields/.gitkeep @@ -0,0 +1 @@ +# This file exists only to add templates/ folder to git repository. diff --git a/i-form-data-repository/assets/templates/search/.gitkeep b/i-form-data-repository/assets/templates/search/.gitkeep new file mode 100644 index 0000000..327361e --- /dev/null +++ b/i-form-data-repository/assets/templates/search/.gitkeep @@ -0,0 +1 @@ +# This file exists only to add templates/ folder to git repository. diff --git a/i-form-data-repository/docker-compose.full.yml b/i-form-data-repository/docker-compose.full.yml new file mode 100644 index 0000000..89eea4c --- /dev/null +++ b/i-form-data-repository/docker-compose.full.yml @@ -0,0 +1,116 @@ +# Example of a full infrastructure stack +# +# Note, this file is not suitable for a production deployment. It is only an +# example of all the infrastructure components needed in a real production +# deployment. +# +# Usage:: +# +# $ docker compose up -f docker-compose.full.yml -d +# +# Following services are included: +# - Frontend: Nginx (exposed ports: 40 and 443) +# - UI application: UWSGI (not exposed) +# - API application: UWSGI (not exposed) +# - Cache: Redis (exposed port: 6379) +# - DB: (PostgresSQL/MySQL) (exposed port: 5432 or 3306) +# - Message queue: RabbitMQ (exposed ports: 5672, 15672) +# - Search platform: (OpenSearch) (exposed ports: 9200, 9600) +# - OpenSearch Dashboard/Kibana (view OS/ES indexes) (exposed ports: 5601) +# +services: + cache: + extends: + file: docker-services.yml + service: cache + db: + extends: + file: docker-services.yml + service: db + mq: + extends: + file: docker-services.yml + service: mq + search: + extends: + file: docker-services.yml + service: search + opensearch-dashboards: + extends: + file: docker-services.yml + service: opensearch-dashboards + pgadmin: + extends: + file: docker-services.yml + service: pgadmin + s3: + extends: + file: docker-services.yml + service: s3 + # Frontend + frontend: + extends: + file: docker-services.yml + service: frontend + volumes: + - static_data:/opt/invenio/var/instance/static + depends_on: + - web-ui + - web-api + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:80:80" + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:443:443" + # UI Application + web-ui: + extends: + file: docker-services.yml + service: app + command: ["uwsgi /opt/invenio/var/instance/uwsgi_ui.ini"] + image: i-form-data-repository:latest + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:5000:5000" + volumes: + - static_data:/opt/invenio/var/instance/static + + # API Rest Application + web-api: + extends: + file: docker-services.yml + service: app + command: ["uwsgi /opt/invenio/var/instance/uwsgi_rest.ini"] + image: i-form-data-repository:latest + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:5001:5000" + + # Worker + worker: + extends: + file: docker-services.yml + service: app + command: ["celery -A invenio_app.celery worker --beat --loglevel=INFO"] + image: i-form-data-repository:latest + depends_on: + search: + condition: service_started + cache: + condition: service_started + db: + condition: service_started + mq: + condition: service_started + + # Jobs scheduler + scheduler: + extends: + file: docker-services.yml + service: app + command: ["celery -A invenio_app.celery beat --scheduler invenio_jobs.services.scheduler:RunScheduler --loglevel=INFO"] + image: i-form-data-repository:latest + depends_on: + mq: + condition: service_started + db: + condition: service_started +volumes: + static_data: + data: diff --git a/i-form-data-repository/docker-compose.yml b/i-form-data-repository/docker-compose.yml new file mode 100644 index 0000000..7534097 --- /dev/null +++ b/i-form-data-repository/docker-compose.yml @@ -0,0 +1,47 @@ +# Backend services needed for development. +# +# This file will start all the backend services needed to run InvenioRDM +# locally in development mode. +# +# Usage:: +# +# $ docker compose up -d +# +# Following services are included: +# - Cache: Redis (exposed port: 6379) +# - DB: (PostgresSQL/MySQL) (exposed port: 5432 or 3306) +# - Message queue: RabbitMQ (exposed ports: 5672, 15672) +# - OpenSearch (exposed ports: 9200, 9600) +# - Kibana (view ES indexes) (exposed ports: 5601) +# +services: + cache: + extends: + file: docker-services.yml + service: cache + db: + extends: + file: docker-services.yml + service: db + mq: + extends: + file: docker-services.yml + service: mq + search: + extends: + file: docker-services.yml + service: search + opensearch-dashboards: + extends: + file: docker-services.yml + service: opensearch-dashboards + pgadmin: + extends: + file: docker-services.yml + service: pgadmin + s3: + extends: + file: docker-services.yml + service: s3 +volumes: + data: diff --git a/i-form-data-repository/docker-services.yml b/i-form-data-repository/docker-services.yml new file mode 100644 index 0000000..e6f13f8 --- /dev/null +++ b/i-form-data-repository/docker-services.yml @@ -0,0 +1,108 @@ +services: + app: + build: + context: ./ + args: + - ENVIRONMENT=DEV + image: i-form-data-repository + restart: "unless-stopped" + environment: + - "INVENIO_ACCOUNTS_SESSION_REDIS_URL=redis://cache:6379/1" + - "INVENIO_BROKER_URL=amqp://guest:guest@mq:5672/" + - "INVENIO_CACHE_REDIS_URL=redis://cache:6379/0" + - "INVENIO_CACHE_TYPE=redis" + - "INVENIO_CELERY_BROKER_URL=amqp://guest:guest@mq:5672/" + - "INVENIO_CELERY_RESULT_BACKEND=redis://cache:6379/2" + - "INVENIO_COMMUNITIES_IDENTITIES_CACHE_REDIS_URL=redis://cache:6379/4" + - "INVENIO_SEARCH_HOSTS=['search:9200']" + - "INVENIO_SECRET_KEY=CHANGE_ME" + - "INVENIO_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://i-form-data-repository:i-form-data-repository@db/i-form-data-repository" + - "INVENIO_WSGI_PROXIES=2" + - "INVENIO_RATELIMIT_STORAGE_URL=redis://cache:6379/3" + frontend: + build: ./docker/nginx/ + image: i-form-data-repository-frontend + restart: "unless-stopped" + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:80:80" + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:443:443" + cache: + image: redis:7 + restart: "unless-stopped" + read_only: true + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:6379:6379" + db: + image: postgres:14.13 + restart: "unless-stopped" + environment: + - "POSTGRES_USER=i-form-data-repository" + - "POSTGRES_PASSWORD=i-form-data-repository" + - "POSTGRES_DB=i-form-data-repository" + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:5432:5432" + pgadmin: + image: dpage/pgadmin4:6 + restart: "unless-stopped" + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:5050:80" + environment: + PGADMIN_DEFAULT_EMAIL: "info@repo.i-form.ie" + PGADMIN_DEFAULT_PASSWORD: "i-form-data-repository" + volumes: + - ./docker/pgadmin/servers.json:/pgadmin4/servers.json + mq: + image: rabbitmq:3-management + restart: "unless-stopped" + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:15672:15672" + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:5672:5672" + search: + image: opensearchproject/opensearch:2.17.1 + restart: "unless-stopped" + environment: + # settings only for development. DO NOT use in production! + - bootstrap.memory_lock=true + - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" + - "OPENSEARCH_INITIAL_ADMIN_PASSWORD=guekxe3mvqieke1!%&ieIADE" + - "DISABLE_INSTALL_DEMO_CONFIG=true" + - "DISABLE_SECURITY_PLUGIN=true" + - "discovery.type=single-node" + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65536 + hard: 65536 + mem_limit: 2g + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:9200:9200" + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:9600:9600" + opensearch-dashboards: + image: opensearchproject/opensearch-dashboards:2.17.1 + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:5601:5601" + expose: + - "5601" + environment: + # settings only for development. DO NOT use in production! + - 'OPENSEARCH_HOSTS=["http://search:9200"]' + - "DISABLE_SECURITY_DASHBOARDS_PLUGIN=true" + s3: + image: minio/minio:RELEASE.2022-10-24T18-35-07Z + restart: "unless-stopped" + ports: + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:9000:9000" + - "${DOCKER_SERVICES_IP_BIND:-127.0.0.1}:9001:9001" + environment: + MINIO_ROOT_USER: CHANGE_ME + MINIO_ROOT_PASSWORD: CHANGE_ME + volumes: + - ./data:/data + command: server /data --console-address :9001 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 diff --git a/i-form-data-repository/docker/nginx/Dockerfile b/i-form-data-repository/docker/nginx/Dockerfile new file mode 100644 index 0000000..69c1bf1 --- /dev/null +++ b/i-form-data-repository/docker/nginx/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx +COPY nginx.conf /etc/nginx/nginx.conf +COPY conf.d/* /etc/nginx/conf.d/ +COPY test.key /etc/ssl/private/test.key +COPY test.crt /etc/ssl/certs/test.crt \ No newline at end of file diff --git a/i-form-data-repository/docker/nginx/conf.d/default.conf b/i-form-data-repository/docker/nginx/conf.d/default.conf new file mode 100644 index 0000000..03ef188 --- /dev/null +++ b/i-form-data-repository/docker/nginx/conf.d/default.conf @@ -0,0 +1,128 @@ +# This nginx configuration defines two servers, one on port 80 and one on port +# 443. All traffix on port 80 is redirect to port 443 on SSL. +# +# Nginx proxies all requests on port 443 to upstream the application server +# which is expected to be running on port 5000/5001. + +upstream ui_server { + server web-ui:5000 fail_timeout=0; +} +upstream api_server { + server web-api:5000 fail_timeout=0; +} + +# HTTP server +server { + # Redirects all requests to https. - this is in addition to HAProxy which + # already redirects http to https. This redirect is needed in case you access + # the server directly (e.g. useful for debugging). + listen 80 default_server; # IPv4 + listen [::]:80 default_server; # IPv6 + server_name _; + return 301 https://$host$request_uri; +} + +# HTTPS server +server { + listen 443 default_server ssl http2; # IPv4 + listen [::]:443 default_server ssl http2; # IPv6 + server_name _; + charset utf-8; + keepalive_timeout 5; + + # SSL configuration according to best practices from + # https://mozilla.github.io/server-side-tls/ssl-config-generator/ + # The provided certificate (test.crt) and private key (test.key) is only for + # testing and must never be used in production environment. + ssl_certificate /etc/ssl/certs/test.crt; + ssl_certificate_key /etc/ssl/private/test.key; + ssl_session_timeout 1d; + ssl_session_cache shared:SSL:50m; + ssl_session_tickets off; + + # Accepted protocols and ciphers + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; + ssl_prefer_server_ciphers on; + + add_header Strict-Transport-Security "max-age=15768000"; # 6 months + + # Request ID tracing (allows end-to-end tracking of requests for better + # troubleshooting) + add_header X-Request-ID $request_id; + + # The request body is sent to the proxied server immediately as it is + # received + proxy_request_buffering off; + # Sets the HTTP protocol v1.1 for proxying in order to not use the buffer + # in case of chunked transfer encoding + proxy_http_version 1.1; + + # Proxying to the application server + ## UI server + location / { + uwsgi_pass ui_server; + include uwsgi_params; + uwsgi_buffering off; + uwsgi_request_buffering off; + chunked_transfer_encoding off; + uwsgi_param Host $host; + uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for; + uwsgi_param X-Forwarded-Proto $scheme; + # Pass request id to the ui server + uwsgi_param X-Request-ID $request_id; + # X-Session-ID / X-User-ID is read by nginx and included in the logs, + # however we don't want to expose them to clients so we are hiding them. + uwsgi_hide_header X-Session-ID; + uwsgi_hide_header X-User-ID; + # Max upload size (except for files) is set to 100mb as default. + client_max_body_size 100m; + } + ## Most API + location /api { + uwsgi_pass api_server; + include uwsgi_params; + uwsgi_buffering off; + uwsgi_request_buffering off; + chunked_transfer_encoding off; + uwsgi_param Host $host; + uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for; + uwsgi_param X-Forwarded-Proto $scheme; + # Pass request id to the api server + uwsgi_param X-Request-ID $request_id; + # X-Session-ID / X-User-ID is read by nginx and included in the logs, + # however we don't want to expose them to clients so we are hiding them. + uwsgi_hide_header X-Session-ID; + uwsgi_hide_header X-User-ID; + # Max upload size (except for files) is set to 100mb as default. + client_max_body_size 100m; + } + ## API files + # Another location is defined in order to allow large file uploads in the files + # API without exposing the other parts of the application to receive huge + # request bodies. This includes part content uploads of multipart file uploads. + location ~ /api/records/.+/draft/files/.+/content(/[0-9]+)?/?$ { + gzip off; + uwsgi_pass api_server; + include uwsgi_params; + uwsgi_buffering off; + uwsgi_request_buffering off; + chunked_transfer_encoding off; + uwsgi_param Host $host; + uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for; + uwsgi_param X-Forwarded-Proto $scheme; + # Pass request id to api server + uwsgi_param X-Request-ID $request_id; + # X-Session-ID / X-User-ID is read by nginx and included in the logs, + # however we don't want to expose them to clients so we are hiding them. + uwsgi_hide_header X-Session-ID; + uwsgi_hide_header X-User-ID; + # Max upload size for files is set to 50GB (configure as needed). + client_max_body_size 50G; + } + # Static content is served directly by nginx and not the application server. + location /static { + alias /opt/invenio/var/instance/static; + autoindex off; + } +} diff --git a/i-form-data-repository/docker/nginx/nginx.conf b/i-form-data-repository/docker/nginx/nginx.conf new file mode 100644 index 0000000..fc28c70 --- /dev/null +++ b/i-form-data-repository/docker/nginx/nginx.conf @@ -0,0 +1,81 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + types { + # The default MIME types file doesn't assign "application/javascript" + # to "*.mjs" files (ECMAScript modules) + application/javascript js mjs; + } + + # Standard log format + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + # Request tracing log format - includes request id, session id, user id, + # and request timing. + log_format trace '$remote_addr - [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for" $request_id ' + '$msec $request_time ' + '$upstream_http_x_session_id $upstream_http_x_user_id'; + + access_log /var/log/nginx/access.log trace; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + + keepalive_timeout 65; + + gzip on; + gzip_disable "msie6"; + gzip_http_version 1.1; + gzip_comp_level 5; # or anything between 4-6 + gzip_min_length 100; + gzip_proxied any; + # We may need more mime-types here (eg. 'application/x-bibtex') + gzip_types + application/atom+xml + application/javascript + application/json + application/ld+json + application/manifest+json + application/octet-stream + application/rss+xml + application/vnd.geo+json + application/vnd.ms-fontobject + application/x-font-ttf + application/x-javascript + application/x-web-app-manifest+json + application/xhtml+xml + application/xml + application/xml+rss + font/opentype + image/bmp + image/svg+xml + image/x-icon + text/cache-manifest + text/css + text/javascript + text/plain + text/vcard + text/vnd.rim.location.xloc + text/vtt + text/x-component + text/x-cross-domain-policy + text/xml; + gzip_vary on; + + include /etc/nginx/conf.d/*.conf; +} diff --git a/i-form-data-repository/docker/nginx/test.crt b/i-form-data-repository/docker/nginx/test.crt new file mode 100644 index 0000000..144f293 --- /dev/null +++ b/i-form-data-repository/docker/nginx/test.crt @@ -0,0 +1,33 @@ +-----BE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M80wUsTAK8khE+YnBe1xhiexJMXn5MnrIljjv7u79EqSAkx/hBL0co14WI8 +5HxbqKTsub4g8EIfuQIDAQABo1MwUTAdBgNVHQ4EFgQUgaT39u46Jud7DJdbgF6I +pEB6XI0wHwYDVR0jBBgwFoAUgaT39u46Jud7DJdbgF6IpEB6XI0wDwYDVR0TAQH/ +BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAc8bweJSg/8S82x0cabl4bl+WiqG2 +PYSzPgMnMXK0rbx8sss9cUIeKoOEWR0DzLdnTE9xPI4rLaKwK3LRv4JWmx1QjIac +tvrnDdoO6uKubqS4Vf0Q+QSeiVIIvu4qveK8syhJaEZJtQiUaYanxYSkn8skOhoL +ZZv/t8Iu0KDJ1EI5eNMCDTzny8VOYk08Nx97TAGazgCp6fx3xpk7mc3iNQcCrtmC +3emhW0Pgro8tHg9bECtugLk/pyBys0mt65gUMXu572LOUdNoOq1jbsXU2/HpA9G2 +/5IntXmP8k6i7w+ZtbN8JpwfUTg25JSGYVEZ0SrtAj6AfLZvG+MdrhWcw7XCbm2a +94h2O1H0rQ2u4EEOqPpAXByVCyfGmQQxzyCinLy42eNPcAiehdSDEgTInIHxmIik +PqCYyWL/s1ltbV+zai1FKK7GU2N911e5kcioGHIpWjo/a+aNsmcw+umpSjyFkQ2x +FtE8i4oePPosSNhDZdpv+0PDygKGU8uMZLO09IOeUIeyZlphCUglBM2dDZY3Rpzg +AQxYMVvP75ceNl4XZ0UFbzM937/a6ElsOSrP1zNHPV8AGWX2VNKWqGMd+qADu8/A +3pcDjJk+YLwT6343+tYc7rRu8skXtMxxRgwvAUdCUaTjNT924PaOf6ImoVhpPgkf +1i0GCvJT5yQK4q4= +-----END CERTIFICATE----- diff --git a/i-form-data-repository/docker/nginx/test.key b/i-form-data-repository/docker/nginx/test.key new file mode 100644 index 0000000..59199e3 --- /dev/null +++ b/i-form-data-repository/docker/nginx/test.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJ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form-data-repository/docker/pgadmin/servers.json b/i-form-data-repository/docker/pgadmin/servers.json new file mode 100644 index 0000000..be36484 --- /dev/null +++ b/i-form-data-repository/docker/pgadmin/servers.json @@ -0,0 +1,13 @@ +{ + "Servers": { + "1": { + "Name": "i-form-data-repository-db", + "Group": "Servers", + "Host": "i-form-data-repository-db-1", + "Port": 5432, + "MaintenanceDB": "postgres", + "Username": "i-form-data-repository", + "SSLMode": "prefer" + } + } +} diff --git a/i-form-data-repository/docker/uwsgi/uwsgi_rest.ini b/i-form-data-repository/docker/uwsgi/uwsgi_rest.ini new file mode 100644 index 0000000..8d26747 --- /dev/null +++ b/i-form-data-repository/docker/uwsgi/uwsgi_rest.ini @@ -0,0 +1,13 @@ +[uwsgi] +socket = 0.0.0.0:5000 +stats = 0.0.0.0:9001 +module = invenio_app.wsgi_rest:application +master = true +die-on-term = true +processes = 2 +threads = 2 +mount = /api=invenio_app.wsgi_rest:application +manage-script-name = true +wsgi-disable-file-wrapper = true +single-interpreter = true +buffer-size = 8192 diff --git a/i-form-data-repository/docker/uwsgi/uwsgi_ui.ini b/i-form-data-repository/docker/uwsgi/uwsgi_ui.ini new file mode 100644 index 0000000..2c8d408 --- /dev/null +++ b/i-form-data-repository/docker/uwsgi/uwsgi_ui.ini @@ -0,0 +1,11 @@ +[uwsgi] +socket = 0.0.0.0:5000 +stats = 0.0.0.0:9000 +module = invenio_app.wsgi_ui:application +master = true +die-on-term = true +processes = 2 +threads = 2 +single-interpreter = true +buffer-size = 8192 +wsgi-disable-file-wrapper = true diff --git a/i-form-data-repository/invenio.cfg b/i-form-data-repository/invenio.cfg new file mode 100644 index 0000000..8f6fda5 --- /dev/null +++ b/i-form-data-repository/invenio.cfg @@ -0,0 +1,228 @@ +""" +InvenioRDM settings for I-Form Data Repository project. + +This file was automatically generated by 'invenio-cli init'. + +For the full list of settings and their values, see +https://inveniordm.docs.cern.ch/operate/customize/configuration/. +""" + +from datetime import datetime +from invenio_i18n import lazy_gettext as _ + + +def _(x): # needed to avoid start time failure with lazy strings + return x + +# Flask +# ===== +# See https://flask.palletsprojects.com/en/1.1.x/config/ + +# Define the value of the cache control header `max-age` returned by the server when serving +# public files. Files will be cached by the browser for the provided number of seconds. +# See flask documentation for more information: +# https://flask.palletsprojects.com/en/2.1.x/config/#SEND_FILE_MAX_AGE_DEFAULT +SEND_FILE_MAX_AGE_DEFAULT = 300 + +# SECURITY WARNING: keep the secret key used in production secret! +# Do not commit it to a source code repository. +# TODO: Set +SECRET_KEY="CHANGE_ME" + +# Since HAProxy and Nginx route all requests no matter the host header +# provided, the trusted hosts variable is set to localhost. In production it +# should be set to the correct host and it is strongly recommended to only +# route correct hosts to the application. +TRUSTED_HOSTS = ['0.0.0.0', 'localhost', '127.0.0.1'] + + +# Flask-SQLAlchemy +# ================ +# See https://flask-sqlalchemy.palletsprojects.com/en/2.x/config/ + +# TODO: Set +SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://i-form-data-repository:i-form-data-repository@localhost/i-form-data-repository" + + +# Invenio-App +# =========== +# See https://invenio-app.readthedocs.io/en/latest/configuration.html + +APP_DEFAULT_SECURE_HEADERS = { + 'content_security_policy': { + 'default-src': [ + "'self'", + 'data:', # for fonts + "'unsafe-inline'", # for inline scripts and styles + "blob:", # for pdf preview + # Add your own policies here (e.g. analytics) + ], + 'script-src': [ + "'self'", "blob:", "'wasm-unsafe-eval'" # for WASM-based workers + # Multipart file uploads use a Web Worker running `hash-wasm` to compute content checksums + # (e.g., MD5) of uploaded parts. This requires both 'blob:' and 'wasm-unsafe-eval' enabled in `script-src`. + ], + }, + 'content_security_policy_report_only': False, + 'content_security_policy_report_uri': None, + 'force_file_save': False, + 'force_https': True, + 'force_https_permanent': False, + 'frame_options': 'sameorigin', + 'frame_options_allow_from': None, + 'session_cookie_http_only': True, + 'session_cookie_secure': True, + 'strict_transport_security': True, + 'strict_transport_security_include_subdomains': True, + 'strict_transport_security_max_age': 31556926, # One year in seconds + 'strict_transport_security_preload': False, +} + + +# Flask-Babel +# =========== +# See https://python-babel.github.io/flask-babel/#configuration + +# Default locale (language) +BABEL_DEFAULT_LOCALE = 'en' +# Default time zone +BABEL_DEFAULT_TIMEZONE = 'Europe/Zurich' + + +# Invenio-I18N +# ============ +# See https://invenio-i18n.readthedocs.io/en/latest/configuration.html + +# Other supported languages (do not include BABEL_DEFAULT_LOCALE in list). +I18N_LANGUAGES = [ + # ('de', _('German')), + # ('tr', _('Turkish')), +] + + +# Invenio-Theme +# ============= +# See https://invenio-theme.readthedocs.io/en/latest/configuration.html + +# Name used in header and UI +THEME_SITENAME = "I-Form Data Repository" +# Frontpage title +THEME_FRONTPAGE_TITLE = "I-Form Data Repository" +# Header logo +THEME_LOGO = 'images/invenio-rdm.svg' + + +# Invenio-App-RDM +# =============== +# See https://github.com/inveniosoftware/invenio-app-rdm/blob/master/invenio_app_rdm/config.py + +# Instance's theme entrypoint file. Path relative to the ``assets/`` folder. +INSTANCE_THEME_FILE = './less/theme.less' + +# Email address for administrator emails (like file checksum alerts) +APP_RDM_ADMIN_EMAIL_RECIPIENT = "info@repo.i-form.ie" + +# Default values for the deposit form +APP_RDM_DEPOSIT_FORM_DEFAULTS = { + "publication_date": lambda: datetime.now().strftime("%Y-%m-%d"), + "rights": [ + { + "id": "cc-by-4.0", + "title": "Creative Commons Attribution 4.0 International", + "description": ("The Creative Commons Attribution license allows " + "re-distribution and re-use of a licensed work " + "on the condition that the creator is " + "appropriately credited."), + "link": "https://creativecommons.org/licenses/by/4.0/legalcode", + } + ], + "publisher": "I-Form Data Repository", +} + +APP_RDM_DEPOSIT_FORM_AUTOCOMPLETE_NAMES = 'search' # "search_only" or "off" + +# Invenio-Files-Rest +# ================== +FILES_REST_STORAGE_FACTORY='invenio_s3.s3fs_storage_factory' + +# Invenio-S3 +# ========== +S3_ENDPOINT_URL='http://localhost:9000/' +S3_ACCESS_KEY_ID='CHANGE_ME' +S3_SECRET_ACCESS_KEY='CHANGE_ME' + +# Allow S3 endpoint in the CSP rules +APP_DEFAULT_SECURE_HEADERS['content_security_policy']['default-src'].append( + S3_ENDPOINT_URL +) + +# Invenio-Records-Resources +# ========================= +# See https://github.com/inveniosoftware/invenio-records-resources/blob/master/invenio_records_resources/config.py + +# TODO: Set with your own hostname when deploying to production +SITE_UI_URL = "https://127.0.0.1" + +SITE_API_URL = "https://127.0.0.1/api" + +# Invenio-RDM-Records +# =================== +# See https://inveniordm.docs.cern.ch/operate/customize/dois/ +DATACITE_ENABLED = False +DATACITE_USERNAME = "" +DATACITE_PASSWORD = "" +DATACITE_PREFIX = "" +DATACITE_TEST_MODE = True +DATACITE_DATACENTER_SYMBOL = "" + +# Authentication - Invenio-Accounts and Invenio-OAuthclient +# ========================================================= +# See: https://inveniordm.docs.cern.ch/operate/customize/authentication/ + +# Invenio-Accounts +# ---------------- +# See https://github.com/inveniosoftware/invenio-accounts/blob/master/invenio_accounts/config.py +ACCOUNTS_LOCAL_LOGIN_ENABLED = True # enable local login +SECURITY_REGISTERABLE = True # local login: allow users to register +SECURITY_RECOVERABLE = True # local login: allow users to reset the password +SECURITY_CHANGEABLE = True # local login: allow users to change psw +SECURITY_CONFIRMABLE = True # local login: users can confirm e-mail address +SECURITY_LOGIN_WITHOUT_CONFIRMATION = False # require users to confirm email before being able to login + +# Invenio-OAuthclient +# ------------------- +# See https://github.com/inveniosoftware/invenio-oauthclient/blob/master/invenio_oauthclient/config.py + +OAUTHCLIENT_REMOTE_APPS = {} # configure external login providers + +from invenio_oauthclient.views.client import auto_redirect_login +ACCOUNTS_LOGIN_VIEW_FUNCTION = auto_redirect_login # autoredirect to external login if enabled +OAUTHCLIENT_AUTO_REDIRECT_TO_EXTERNAL_LOGIN = False # autoredirect to external login + +# Invenio-UserProfiles +# -------------------- +USERPROFILES_READ_ONLY = False # allow users to change profile info (name, email, etc...) + +# OAI-PMH +# ======= +# See https://github.com/inveniosoftware/invenio-oaiserver/blob/master/invenio_oaiserver/config.py + +OAISERVER_ID_PREFIX = "repo.i-form.ie" +"""The prefix that will be applied to the generated OAI-PMH ids.""" +OAISERVER_ADMIN_EMAILS = [ + "info@repo.i-form.ie", +] + +# Invenio-Search +# -------------- + +SEARCH_INDEX_PREFIX = "i-form-data-repository-" + +# Invenio-Administration +# ---------------------- + +from invenio_app_rdm import __version__ +ADMINISTRATION_DISPLAY_VERSIONS = [ + ("invenio-app-rdm", f"v{__version__}"), + ("i-form-data-repository", "v1.0.0"), +] diff --git a/i-form-data-repository/site/.gitkeep b/i-form-data-repository/site/.gitkeep new file mode 100644 index 0000000..bf805ce --- /dev/null +++ b/i-form-data-repository/site/.gitkeep @@ -0,0 +1 @@ +# This file exists only to add i_form_data_repository/ folder to git repository. diff --git a/i-form-data-repository/site/i_form_data_repository/__init__.py b/i-form-data-repository/site/i_form_data_repository/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/i-form-data-repository/site/i_form_data_repository/assets/semantic-ui/js/i_form_data_repository/.gitkeep b/i-form-data-repository/site/i_form_data_repository/assets/semantic-ui/js/i_form_data_repository/.gitkeep new file mode 100644 index 0000000..985fe1b --- /dev/null +++ b/i-form-data-repository/site/i_form_data_repository/assets/semantic-ui/js/i_form_data_repository/.gitkeep @@ -0,0 +1 @@ +# This file exists only to add js/ folder to git repository. diff --git a/i-form-data-repository/site/i_form_data_repository/assets/semantic-ui/less/i_form_data_repository/.gitkeep b/i-form-data-repository/site/i_form_data_repository/assets/semantic-ui/less/i_form_data_repository/.gitkeep new file mode 100644 index 0000000..0690adc --- /dev/null +++ b/i-form-data-repository/site/i_form_data_repository/assets/semantic-ui/less/i_form_data_repository/.gitkeep @@ -0,0 +1 @@ +# This file exists only to add less/ folder to git repository. diff --git a/i-form-data-repository/site/i_form_data_repository/templates/semantic-ui/i_form_data_repository/.gitkeep b/i-form-data-repository/site/i_form_data_repository/templates/semantic-ui/i_form_data_repository/.gitkeep new file mode 100644 index 0000000..327361e --- /dev/null +++ b/i-form-data-repository/site/i_form_data_repository/templates/semantic-ui/i_form_data_repository/.gitkeep @@ -0,0 +1 @@ +# This file exists only to add templates/ folder to git repository. diff --git a/i-form-data-repository/site/i_form_data_repository/views.py b/i-form-data-repository/site/i_form_data_repository/views.py new file mode 100644 index 0000000..c355ac8 --- /dev/null +++ b/i-form-data-repository/site/i_form_data_repository/views.py @@ -0,0 +1,17 @@ +"""Additional views.""" + +from flask import Blueprint + +# +# Registration +# +def create_blueprint(app): + """Register blueprint routes on app.""" + blueprint = Blueprint( + "i_form_data_repository", + __name__, + template_folder="./templates", + ) + + # Add URL rules + return blueprint diff --git a/i-form-data-repository/site/i_form_data_repository/webpack.py b/i-form-data-repository/site/i_form_data_repository/webpack.py new file mode 100644 index 0000000..1c6b005 --- /dev/null +++ b/i-form-data-repository/site/i_form_data_repository/webpack.py @@ -0,0 +1,16 @@ +"""JS/CSS Webpack bundles for I-Form Data Repository.""" + +from invenio_assets.webpack import WebpackThemeBundle + +theme = WebpackThemeBundle( + __name__, + "assets", + default="semantic-ui", + themes={ + "semantic-ui": dict( + entry={ + # Add your webpack entrypoints + }, + ), + }, +) diff --git a/i-form-data-repository/site/pyproject.toml b/i-form-data-repository/site/pyproject.toml new file mode 100644 index 0000000..ec4e1ea --- /dev/null +++ b/i-form-data-repository/site/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel", "babel>2.8"] +build-backend = "setuptools.build_meta" diff --git a/i-form-data-repository/site/setup.cfg b/i-form-data-repository/site/setup.cfg new file mode 100644 index 0000000..b006b6d --- /dev/null +++ b/i-form-data-repository/site/setup.cfg @@ -0,0 +1,13 @@ + +[metadata] +name = i-form-data-repository + +[options.extras_require] +tests = + pytest-invenio>=2.1.0,<3.0.0 + +[options.entry_points] +invenio_base.blueprints = + i_form_data_repository_views = i_form_data_repository.views:create_blueprint +invenio_assets.webpack = + i_form_data_repository_theme = i_form_data_repository.webpack:theme diff --git a/i-form-data-repository/site/setup.py b/i-form-data-repository/site/setup.py new file mode 100644 index 0000000..6068493 --- /dev/null +++ b/i-form-data-repository/site/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup() diff --git a/i-form-data-repository/site/tests/.gitkeep b/i-form-data-repository/site/tests/.gitkeep new file mode 100644 index 0000000..327361e --- /dev/null +++ b/i-form-data-repository/site/tests/.gitkeep @@ -0,0 +1 @@ +# This file exists only to add templates/ folder to git repository. diff --git a/i-form-data-repository/static/images/invenio-rdm.svg b/i-form-data-repository/static/images/invenio-rdm.svg new file mode 100644 index 0000000..a451871 --- /dev/null +++ b/i-form-data-repository/static/images/invenio-rdm.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/i-form-data-repository/static/images/logo-invenio-white.svg b/i-form-data-repository/static/images/logo-invenio-white.svg new file mode 100644 index 0000000..b6cc40d --- /dev/null +++ b/i-form-data-repository/static/images/logo-invenio-white.svg @@ -0,0 +1,129 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/i-form-data-repository/templates/.gitkeep b/i-form-data-repository/templates/.gitkeep new file mode 100644 index 0000000..327361e --- /dev/null +++ b/i-form-data-repository/templates/.gitkeep @@ -0,0 +1 @@ +# This file exists only to add templates/ folder to git repository. diff --git a/i-form-data-repository/translations/babel.ini b/i-form-data-repository/translations/babel.ini new file mode 100644 index 0000000..c5a0801 --- /dev/null +++ b/i-form-data-repository/translations/babel.ini @@ -0,0 +1,12 @@ +# This file is required to allow string extraction for translations. +# Extraction from Python source files +[python: **.py] +encoding = utf-8 + +# Extraction from Python config files +[python: **.cfg] +encoding = utf-8 + +# Extraction from Jinja2 templates +[jinja2: **/templates/**.html] +encoding = utf-8