Skip to content

Commit 4677f70

Browse files
authored
Merge pull request #569 from vbisserie/dev/docker
Docker: set STATIC_ROOT to /var/vulnerablecode/static/ Signed-off-by: Philippe Ombredanne <[email protected]>
2 parents 6de9ed2 + 28d1e3e commit 4677f70

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

README.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ incarnations of a package. Being specific increases the accuracy and validity
5757
of the data as the same version of an upstream package across different
5858
ecosystems may or may not be vulnerable to the same vulnerability.
5959

60-
The packages are identified using Package URL `PURL
60+
The packages are identified using Package URL `PURL
6161
<https://github.com/package-url/purl-spec>`__ as primary identifiers rather than
6262
CPEs. This makes answers to questions such as "Is package foo vulnerable
6363
to vulnerability bar?" much more accurate and easy to interpret.
@@ -68,7 +68,7 @@ The primary access to the data is through a REST API.
6868
In addition, an emerging web interface goal is to support vulnerabilities data
6969
browsing and search and progressively to enable community curation of the data
7070
with the addition of new packages and vulnerabilities, and reviewing and
71-
updating their relationships.
71+
updating their relationships.
7272

7373
We also plan to mine for vulnerabilities which didn't receive any
7474
exposure due to various reasons like but not limited to the complicated
@@ -102,6 +102,7 @@ TL;DR
102102
103103
git clone https://github.com/nexB/vulnerablecode.git && cd vulnerablecode
104104
make envfile
105+
docker-compose build
105106
docker-compose up
106107
107108
Go to http://localhost:8000/ on a web browser to access the web UI.
@@ -121,7 +122,7 @@ On Debian-based distros, these can be installed with::
121122
sudo apt-get install python3-venv python3-dev postgresql libpq-dev build-essential
122123

123124

124-
**Database configuration**
125+
**Database configuration**
125126

126127
- Create a user named ``vulnerablecode``. Use ``vulnerablecode`` as password
127128
when prompted::
@@ -138,7 +139,7 @@ On Debian-based distros, these can be installed with::
138139
**Application dependencies**
139140

140141
Create a virtualenv, install dependencies, generate static files and run the database migrations::
141-
142+
142143
make envfile
143144
python3 -m venv venv
144145
source venv/bin/activate
@@ -164,11 +165,11 @@ You can specify several hosts by separating them with a comma (`,`)
164165
Using Nix
165166
~~~~~~~~~
166167

167-
You can install VulnerableCode with `Nix <https://nixos.org/download.html>`__
168+
You can install VulnerableCode with `Nix <https://nixos.org/download.html>`__
168169
(`Flake <https://nixos.wiki/wiki/Flakes>`__ support is needed)::
169170

170171
cd etc/nix
171-
nix-shell -p nixFlakes --run "nix --print-build-logs flake check " # build & run tests
172+
nix-shell -p nixFlakes --run "nix --print-build-logs flake check " # build & run tests
172173

173174
There are several options to use the Nix version::
174175

@@ -223,8 +224,8 @@ If you are running behind a proxy, you will need to setup the standard ``https_p
223224

224225
export https_proxy=https?://<proxy>:<port>
225226

226-
See `GitHub docs
227-
<https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token>`_
227+
See `GitHub docs
228+
<https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token>`_
228229
for instructions on how to obtain your GitHub token.
229230

230231
To run all data importers use::
@@ -237,7 +238,7 @@ To list available importers use::
237238

238239
To run specific importers::
239240

240-
python manage.py import rust npm
241+
python manage.py import rust npm
241242

242243

243244
REST API access

docker.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ POSTGRES_PASSWORD=vulnerablecode
44

55
DJANGO_SETTINGS_MODULE=vulnerablecode.settings
66
VULNERABLECODE_DB_HOST=db
7+
VULNERABLECODE_STATIC_ROOT=/var/vulnerablecode/static/
78

89
GUNICORN_SERVER=vulnerablecode

vulnerablecode/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
# Static files (CSS, JavaScript, Images)
123123

124124
STATIC_URL = "/static/"
125-
STATIC_ROOT = "./"
125+
STATIC_ROOT = env.str("VULNERABLECODE_STATIC_ROOT", "./")
126126

127127
STATICFILES_DIRS = [
128128
str(PROJECT_DIR.joinpath("static")),

0 commit comments

Comments
 (0)