Skip to content

Commit 2b771ff

Browse files
authored
Merge pull request umami-software#3832 from umami-software/dev
v3.0.2
2 parents 7e42b5b + 6027177 commit 2b771ff

File tree

592 files changed

+5746
-4749
lines changed

Some content is hidden

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

592 files changed

+5746
-4749
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ node_modules
77
.idea
88
.env
99
.env.*
10+
scripts/seed
11+
scripts/seed-data.ts

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 51 deletions
This file was deleted.

.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.prettierrc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

Dockerfile

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
ARG NODE_IMAGE_VERSION="22-alpine"
2+
13
# Install dependencies only when needed
2-
FROM node:22-alpine AS deps
4+
FROM node:${NODE_IMAGE_VERSION} AS deps
35
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
46
RUN apk add --no-cache libc6-compat
57
WORKDIR /app
@@ -8,26 +10,25 @@ RUN npm install -g pnpm
810
RUN pnpm install --frozen-lockfile
911

1012
# Rebuild the source code only when needed
11-
FROM node:22-alpine AS builder
13+
FROM node:${NODE_IMAGE_VERSION} AS builder
1214
WORKDIR /app
1315
COPY --from=deps /app/node_modules ./node_modules
1416
COPY . .
1517
COPY docker/middleware.ts ./src
1618

17-
ARG DATABASE_TYPE
1819
ARG BASE_PATH
1920

20-
ENV DATABASE_TYPE=$DATABASE_TYPE
2121
ENV BASE_PATH=$BASE_PATH
22-
2322
ENV NEXT_TELEMETRY_DISABLED=1
23+
ENV DATABASE_URL="postgresql://user:pass@localhost:5432/dummy"
2424

2525
RUN npm run build-docker
2626

2727
# Production image, copy all the files and run next
28-
FROM node:22-alpine AS runner
28+
FROM node:${NODE_IMAGE_VERSION} AS runner
2929
WORKDIR /app
3030

31+
ARG PRISMA_VERSION="6.19.0"
3132
ARG NODE_OPTIONS
3233

3334
ENV NODE_ENV=production
@@ -36,16 +37,14 @@ ENV NODE_OPTIONS=$NODE_OPTIONS
3637

3738
RUN addgroup --system --gid 1001 nodejs
3839
RUN adduser --system --uid 1001 nextjs
39-
RUN npm install -g pnpm
40-
4140
RUN set -x \
42-
&& apk add --no-cache curl
41+
&& apk add --no-cache curl \
42+
&& npm install -g pnpm
4343

4444
# Script dependencies
45-
RUN pnpm add npm-run-all dotenv chalk semver [email protected] @prisma/[email protected]
46-
47-
# Permissions for prisma
48-
RUN chown -R nextjs:nodejs node_modules/.pnpm/
45+
RUN pnpm --allow-build='@prisma/engines' add npm-run-all dotenv chalk semver \
46+
prisma@${PRISMA_VERSION} \
47+
@prisma/adapter-pg@${PRISMA_VERSION}
4948

5049
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
5150
COPY --from=builder /app/prisma ./prisma

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ A detailed getting started guide can be found at [umami.is/docs](https://umami.i
2727

2828
### Requirements
2929

30-
- A server with Node.js version 18.18 or newer
31-
- A database. Umami supports [PostgreSQL](https://www.postgresql.org/) (minimum v12.14) databases.
30+
- A server with Node.js version 18.18+.
31+
- A PostgreSQL database version v12.14+.
3232

33-
### Get the Source Code and Install Packages
33+
### Get the source code and install packages
3434

3535
```bash
3636
git clone https://github.com/umami-software/umami.git
@@ -58,45 +58,44 @@ postgresql://username:mypassword@localhost:5432/mydb
5858
pnpm run build
5959
```
6060

61-
_The build step will create tables in your database if you are installing for the first time. It will also create a login user with username **admin** and password **umami**._
61+
The build step will create tables in your database if you are installing for the first time. It will also create a login user with username **admin** and password **umami**.
6262

6363
### Start the Application
6464

6565
```bash
6666
pnpm run start
6767
```
6868

69-
_By default, this will launch the application on `http://localhost:3000`. You will need to either [proxy](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) requests from your web server or change the [port](https://nextjs.org/docs/api-reference/cli#production) to serve the application directly._
69+
By default, this will launch the application on `http://localhost:3000`. You will need to either [proxy](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/) requests from your web server or change the [port](https://nextjs.org/docs/api-reference/cli#production) to serve the application directly.
7070

7171
---
7272

7373
## 🐳 Installing with Docker
7474

75-
To build the Umami container and start up a Postgres database, run:
75+
Umami provides Docker images as well as a Docker compose file for easy deployment.
76+
77+
Docker image:
7678

7779
```bash
78-
docker compose up -d
80+
docker pull docker.umami.is/umami-software/umami:latest
7981
```
8082

81-
Alternatively, to pull just the Umami Docker image with PostgreSQL support:
83+
Docker compose to run Umami with a Postgres database, run:
8284

8385
```bash
84-
docker pull docker.umami.is/umami-software/umami:latest
86+
docker compose up -d
8587
```
8688

8789
---
8890

8991
## 🔄 Getting Updates
90-
> [!WARNING]
91-
> If you are updating from Umami V2, image "postgresql-latest" is deprecated. You must change it to "latest".
92-
> e.g., rename `docker.umami.is/umami-software/umami:postgresql-latest` to `docker.umami.is/umami-software/umami:latest`.
9392

9493
To get the latest features, simply do a pull, install any new dependencies, and rebuild:
9594

9695
```bash
9796
git pull
9897
pnpm install
99-
pnpm run build
98+
pnpm build
10099
```
101100

102101
To update the Docker image, simply pull the new images and rebuild:

biome.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.6/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"includes": ["**", "!!**/dist"]
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"lineWidth": 100,
14+
"indentStyle": "space",
15+
"indentWidth": 2,
16+
"lineEnding": "lf"
17+
},
18+
"linter": {
19+
"enabled": true,
20+
"rules": {
21+
"recommended": true,
22+
"a11y": "off",
23+
"correctness": {
24+
"useExhaustiveDependencies": "off"
25+
},
26+
"style": {
27+
"noDescendingSpecificity": "off"
28+
},
29+
"complexity": {
30+
"noImportantStyles": "off"
31+
},
32+
"suspicious": {
33+
"noArrayIndexKey": "off",
34+
"noExplicitAny": "off",
35+
"noImplicitAnyLet": "off"
36+
},
37+
"performance": {
38+
"noImgElement": "off"
39+
}
40+
}
41+
},
42+
"javascript": {
43+
"formatter": {
44+
"quoteStyle": "single",
45+
"trailingCommas": "all",
46+
"arrowParentheses": "asNeeded"
47+
}
48+
},
49+
"css": {
50+
"formatter": {
51+
"enabled": true,
52+
"indentStyle": "space",
53+
"indentWidth": 2,
54+
"lineEnding": "lf"
55+
}
56+
},
57+
"assist": {
58+
"enabled": true,
59+
"actions": {
60+
"source": {
61+
"organizeImports": "on"
62+
}
63+
}
64+
}
65+
}

docker/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextRequest, NextResponse } from 'next/server';
1+
import { type NextRequest, NextResponse } from 'next/server';
22

33
export const config = {
44
matcher: '/:path*',

next.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'dotenv/config';
2-
import pkg from './package.json' assert { type: 'json' };
2+
import pkg from './package.json' with { type: 'json' };
33

44
const TRACKER_SCRIPT = '/script.js';
55

0 commit comments

Comments
 (0)