Skip to content
Snippets Groups Projects
Commit bf841d37 authored by Tögl, Christina's avatar Tögl, Christina
Browse files

Setup new app

Create a basic start page, disable welcome page and enable force-login.
parents
No related branches found
No related tags found
No related merge requests found
Pipeline #13204 failed
Showing with 491 additions and 0 deletions
/vendor/**
/dist/**
/*.js
\ No newline at end of file
{
"env": {
"browser": true,
"es6": true,
"mocha": true
},
"extends": ["eslint:recommended", "plugin:jsdoc/recommended"],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"no-unused-vars": ["error", { "args": "none" }],
"semi": [2, "always"],
"jsdoc/require-jsdoc": 0,
"jsdoc/require-param-description": 0,
"jsdoc/require-returns": 0,
"jsdoc/require-param-type": 0
}
}
\ No newline at end of file
dist
node_modules
.idea
npm-debug.log
.vscode
.cert
package-lock.json
\ No newline at end of file
image: registry.gitlab.tugraz.at/dbp/apps/checkin/main:v1
cache:
key: $CI_PROJECT_PATH
paths:
- _yarn_cache
before_script:
- "sed -i 's|git@gitlab.tugraz.at:dbp|../..|g' .gitmodules"
- git submodule sync
- git submodule update --init
- yarn config set cache-folder "$CI_PROJECT_DIR/_yarn_cache"
stages:
- test
- deploy
test:
stage: test
script:
- yarn install
- yarn run build-dev
- yarn run test-full
linting:
stage: test
allow_failure: true
script:
- yarn install
- yarn run lint
.deploy_defaults: &deploy_defaults
except:
- schedules
stage: deploy
script:
# Add ssh key
- mkdir -p ~/.ssh
- echo "${DEPLOY_KEY}" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -t rsa "${DEPLOY_HOST}" >> ~/.ssh/known_hosts
# Deploy
- dep deploy "${CI_ENVIRONMENT_NAME}"
- echo "Deployed to ${CI_ENVIRONMENT_URL}"
# Simple health check
- curl --max-time 10 --retry 3 --output /dev/null --silent --show-error --fail --location "${CI_ENVIRONMENT_URL}"
deploy_demo:
only:
refs:
- demo
environment:
name: demo
url: https://frontend-demo.tugraz.at/apps/checkin
variables:
DEPLOY_HOST: mw01-dev.tugraz.at
DEPLOY_KEY: "$DEPLOY_SSH_KEY"
<<: *deploy_defaults
deploy_development:
only:
refs:
- master
environment:
name: development
url: https://mw-frontend-dev.tugraz.at/apps/checkin
variables:
DEPLOY_HOST: mw01-dev.tugraz.at
DEPLOY_KEY: "$DEPLOY_SSH_KEY"
<<: *deploy_defaults
deploy_production:
only:
refs:
- production
environment:
name: production
url: https://checkin.tugraz.at
variables:
DEPLOY_HOST: mw01-prod.tugraz.at
DEPLOY_KEY: "$DEPLOY_SSH_KEY"
<<: *deploy_defaults
FROM debian:buster
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
# https://github.com/karma-runner/karma-firefox-launcher/issues/104
ENV MOZ_FORCE_DISABLE_E10S true
RUN apt-get update && apt-get install -y \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y \
nodejs \
yarn \
chromium \
# libgbm1: newer chromium from puppeteer
libgbm1 \
firefox-esr \
composer \
php-zip \
rsync \
sudo \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -u 1000 -ms /bin/bash user
RUN echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER user
WORKDIR /home/user
# Install deployer globally and add it to PATH
ENV COMPOSER_HOME="/home/user/.composer"
RUN mkdir -p "${COMPOSER_HOME}"
ADD composer.lock "${COMPOSER_HOME}"
ADD composer.json "${COMPOSER_HOME}"
RUN composer global install
ENV PATH "${COMPOSER_HOME}/vendor/bin:${PATH}"
\ No newline at end of file
* In case of an incompatible change increase the tag version number in build.sh
* ./build.sh
* (first time) sudo docker login registry.gitlab.tugraz.at
* sudo docker push registry.gitlab.tugraz.at/dbp/apps/checkin/main:v1
#!/bin/bash
set -e
TAG="registry.gitlab.tugraz.at/dbp/apps/checkin/main:v1"
sudo docker build --tag "${TAG}" --file "Dockerfile" .
sudo docker run --rm --security-opt label=disable \
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
--tty --interactive "${TAG}" bash
echo "Now run: sudo docker push '$TAG'"
{
"require": {
"symfony/process": " ^4.4",
"symfony/console": " ^4.4",
"symfony/yaml": " ^4.4",
"deployer/deployer": " ^6.4",
"deployer/recipes": " ^6.2"
}
}
This diff is collapsed.
#### Expected behavior
#### Actual behavior
#### Steps to reproduce
#### Output from the Javascript console in your browser
<!-- You have to enable the developer tools with Ctrl + Shift + I in your browser. -->
\ No newline at end of file
[submodule "vendor/toolkit"]
path = vendor/toolkit
url = git@gitlab.tugraz.at:dbp/web-components/toolkit.git
This diff is collapsed.
# Check-in Application
[GitLab Repository](https://gitlab.tugraz.at/dbp/apps/checkin)
## Local development
```bash
# get the source
git clone git@gitlab.tugraz.at:dbp/apps/checkin.git
cd checkin
git submodule update --init
# install dependencies
yarn install
# constantly build dist/bundle.js and run a local web-server on port 8001
yarn run watch
# same as watch, but with babel, terser, etc active -> very slow
yarn run watch-full
# run tests
yarn test
```
Jump to <http://localhost:8001> and you should get a Single Sign On login page.
## Browser versions
These browser versions should work with the application.
- Firefox 67+ (2019-05)
- Chrome 67+ (2018-05)
- Edge 79+ (2020-01)
- Safari 11.1+ (2018-04)
- Opera 64+ (2019-10)
- iOS Safari 12+/iOS 12+ (2018-09)
We use a row of newer features:
- https://caniuse.com/#feat=custom-elementsv1
- https://caniuse.com/#feat=es6-module-dynamic-import
- https://caniuse.com/#feat=shadowdomv1
- https://caniuse.com/#feat=mdn-javascript_statements_import_meta
- https://caniuse.com/#feat=es6-module
- https://caniuse.com/#feat=async-functions
DirectoryIndex <%= getUrl(name + '.html') %>
<FilesMatch "^(de|en|)$">
FallbackResource <%= getUrl(name + '.html') %>
</FilesMatch>
Header set Cache-Control "must-revalidate, max-age=60"
Header set Content-Security-Policy "default-src 'self' 'unsafe-eval' 'unsafe-inline' eid.egiz.gv.at analytics.tugraz.at <%= keyCloakServer %> <%= entryPointURL %> httpbin.org; img-src * blob: data:"
# Apache adds a "-gzip" suffix to the etag when it uses gzip but doesn't
# take that into account when receiving requests.
# See https://bz.apache.org/bugzilla/show_bug.cgi?id=45023
RequestHeader edit "If-None-Match" '^"((.*)-(gzip|br))"$' '"$1", "$2"'
\ No newline at end of file
SOURCE=logo.svg
all: icon-192.png icon-512.png
icon-192.png: $(SOURCE)
inkscape $(SOURCE) --export-png $@ -w 192 -h 192
icon-512.png: $(SOURCE)
inkscape $(SOURCE) --export-png $@ -w 512 -h 512
{
"element": "dbp-check-in-request",
"module_src": "dbp-check-in-request.js",
"routing_name": "check-in-request",
"name": {
"de": "An Ort anmelden",
"en": "Check-in at a place"
},
"short_name": {
"de": "An Ort anmelden",
"en": "Check-in at a place"
},
"description": {
"de": "Meldet den eingeloggten User an einem Ort an.",
"en": "Logs the logged in user in one place."
}
}
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Favicons -->
<link rel="shortcut icon" type="image/x-icon" href="<%= getPrivateUrl('favicon.ico') %>">
<link rel="icon" type="image/svg+xml" href="<%= getPrivateUrl('favicon.svg') %>" sizes="any">
<% if (environment === "local") { -%>
<!-- XXX: Disable adoptedStyleSheets so that lit-element doesn't use it and we can edit CSS in the Chrome dev tools -->
<script>
delete Document.prototype.adoptedStyleSheets;
</script>
<% } -%>
<!-- PWA manfiest file -->
<link rel="manifest" href="<%= getUrl(name + '.manifest.json') %>">
<!-- Loading spinner -->
<script type="module">
import {Spinner} from '<%= getPrivateUrl('spinner.js') %>';
customElements.define('dbp-loading-spinner', Spinner);
</script>
<!-- App bundles-->
<script type="module" src="<%= getUrl(name + '.js') %>"></script>
<!-- Prevent Chrome/Edge from suggesting to translate the page -->
<meta name="google" content="notranslate">
<!-- Preload fonts -->
<link rel="preload" href="<%= getPrivateUrl('fonts/SourceSansPro-Light.otf.woff2') %>" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<%= getPrivateUrl('fonts/SourceSansPro-Regular.otf.woff2') %>" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<%= getPrivateUrl('fonts/SourceSansPro-Semibold.otf.woff2') %>" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<%= getPrivateUrl('fonts/SourceSansPro-Bold.otf.woff2') %>" as="font" type="font/woff2" crossorigin>
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
_paq.push(['setCustomVariable', 1, "GitCommit", "<%= buildInfo.info %>", "visit"]);
_paq.push(['enableHeartBeatTimer']);
_paq.push(['disableCookies']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.tugraz.at/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '<%= matomoSiteId %>']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
// track changed locations
window.addEventListener('locationchanged', function(e) {
_paq.push(['setReferrerUrl', e.detail.referrerUrl]);
_paq.push(['setCustomUrl', location.href]);
// _paq.push(['setDocumentTitle', '']);
_paq.push(['trackPageView']);
// make Matomo aware of newly added content
var content = document.getElementById('content');
_paq.push(['MediaAnalytics::scanForMedia', content]);
_paq.push(['FormAnalytics::scanForForms', content]);
_paq.push(['trackContentImpressionsWithinNode', content]);
});
// track errors
window.addEventListener('error', function(e) {
if(typeof e.error !== "undefined" && e.error) {
_paq.push(['trackEvent', 'Error', e.error.message + '\n' + e.error.stack]);
}
});
</script>
<!-- End Matomo Code -->
<!-- Font related CSS -->
<style>
body {
font-family: 'Source Sans Pro', 'Calibri', 'Arial', 'sans-serif';
font-weight: 300;
margin: 0;
}
@font-face {
font-family: 'Source Sans Pro';
font-weight: 300;
src: url('<%= getPrivateUrl('fonts/SourceSansPro-Light.otf.woff2') %>') format('woff2');
font-display: block;
}
@font-face {
font-family: 'Source Sans Pro';
font-weight: 400;
src: url('<%= getPrivateUrl('fonts/SourceSansPro-Regular.otf.woff2') %>') format('woff2');
font-display: block;
}
@font-face {
font-family: 'Source Sans Pro';
font-weight: 600;
src: url('<%= getPrivateUrl('fonts/SourceSansPro-Semibold.otf.woff2') %>') format('woff2');
font-display: block;
}
@font-face {
font-family: 'Source Sans Pro';
font-weight: 700;
src: url('<%= getPrivateUrl('fonts/SourceSansPro-Bold.otf.woff2') %>') format('woff2');
font-display: block;
}
/* TU-Graz style override */
html {
--dbp-override-primary-bg-color: #245b78;
--dbp-override-primary-button-border: solid 1px #245b78;
--dbp-override-info-bg-color: #245b78;
--dbp-override-danger-bg-color: #e4154b;
--dbp-override-warning-bg-color: #ffe183;
--dbp-override-warning-text-color: black;
--dbp-override-success-bg-color: #259207;
}
</style>
<!-- Preloading/Preconnecting -->
<link rel="preconnect" href="<%= entryPointURL %>">
<link rel="preconnect" href="<%= keyCloakBaseURL %>">
</head>
<body>
<<%= name %>
lang="de"
src="<%= getUrl(name + '.topic.metadata.json') %>"
entry-point-url="<%= entryPointURL %>"
base-path="<%= getUrl('') %>"
keycloak-config='{"url": "<%= keyCloakBaseURL %>", "realm": "tugraz", "clientId": "<%= keyCloakClientId %>", "silentCheckSsoRedirectUri": "<%= getUrl('silent-check-sso.html') %>", "forceLogin": "true"}'
matomo-url="<%= matomoUrl %>" matomo-site-id="<%= matomoSiteId %>"
no-welcome-page
><dbp-loading-spinner></dbp-loading-spinner></<%= name %>>
<!-- Error handling for too old browsers -->
<script src="<%= getPrivateUrl('browser-check.js') %>" defer></script>
<noscript>Diese Applikation benötigt Javascript / This application requires Javascript</noscript>
</body>
</html>
\ No newline at end of file
{
"name": {
"de": "TU Graz Check-in",
"en": "TU Graz Check-in"
},
"short_name": {
"de": "TU Graz Check-in",
"en": "TU Graz Check-in"
},
"description": {
"de": "Mit dieser Applikation können Sie sich an einem Ort anmelden.",
"en": "With this application you can check-in at a place."
},
"routing_name": "check-in",
"activities": [
{"path": "dbp-check-in-request.metadata.json"}
],
"attributes": []
}
\ No newline at end of file
assets/favicon.ico

1.12 KiB

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100.00096"
version="1.1"
width="100"
height="100"
xml:space="preserve"
id="int-header-logo-img"><metadata
id="metadata35"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs33" /><g
id="g28"
transform="matrix(1.25,0,0,-1.25,-6.7752613e-4,100.00096)"><g
id="g26"
transform="scale(0.1)"><g
transform="translate(68.08042,192.54384)"
id="g3745"><path
style="fill:#e4154b"
d="M 0,103.73 H 207.45 V 311.19 L 0,311.2 Z"
id="path2" /><path
style="fill:#e4154b"
d="M 228.19,103.73 H 435.65 V 311.19 H 228.19 Z"
id="path4" /><path
style="fill:#e4154b"
d="M 456.41,103.73 H 663.85 V 311.19 H 456.41 Z"
id="path6" /><path
style="fill:#e4154b"
d="M 103.72,0 H 311.19 V 207.46 H 103.72 Z"
id="path8" /><path
style="fill:#e4154b"
d="M 352.68,207.46 H 560.12 V 414.92 H 352.68 Z"
id="path10" /></g></g></g></svg>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment