diff --git a/.github/workflows/delivery.yml b/.github/workflows/delivery.yml new file mode 100644 index 0000000..1730a6b --- /dev/null +++ b/.github/workflows/delivery.yml @@ -0,0 +1,43 @@ +name: Delivery + +on: + push: + branches: [ master ] + release: + # Note: a current limitation is that when a release is edited after publication, then the Docker tags are not automatically updated. + types: [ published ] + +permissions: + contents: write + packages: write + +jobs: + publish-docker-image: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=semver,pattern={{major}}.{{minor}}.{{patch}} + type=raw,value=edge + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build container and push to GitHub Container Registry + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/status-checks.yml b/.github/workflows/status-checks.yml new file mode 100644 index 0000000..865d490 --- /dev/null +++ b/.github/workflows/status-checks.yml @@ -0,0 +1,16 @@ +name: Status checks + +on: + push: + branches: [ master ] + pull_request: + # Make it possible to trigger the checks manually. + workflow_dispatch: + +jobs: + docker-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run Dockerfile build stage + run: docker build -t privacybydesign/irma-demos:build . diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 829c9e6..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,21 +0,0 @@ -image: privacybydesign/node_yarn:latest - -stages: - - build - -before_script: - - set -euxo pipefail - - apt-get update - - apt-get install -y --no-install-recommends php php-curl php-xml php-mbstring composer - - composer install - - yarn install - -build: - stage: build - script: - - ./build_artifacts.sh - artifacts: - # Disabling artifact expiry is not supported yet, so make - expire_in: 100 year - paths: - - build/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f36ae58 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM node:18 AS builder + +RUN apt-get update && apt-get install -y \ + php \ + php-cli \ + php-zip \ + unzip + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +WORKDIR /app + +COPY . . + +RUN composer install +RUN yarn install + +RUN chmod +x build_artifacts.sh +RUN ./build_artifacts.sh + +FROM php:8.0-apache + +COPY --from=builder /app/ /var/www/html/ + +RUN chown -R www-data:www-data /var/www/html \ + && chmod -R 755 /var/www/html + +RUN echo "Listen 8080" >> /etc/apache2/ports.conf + +EXPOSE 8080 \ No newline at end of file diff --git a/README.md b/README.md index 64da50a..68302da 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ This project is the combination of all demos hosted on https://privacybydesign.foundation/demo/. +## Preliminaries +Make sure you have an [IRMA server] (https://github.com/privacybydesign/irmago running. + + ### Install * Run `composer install` * Run `yarn install` @@ -9,6 +13,14 @@ This project is the combination of all demos hosted on https://privacybydesign.f * Follow the instructions in `data`. * Run ./build_artifacts.sh +### Install all the demos with Docker (Locally) +Alternatively, you can run the demos with Docker. +* Build the image with `docker build -t .`. Docker will run the necessary scripts to build the necessary +node packages and sets up a php server on port 8080. +* You need a Yivi server to be running on 8088. +* You can run the docker image you previously built with `docker run -d --network="host" `. The --network flag will make it possible to communicate with the locally running Yivi server. + + ### Adding a new demo Example when adding a demo called new-demo: * Make a new demo directory in the project root: `mkdir new-demo` diff --git a/config.php b/config.php index 950b7f1..737b5c3 100644 --- a/config.php +++ b/config.php @@ -1,7 +1,7 @@ + + + + + + + + Yivi Demos + + + + + +
+
+

+ This page describes different possible applications of Yivi, both for disclosing relevant information about yourself and for digital signing. With each of the buttons below, additional information is provided. Detailed + explanations are available. +

+
+
Log in with e-mail address
+
+ E-mail log in +
+ +
Yivi signatures for permissions and statements
+
+ Yivi signatures +
+ +
Submitting address information by automatic form-filling
+
+ Filling in address +
+ +
Verification whether someone is a student
+
+ Student check +
+ +
Age verification
+
+ 18+ check + Angry Games demo +
+ +
Registration and verification for watching movies online
+
+ YiviTube +
+ +
Chained Yivi sessions
+
+ YiviTube Premium +
+ +
Verification whether someone is being alive
+
+ Attestatio de vita demo +
+
+
+
+ + +