Initial commit

This commit is contained in:
Grit-Grenzdoerfer 2023-09-17 13:24:39 +02:00
commit 5f27fe0c5b
753 changed files with 15517 additions and 0 deletions

1
.basic-auth-code Normal file
View File

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

2
.basic-auth-web Normal file
View File

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

151
.drone.yml.bak Normal file
View File

@ -0,0 +1,151 @@
kind: pipeline
type: docker
name: default
steps:
##############################
# Build and deploy docs
##############################
- name: build docs
image: node:18
pull: if-not-exists
environment:
FORCE_COLOR: "true"
commands:
- cd docs
- yarn install
- yarn docpress:build
when:
branch: [master]
event: [push]
- name: deploy docs
image: instrumentisto/rsync-ssh
pull: if-not-exists
environment:
RSYNC_HOST: ftp1.webmakers.de
RSYNC_PORT: 22222
RSYNC_USER: webmakers_tibi_docs_rsync_master
RSYNC_PASS:
from_secret: rsync_master
commands:
- cd docs
- >
rsync -rlcgD --perms -i -u -v --stats --progress
--delete
-e "sshpass -p $${RSYNC_PASS} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p $${RSYNC_PORT}"
_docpress/
$${RSYNC_USER}@$${RSYNC_HOST}:./
when:
branch: [master]
event: [push]
##############################
# Demo project
##############################
- name: yarn install
image: node:18
pull: if-not-exists
environment:
FORCE_COLOR: "true"
commands:
- yarn install
- name: modify config
image: alpine/git
commands:
- sed -i 's#\(sentryEnvironment.*\)".*"#\1"${DRONE_BRANCH}"#g' frontend/src/config.ts
- sed -i 's#//\( sentry\\.init.*\)#\1#g' frontend/src/config.ts
- export $(cat .env | xargs)
- echo "PROJECT_RELEASE=$${RELEASE_PROJECT_SLUG}.r`git rev-list HEAD --count`-`git describe --all --long | sed 's+/+-+'`" >> .env
- export $(cat .env | xargs)
- cat .env
- sed -i 's#\(const release = \).*#\1"'$${PROJECT_RELEASE}'"#g' api/hooks/config-client.js
- name: build
image: node:18
commands:
- yarn build
- name: build ssr
image: node:18
commands:
- yarn build:server
- name: build legacy
image: node:18
commands:
- yarn build:legacy
- name: modify html
image: bash
commands:
- 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`
- echo $$stamp
- sed -i s/__TIMESTAMP__/$$stamp/g frontend/spa.html
#- sed -i s/__TIMESTAMP__/$$stamp/g frontend/serviceworker.js
#- cat frontend/serviceworker.js
- cp frontend/spa.html api/templates/spa.html
- cat frontend/spa.html
# staging
- name: copy api config to staging
image: instrumentisto/rsync-ssh
volumes:
- name: data
path: /data
commands:
- rsync -av api /data/
- mkdir -p /data/frontend/dist
- rsync -av frontend/dist/ /data/frontend/dist/
when:
branch: [dev]
event: [push]
- name: review in staging
image: docker/compose:1.22.0
commands:
- docker-compose -p ${DRONE_BRANCH}-${DRONE_REPO_NAME}-${DRONE_REPO_OWNER} up -d --build --remove-orphans
volumes:
- name: docker
path: /var/run/docker.sock
when:
branch: [dev]
event: [push]
# live
- name: deploy master
image: instrumentisto/rsync-ssh
environment:
RSYNC_USER: ""
RSYNC_PASS:
from_secret: rsync_master
# remove if user and pass is set
failure: ignore
commands:
- apk add --no-cache sshpass curl
- scripts/deploy.sh ftp1.webmakers.de $${RSYNC_USER} $${RSYNC_PASS}
# - curl -X POST "https://www....de/api/ssr?token=TowendQhi&clear=1"
when:
branch: [master]
event: [push]
# - name: upload sourcemaps for glitchtip
# image: node
# environment:
# GLITCHTIP_TOKEN:
# from_secret: glitchtip_token
# commands:
# - yarn upload:sourcemaps
########
volumes:
- name: data
host:
path: /data/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_BRANCH}
- name: docker
host:
path: /var/run/docker.sock

7
.env Normal file
View File

@ -0,0 +1,7 @@
PROJECT_NAME=wasserski-erfurt
TIBI_PREFIX=tibi
TIBI_NAMESPACE=wasserski_erfurt
UID=100
GID=101
RELEASE_ORG_SLUG=webmakers-gmbh
RELEASE_PROJECT_SLUG=wasserski-erfurt

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
.yarn/cache/* filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,97 @@
name: deploy to production
on: "push"
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
- name: remove lfs links
run: |
ls -la .yarn/cache
rm -r .yarn/cache
- name: setup node 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: install dependencies
env:
FORCE_COLOR: "true"
run: |
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
export $(cat .env | xargs)
echo "PROJECT_RELEASE=${RELEASE_PROJECT_SLUG}.r`git rev-list HEAD --count`-`git describe --all --long | sed 's+/+-+'`" >> .env
export $(cat .env | xargs)
echo ______ .env ______
cat .env
echo
sed -i 's#\(const release = \).*#\1"'${PROJECT_RELEASE}'"#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
rm api/templates/spa.html
cp frontend/spa.html api/templates/spa.html
echo ______ frontend/spa.html ______
cat frontend/spa.html
- name: build
env:
FORCE_COLOR: "true"
run: |
yarn build
#- name: build ssr
# env:
# FORCE_COLOR: "true"
# run: |
# yarn build:server
- name: build legacy
env:
FORCE_COLOR: "true"
run: |
yarn build:legacy
#- name: staging api
# if: github.ref == 'refs/heads/dev'
# run: |
# targetDir=/data/${GITHUB_REPOSITORY}/${GITHUB_REF_NAME}
# mkdir -p targetDir
# rsync -av api $targetDir/
# mkdir -p $targetDir/frontend/dist
# rsync -av frontend/dist/ $targetDir/frontend/dist/
#- name: staging frontend
# if: github.ref == 'refs/heads/dev'
# run: |
# docker compose -p ${GITHUB_REF_NAME}-${GITHUB_REPOSITORY_NAME}-${GITHUB_REPOSITORY_OWNER} up -d --build --remove-orphans
- name: deploy
if: github.ref == 'refs/heads/master'
env:
RSYNC_USER: "wasserski_rsync_master"
RSYNC_PASS: ${{ secrets.rsync_master }}
run: |
scripts/deploy.sh ftp1.webmakers.de $RSYNC_USER $RSYNC_PASS

22
.gitignore vendored Normal file
View File

@ -0,0 +1,22 @@
docs/_docpress
docs/node_modules
docs/.yarn/*
!docs/.yarn/patches
!docs/.yarn/plugins
!docs/.yarn/releases
!docs/.yarn/sdks
!docs/.yarn/versions
api/hooks/lib/app.server*
node_modules
/media
tmp
_temp
frontend/dist
yarn-error.log
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

3
.opencommitignore Normal file
View File

@ -0,0 +1,3 @@
**/*.jpg
**/.env
**/.yarn

15
.prettierrc Normal file
View File

@ -0,0 +1,15 @@
{
"printWidth": 120,
"tabWidth": 4,
"singleQuote": false,
"trailingComma": "es5",
"semi": false,
"newline-before-return": true,
"no-duplicate-variable": [true, "check-parameters"],
"no-var-keyword": true,
"svelteSortOrder": "scripts-markup-styles",
"svelteStrictMode": true,
"svelteBracketNewLine": true,
"svelteAllowShorthand": true,
"svelteIndentScriptAndStyle": true
}

28
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,28 @@
{
"editor.tabCompletion": "on",
"diffEditor.codeLens": true,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"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",
"https://json.schemastore.org/github-workflow.json": "file:///WM_Dev/src/gitbase.de/cms/tibi-docs/.gitea/workflows/deploy.yaml"
},
"yaml.customTags": ["!include scalar"],
"filewatcher.commands": [
{
"match": "/api/.*(\\.ya?ml|js|env)$",
"isAsync": false,
"cmd": "docker compose -f ${workspaceRoot}/docker-compose-local.yml restart tibiserver",
"event": "onFileChange"
}
],
"i18n-ally.localesPaths": ["frontend/locales"],
"i18n-ally.sourceLanguage": "de",
"i18n-ally.keystyle": "nested"
}

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