diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6af2d39d..52ad57fed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 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 yarn=1 flake8 ipywidgets matplotlib xeus-cling "traitlets>=5.0.3,<6" - name: Install dependencies shell: bash -l {0} @@ -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=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 yarn=1 flake8 ipywidgets matplotlib xeus-cling "traitlets>=5.0.3,<6" - name: Install dependencies shell: bash -l {0} diff --git a/packages/jupyterlab-preview/package.json b/packages/jupyterlab-preview/package.json index a13617cc5..19635570e 100644 --- a/packages/jupyterlab-preview/package.json +++ b/packages/jupyterlab-preview/package.json @@ -72,6 +72,7 @@ }, "jupyterlab": { "extension": true, + "webpackConfig": "webpack.lab.config.js", "schemaDir": "schema", "outputDir": "../../voila/labextension", "discovery": { diff --git a/packages/jupyterlab-preview/webpack.lab.config.js b/packages/jupyterlab-preview/webpack.lab.config.js new file mode 100644 index 000000000..e7a395519 --- /dev/null +++ b/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); diff --git a/packages/voila/package.json b/packages/voila/package.json index 2c9ed767d..bedcb4456 100644 --- a/packages/voila/package.json +++ b/packages/voila/package.json @@ -45,9 +45,9 @@ }, "style": "style/index.css", "scripts": { - "build": "npm run build:lib && webpack", + "build": "jlpm run build:lib && webpack", "build:lib": "tsc", - "build:prod": "npm run build:lib && webpack --production", + "build:prod": "jlpm run build:lib && webpack --production", "clean": "jlpm run clean:lib", "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "test": "echo \"Error: no test specified\" && exit 1", diff --git a/packages/voila/webpack.config.js b/packages/voila/webpack.config.js index 374574989..104660320 100644 --- a/packages/voila/webpack.config.js +++ b/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 diff --git a/voila/notebook_renderer.py b/voila/notebook_renderer.py index 4a0848cdf..a2de1ba91 100644 --- a/voila/notebook_renderer.py +++ b/voila/notebook_renderer.py @@ -306,7 +306,6 @@ async def _jinja_cell_generator(self, nb, kernel_id): await self._cleanup_resources() async def _cleanup_resources(self): - await ensure_async(self.executor.km.cleanup_resources()) await ensure_async(self.executor.kc.stop_channels()) async def load_notebook(self, path):