diff --git a/.config.sh b/.config.sh index 213a7b9d..0628311d 100755 --- a/.config.sh +++ b/.config.sh @@ -27,7 +27,7 @@ IDM_DEBUG=false IMAGE_KEYROCK=letsfiware/fiware-idm:8.4.0 # Docker image for Postfix -IMAGE_POSTFIX=letsfiware/postfix:0.39.0 +IMAGE_POSTFIX=letsfiware/postfix:0.40.0 # # Wilma @@ -48,6 +48,31 @@ ORION=orion # Expose port 1026 (none, local, all) Default: none ORION_EXPOSE_PORT= +# Enable cross-origin resource sharing (CORS) Default: false +ORION_CORS= + +# Set Access-Control-Allow-Origin header for CORS +# Default: '*' +set -f +ORION_ACCESS_CONTROL_ALLOW_ORIGIN= +set +f + +# Set Access-Control-Allow-Methods header for CORS +# Default: 'GET, POST, OPTIONS, DELETE, PUT, PATCH' +ORION_ACCESS_CONTROL_ALLOW_METHODS= + +# Set Access-Control-Allow-Headers header for CORS +# Default: 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' +ORION_ACCESS_CONTROL_ALLOW_HEADERS= + +# Set Access-Control-Expose-Headers header for CORS +# Default: 'location, fiware-correlator' +ORION_CONTROL_EXPOSE_HEADERS= + +# Set Access-Control-Max-Age header for CORS +# Default: 7200 +ORION_ACCESS_CONTROL_MAX_AGE= + # Docker image for Orion IMAGE_ORION=telefonicaiot/fiware-orion:4.0.0 @@ -338,7 +363,7 @@ NODE_RED_LOGGING_METRICS= NODE_RED_LOGGING_AUDIT= # Docker image for Node-RED -IMAGE_NODE_RED=letsfiware/node-red:0.39.0 +IMAGE_NODE_RED=letsfiware/node-red:0.40.0 # # Grafana @@ -364,7 +389,7 @@ ZEPPELIN= ZEPPELIN_DEBUG= # Docker image for Zeppelin -IMAGE_ZEPPELIN=letsfiware/zeppelin:0.39.0 +IMAGE_ZEPPELIN=letsfiware/zeppelin:0.40.0 # # Queryproxy @@ -376,7 +401,7 @@ QUERYPROXY= QUERYPROXY_LOGLEVEL=info # Docker image for Queryproxy -IMAGE_QUERYPROXY=letsfiware/queryproxy:0.39.0 +IMAGE_QUERYPROXY=letsfiware/queryproxy:0.40.0 # # Tokenproxy @@ -388,7 +413,7 @@ TOKENPROXY_LOGLEVEL=info TOKENPROXY_VERBOSE= # Docker image for Tokenproxy -IMAGE_TOKENPROXY=letsfiware/tokenproxy:0.39.0 +IMAGE_TOKENPROXY=letsfiware/tokenproxy:0.40.0 # # Regproxy @@ -427,7 +452,7 @@ REGPROXY_LOGLEVEL=info REGPROXY_VERBOSE=false # Docker image for Regproxy -IMAGE_REGPROXY=letsfiware/regproxy:0.39.0 +IMAGE_REGPROXY=letsfiware/regproxy:0.40.0 # # MongoDB @@ -463,7 +488,7 @@ IMAGE_POSTGRES=postgres:15 IMAGE_NGINX=nginx:1.26 # Docker image for pwgen -IMAGE_PWGEN=letsfiware/pwgen:0.39.0 +IMAGE_PWGEN=letsfiware/pwgen:0.40.0 # # Firewall (firewalld) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a6e66a70..a37bfad9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,7 +2,7 @@ Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. Please send a pull request to -the `v0.39.0-next` branch. +the `v0.40.0-next` branch. ## Types of changes @@ -23,7 +23,7 @@ merging your code._ - \[ \] I have read the [CONTRIBUTING](https://github.com/lets-fiware/FIWARE-Big-Bang/blob/main/CONTRIBUTING.md) doc - \[ \] I have signed the [CLA](https://github.com/lets-fiware/FIWARE-Big-Bang/blob/main/FIWARE-Big-Bang-individual-cla.pdf) - \[ \] I have updated the change log (CHANGELOG.md) -- \[ \] I send this pull request to the `v0.39.0-next` branch. +- \[ \] I send this pull request to the `v0.40.0-next` branch. - \[ \] I have added tests that prove my fix is effective or that my feature works - \[ \] I have added necessary documentation (if appropriate) - \[ \] Any dependent changes have been merged and published in downstream modules diff --git a/CHANGELOG.md b/CHANGELOG.md index a660b2df..394521a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## FIWARE Big Bang v0.40.0 - 21 June, 2024 + +- Update Node-RED to 4.0.0 (#395) +- Add cross-origin resource sharing for Orion (#394) +- Fix maintenance script (#393) + ## FIWARE Big Bang v0.39.0 - 09 June, 2024 - Update Mongodb to 6.0 for Orion (#389) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 69ecae64..5819b91a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ If you don't see your idea listed, and you think it fits into the goals of this - **If your contribution is minor,** such as a typo fix, open a pull request. - **If your contribution is major,** such as a new guide, start by opening an issue first. That way, other people can weigh in on the discussion before you do any work. -- Send a pull request to the `v0.39.0-next` branch (not main branch). +- Send a pull request to the `v0.40.0-next` branch (not main branch). ## Community diff --git a/README.ja.md b/README.ja.md index 5392e0e4..71cab843 100644 --- a/README.ja.md +++ b/README.ja.md @@ -90,13 +90,13 @@ FI-BB は FIWARE Big Bang の略名です。 FIWARE Big Bang の tar.gz ファイルをダウンロードします。 ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Big-Bang/releases/download/v0.39.0/FIWARE-Big-Bang-0.39.0.tar.gz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Big-Bang/releases/download/v0.40.0/FIWARE-Big-Bang-0.40.0.tar.gz | tar zxf - ``` -`FIWARE-Big-Bang-0.39.0` ディレクトリに移動します。 +`FIWARE-Big-Bang-0.40.0` ディレクトリに移動します。 ```bash -cd FIWARE-Big-Bang-0.39.0/ +cd FIWARE-Big-Bang-0.40.0/ ``` 独自のドメイン名とパブリック IP アドレスを指定して、`lets-fiware.sh` スクリプトを実行します。 diff --git a/README.md b/README.md index 9ac628f7..64f61e15 100644 --- a/README.md +++ b/README.md @@ -92,13 +92,13 @@ or CNAME records. Download a tar.gz file for the FIWARE Big Bang. ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Big-Bang/releases/download/v0.39.0/FIWARE-Big-Bang-0.39.0.tar.gz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Big-Bang/releases/download/v0.40.0/FIWARE-Big-Bang-0.40.0.tar.gz | tar zxf - ``` -Move to the `FIWARE-Big-Bang-0.39.0` directory. +Move to the `FIWARE-Big-Bang-0.40.0` directory. ```bash -cd FIWARE-Big-Bang-0.39.0/ +cd FIWARE-Big-Bang-0.40.0/ ``` Run the `lets-fiware.sh` script with your own domain name and a public IP address. diff --git a/SECURITY.md b/SECURITY.md index 7f07de95..1056960b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,8 +4,8 @@ | Version | Supported | | -------- | ------------------ | -| 0.39.0 | :white_check_mark: | -| < 0.39.0 | :x: | +| 0.40.0 | :white_check_mark: | +| < 0.40.0 | :x: | ## Reporting a Vulnerability diff --git a/VERSION b/VERSION index f9e8a4ef..a575e549 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -VERSION=0.39.0 +VERSION=0.40.0 diff --git a/config.sh b/config.sh index 213a7b9d..0628311d 100755 --- a/config.sh +++ b/config.sh @@ -27,7 +27,7 @@ IDM_DEBUG=false IMAGE_KEYROCK=letsfiware/fiware-idm:8.4.0 # Docker image for Postfix -IMAGE_POSTFIX=letsfiware/postfix:0.39.0 +IMAGE_POSTFIX=letsfiware/postfix:0.40.0 # # Wilma @@ -48,6 +48,31 @@ ORION=orion # Expose port 1026 (none, local, all) Default: none ORION_EXPOSE_PORT= +# Enable cross-origin resource sharing (CORS) Default: false +ORION_CORS= + +# Set Access-Control-Allow-Origin header for CORS +# Default: '*' +set -f +ORION_ACCESS_CONTROL_ALLOW_ORIGIN= +set +f + +# Set Access-Control-Allow-Methods header for CORS +# Default: 'GET, POST, OPTIONS, DELETE, PUT, PATCH' +ORION_ACCESS_CONTROL_ALLOW_METHODS= + +# Set Access-Control-Allow-Headers header for CORS +# Default: 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' +ORION_ACCESS_CONTROL_ALLOW_HEADERS= + +# Set Access-Control-Expose-Headers header for CORS +# Default: 'location, fiware-correlator' +ORION_CONTROL_EXPOSE_HEADERS= + +# Set Access-Control-Max-Age header for CORS +# Default: 7200 +ORION_ACCESS_CONTROL_MAX_AGE= + # Docker image for Orion IMAGE_ORION=telefonicaiot/fiware-orion:4.0.0 @@ -338,7 +363,7 @@ NODE_RED_LOGGING_METRICS= NODE_RED_LOGGING_AUDIT= # Docker image for Node-RED -IMAGE_NODE_RED=letsfiware/node-red:0.39.0 +IMAGE_NODE_RED=letsfiware/node-red:0.40.0 # # Grafana @@ -364,7 +389,7 @@ ZEPPELIN= ZEPPELIN_DEBUG= # Docker image for Zeppelin -IMAGE_ZEPPELIN=letsfiware/zeppelin:0.39.0 +IMAGE_ZEPPELIN=letsfiware/zeppelin:0.40.0 # # Queryproxy @@ -376,7 +401,7 @@ QUERYPROXY= QUERYPROXY_LOGLEVEL=info # Docker image for Queryproxy -IMAGE_QUERYPROXY=letsfiware/queryproxy:0.39.0 +IMAGE_QUERYPROXY=letsfiware/queryproxy:0.40.0 # # Tokenproxy @@ -388,7 +413,7 @@ TOKENPROXY_LOGLEVEL=info TOKENPROXY_VERBOSE= # Docker image for Tokenproxy -IMAGE_TOKENPROXY=letsfiware/tokenproxy:0.39.0 +IMAGE_TOKENPROXY=letsfiware/tokenproxy:0.40.0 # # Regproxy @@ -427,7 +452,7 @@ REGPROXY_LOGLEVEL=info REGPROXY_VERBOSE=false # Docker image for Regproxy -IMAGE_REGPROXY=letsfiware/regproxy:0.39.0 +IMAGE_REGPROXY=letsfiware/regproxy:0.40.0 # # MongoDB @@ -463,7 +488,7 @@ IMAGE_POSTGRES=postgres:15 IMAGE_NGINX=nginx:1.26 # Docker image for pwgen -IMAGE_PWGEN=letsfiware/pwgen:0.39.0 +IMAGE_PWGEN=letsfiware/pwgen:0.40.0 # # Firewall (firewalld) diff --git a/docs/en/installation/index.md b/docs/en/installation/index.md index 927437c4..eb32f69a 100644 --- a/docs/en/installation/index.md +++ b/docs/en/installation/index.md @@ -92,13 +92,13 @@ or CNAME records. Download a tar.gz file for the FIWARE Big Bang. ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Big-Bang/releases/download/v0.39.0/FIWARE-Big-Bang-0.39.0.tar.gz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Big-Bang/releases/download/v0.40.0/FIWARE-Big-Bang-0.40.0.tar.gz | tar zxf - ``` -Move to the `FIWARE-Big-Bang-0.39.0` directory. +Move to the `FIWARE-Big-Bang-0.40.0` directory. ```bash -cd FIWARE-Big-Bang-0.39.0/ +cd FIWARE-Big-Bang-0.40.0/ ``` Run the `lets-fiware.sh` script with your own domain name and a public IP address. diff --git a/docs/en/installation/orion.md b/docs/en/installation/orion.md index 3e94e782..57c3d34e 100644 --- a/docs/en/installation/orion.md +++ b/docs/en/installation/orion.md @@ -15,10 +15,16 @@ You can specify configurations by editing the `config.sh` file. -| Variable name | Description | Default value | -| ------------------- | ------------------------------------- | ------------- | -| ORION | A sub-domain name of Orion. | orion | -| ORION\_EXPOSE\_PORT | Expose port 1026. (none, local, all) | none | +| Variable name | Description | Default value | +| -------------------------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| ORION | A sub-domain name of Orion. | orion | +| ORION\_EXPOSE\_PORT | Expose port 1026. (none, local, all) | none | +| ORION\_CORS | Enable cross-origin resource sharing (CORS) | false | +| ORION\_ACCESS\_CONTROL\_ALLOW\_ORIGIN | Set Access-Control-Allow-Origin header for CORS | '\*' | +| ORION\_ACCESS\_CONTROL\_ALLOW\_METHODS | Set Access-Control-Allow-Methods header for CORS | 'GET, POST, OPTIONS, DELETE, PUT, PATCH' | +| ORION\_ACCESS\_CONTROL\_ALLOW\_HEADERS | Set Access-Control-Allow-Headers header for CORS | 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' | +| ORION\_CONTROL\_EXPOSE\_HEADERS | Set Access-Control-Expose-Headers header for CORS | 'location, fiware-correlator' | +| ORION\_ACCESS\_CONTROL\_MAX\_AGE | Set Access-Control-Max-Age header for CORS | 7200 | ## How to setup diff --git a/docs/ja/installation/index.md b/docs/ja/installation/index.md index e5fb7c4d..3c288c11 100644 --- a/docs/ja/installation/index.md +++ b/docs/ja/installation/index.md @@ -100,13 +100,13 @@ FIWARE Big Bang によってインストールされた Web アプリケーシ FIWARE Big Bang の tar.gz ファイルをダウンロードします。 ```bash -curl -sL https://github.com/lets-fiware/FIWARE-Big-Bang/releases/download/v0.39.0/FIWARE-Big-Bang-0.39.0.tar.gz | tar zxf - +curl -sL https://github.com/lets-fiware/FIWARE-Big-Bang/releases/download/v0.40.0/FIWARE-Big-Bang-0.40.0.tar.gz | tar zxf - ``` -`FIWARE-Big-Bang-0.39.0` ディレクトリに移動します。 +`FIWARE-Big-Bang-0.40.0` ディレクトリに移動します。 ```bash -cd FIWARE-Big-Bang-0.39.0/ +cd FIWARE-Big-Bang-0.40.0/ ``` 独自のドメイン名とパブリック IP アドレスを指定して、`lets-fiware.sh` スクリプトを実行します。 diff --git a/docs/ja/installation/orion.md b/docs/ja/installation/orion.md index 6c596a7e..0a6a003d 100644 --- a/docs/ja/installation/orion.md +++ b/docs/ja/installation/orion.md @@ -17,10 +17,16 @@ `config.sh` ファイルを編集して構成を指定できます。 -| 変数名 | 説明 | 既定値 | -| ------------------- | ---------------------------------------------------- | ------ | -| ORION | Orion のサブドメイン名 | orion | -| ORION\_EXPOSE\_PORT | Orion のポート 1026 を公開。(none, local または all) | none | +| 変数名 | 説明 | 既定値 | +| -------------------------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| ORION | Orion のサブドメイン名 | orion | +| ORION\_EXPOSE\_PORT | Orion のポート 1026 を公開。(none, local または all) | none | +| ORION\_CORS | Cross-origin resource sharing (CORS) を有効化 | false | +| ORION\_ACCESS\_CONTROL\_ALLOW\_ORIGIN | CORS の Access-Control-Allow-Origin ヘッダを設定 | '\*' | +| ORION\_ACCESS\_CONTROL\_ALLOW\_METHODS | CORS の Access-Control-Allow-Methods ヘッダを設定 | 'GET, POST, OPTIONS, DELETE, PUT, PATCH' | +| ORION\_ACCESS\_CONTROL\_ALLOW\_HEADERS | CORS の Access-Control-Allow-Headers ヘッダを設定 | 'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath' | +| ORION\_CONTROL\_EXPOSE\_HEADERS | CORS の Access-Control-Expose-Headers ヘッダを設定 | 'location, fiware-correlator' | +| ORION\_ACCESS\_CONTROL\_MAX\_AGE | CORS の Access-Control-Max-Age header ヘッダを設定 | 7200 | diff --git a/extras/node-red/Dockerfile b/extras/node-red/Dockerfile index ce2503e8..24d137f1 100644 --- a/extras/node-red/Dockerfile +++ b/extras/node-red/Dockerfile @@ -1,4 +1,4 @@ -FROM nodered/node-red:3.1.9 +FROM nodered/node-red:4.0.0 # # Add node modules for Node-RED diff --git a/lets-fiware.sh b/lets-fiware.sh index fbda62d9..5ecf9c86 100755 --- a/lets-fiware.sh +++ b/lets-fiware.sh @@ -28,7 +28,7 @@ set -Ceuo pipefail -VERSION=0.39.0 +VERSION=0.40.0 # # Syslog info @@ -124,6 +124,10 @@ set_default_values() { ORION_EXPOSE_PORT=none fi + if [ -z "${ORION_CORS=}" ]; then + ORION_CORS=false + fi + if [ -z "${ORION_LD_EXPOSE_PORT}" ]; then ORION_LD_EXPOSE_PORT=none fi @@ -1958,6 +1962,30 @@ EOF create_nginx_conf "${ORION}" "nginx-orion" + if "${ORION_CORS}"; then + set -f + if [ -z ${ORION_ACCESS_CONTROL_ALLOW_ORIGIN} ]; then + ORION_ACCESS_CONTROL_ALLOW_ORIGIN="'*'" + fi + : ${ORION_ACCESS_CONTROL_ALLOW_METHODS:="'GET, POST, OPTIONS, DELETE, PUT, PATCH'"} + : ${ORION_ACCESS_CONTROL_ALLOW_HEADERS:="'Origin, Content-Type, Accept, Authorization, X-Requested-With, fiware-service, fiware-servicepath'"} + : ${ORION_CONTROL_EXPOSE_HEADERS:="'location, fiware-correlator'"} + : ${ORION_ACCESS_CONTROL_MAX_AGE:=7200} + + sed -i \ + -e "/__NGINX_ORION_CORS_HEADERS__/r ${SETUP_DIR}/template/nginx/nginx-orion-cors-headers" \ + -e "/__NGINX_ORION_CORS_REQUEST_METHOD__/r ${SETUP_DIR}/template/nginx/nginx-orion-cors-request-method" \ + "${NGINX_SITES}/${ORION}" + sed -i \ + -e "s/ORION_ACCESS_CONTROL_ALLOW_ORIGIN/${ORION_ACCESS_CONTROL_ALLOW_ORIGIN}/" \ + -e "s/ORION_ACCESS_CONTROL_ALLOW_METHODS/${ORION_ACCESS_CONTROL_ALLOW_METHODS}/" \ + -e "s/ORION_ACCESS_CONTROL_ALLOW_HEADERS/${ORION_ACCESS_CONTROL_ALLOW_HEADERS}/" \ + -e "s/ORION_CONTROL_EXPOSE_HEADERS/${ORION_CONTROL_EXPOSE_HEADERS}/" \ + -e "s/ORION_ACCESS_CONTROL_MAX_AGE/${ORION_ACCESS_CONTROL_MAX_AGE}/" \ + "${NGINX_SITES}/${ORION}" + set +f + fi + add_nginx_depends_on "orion" add_rsyslog_conf "orion" @@ -3648,7 +3676,7 @@ setup_end() { sed -i -e "/# __NGINX_KEYROCK__/d" "${NGINX_SITES}/${KEYROCK}" fi if [ -n "${ORION}" ]; then - sed -i -e "/# __NGINX_ORION__/d" "${NGINX_SITES}/${ORION}" + sed -i -e "/# __NGINX_ORION_/d" "${NGINX_SITES}/${ORION}" fi if [ -n "${ORION_LD}" ]; then sed -i -e "/# __NGINX_ORION_LD__/d" "${NGINX_SITES}/${ORION_LD}" diff --git a/maintenance/release.sh b/maintenance/release.sh index be1e48a7..da402957 100755 --- a/maintenance/release.sh +++ b/maintenance/release.sh @@ -129,6 +129,8 @@ sed -i -e "s/postfix:${VER_SED}/postfix:${VER_SED}-next/" config.sh sed -i -e "s/zeppelin:${VER_SED}/zeppelin:${VER_SED}-next/" config.sh sed -i -e "s/pwgen:${VER_SED}/pwgen:${VER_SED}-next/" config.sh +cp -a config.sh .config.sh + git add . git commit -m "Bump: ${VER} -> ${VER}-next" git push origin "release/${VER}_next" diff --git a/maintenance/version-up.sh b/maintenance/version-up.sh index 4e06944a..562d17b6 100755 --- a/maintenance/version-up.sh +++ b/maintenance/version-up.sh @@ -30,6 +30,8 @@ version_up() { sed -i -e "s/${OLD}-next/${NEW}-next/" "${FIBB_HOME}/.github/pull_request_template.md" sed -i -e "s/${OLD}-next/${NEW}-next/" "${FIBB_HOME}/CONTRIBUTING.md" sed -i -e "s/${OLD}/${NEW}/" "${FIBB_HOME}/SECURITY.md" + + cp -a "${FIBB_HOME}/config.sh" "${FIBB_HOME}/.config.sh" git add . git commit -m "Bump: ${OLD}-next -> ${NEW}" @@ -61,6 +63,8 @@ next_version() { sed -i -e "s/zeppelin:${VER}/zeppelin:${VER}-next/" "${FIBB_HOME}/config.sh" sed -i -e "s/pwgen:${VER}/pwgen:${VER}-next/" "${FIBB_HOME}/config.sh" + cp -a "${FIBB_HOME}/config.sh" "${FIBB_HOME}/.config.sh" + git add . git commit -m "Bump: ${VER} -> ${VER}-next" git push origin "${BRANCH}" diff --git a/setup/docker/node-red/Dockerfile b/setup/docker/node-red/Dockerfile index 15fb6f3a..30dc6d26 100644 --- a/setup/docker/node-red/Dockerfile +++ b/setup/docker/node-red/Dockerfile @@ -1,4 +1,4 @@ -FROM nodered/node-red:3.1.9 +FROM nodered/node-red:4.0.0 # # Add node modules for Node-RED diff --git a/setup/template/nginx/nginx-orion b/setup/template/nginx/nginx-orion index 15c4a84f..207264f3 100644 --- a/setup/template/nginx/nginx-orion +++ b/setup/template/nginx/nginx-orion @@ -31,7 +31,9 @@ server { add_header Front-End-Https on; add_header Strict-Transport-Security 'max-age=15768000; includeSubdomains; always'; + # __NGINX_ORION_CORS_HEADERS__ location / { + # __NGINX_ORION_CORS_REQUEST_METHOD__ set $req_uri "$uri"; auth_request /_check_oauth2_token; diff --git a/setup/template/nginx/nginx-orion-cors-headers b/setup/template/nginx/nginx-orion-cors-headers new file mode 100644 index 00000000..83abc1d9 --- /dev/null +++ b/setup/template/nginx/nginx-orion-cors-headers @@ -0,0 +1,6 @@ + # Add CORS Headers + add_header 'Access-Control-Allow-Origin' ORION_ACCESS_CONTROL_ALLOW_ORIGIN; + add_header 'Access-Control-Allow-Methods' ORION_ACCESS_CONTROL_ALLOW_METHODS; + add_header 'Access-Control-Allow-Headers' ORION_ACCESS_CONTROL_ALLOW_HEADERS; + add_header 'Access-Control-Expose-Headers' ORION_CONTROL_EXPOSE_HEADERS; + diff --git a/setup/template/nginx/nginx-orion-cors-request-method b/setup/template/nginx/nginx-orion-cors-request-method new file mode 100644 index 00000000..76cad5cd --- /dev/null +++ b/setup/template/nginx/nginx-orion-cors-request-method @@ -0,0 +1,11 @@ + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' ORION_ACCESS_CONTROL_ALLOW_ORIGIN; + add_header 'Access-Control-Allow-Methods' ORION_ACCESS_CONTROL_ALLOW_METHODS; + add_header 'Access-Control-Allow-Headers' ORION_ACCESS_CONTROL_ALLOW_HEADERS; + add_header 'Access-Control-Expose-Headers' ORION_CONTROL_EXPOSE_HEADERS; + add_header 'Access-Control-Max-Age' ORION_ACCESS_CONTROL_MAX_AGE; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } + diff --git a/tests/script/coverage.sh b/tests/script/coverage.sh index 2f365e1f..1d829431 100755 --- a/tests/script/coverage.sh +++ b/tests/script/coverage.sh @@ -253,6 +253,7 @@ install_test1() { sudo apt remove -y rsyslog sed -i -e "s/^\(ORION_EXPOSE_PORT=\).*/\1local/" config.sh + sed -i -e "s/^\(ORION_CORS=\).*/\1true/" config.sh sed -i -e "s/^\(CYGNUS=\).*/\1cygnus/" config.sh sed -i -e "s/^\(COMET=\).*/\1comet/" config.sh sed -i -e "s/^\(QUANTUMLEAP=\).*/\1quantumleap/" config.sh