Skip to content

Commit

Permalink
deployment: fix docker file
Browse files Browse the repository at this point in the history
* Fixes lxml conflict with uwsgi command for the deployment.
* Adds safety exceptions.
* Fixes some small cosmetics in the JSONSchemas.

Co-Authored-by: Johnny Mariéthoz <[email protected]>
  • Loading branch information
jma committed Jul 30, 2024
1 parent 11a6c67 commit ad3310a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 33 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
# and includes Pip, Pipenv, Node.js, NPM and some few standard libraries
# Invenio usually needs.

FROM python:3.9-slim-bullseye
FROM python:3.9-slim-bookworm

# require debian packages
RUN apt-get upgrade -y && apt-get update -y
RUN apt-get install --no-install-recommends -y git vim-tiny curl gcc g++ pkg-config gnupg libc6-dev libxml2-dev libxmlsec1-dev libxmlsec1-openssl xpdf xpdf-utils ghostscript imagemagick && rm -rf /var/lib/apt/lists/*
RUN apt-get install --no-install-recommends -y git vim-tiny curl gcc g++ pkg-config gnupg libc6-dev libxmlsec1-openssl xpdf xpdf-utils ghostscript imagemagick && rm -rf /var/lib/apt/lists/*
RUN sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<policy domain="coder" rights="read" pattern="PDF" \/>/g' /etc/ImageMagick-6/policy.xml
RUN pip install --upgrade wheel pip poetry

Expand Down
8 changes: 7 additions & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ fi
# Vulnerability ID: 70612
# -> Vulnerability found in flask-cors version 4.0.1
# Vulnerability ID: 70624
# -> Vulnerability found in werkzeug version 2.2.3
# Vulnerability ID: 71595
# -> Vulnerability found in werkzeug version 2.2.3
# Vulnerability ID: 71594
# -> Vulnerability found in urllib3 version 1.26.18
# Vulnerability ID: 71608

echo "Check vulnerabilities:"
safety_exceptions="-i 40459 -i 51668 -i 42194 -i 42852 -i 62019 -i 67599 -i 51457 -i 70624 -i 70612"
safety_exceptions="-i 40459 -i 51668 -i 42194 -i 42852 -i 62019 -i 67599 -i 51457 -i 70624 -i 70612 -i 71595 -i 71594 -i 71608"
msg=$(safety check -o text ${safety_exceptions}) || {
echo "Safety vulnerabilites found for packages:" $(safety check -o bare ${safety_exceptions})
echo "Run:" "safety check -o screen ${safety_exceptions} | grep -i vulnerability" "for more details"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,14 @@
"type": "object",
"properties": {
"$ref": {
"title": "Organisation",
"type": "string",
"pattern": "^https://sonar.ch/api/organisations/.*?$",
"minLength": 1,
"widget": {
"formlyConfig": {
"props": {
"hideLabel": true,
"remoteOptions": {
"type": "organisations"
}
Expand Down Expand Up @@ -2324,10 +2326,10 @@
}
},
"propertiesOrder": [
"organisation",
"documentType",
"title",
"language",
"organisation",
"projects",
"classification",
"abstracts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"description": {
"title": "Descriptions",
"type": "array",
"minItems": 1,
"items": {
"title": "Description",
"type": "object",
Expand Down Expand Up @@ -97,7 +96,6 @@
"footer": {
"title": "Footers",
"type": "array",
"minItems": 1,
"items": {
"title": "Footer",
"type": "object",
Expand Down Expand Up @@ -226,6 +224,7 @@
"widget": {
"formlyConfig": {
"type": "markdown",
"wrappers": ["form-field"],
"expressions": {
"hide": "!field.model.isDedicated"
},
Expand Down Expand Up @@ -520,13 +519,13 @@
"propertiesOrder": [
"name",
"code",
"description",
"arkNAAN",
"isShared",
"isDedicated",
"allowedIps",
"serverName",
"platformName",
"arkNAAN",
"allowedIps",
"description",
"footer",
"documentsCustomField1",
"documentsCustomField2",
Expand Down
41 changes: 19 additions & 22 deletions sonar/modules/users/jsonschemas/users/user-v1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@
"description": "Date in yyyy-mm-dd format, ex: 1970-01-01",
"type": "string",
"format": "date",
"pattern": "^[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$"
"pattern": "^[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$",
"widget": {
"formlyConfig": {
"type": "datepicker"
}
}
},
"email": {
"title": "Email",
Expand Down Expand Up @@ -91,6 +96,7 @@
},
"organisation": {
"type": "object",
"title": "Organisation",
"properties": {
"$ref": {
"title": "Organisation",
Expand All @@ -107,21 +113,20 @@
}
}
},
"required": [
"$ref"
]
"required": ["$ref"],
"widget": {
"formlyConfig": {
"props": {
"hideLabel": true
}
}
}
},
"role": {
"title": "Role",
"type": "string",
"minLength": 1,
"enum": [
"superuser",
"admin",
"moderator",
"submitter",
"user"
],
"enum": ["superuser", "admin", "moderator", "submitter", "user"],
"widget": {
"formlyConfig": {
"props": {
Expand Down Expand Up @@ -172,9 +177,7 @@
}
}
},
"required": [
"$ref"
]
"required": ["$ref"]
}
},
"propertiesOrder": [
Expand All @@ -190,11 +193,5 @@
"postal_code",
"city"
],
"required": [
"first_name",
"last_name",
"email",
"role",
"$schema"
]
}
"required": ["first_name", "last_name", "email", "role", "$schema"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
"funding_organisations": {
"title": "Funding organisations",
"type": "array",
"minItems": 0,
"minItems": 1,
"items": {
"title": "Funding organisation",
"type": "object",
Expand Down Expand Up @@ -316,6 +316,7 @@
"type": "object",
"properties": {
"$ref": {
"title": "Organisation",
"type": "string",
"pattern": "^https://sonar.ch/api/organisations/.*?$",
"widget": {
Expand All @@ -334,6 +335,9 @@
],
"widget": {
"formlyConfig": {
"props": {
"hideLabel": true
},
"expressions": {
"props.required": "true"
}
Expand Down Expand Up @@ -373,11 +377,11 @@
}
},
"propertiesOrder": [
"organisation",
"name",
"description",
"startDate",
"endDate",
"organisation",
"identifiedBy",
"investigators",
"funding_organisations"
Expand Down

0 comments on commit ad3310a

Please sign in to comment.