diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8e7dab876..a5e6af16f 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -8,21 +8,14 @@ permissions: on: push: branches: [main] - issue_comment: - types: [created] + pull_request: + workflow_dispatch: jobs: e2e: runs-on: ubuntu-latest - # Run on push/PR or when a maintainer comments "/test e2e" or "/run e2e" - if: | - github.event_name != 'issue_comment' || ( - github.event.issue.pull_request && - (contains(github.event.comment.body, '/test e2e') || contains(github.event.comment.body, '/run e2e')) && - (github.event.comment.author_association == 'OWNER' || - github.event.comment.author_association == 'MEMBER' || - github.event.comment.author_association == 'COLLABORATOR') - ) + # Only run on workflow_dispatch (manual trigger), but always register check on PRs + if: github.event_name == 'workflow_dispatch' steps: - name: Checkout code diff --git a/Dockerfile b/Dockerfile index 934ba0563..a57140a71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,26 +2,27 @@ FROM node:20 AS builder USER root -WORKDIR /app +WORKDIR /out + +COPY package*.json ./ +COPY tsconfig.json tsconfig.publish.json proxy.config.json config.schema.json test-e2e.proxy.config.json vite.config.ts index.html index.ts ./ + +RUN npm pkg delete scripts.prepare && npm ci --include=dev -COPY tsconfig.json tsconfig.publish.json proxy.config.json config.schema.json test-e2e.proxy.config.json vite.config.ts package*.json index.html index.ts ./ -COPY src/ /app/src/ -COPY public/ /app/public/ +COPY src/ /out/src/ +COPY public/ /out/public/ -# Build the UI and server -RUN npm pkg delete scripts.prepare \ - && npm ci --include=dev \ - && npm run build-ui -dd \ +RUN npm run build-ui \ && npx tsc --project tsconfig.publish.json \ && cp config.schema.json dist/ \ && npm prune --omit=dev FROM node:20 AS production -COPY --from=builder /app/package*.json ./ -COPY --from=builder /app/node_modules/ /app/node_modules/ -COPY --from=builder /app/dist/ /app/dist/ -COPY --from=builder /app/build /app/dist/build/ +COPY --from=builder /out/package*.json ./ +COPY --from=builder /out/node_modules/ /app/node_modules/ +COPY --from=builder /out/dist/ /app/dist/ +COPY --from=builder /out/build /app/dist/build/ COPY proxy.config.json config.schema.json ./ COPY docker-entrypoint.sh /docker-entrypoint.sh @@ -31,8 +32,8 @@ RUN apt-get update && apt-get install -y \ git tini \ && rm -rf /var/lib/apt/lists/* -RUN mkdir -p /app/.data /app/.tmp \ - && chown 1000:1000 /app/dist/build /app/.data /app/.tmp +RUN mkdir -p /app/.data /app/.tmp /app/.remote \ + && chown -R 1000:1000 /app USER 1000 @@ -41,4 +42,4 @@ WORKDIR /app EXPOSE 8080 8000 ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"] -CMD ["node", "dist/index.js"] +CMD ["node", "--enable-source-maps", "dist/index.js"] diff --git a/src/proxy/index.ts b/src/proxy/index.ts index a50f7531f..fd077b546 100644 --- a/src/proxy/index.ts +++ b/src/proxy/index.ts @@ -51,14 +51,14 @@ export class Proxy { const defaultAuthorisedRepoList = getAuthorisedList(); const allowedList: Repo[] = await getRepos(); - defaultAuthorisedRepoList.forEach(async (x) => { - const found = allowedList.find((y) => y.url === x.url); + for (const defaultRepo of defaultAuthorisedRepoList) { + const found = allowedList.find((configuredRepo) => configuredRepo.url === defaultRepo.url); if (!found) { - const repo = await createRepo(x); + const repo = await createRepo(defaultRepo); await addUserCanPush(repo._id!, 'admin'); await addUserCanAuthorise(repo._id!, 'admin'); } - }); + } } private async createApp() {