Skip to content

Commit 9809200

Browse files
authored
Merge pull request #3683 from umami-software/dev
v3
2 parents 777515f + a6d4519 commit 9809200

1,139 files changed

Lines changed: 54864 additions & 32081 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ Dockerfile
44
.gitignore
55
.DS_Store
66
node_modules
7-
.idea
7+
.idea
8+
.env
9+
.env.*

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/src/generated/

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
"@typescript-eslint/no-var-requires": "off",
4343
"@typescript-eslint/no-empty-interface": "off",
4444
"@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }],
45-
"@typescript-eslint/no-namespace": ["error", { "allowDeclarations": true }]
45+
"@typescript-eslint/no-namespace": ["error", { "allowDeclarations": true }],
46+
"@typescript-eslint/triple-slash-reference": "off"
4647
},
4748
"globals": {
4849
"React": "writable"

.github/workflows/cd-manual.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Create docker images (manual)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
type: string
8+
description: Version
9+
required: true
10+
11+
jobs:
12+
build:
13+
name: Build, push, and deploy
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
db-type: [postgresql]
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Extract version parts from input
24+
id: extract_version
25+
run: |
26+
echo "version=$(echo ${{ github.event.inputs.version }})" >> $GITHUB_ENV
27+
echo "major=$(echo ${{ github.event.inputs.version }} | cut -d. -f1)" >> $GITHUB_ENV
28+
echo "minor=$(echo ${{ github.event.inputs.version }} | cut -d. -f2)" >> $GITHUB_ENV
29+
30+
- name: Generate tags
31+
id: generate_tags
32+
run: |
33+
echo "tag_major=$(echo ${{ matrix.db-type }}-${{ env.major }})" >> $GITHUB_ENV
34+
echo "tag_minor=$(echo ${{ matrix.db-type }}-${{ env.major }}.${{ env.minor }})" >> $GITHUB_ENV
35+
echo "tag_patch=$(echo ${{ matrix.db-type }}-${{ env.version }})" >> $GITHUB_ENV
36+
echo "tag_latest=$(echo ${{ matrix.db-type }}-latest)" >> $GITHUB_ENV
37+
38+
- uses: mr-smithers-excellent/docker-build-push@v6
39+
name: Build & push Docker image to ghcr.io for ${{ matrix.db-type }}
40+
with:
41+
image: umami
42+
tags: ${{ env.tag_major }}, ${{ env.tag_minor }}, ${{ env.tag_patch }}, ${{ env.tag_latest }}
43+
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
44+
registry: ghcr.io
45+
multiPlatform: true
46+
platform: linux/amd64,linux/arm64
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- uses: mr-smithers-excellent/docker-build-push@v6
51+
name: Build & push Docker image to docker.io for ${{ matrix.db-type }}
52+
with:
53+
image: umamisoftware/umami
54+
tags: ${{ env.tag_major }}, ${{ env.tag_minor }}, ${{ env.tag_patch }}, ${{ env.tag_latest }}
55+
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
56+
registry: docker.io
57+
username: ${{ secrets.DOCKER_USERNAME }}
58+
password: ${{ secrets.DOCKER_PASSWORD }}

.github/workflows/ci.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3-
41
name: Node.js CI
52

63
on: [push]
@@ -11,7 +8,6 @@ env:
118

129
jobs:
1310
build:
14-
# Only run the CI if it belongs to the original repository
1511
if: github.repository == 'umami-software/umami'
1612
runs-on: ubuntu-latest
1713

@@ -21,9 +17,6 @@ jobs:
2117
- node-version: 18.18
2218
pnpm-version: 10
2319
db-type: postgresql
24-
- node-version: 18.18
25-
pnpm-version: 10
26-
db-type: mysql
2720

2821
steps:
2922
- uses: actions/checkout@v4

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ node_modules
1010
/coverage
1111

1212
# next.js
13-
/.next/
14-
/out/
15-
/prisma/
16-
/src/generated/
13+
/.next
14+
/out
1715

1816
# production
1917
/build
2018
/public/script.js
2119
/geo
2220
/dist
21+
/generated
22+
/src/generated
2323

2424
# misc
2525
.DS_Store

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx lint-staged

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/public/script.js
1+
/public/script.js
2+
/src/generated/

.stylelintrc.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"extends": [
3-
"stylelint-config-recommended",
4-
"stylelint-config-css-modules",
5-
"stylelint-config-prettier"
6-
],
2+
"extends": ["stylelint-config-recommended", "stylelint-config-css-modules"],
73
"rules": {
84
"no-descending-specificity": null
9-
},
10-
"ignoreFiles": ["**/*.js", "**/*.md"]
5+
}
116
}

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ FROM node:22-alpine AS builder
1212
WORKDIR /app
1313
COPY --from=deps /app/node_modules ./node_modules
1414
COPY . .
15+
COPY docker/middleware.ts ./src
1516

1617
ARG DATABASE_TYPE
1718
ARG BASE_PATH
@@ -41,23 +42,21 @@ RUN set -x \
4142
&& apk add --no-cache curl
4243

4344
# Script dependencies
44-
RUN pnpm add npm-run-all dotenv prisma@6.7.0
45+
RUN pnpm add npm-run-all dotenv chalk semver prisma@6.18.0 @prisma/adapter-pg@6.18.0
4546

4647
# Permissions for prisma
4748
RUN chown -R nextjs:nodejs node_modules/.pnpm/
4849

4950
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
5051
COPY --from=builder /app/prisma ./prisma
5152
COPY --from=builder /app/scripts ./scripts
53+
COPY --from=builder /app/generated ./generated
5254

5355
# Automatically leverage output traces to reduce image size
5456
# https://nextjs.org/docs/advanced-features/output-file-tracing
5557
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
5658
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
5759

58-
# Custom routes
59-
RUN mv ./.next/routes-manifest.json ./.next/routes-manifest-orig.json
60-
6160
USER nextjs
6261

6362
EXPOSE 3000

0 commit comments

Comments
 (0)