Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 16 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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"]
8 changes: 4 additions & 4 deletions src/proxy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ export class Proxy {
const defaultAuthorisedRepoList = getAuthorisedList();
const allowedList: Repo[] = await getRepos();

defaultAuthorisedRepoList.forEach(async (x) => {
Comment thread
coopernetes marked this conversation as resolved.
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() {
Expand Down
Loading