diff --git a/login/.dockerignore b/login/.dockerignore deleted file mode 100644 index 04003f9daf..0000000000 --- a/login/.dockerignore +++ /dev/null @@ -1,29 +0,0 @@ -.git -.DS_Store -node_modules -.turbo -*.log -.next -dist -dist-ssr -*.local -.env -.cache -server/dist -public/dist -.vscode -.idea -.vercel -.env*.local -/test-results/ -/playwright-report/ -/blob-report/ -/playwright/.cache/ -/out -/docker - -Makefile -docker-bake.hcl -**/*.md -**/*.gitignore -.git diff --git a/login/.github/workflows/close_pr.yml b/login/.github/workflows/close_pr.yml new file mode 100644 index 0000000000..d1822b0ef6 --- /dev/null +++ b/login/.github/workflows/close_pr.yml @@ -0,0 +1,35 @@ +name: Auto-close PRs and guide to correct repo + +on: + pull_request_target: + types: [opened] + +jobs: + auto-close: + runs-on: ubuntu-latest + if: github.repository_owner == 'zitadel' + steps: + - name: Comment and close PR + uses: actions/github-script@v7 + with: + script: | + const message = ` + 👋 **Thanks for your contribution!** + + This repository \`${{ github.repository }}\` is a read-only mirror of our internal development in [\`zitadel/zitadel\`](https://github.com/zitadel/zitadel). + Therefore, we close this pull request automatically, but submitting your changes to the main repository is easy: + 1. Fork and clone zitadel/zitadel + 2. Create a new branch for your changes + 3. Pull your changes into the new fork by running `make login-pull LOGIN_REMOTE_URL=/typescript LOGIN_REMOTE_BRANCH=`. + 4. Push your changes and open a pull request to zitadel/zitadel + `.trim(); + await github.rest.issues.createComment({ + ...context.repo, + issue_number: context.issue.number, + body: message + }); + await github.rest.pulls.update({ + ...context.repo, + pull_number: context.issue.number, + state: "closed" + }); diff --git a/login/.github/workflows/issues.yml b/login/.github/workflows/issues.yml index 480c3392bc..400cfec07e 100644 --- a/login/.github/workflows/issues.yml +++ b/login/.github/workflows/issues.yml @@ -4,14 +4,12 @@ on: issues: types: - opened - pull_request_target: - types: - - opened jobs: add-to-project: name: Add issue and community pr to project runs-on: ubuntu-latest + if: github.repository_owner == 'zitadel' steps: - name: add issue uses: actions/add-to-project@v1.0.2 diff --git a/login/.github/workflows/test.yml b/login/.github/workflows/test.yml index fb7aa77fad..2430702fcc 100644 --- a/login/.github/workflows/test.yml +++ b/login/.github/workflows/test.yml @@ -2,7 +2,6 @@ name: Quality on: push: pull_request: - pull_request_target: workflow_dispatch: inputs: force: @@ -18,8 +17,7 @@ jobs: name: Ensure Quality if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.repository_owner != 'zitadel') || - (github.event_name == 'pull_request' && github.repository_owner != 'zitadel') || - (github.event_name == 'pull_request_target' && github.repository_owner != 'zitadel') + (github.event_name == 'pull_request' && github.repository_owner != 'zitadel') runs-on: ubuntu-22.04 timeout-minutes: 30 permissions: diff --git a/login/README.md b/login/README.md index 68f481959c..b2f34b7525 100644 --- a/login/README.md +++ b/login/README.md @@ -151,11 +151,11 @@ You can find a more detailed documentation of the different pages [here](./apps/ ## Useful Commands -- `make login-quality` - Check the quality of your code against a production build without installing any dependencies besides Docker -- `pnpm generate` - Build proto stubs for the client package -- `pnpm dev` - Develop all packages and the login app -- `pnpm build` - Build all packages and the login app -- `pnpm clean` - Clean up all `node_modules` and `dist` folders (runs each package's clean script) +- `make login-quality` - Check the quality of your code against a production build without installing any dependencies besides Docker +- `pnpm generate` - Build proto stubs for the client package +- `pnpm dev` - Develop all packages and the login app +- `pnpm build` - Build all packages and the login app +- `pnpm clean` - Clean up all `node_modules` and `dist` folders (runs each package's clean script) Learn more about developing the login UI in the [contribution guide](/CONTRIBUTING.md). diff --git a/login/apps/login-test-acceptance/playwright.config.ts b/login/apps/login-test-acceptance/playwright.config.ts index ff1d434011..0e77aa70b0 100644 --- a/login/apps/login-test-acceptance/playwright.config.ts +++ b/login/apps/login-test-acceptance/playwright.config.ts @@ -75,13 +75,4 @@ export default defineConfig({ // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, // }, ], - - /* Run local dev server before starting the tests */ - - /* webServer: { - command: "pnpm start:built", - url: process.env.LOGIN_BASE_URL || "http://127.0.0.1:3000", - reuseExistingServer: !!process.env.LOGIN_BASE_URL, - timeout: 5 * 60_000, - },*/ }); diff --git a/login/apps/login/src/middleware.ts b/login/apps/login/src/middleware.ts index 5cfdaa247f..4d66d0ab39 100644 --- a/login/apps/login/src/middleware.ts +++ b/login/apps/login/src/middleware.ts @@ -14,7 +14,7 @@ export const config = { }; export async function middleware(request: NextRequest) { - // escape proxy if the environment is NOT setup for multitenancy + // escape proxy if the environment is setup for multitenancy if (!process.env.ZITADEL_API_URL || !process.env.ZITADEL_SERVICE_USER_TOKEN) { return NextResponse.next(); } diff --git a/login/docker-bake.hcl b/login/docker-bake.hcl index 4e3cfec6a5..6a9714fd27 100644 --- a/login/docker-bake.hcl +++ b/login/docker-bake.hcl @@ -1,3 +1,7 @@ +variable "LOGIN_DIR" { + default = "./" +} + variable "DOCKERFILES_DIR" { default = "dockerfiles/" } @@ -75,7 +79,7 @@ variable "LOGIN_CORE_MOCK_TAG" { } target "login-core-mock" { - context = "/apps/login-test-integration/core-mock" + context = "${LOGIN_DIR}apps/login-test-integration/core-mock" contexts = { protos = "target:proto-files" } diff --git a/login/dockerfiles/login-client.Dockerfile b/login/dockerfiles/login-client.Dockerfile index c43c5543cf..783bc92062 100644 --- a/login/dockerfiles/login-client.Dockerfile +++ b/login/dockerfiles/login-client.Dockerfile @@ -1,6 +1,5 @@ FROM typescript-proto-client AS login-client COPY packages/zitadel-tsconfig packages/zitadel-tsconfig -COPY packages/zitadel-proto packages/zitadel-proto COPY packages/zitadel-client/package.json ./packages/zitadel-client/ RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ pnpm install --frozen-lockfile --workspace-root --filter ./packages/zitadel-client diff --git a/login/dockerfiles/login-client.Dockerfile.dockerignore b/login/dockerfiles/login-client.Dockerfile.dockerignore new file mode 100644 index 0000000000..c2302359f5 --- /dev/null +++ b/login/dockerfiles/login-client.Dockerfile.dockerignore @@ -0,0 +1,11 @@ +* + +!packages/zitadel-client +packages/zitadel-client/dist + +!packages/zitadel-tsconfig + +**/*.md +**/*.png +**/node_modules +**/.turbo diff --git a/login/dockerfiles/login-standalone.Dockerfile.dockerignore b/login/dockerfiles/login-standalone.Dockerfile.dockerignore new file mode 100644 index 0000000000..783f7fe343 --- /dev/null +++ b/login/dockerfiles/login-standalone.Dockerfile.dockerignore @@ -0,0 +1,13 @@ +* + +!apps/login +apps/login/.next +apps/login/dist + +!scripts/healthcheck.js +!packages/zitadel-tailwind-config + +**/*.md +**/*.png +**/node_modules +**/.turbo diff --git a/login/packages/zitadel-client/.dockerignore b/login/packages/zitadel-client/.dockerignore deleted file mode 100644 index 8ff894e88c..0000000000 --- a/login/packages/zitadel-client/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -src/proto -node_modules -dist -.turbo diff --git a/login/packages/zitadel-proto/.dockerignore b/login/packages/zitadel-proto/.dockerignore deleted file mode 100644 index 20bdea6767..0000000000 --- a/login/packages/zitadel-proto/.dockerignore +++ /dev/null @@ -1,5 +0,0 @@ -zitadel -google -protoc-gen-openapiv2 -validate -node_modules diff --git a/login/packages/zitadel-proto/turbo.json b/login/packages/zitadel-proto/turbo.json index bffd614f62..2d24f0349b 100644 --- a/login/packages/zitadel-proto/turbo.json +++ b/login/packages/zitadel-proto/turbo.json @@ -3,7 +3,7 @@ "tasks": { "generate": { "outputs": ["zitadel/**"], - "cache": true + "cache": false } } } diff --git a/login/scripts/.dockerignore b/login/scripts/.dockerignore deleted file mode 100644 index 96841d44ae..0000000000 --- a/login/scripts/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -run_or_skip.sh