Skip to content

Commit bddb3c1

Browse files
committed
fix: file permission issue in e2e tests & regression on db init
Closes #1354
1 parent 930a5da commit bddb3c1

3 files changed

Lines changed: 21 additions & 19 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ permissions:
88
on:
99
push:
1010
branches: [main]
11+
pull_request:
1112
issue_comment:
1213
types: [created]
1314

Dockerfile

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@ FROM node:20 AS builder
22

33
USER root
44

5-
WORKDIR /app
5+
WORKDIR /out
6+
7+
COPY package*.json ./
8+
COPY tsconfig.json tsconfig.publish.json proxy.config.json config.schema.json test-e2e.proxy.config.json vite.config.ts index.html index.ts ./
9+
10+
RUN npm pkg delete scripts.prepare && npm ci --include=dev
611

7-
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 ./
8-
COPY src/ /app/src/
9-
COPY public/ /app/public/
12+
COPY src/ /out/src/
13+
COPY public/ /out/public/
1014

11-
# Build the UI and server
12-
RUN npm pkg delete scripts.prepare \
13-
&& npm ci --include=dev \
14-
&& npm run build-ui -dd \
15+
RUN npm run build-ui \
1516
&& npx tsc --project tsconfig.publish.json \
1617
&& cp config.schema.json dist/ \
1718
&& npm prune --omit=dev
1819

1920
FROM node:20 AS production
2021

21-
COPY --from=builder /app/package*.json ./
22-
COPY --from=builder /app/node_modules/ /app/node_modules/
23-
COPY --from=builder /app/dist/ /app/dist/
24-
COPY --from=builder /app/build /app/dist/build/
22+
COPY --from=builder /out/package*.json ./
23+
COPY --from=builder /out/node_modules/ /app/node_modules/
24+
COPY --from=builder /out/dist/ /app/dist/
25+
COPY --from=builder /out/build /app/dist/build/
2526
COPY proxy.config.json config.schema.json ./
2627
COPY docker-entrypoint.sh /docker-entrypoint.sh
2728

@@ -31,8 +32,8 @@ RUN apt-get update && apt-get install -y \
3132
git tini \
3233
&& rm -rf /var/lib/apt/lists/*
3334

34-
RUN mkdir -p /app/.data /app/.tmp \
35-
&& chown 1000:1000 /app/dist/build /app/.data /app/.tmp
35+
RUN mkdir -p /app/.data /app/.tmp /app/.remote \
36+
&& chown -R 1000:1000 /app
3637

3738
USER 1000
3839

@@ -41,4 +42,4 @@ WORKDIR /app
4142
EXPOSE 8080 8000
4243

4344
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
44-
CMD ["node", "dist/index.js"]
45+
CMD ["node", "--enable-source-maps", "dist/index.js"]

src/proxy/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ export class Proxy {
5151
const defaultAuthorisedRepoList = getAuthorisedList();
5252
const allowedList: Repo[] = await getRepos();
5353

54-
defaultAuthorisedRepoList.forEach(async (x) => {
55-
const found = allowedList.find((y) => y.url === x.url);
54+
for (const defaultRepo of defaultAuthorisedRepoList) {
55+
const found = allowedList.find((configuredRepo) => configuredRepo.url === defaultRepo.url);
5656
if (!found) {
57-
const repo = await createRepo(x);
57+
const repo = await createRepo(defaultRepo);
5858
await addUserCanPush(repo._id!, 'admin');
5959
await addUserCanAuthorise(repo._id!, 'admin');
6060
}
61-
});
61+
}
6262
}
6363

6464
private async createApp() {

0 commit comments

Comments
 (0)