Skip to content

Commit

Permalink
0.3.x: Fix OpenSSL issue (#1337)
Browse files Browse the repository at this point in the history
* Fix OpenSSL issue

* OpenSSL issue in labextension

* Remove openssl pinning

* Iterate

* Wut

* Fix ui-test env

* Linter

* Iterate
  • Loading branch information
martinRenou committed Jun 23, 2023
1 parent c736653 commit 3dd92da
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs==16.19.0 yarn==1 flake8 ipywidgets matplotlib xeus-cling openssl=1.1.1l "traitlets>=5.0.3,<6"
run: mamba install -q python=3.9 pip jupyterlab_pygments=0.1.0 pytest-cov pytest-rerunfailures nodejs=16.19.0 yarn=1 flake8 ipywidgets matplotlib xeus-cling traitlets=5

- name: Install Dependencies
shell: bash -l {0}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs==16.19.0 yarn==1 flake8 ipywidgets matplotlib xeus-cling openssl=1.1.1l "traitlets>=5.0.3,<6"
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments=0.1.0 pytest-cov pytest-rerunfailures nodejs=16 yarn=1 flake8 ipywidgets matplotlib xeus-cling traitlets=5

- name: Install dependencies
shell: bash -l {0}
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs yarn flake8 ipywidgets matplotlib xeus-cling openssl=1.1.1l "traitlets>=5.0.3,<6"
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments=0.1.0 pytest-cov pytest-rerunfailures nodejs=16 yarn=1 flake8 ipywidgets matplotlib xeus-cling traitlets=5

- name: Install dependencies
shell: bash -l {0}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/ui-tests.yml
Expand Up @@ -2,6 +2,10 @@ name: UI Tests

on: [push, pull_request]

defaults:
run:
shell: bash -l {0}

jobs:
ui-tests:
name: Visual Regression
Expand All @@ -17,6 +21,15 @@ jobs:
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Setup mamba
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge

- name: Create the conda environment
run: mamba install -q python=3.9 pip jupyterlab_pygments=0.1.0 pytest-cov pytest-rerunfailures nodejs=16.19.0 yarn=1 flake8 ipywidgets matplotlib xeus-cling traitlets=5

- name: Install dependencies
run: |
python -m pip install --upgrade ".[test,visual_test]"
Expand Down
1 change: 1 addition & 0 deletions packages/jupyterlab-preview/package.json
Expand Up @@ -72,6 +72,7 @@
},
"jupyterlab": {
"extension": true,
"webpackConfig": "webpack.lab.config.js",
"schemaDir": "schema",
"outputDir": "../../voila/labextension",
"discovery": {
Expand Down
6 changes: 6 additions & 0 deletions packages/jupyterlab-preview/webpack.lab.config.js
@@ -0,0 +1,6 @@
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm === 'md4' ? 'sha256' : algorithm);
7 changes: 7 additions & 0 deletions packages/voila/webpack.config.js
@@ -1,5 +1,12 @@
var path = require('path');

const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm === 'md4' ? 'sha256' : algorithm);

var rules = [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
// required to load font-awesome
Expand Down

0 comments on commit 3dd92da

Please sign in to comment.