forked from ckan/ckan-docker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into Update-fairdatapoint-extension-
- Loading branch information
Showing
17 changed files
with
183 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# SPDX-FileCopyrightText: 2024 PNED G.I.E. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Scan Latest Two Semantically Versioned Image with Trivy and ORT | ||
|
||
on: | ||
schedule: | ||
- cron: "0 14 * * 1" # Works on every Monday at 14:00 UTC | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ghcr.io/genomicdatainfrastructure/gdi-userportal-ckan-docker | ||
LATEST_PATCHES: "" | ||
|
||
jobs: | ||
fetch-and-scan: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Docker | ||
run: sudo service docker start | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: List Docker Image Tags and Fetch Latest Two | ||
run: | | ||
IMAGE="ghcr.io/genomicdatainfrastructure/gdi-userportal-ckan-docker" | ||
echo "Fetching Docker image tags..." | ||
RESPONSE=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/orgs/genomicdatainfrastructure/packages/container/gdi-userportal-ckan-docker/versions") | ||
# Log the response for debugging | ||
echo "Response from curl: $RESPONSE" | ||
# Extract tags and creation dates, then sort by creation date | ||
TAGS_WITH_DATES=$(echo "$RESPONSE" | jq -r '.[] | .metadata.container.tags[] as $tag | select($tag | test("^sha-[a-z0-9]+$")) | "\($tag) \(.created_at)"' | sort -k2 -r) | ||
# Get the latest tag from each of the latest two minor versions | ||
LATEST_TAGS=$(echo "$TAGS_WITH_DATES" | awk '{split($1, a, "."); key=a[1] "." a[2]; if (!seen[key]++) print $1}' | head -n 2 | tr '\n' ' ') | ||
# Print the results | ||
echo "Tags fetched: $LATEST_TAGS" | ||
echo "LATEST_PATCHES=$LATEST_TAGS" >> $GITHUB_ENV | ||
- name: Pull and Scan Docker Images with Trivy | ||
run: | | ||
IFS=' ' read -ra TAGS <<< "${{ env.LATEST_PATCHES }}" | ||
for TAG in "${TAGS[@]}" | ||
do | ||
IMAGE_TAG="ghcr.io/genomicdatainfrastructure/gdi-userportal-ckan-docker:$TAG" | ||
echo "Pulling $IMAGE_TAG" | ||
docker pull $IMAGE_TAG || exit 1 | ||
echo "Scanning $IMAGE_TAG with Trivy" | ||
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock aquasec/trivy:latest image --severity CRITICAL,HIGH --exit-code 1 "$IMAGE_TAG" || exit 1 | ||
done | ||
- name: OSS Review Toolkit (ORT) Analysis | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.repository }} | ||
|
||
- uses: oss-review-toolkit/ort-ci-github-action@v1 | ||
with: | ||
allow-dynamic-versions: "true" | ||
fail-on: "issues" | ||
run: "cache-dependencies,cache-scan-results,labels,analyzer,evaluator,advisor,reporter,upload-results" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,4 @@ _service-provider/* | |
_solr/schema.xml | ||
_src/* | ||
local/* | ||
.env | ||
venv | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,6 @@ | |
|
||
FROM ckan/ckan-base:2.10.4 | ||
|
||
# Install any extensions needed by your CKAN instance | ||
# See Dockerfile.dev for more details and examples | ||
|
||
RUN pip3 install -e git+https://github.com/GenomicDataInfrastructure/[email protected]#egg=ckanext-gdi-userportal && \ | ||
pip3 install -r ${APP_DIR}/src/ckanext-gdi-userportal/requirements.txt | ||
|
||
|
@@ -72,7 +69,5 @@ COPY --chown=ckan:ckan setup/prerun.py ${APP_DIR} | |
# TODO | ||
# 1. Remove this command once the issue is fixed | ||
# https://github.com/ckan/ckan-docker-base/issues/41 | ||
RUN mkdir /var/lib/ckan/storage | ||
RUN mkdir /var/lib/ckan/storage/uploads | ||
RUN mkdir /var/lib/ckan/storage/uploads/group | ||
RUN chmod -R u+rwx "/var/lib/ckan" | ||
RUN mkdir -p /var/lib/ckan/storage/uploads/group && \ | ||
chmod -R u+rwx "/var/lib/ckan" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
ckan/docker-entrypoint.d/setup_default_user_permissions.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# SPDX-FileCopyrightText: 2024 PNED G.I.E. | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
# Update the config file with each extension config-options | ||
echo "[ckan.auth] Setting up config-options" | ||
ckan config-tool $CKAN_INI -s app:main \ | ||
"ckan.auth.create_user_via_api = False"\ | ||
"ckan.auth.create_user_via_web = False"\ | ||
"ckan.auth.user_create_groups = False"\ | ||
"ckan.auth.user_create_organizations = False"\ | ||
"ckan.auth.user_delete_groups = False"\ | ||
"ckan.auth.user_delete_organizations = False"\ | ||
"ckan.auth.anon_create_dataset = False"\ | ||
"ckan.auth.create_unowned_dataset = False"\ | ||
"ckan.auth.create_dataset_if_not_in_organization = False"\ | ||
"ckan.auth.roles_that_cascade_to_sub_groups = admin"\ | ||
"ckan.auth.public_user_details = False"\ | ||
"ckan.auth.public_activity_stream_detail = False"\ | ||
"ckan.auth.allow_dataset_collaborators = False"\ | ||
"ckan.auth.allow_admin_collaborators = False"\ | ||
"ckan.auth.allow_collaborators_to_change_owner_org = False"\ | ||
"ckan.auth.create_default_api_keys = False"\ | ||
"ckan.auth.reveal_private_datasets = False"\ | ||
"ckan.auth.enable_cookie_auth_in_api = False"\ | ||
"ckan.auth.route_after_login = home.index"\ | ||
"ckan.user_reset_landing_page = home.index"\ | ||
"ckan.upload.user.types = image"\ | ||
"ckan.upload.user.mimetypes = image/png image/jpeg"\ | ||
"ckan.upload.group.types = image text/svg"\ | ||
"ckan.upload.group.mimetypes = image/png text/svg image/svg+xml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-FileCopyrightText: 2024 PNED G.I.E. | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
|
||
echo "[DEFAULT] Setting up debug" | ||
#ckan config-tool $CKAN_INI -s DEFAULT "debug = $CKAN___DEBUG" | ||
|
||
echo "[logger_ckanext] Setting up level" | ||
#ckan config-tool $CKAN_INI -s logger_ckanext "level = $CKAN___LOGGER_CKANEXT__LEVEL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"packageRules": [ | ||
{ | ||
"depTypeList": ["devDependencies", "require-dev"], | ||
"updateTypes": ["patch", "minor", "major"], | ||
"groupName": "devDependencies" | ||
}, | ||
{ | ||
"description": "Trigger fix release for patch updates", | ||
"matchPackageNames": [ | ||
"renovate/renovate", | ||
"ghcr.io/renovatebot/renovate" | ||
], | ||
"automerge": true, | ||
"matchUpdateTypes": ["patch"], | ||
"semanticCommitType": "fix", | ||
"automergeType": "pr" | ||
} | ||
], | ||
"extends": [ | ||
"config:base", | ||
":preserveSemverRanges", | ||
":dependencyDashboard", | ||
":rebaseStalePrs", | ||
":enableVulnerabilityAlertsWithLabel('security')", | ||
"group:recommended" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SPDX-FileCopyrightText: 2024 PNED G.I.E. | ||
|
||
SPDX-License-Identifier: Apache-2.0 |
Submodule ckanext-gdi-userportal
updated
from 468453 to 761da4