3 Commits

Author SHA1 Message Date
30fe289199 index 2022-06-22 16:02:46 +02:00
a35e2ab9f1 simple remark plugin 2022-06-20 20:00:11 +02:00
d5257fa606 yarn cache 2022-06-20 10:53:32 +02:00
1750 changed files with 23823 additions and 7416 deletions

View File

@@ -1 +0,0 @@
code:$apr1$AeePIAei$E9E6E6jtFFtwmtGhIEG.Y/

View File

@@ -1,2 +0,0 @@
code:$apr1$AeePIAei$E9E6E6jtFFtwmtGhIEG.Y/
web:$apr1$/zc/TBtD$ZGr3RqPiULYMD0kJUup5E0

191
.drone.yml Normal file
View File

@@ -0,0 +1,191 @@
kind: pipeline
type: docker
name: default
workspace:
path: /drone/workdir
steps:
- name: load dependencies
image: node
pull: if-not-exists
environment:
FORCE_COLOR: "true"
volumes:
- name: cache
path: /cache
commands:
- mkdir -p /cache/node_modules
- mkdir -p /cache/user-cache
- ln -s /cache/node_modules ./node_modules
- ln -s /cache/user-cache ~/.cache
- echo cache=/cache/npm-cache >> .npmrc
- "echo 'enableGlobalCache: false' >> .yarnrc"
- 'echo ''cacheFolder: "/cache/yarn-cache"'' >> .yarnrc'
- 'echo ''yarn-offline-mirror "/cache/npm-packages-offline-cache"'' >> .yarnrc'
- "echo 'yarn-offline-mirror-pruning: true' >> .yarnrc"
- cat .yarnrc
- yarn install --verbose --frozen-lockfile
- name: mongo
image: mongo
pull: if-not-exists
detach: true
- name: maildev
image: node
pull: if-not-exists
volumes:
- name: cache
path: /cache
commands:
- yarn run maildev --web 80 --smtp 25 -v --hide-extensions=STARTTLS
detach: true
- name: liveserver
image: node
pull: if-not-exists
volumes:
- name: cache
path: /cache
commands:
- yarn run -- live-server --no-browser --port=80 --ignore='*' --entry-file=spa.html --no-css-inject --proxy=/api:http://tibi-server:8080/api/v1/_/__NAMESPACE__ dist
detach: true
- name: tibi-server
image: registry.webmakers.de/tibi/tibi-server
pull: never
environment:
DB_DIAL: mongodb://mongo
API_PORT: 8080
MAIL_HOST: maildev:25
detach: true
- name: cypress run
image: cypress/base
pull: if-not-exists
volumes:
- name: cache
path: /cache
environment:
FORCE_COLOR: "true"
CYPRESS_BASE_URL: http://liveserver
CYPRESS_CI: "true"
CYPRESS_mongodbUri: mongodb://mongo
CYPRESS_tibiApiUrl: http://tibi-server:8080/api/v1
CYPRESS_projectApiConfig: /drone/workdir/api/config.yml
commands:
- ln -s /cache/user-cache ~/.cache
- yarn build:instanbul
- yarn cy:run
- yarn run nyc report --exclude-after-remap false
- name: modify master config
image: bash
pull: if-not-exists
commands:
- bash scripts/modify-config.sh master __MASTER_URL__
when:
branch: [master]
- name: modify dev config
image: bash
pull: if-not-exists
commands:
- bash scripts/modify-config.sh dev __DEV_URL__
when:
branch: [dev]
- name: build
image: node
pull: if-not-exists
volumes:
- name: cache
path: /cache
commands:
- yarn build
- name: build ssr
image: node
pull: if-not-exists
volumes:
- name: cache
path: /cache
commands:
- yarn build:server
- name: build legacy
image: node
pull: if-not-exists
volumes:
- name: cache
path: /cache
commands:
- yarn build:legacy
- name: modify html
image: bash
pull: if-not-exists
commands:
- bash scripts/preload-meta.sh public/spa.html
- bash scripts/preload-meta.sh public/spa.html > dist/spa.html
- export stamp=`date +%s`
- echo $$stamp
- sed -i s/__TIMESTAMP__/$$stamp/g dist/spa.html
- sed -i s/__TIMESTAMP__/$$stamp/g dist/serviceworker.js
- cat dist/serviceworker.js
- cp dist/spa.html api/templates/spa.html
- cat dist/spa.html
- name: deploy master
image: instrumentisto/rsync-ssh
pull: if-not-exists
environment:
RSYNC_USER: USER_PROJECT_master
RSYNC_PASS:
from_secret: rsync_master
commands:
- apk add --no-cache sshpass
- scripts/deploy.sh ftp1.webmakers.de $${RSYNC_USER} $${RSYNC_PASS}
when:
branch: [master]
event: [push]
- name: deploy dev
image: instrumentisto/rsync-ssh
pull: if-not-exists
environment:
RSYNC_USER: USER_PROJECT_dev
RSYNC_PASS:
from_secret: rsync_dev
commands:
- apk add --no-cache sshpass
- scripts/deploy.sh ftp1.webmakers.de $${RSYNC_USER} $${RSYNC_PASS}
when:
branch: [dev]
event: [push]
- name: prepare notify
image: cypress/base
pull: if-not-exists
commands:
- find cypress -type f -wholename "cypress/videos/*" -or -wholename "cypress/screenshots/*" | tar -cvf cypress-media.tar -T -
when:
status:
- failure
- name: notify
image: drillster/drone-email
pull: if-not-exists
settings:
from: noreply@ci.gitbase.de
host: smtp.basehosts.de
attachment: cypress-media.tar
when:
status:
- failure
volumes:
- name: cache
host:
path: /tmp/cache/drone/${DRONE_REPO}

23
.env
View File

@@ -1,23 +0,0 @@
PROJECT_NAME=__PROJECT_NAME__
TIBI_PREFIX=tibi
TIBI_NAMESPACE=__TIBI_NAMESPACE__
CODER_UID=100
CODER_GID=101
SENTRY_URL=https://sentry.basehosts.de
SENTRY_ORG=webmakers
SENTRY_PROJECT=
RSYNC_HOST=ftp1.webmakers.de
RSYNC_PORT=22223
PRODUCTION_SERVER=dock4.basehosts.de
PRODUCTION_TIBI_PREFIX=wmbasic
PRODUCTION_PATH=/webroots2/customers/_CUSTOMER_ID_/____
STAGING_PATH=/staging/__ORG__/__PROJECT__/dev
LIVE_URL=https://www
STAGING_URL=https://dev-__PROJECT_NAME__.staging.testversion.online
#START_SCRIPT=:ssr

View File

@@ -1,201 +0,0 @@
name: deploy to production
on: "push"
# push:
# branches:
# - master
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
container:
image: gitbase.de/actions/ubuntu:latest
volumes:
- /data:/data
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
submodules: true
- run: |
git fetch --force --tags
# setup node 20
- name: setup node 20
uses: actions/setup-node@v3
with:
node-version: 20
- name: install dependencies
run: |
npm install -g yarn
yarn install
- name: modify config
run: |
sed -i 's#\(sentryEnvironment.*\)".*"#\1"${GITHUB_REF_NAME}"#g' frontend/src/config.ts
sed -i 's#//\( sentry\\.init.*\)#\1#g' frontend/src/config.ts
sed -i 's#metrictCall = false#metrictCall = true#g' frontend/src/config.ts
set -o allexport
. ./.env
echo "PROJECT_RELEASE=${SENTRY_PROJECT}.r`git rev-list HEAD --count`-`git describe --all --long | sed 's+/+-+'`" >> .env
. ./.env
set +o allexport
echo ______ .env ______
cat .env
echo
sed -i 's#\(const release = \).*#\1"'${PROJECT_RELEASE}'"#g' api/hooks/config-client.js
sed -i 's#\(const originURL = \).*#\1"'${LIVE_URL}'"#g' api/hooks/config-client.js
# bash scripts/preload-meta.sh frontend/spa.html
# bash scripts/preload-meta.sh frontend/spa.html > frontend/_spa.html
# cp frontend/_spa.html frontend/spa.html
export stamp=`date +%s`
sed -i s/__TIMESTAMP__/$stamp/g frontend/spa.html
# sed -i s/__TIMESTAMP__/$stamp/g frontend/serviceworker.js
# cat frontend/serviceworker.js
test -d api/templates && test -L api/templates/spa.html && rm api/templates/spa.html || test -d api/templates && test -f api/templates/spa.html && rm api/templates/spa.html
test -d api/templates && cp frontend/spa.html api/templates/spa.html
cp frontend/spa.html api/templates/spa.html
echo ______ frontend/spa.html ______
cat frontend/spa.html
sed -i 's#\(PREVIEW_URL=\).*#\1'${LIVE_URL}/preview'#g' api/config.yml.env
echo ______ api/config.yml.env ______
cat api/config.yml.env
- name: build
env:
FORCE_COLOR: "true"
run: |
yarn build
- name: build admin
env:
FORCE_COLOR: "true"
run: |
yarn build:admin
- name: build ssr
env:
FORCE_COLOR: "true"
run: |
yarn build:server
- name: build legacy
env:
FORCE_COLOR: "true"
run: |
yarn build:legacy
- name: staging
# only if branch is dev
if: github.ref == 'refs/heads/dev'
env:
# /data/ORG/PROJECT/BRANCH
API_BASEDIR: /data/${{ github.repository }}/${{ github.ref_name }}
COMPOSE_PROJECT_NAME: ${{ github.repository }}-${{ github.ref_name }}
run: |
# read .env
set -o allexport
. ./.env
. ./api/config.yml.env
set +o allexport
# replace / with -
COMPOSE_PROJECT_NAME=`echo $COMPOSE_PROJECT_NAME | sed 's+/+-+g'`
mkdir -p $API_BASEDIR/frontend
rsync -av api $API_BASEDIR/
rsync -av frontend/dist $API_BASEDIR/frontend/
rsync -av frontend/assets $API_BASEDIR/frontend/
sed -i 's#\(PREVIEW_URL=\).*#\1'${STAGING_URL}/preview'#g' $API_BASEDIR/api/config.yml.env
docker compose -f docker-compose-staging.yml -p $COMPOSE_PROJECT_NAME up -d --build --remove-orphans
reloadUrl=${STAGING_URL}/api/_/admin/reload
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ${ADMIN_TOKEN}" -d '{}' "${reloadUrl}"
# clear ssr cache
ssrUrl=${STAGING_URL}/api/ssr
curl -X POST -H "Content-Type: application/json" -d '{}' "${ssrUrl}?clear=1"
- name: deploy
# only if branch is master
if: github.ref == 'refs/heads/master'
env:
RSYNC_USER: ${{ github.repository }}
RSYNC_PASS: ${{ github.token }}
BRANCH: ${{ github.ref_name }}
run: |
# read .env
set -o allexport
. ./.env
. ./api/config.yml.env
set +o allexport
# if RSYNC_USER or RSYNC_KEY is not set, exit
if [ -z "${RSYNC_USER}" ]; then
echo "RSYNC_USER missing, exiting"
exit 1
fi
if [ -z "${RSYNC_PASS}" ]; then
echo "RSYNC_PASS missing, exiting"
exit 1
fi
if [ -z "${RSYNC_HOST}" ]; then
echo "RSYNC_HOST missing, exiting"
exit 1
fi
if [ -z "${RSYNC_PORT}" ]; then
echo "RSYNC_PORT missing, exiting"
exit 1
fi
echo "Deploying ${BRANCH} to ${RSYNC_HOST} on port ${RSYNC_PORT} as ${RSYNC_USER}"
excludes=""
if [ "${BRANCH}" = "master" ]; then
excludes='--exclude=src --exclude=*.map'
echo "master deploy, excluding $excludes"
fi
SSH_CMD="sshpass -p ${RSYNC_PASS} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p ${RSYNC_PORT} -l ${RSYNC_USER}"
# sync frontend
rsync -rlcgD --perms -i -u -v --stats --progress \
--delete \
-e "${SSH_CMD}" \
$excludes \
frontend/ \
${RSYNC_HOST}:./frontend/ \
# sync api config
rsync -rlcgD --perms -i -u -v --stats --progress \
--delete \
-e "${SSH_CMD}" \
api/ \
${RSYNC_HOST}:./api/
# create media directory
mkdir media
chmod 770 media
rsync -rlcgD --perms -i -u -v --stats --progress \
-e "${SSH_CMD}" \
media \
${RSYNC_HOST}:./
reloadUrl=${LIVE_URL}/api/_/admin/reload
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ${ADMIN_TOKEN}" -d '{}' "${reloadUrl}"
# clear ssr cache
ssrUrl=${LIVE_URL}/api/ssr
curl -X POST -H "Content-Type: application/json" -d '{}' "${ssrUrl}?clear=1"

View File

@@ -1,25 +0,0 @@
# Copilot Instructions
## Common Instructions
- Look in the problems tab for any errors or warnings in the code
- Follow the existing code style and conventions used in the project
- Write clear and concise comments where necessary to explain complex logic
- Ensure code is modular and reusable where possible
- Write unit tests for new functionality and ensure existing tests pass, but only if there is a configured testing framework
- Avoid introducing new dependencies unless absolutely necessary, but ask the user if there is a specific library they want to use
- If you are unsure about any requirements or details, ask the user for clarification before proceeding
- Respect a11y and localization best practices if applicable, optimize for WCAG AA standards
## Toolchain
- See .env in root for project specific environment variables
- See Makefile for starting up the development environment with Docker
- If development environment is running, access the website at: https://${PROJECT_NAME}.code.testversion.online/ or ask the user for the correct URL
- You can also use Browser MCP, so ask user to connect if needed
- Esbuild is used, watching for changes in files to rebuild automatically
- To force a restart of the frontend build and dev-server run: `make restart-frontend`
- Backend is tibi-server configured in /api/ folder and also restarted if changes are detected in this folder
- To show last X lines of docker logs run: `make docker-logs-X` where X is the number
of lines you want to see
- For a11y testing use the MCP a11y tools if available

29
.gitignore vendored
View File

@@ -1,14 +1,17 @@
api/hooks/lib/app.server*
node_modules
media
tmp
_temp
frontend/dist
_temp/
node_modules/
dist/
build/
build_ssr/
stat/
yarn-error.log
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
/media/
/test.js
/api/templates/spa.html
/api/hooks/lib/app.server*
cypress/_old
cypress/videos
cypress/screenshots
.~lock.*
coverage/
.nyc_output/

View File

@@ -10,7 +10,7 @@
"check-parameters"
],
"no-var-keyword": true,
"svelteSortOrder": "scripts-options-markup-styles",
"svelteSortOrder": "scripts-markup-styles",
"svelteStrictMode": true,
"svelteBracketNewLine": true,
"svelteAllowShorthand": true,

15
.vscode/launch.json vendored
View File

@@ -1,15 +0,0 @@
{
// Verwendet IntelliSense zum Ermitteln möglicher Attribute.
// Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-msedge",
"request": "launch",
"name": "Launch Edge against localhost",
"url": "http://localhost:5501/",
"webRoot": "${workspaceFolder}/dist"
}
]
}

53
.vscode/settings.json vendored
View File

@@ -1,33 +1,34 @@
{
"editor.tabCompletion": "on",
"diffEditor.codeLens": true,
"eslint.alwaysShowStatus": true,
"tslint.autoFixOnSave": true,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[markdown]": {
"editor.wordWrap": "on",
"editor.defaultFormatter": "vscode.markdown-language-features"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"liveServer.settings.root": "/dist",
"liveServer.settings.file": "spa.html",
"liveServer.settings.port": 5502,
"liveServer.settings.proxy": {
"enable": true,
"baseUri": "/api",
"proxyUri": "http://127.0.0.1:8080/api/v1/_/__NAMESPACE__"
},
"extensions.ignoreRecommendations": true,
"files.autoSave": "off",
"typescript.tsc.autoDetect": "off",
"npm.autoDetect": "off",
"debug.allowBreakpointsEverywhere": true,
"html.autoClosingTags": false,
"yaml.schemas": {
"./../../cms/tibi-types/schemas/api-config/config.json": "api/config.y*ml",
"./../../cms/tibi-types/schemas/api-config/collection.json": "api/collections/*.y*ml",
"./../../cms/tibi-types/schemas/api-config/field.json": "api/collections/fields/*.y*ml",
"./../../cms/tibi-types/schemas/api-config/fieldArray.json": "api/collections/fieldLists/*.y*ml",
"./../../cms/tibi-types/schemas/api-config/job.json": "api/jobs/*.y*ml",
"./../../cms/tibi-types/schemas/api-config/assets.json": "api/assets/*.y*ml"
"node_modules/tibi-types/schemas/api-config/config.json": "api/config.y*ml",
"node_modules/tibi-types/schemas/api-config/collection.json": "api/collections/*.y*ml",
"node_modules/tibi-types/schemas/api-config/field.json": "api/collections/fields/*.y*ml"
},
"yaml.customTags": ["!include scalar"],
"filewatcher.commands": [
{
"match": "/api/.*(\\.ya?ml|js|env)$",
"isAsync": false,
"cmd": "cd ${currentWorkspace} && scripts/reload-local-tibi.sh",
"event": "onFileChange"
}
],
"i18n-ally.localesPaths": ["frontend/locales"],
"i18n-ally.sourceLanguage": "de",
"i18n-ally.keystyle": "nested",
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"files.associations": {
"css": "tailwindcss"
}
"yaml.customTags": ["!include scalar"]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More