-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from rockychen-dpaw/master
Upgrade python & Customize singout page per domain
- Loading branch information
Showing
32 changed files
with
1,424 additions
and
1,241 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
name: "Build Docker image and run Trivy vulnerability scan" | ||
|
||
on: | ||
push: | ||
# Publish `master` as `latest` image. | ||
branches: [master] | ||
# Publish `2.*` tags as releases. | ||
tags: ['2.*'] | ||
pull_request: | ||
branches: [master] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
name: Build Docker image | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
security-events: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
flavor: | | ||
latest=true | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
scan: | ||
name: Trivy scan | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
permissions: | ||
contents: read | ||
packages: read | ||
security-events: write | ||
steps: | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
scan-type: image | ||
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
vuln-type: 'os,library' | ||
severity: 'HIGH,CRITICAL' | ||
format: template | ||
template: '@/contrib/sarif.tpl' | ||
output: trivy-results.sarif | ||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: trivy-results.sarif |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,19 +1,20 @@ | ||
# Prepare the base environment. | ||
FROM python:3.7.8-slim-buster as builder_base_authome | ||
FROM python:3.10.12-slim-buster as builder_base_authome | ||
MAINTAINER [email protected] | ||
LABEL org.opencontainers.image.source https://github.com/dbca-wa/authome | ||
RUN apt-get update -y \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install --no-install-recommends -y wget python3-dev \ | ||
&& apt-get install -y wget libmagic-dev gcc binutils python3-dev libpq-dev \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& pip install --upgrade pip | ||
|
||
#install and config poetry | ||
ENV POETRY_VERSION=1.0.5 | ||
RUN pip install "poetry==$POETRY_VERSION" | ||
WORKDIR /app | ||
COPY poetry.lock pyproject.toml ./ | ||
ENV POETRY_VERSION=1.5.1 | ||
RUN pip install "poetry==$POETRY_VERSION" | ||
COPY poetry.lock pyproject.toml /app/ | ||
RUN poetry config virtualenvs.create false \ | ||
&& poetry install --no-dev --no-interaction --no-ansi | ||
&& poetry install --only main --no-interaction --no-ansi | ||
|
||
# Install Python libs from pyproject.toml. | ||
FROM builder_base_authome as python_libs_authome | ||
|
@@ -64,7 +65,6 @@ fi \n\ | |
|
||
RUN chmod 555 run_command | ||
|
||
|
||
# Run the application as the www-data user. | ||
USER www-data | ||
EXPOSE 8080 | ||
|
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
Oops, something went wrong.