cabal firewall demo - michaelmworthington/codesamples GitHub Wiki
This page walks through the steps to set up NXRM and a Haskell Docker container to test Cabal Firewall using http://hackage.haskell.org/
See the community docs at https://github.com/sonatype-nexus-community/nexus-repository-cabal
- Prerequisites
- Step 1. Create a new Proxy Repository in NXRM
- Step 2. Enable Firewall for the New Proxy Repo
- Step 3. Run Docker Image for the Dependency Manager
- Step 4. Set the environment to download packages from NXRM
- Step 5. Install a package
- Step 6. Browse NXRM to view it
- Step 7. View the Firewall Report
- Step 8. Test Quarantine
- Step 9. Notes
- IQ Server installed and running
- NXRM 3 installed and running and configured with the IQ Server
- Docker for Mac installed and running
Use http://hackage.haskell.org/ as the Remote URL. Accept default values for the remainder of the settings.
docker run -it --rm haskell bash
unlike the centos image used in the Yum Firewall Demo, this image runs the 'maven' command when starting the container, rather than plain 'bash'. since i want to run a couple maven commands, force docker to run bash.
First run cabal user-config update
to create the config file. Then update ~/.cabal/config
to
repository cabal-hackage.haskell.org-proxy
url: http://host.docker.internal:8081/repository/cabal-hackage.haskell.org-proxy/
-- secure: False
-- root-keys:
-- key-threshold: 3
TIP: if needed, install vim
apt-get update
apt-get install vim
mkdir testproject
cd testproject
cabal update
cabal install titlecase
Observe the inbound requests to NXRM in the request.log file:
172.17.0.1 - - [12/Nov/2020:15:49:16 +0000] "GET /repository/cabal-hackage.haskell.org-proxy/00-index.tar.gz HTTP/1.1" 200 - 21342857 3956 "cabal-install/3.2.0.0 (linux; x86_64)" [qtp553156788-50]
172.17.0.1 - - [12/Nov/2020:15:49:41 +0000] "GET /repository/cabal-hackage.haskell.org-proxy/package/titlecase-1.0.1.tar.gz HTTP/1.1" 200 - 5210 798 "cabal-install/3.2.0.0 (linux; x86_64)" [qtp553156788-50]
Repo List
IQ Server Report
Not Supported |
---|
Not Supported |
---|