Skip to content

Commit 2ff1971

Browse files
author
Vadim Bogulean
committed
Make build artifacts (ver) immutable
1 parent f2a5e78 commit 2ff1971

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
POSTGRES_PASSWORD="postgres_password"
22
FCDB_USER="fastcve_db_user"
33
FCDB_PASS="fastcve_db_pass"
4-
FASTCVE_DOCKER_IMG="binareio/fastcve"
4+
FASTCVE_DOCKER_IMG="binare/fastcve"
55
FASTCVE_DOCKER_TAG="latest"
66
NVD_API_KEY=

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM postgres:16-alpine3.19
22

3-
ARG APP_VERSION=0.1.0
3+
ARG APP_VERSION=notset
44

5-
ENV APP_VERSION=${APP_VERSION} FCDB_HOME=/fastcve FCDB_NAME=vuln_db POSTGRES_PASSWORD= FCDB_USER= FCDB_PASS=
5+
ENV FCDB_HOME=/fastcve FCDB_NAME=vuln_db POSTGRES_PASSWORD= FCDB_USER= FCDB_PASS=
66
ENV PATH=${FCDB_HOME}:$PATH
77

88
RUN apk add gcc g++ build-base python3-dev py3-pip
@@ -17,6 +17,8 @@ COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
1717
COPY ./start_web.sh /always-init.d/start_web.sh
1818
COPY ./src ${FCDB_HOME}
1919

20+
RUN sed -i "1i\export APP_VERSION=${APP_VERSION}" ${FCDB_HOME}/config/setenv/setenv_*
21+
2022
RUN mkdir -p ${FCDB_HOME}/logs && chmod +wx ${FCDB_HOME}/logs \
2123
&& chmod +x ${FCDB_HOME}/db/setup_db.sh \
2224
&& chmod +x ${FCDB_HOME}/db/schema.sh \

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
dockerfile: $PWD/Dockerfile
1515

1616
args:
17-
APP_VERSION: ${FASTCVE_DOCKER_TAG:-0.1.0}
17+
APP_VERSION: ${FASTCVE_DOCKER_TAG:-notset}
1818

1919
environment:
2020
- INP_ENV_NAME=${INP_ENV_NAME}

src/search

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ $ search --help
1111
Copyright (c) 2020 to date, Binare Oy (license@binare.io) All rights reserved.
1212
"""
1313

14+
import os
1415
import logging
1516
import pydantic_argparse
1617
import argcomplete
@@ -21,8 +22,8 @@ from common.models import SearchOptions
2122
from common.util import init_db_schema
2223
from common.search import search_data, results_output
2324

24-
__version__ = '1.0.0'
25-
__description__ = "fastCVE - fast, rich and API-based search for CVE and more (CPE, CWE, CAPEC)"
25+
__version__ = os.getenv("APP_VERSION", "modified")
26+
__description__ = "FastCVE - fast, rich and API-based search for CVE and more (CPE, CWE, CAPEC)"
2627

2728
# ------------------------------------------------------------------------------
2829
def main():

src/web/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from web.models.search import StatusOutput
88
import os
99

10-
version = os.getenv("APP_VERSION", "0.1.0")
10+
version = os.getenv("APP_VERSION", "modified")
1111
app = FastAPI(title="FastCVE", description="Fast, Rich and API-based search for CVE and more (CPE, CWE, CAPEC)", version=version)
1212

1313

0 commit comments

Comments
 (0)