diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e893d73 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +# .github/workflows/ci.yml + +name: CI + +on: + push: + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + env: + MY_DOCKER_USERNAME: ${{ secrets.MY_DOCKER_USERNAME }} + MY_DOCKER_PASSWORD: ${{ secrets.MY_DOCKER_PASSWORD }} + FORCE_COLOR: 1 + steps: + - uses: https://github.com/earthly/actions-setup@v1 + with: + version: v0.7.0 + - uses: actions/checkout@v2 + - name: Put back the git branch into git (Earthly uses it for tagging) + run: | + branch="" + if [ -n "$GITHUB_HEAD_REF" ]; then + branch="$GITHUB_HEAD_REF" + else + branch="${GITHUB_REF##*/}" + fi + git checkout -b "$branch" || true + - name: Docker Login + run: docker login git.hibas.dev --username "$MY_DOCKER_USERNAME" --password "$MY_DOCKER_PASSWORD" + - name: Earthly version + run: earthly --version + - name: Run build + run: earthly --push +docker-multi diff --git a/.gitignore b/.gitignore index 8a821ce..63074d8 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ config.ini doc/ .yarn/cache -.yarn/install-state.gz +.yarn/install-state.gz \ No newline at end of file diff --git a/Earthfile b/Earthfile new file mode 100644 index 0000000..4d8e1e4 --- /dev/null +++ b/Earthfile @@ -0,0 +1,39 @@ +VERSION 0.7 +FROM node:20-alpine3.18 +WORKDIR /build + +project: + COPY . . + RUN yarn install + +build: + FROM +project + + RUN yarn build + + SAVE ARTIFACT /build/Backend/lib /Backend + SAVE ARTIFACT /build/Frontend/build /Frontend + SAVE ARTIFACT /build/FrontendLegacy/out /FrontendLegacy + +docker-multi: + BUILD +build + BUILD --platform linux/amd64 --platform linux/arm64 +docker + +docker: + FROM +project + +# RUN apk add --no-cache caddy supervisor + +# COPY ./supervisord.conf /etc/supervisord.conf + + COPY +build/Backend /build/Backend/lib + COPY +build/Frontend /build/Frontend/build + COPY +build/FrontendLegacy /build/FrontendLegacy/out + + WORKDIR /build/Backend + + ENTRYPOINT ["node", "lib/index.js"] + + ARG EARTHLY_TARGET_TAG + ARG TAG=$EARTHLY_TARGET_TAG + SAVE IMAGE --push git.hibas.dev/openserver/openauth:$TAG diff --git a/FrontendLegacy/.gitignore b/FrontendLegacy/.gitignore new file mode 100644 index 0000000..466e248 --- /dev/null +++ b/FrontendLegacy/.gitignore @@ -0,0 +1 @@ +out/ \ No newline at end of file diff --git a/FrontendLegacy/out/admin/admin.html b/FrontendLegacy/out/admin/admin.html deleted file mode 100644 index e5705ff..0000000 --- a/FrontendLegacy/out/admin/admin.html +++ /dev/null @@ -1,484 +0,0 @@ -{{i18n "Administration"}}

{{appname}} {{i18n "Administration"}} LOADING

\ No newline at end of file diff --git a/FrontendLegacy/out/admin/stats.json b/FrontendLegacy/out/admin/stats.json deleted file mode 100644 index c13bf71..0000000 --- a/FrontendLegacy/out/admin/stats.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "sass": { - "entry": "src\\admin/admin.scss", - "start": 1680888864800, - "end": 1680888864814, - "duration": 14, - "includedFiles": [ - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\FrontendLegacy\\src\\admin\\admin.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\FrontendLegacy\\shared\\mat_bs.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\FrontendLegacy\\shared\\style.scss" - ] - }, - "js": { - "chars": 7975 - }, - "css": { - "chars": 1665 - }, - "bundle_size": 21873, - "gzip_size": 4359 -} \ No newline at end of file diff --git a/FrontendLegacy/out/authorize/authorize.html b/FrontendLegacy/out/authorize/authorize.html deleted file mode 100644 index 422fe87..0000000 --- a/FrontendLegacy/out/authorize/authorize.html +++ /dev/null @@ -1,21 +0,0 @@ -{{title}}

{{title}}


{{information}}
\ No newline at end of file diff --git a/FrontendLegacy/out/authorize/stats.json b/FrontendLegacy/out/authorize/stats.json deleted file mode 100644 index de91f29..0000000 --- a/FrontendLegacy/out/authorize/stats.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "sass": { - "entry": "src\\authorize/authorize.scss", - "start": 1680888863485, - "end": 1680888864104, - "duration": 619, - "includedFiles": [ - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\FrontendLegacy\\src\\authorize\\authorize.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\button\\mdc-button.import.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\base\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\feature-targeting\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\feature-targeting\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\feature-targeting\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\theme\\_constants.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\theme\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\theme\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\animation\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\elevation\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\ripple\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\rtl\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\touch-target\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\typography\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\typography\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\shape\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\density\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\button\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\button\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\elevation\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\theme\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\elevation\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\ripple\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\animation\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\ripple\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\ripple\\_keyframes.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\rtl\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\touch-target\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\typography\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\shape\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\shape\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\density\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\button\\mdc-button.scss" - ] - }, - "js": { - "chars": 576 - }, - "css": { - "chars": 9933 - }, - "bundle_size": 11387, - "gzip_size": 2740 -} \ No newline at end of file diff --git a/FrontendLegacy/out/login/login.html b/FrontendLegacy/out/login/login.html deleted file mode 100644 index 8e91c77..0000000 --- a/FrontendLegacy/out/login/login.html +++ /dev/null @@ -1,3217 +0,0 @@ - - - {{i18n "Login"}} - - - - - -
- {{!-- -

{{i18n "Login"}}

-
-
-
-
-
- - - - -
- -
-
- - -
-
-
    -
    -
    -
    -
    - - --}} - - - diff --git a/FrontendLegacy/out/login/stats.json b/FrontendLegacy/out/login/stats.json deleted file mode 100644 index 8d56b87..0000000 --- a/FrontendLegacy/out/login/stats.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "sass": { - "entry": "src\\login/login.scss", - "start": 1596809618526, - "end": 1596809618741, - "duration": 215, - "includedFiles": [ - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\src\\login\\login.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\button\\mdc-button.import.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\base\\_mixins.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\feature-targeting\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\feature-targeting\\_mixins.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\feature-targeting\\_functions.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\theme\\_constants.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\theme\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\theme\\_functions.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\animation\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\elevation\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\ripple\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\rtl\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\touch-target\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\typography\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\typography\\_functions.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\shape\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\density\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\button\\_variables.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\button\\_mixins.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\elevation\\_mixins.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\theme\\_mixins.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\elevation\\_functions.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\ripple\\_mixins.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\animation\\_functions.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\ripple\\_functions.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\ripple\\_keyframes.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\rtl\\_mixins.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\touch-target\\_mixins.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\typography\\_mixins.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\shape\\_mixins.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\shape\\_functions.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\density\\_functions.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\node_modules\\@material\\button\\mdc-button.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\shared\\inputs.scss", - "C:\\Users\\micro\\Documents\\Projekte\\OpenAuth\\server\\views\\shared\\style.scss" - ] - }, - "js": { - "chars": 68059 - }, - "css": { - "chars": 11795 - }, - "bundle_size": 81043, - "gzip_size": 20007 -} diff --git a/FrontendLegacy/out/main/main.html b/FrontendLegacy/out/main/main.html deleted file mode 100644 index 9793f9d..0000000 --- a/FrontendLegacy/out/main/main.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/FrontendLegacy/out/main/stats.json b/FrontendLegacy/out/main/stats.json deleted file mode 100644 index 9f244d8..0000000 --- a/FrontendLegacy/out/main/stats.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "sass": { - "entry": "src\\main/main.scss", - "start": 1680888864122, - "end": 1680888864124, - "duration": 2, - "includedFiles": [ - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\FrontendLegacy\\src\\main\\main.scss" - ] - }, - "js": { - "chars": 57 - }, - "css": { - "chars": 18 - }, - "bundle_size": 128, - "gzip_size": 123 -} \ No newline at end of file diff --git a/FrontendLegacy/out/register/register.html b/FrontendLegacy/out/register/register.html deleted file mode 100644 index 3c57690..0000000 --- a/FrontendLegacy/out/register/register.html +++ /dev/null @@ -1,687 +0,0 @@ -{{i18n "Register"}}

    {{i18n "Register"}}

    \ No newline at end of file diff --git a/FrontendLegacy/out/register/stats.json b/FrontendLegacy/out/register/stats.json deleted file mode 100644 index 2324e2d..0000000 --- a/FrontendLegacy/out/register/stats.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "sass": { - "entry": "src\\register/register.scss", - "start": 1680888864210, - "end": 1680888864775, - "duration": 565, - "includedFiles": [ - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\FrontendLegacy\\src\\register\\register.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\button\\mdc-button.import.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\base\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\feature-targeting\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\feature-targeting\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\feature-targeting\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\theme\\_constants.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\theme\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\theme\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\animation\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\elevation\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\ripple\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\rtl\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\touch-target\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\typography\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\typography\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\shape\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\density\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\button\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\button\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\elevation\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\theme\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\elevation\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\ripple\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\animation\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\ripple\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\ripple\\_keyframes.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\rtl\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\touch-target\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\typography\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\shape\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\shape\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\density\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\button\\mdc-button.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\form-field\\mdc-form-field.import.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\form-field\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\form-field\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\form-field\\mdc-form-field.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\radio\\mdc-radio.import.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\radio\\_variables.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\radio\\_mixins.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\radio\\_functions.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\node_modules\\@material\\radio\\mdc-radio.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\FrontendLegacy\\shared\\inputs.scss", - "D:\\Projekte\\OpenServer\\OpenAuth\\server\\FrontendLegacy\\shared\\style.scss" - ] - }, - "js": { - "chars": 21204 - }, - "css": { - "chars": 19609 - }, - "bundle_size": 44031, - "gzip_size": 9858 -} \ No newline at end of file diff --git a/example.env b/example.env new file mode 100644 index 0000000..63ffe5c --- /dev/null +++ b/example.env @@ -0,0 +1,6 @@ +DATABASE_HOST=mongodb +DATABASE_DATABASE=openauth +CORE_NAME=OpenAuthDev +CORE_URL=http://localhost +CORE_SECRET=verysecretsecret +WEB_PORT=3000