mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Compare commits
4 commits
1483241494
...
83b03d682c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83b03d682c | ||
|
|
60271779de | ||
|
|
33e927ed1f | ||
|
|
2993db14f0 |
6 changed files with 31 additions and 28 deletions
|
|
@ -16,13 +16,11 @@ COPY --from=deps /app/node_modules ./node_modules
|
|||
COPY . .
|
||||
COPY docker/middleware.ts ./src
|
||||
|
||||
ARG DATABASE_TYPE
|
||||
ARG BASE_PATH
|
||||
|
||||
ENV DATABASE_TYPE=$DATABASE_TYPE
|
||||
ENV BASE_PATH=$BASE_PATH
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV DATABASE_URL="postgresql://user:pass@localhost:5432/dummy"
|
||||
|
||||
RUN npm run build-docker
|
||||
|
||||
|
|
|
|||
29
README.md
29
README.md
|
|
@ -27,10 +27,10 @@ A detailed getting started guide can be found at [umami.is/docs](https://umami.i
|
|||
|
||||
### Requirements
|
||||
|
||||
- A server with Node.js version 18.18 or newer
|
||||
- A database. Umami supports [PostgreSQL](https://www.postgresql.org/) (minimum v12.14) databases.
|
||||
- A server with Node.js version 18.18+.
|
||||
- A PostgreSQL database version v12.14+.
|
||||
|
||||
### Get the Source Code and Install Packages
|
||||
### Get the source code and install packages
|
||||
|
||||
```bash
|
||||
git clone https://github.com/umami-software/umami.git
|
||||
|
|
@ -58,7 +58,7 @@ postgresql://username:mypassword@localhost:5432/mydb
|
|||
pnpm run build
|
||||
```
|
||||
|
||||
_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**._
|
||||
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**.
|
||||
|
||||
### Start the Application
|
||||
|
||||
|
|
@ -66,37 +66,36 @@ _The build step will create tables in your database if you are installing for th
|
|||
pnpm run start
|
||||
```
|
||||
|
||||
_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._
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
## 🐳 Installing with Docker
|
||||
|
||||
To build the Umami container and start up a Postgres database, run:
|
||||
Umami provides Docker images as well as a Docker compose file for easy deployment.
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Alternatively, to pull just the Umami Docker image with PostgreSQL support:
|
||||
Docker image:
|
||||
|
||||
```bash
|
||||
docker pull docker.umami.is/umami-software/umami:latest
|
||||
```
|
||||
|
||||
Docker compose to run Umami with a Postgres database, run:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Getting Updates
|
||||
> [!WARNING]
|
||||
> If you are updating from Umami V2, image "postgresql-latest" is deprecated. You must change it to "latest".
|
||||
> e.g., rename `docker.umami.is/umami-software/umami:postgresql-latest` to `docker.umami.is/umami-software/umami:latest`.
|
||||
|
||||
To get the latest features, simply do a pull, install any new dependencies, and rebuild:
|
||||
|
||||
```bash
|
||||
git pull
|
||||
pnpm install
|
||||
pnpm run build
|
||||
pnpm build
|
||||
```
|
||||
|
||||
To update the Docker image, simply pull the new images and rebuild:
|
||||
|
|
|
|||
|
|
@ -46,6 +46,14 @@
|
|||
"arrowParentheses": "asNeeded"
|
||||
}
|
||||
},
|
||||
"css": {
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2,
|
||||
"lineEnding": "lf"
|
||||
}
|
||||
},
|
||||
"assist": {
|
||||
"enabled": true,
|
||||
"actions": {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "umami",
|
||||
"version": "3.0.1",
|
||||
"version": "3.0.2",
|
||||
"description": "A modern, privacy-focused alternative to Google Analytics.",
|
||||
"author": "Umami Software, Inc. <hello@umami.is>",
|
||||
"license": "MIT",
|
||||
|
|
|
|||
|
|
@ -303,9 +303,7 @@ function getClient() {
|
|||
const url = process.env.DATABASE_URL;
|
||||
const replicaUrl = process.env.DATABASE_REPLICA_URL;
|
||||
const logQuery = process.env.LOG_QUERY;
|
||||
|
||||
const connectionUrl = new URL(url);
|
||||
const schema = connectionUrl.searchParams.get('schema') ?? undefined;
|
||||
const schema = getSchema();
|
||||
|
||||
const baseAdapter = new PrismaPg({ connectionString: url }, { schema });
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ async function relationalQuery(
|
|||
${joinSessionQuery}
|
||||
where revenue.website_id = {{websiteId::uuid}}
|
||||
and revenue.created_at between {{startDate}} and {{endDate}}
|
||||
and revenue.currency = upper({{currency}})
|
||||
and upper(revenue.currency) = {{currency}}
|
||||
${filterQuery}
|
||||
group by x, t
|
||||
order by t
|
||||
|
|
@ -83,7 +83,7 @@ async function relationalQuery(
|
|||
${cohortQuery}
|
||||
where revenue.website_id = {{websiteId::uuid}}
|
||||
and revenue.created_at between {{startDate}} and {{endDate}}
|
||||
and revenue.currency = upper({{currency}})
|
||||
and upper(revenue.currency) = {{currency}}
|
||||
${filterQuery}
|
||||
group by session.country
|
||||
`,
|
||||
|
|
@ -102,7 +102,7 @@ async function relationalQuery(
|
|||
${joinSessionQuery}
|
||||
where revenue.website_id = {{websiteId::uuid}}
|
||||
and revenue.created_at between {{startDate}} and {{endDate}}
|
||||
and revenue.currency = upper({{currency}})
|
||||
and upper(revenue.currency) = {{currency}}
|
||||
${filterQuery}
|
||||
`,
|
||||
queryParams,
|
||||
|
|
@ -154,7 +154,7 @@ async function clickhouseQuery(
|
|||
${cohortQuery}
|
||||
where website_revenue.website_id = {websiteId:UUID}
|
||||
and website_revenue.created_at between {startDate:DateTime64} and {endDate:DateTime64}
|
||||
and website_revenue.currency = upper({currency:String})
|
||||
and upper(website_revenue.currency) = {currency:String}
|
||||
${filterQuery}
|
||||
group by x, t
|
||||
order by t
|
||||
|
|
@ -182,7 +182,7 @@ async function clickhouseQuery(
|
|||
${cohortQuery}
|
||||
where website_revenue.website_id = {websiteId:UUID}
|
||||
and website_revenue.created_at between {startDate:DateTime64} and {endDate:DateTime64}
|
||||
and website_revenue.currency = upper({currency:String})
|
||||
and upper(website_revenue.currency) = {currency:String}
|
||||
${filterQuery}
|
||||
group by website_event.country
|
||||
order by value desc
|
||||
|
|
@ -205,7 +205,7 @@ async function clickhouseQuery(
|
|||
${cohortQuery}
|
||||
where website_revenue.website_id = {websiteId:UUID}
|
||||
and website_revenue.created_at between {startDate:DateTime64} and {endDate:DateTime64}
|
||||
and website_revenue.currency = upper({currency:String})
|
||||
aand upper(website_revenue.currency) = {currency:String}
|
||||
${filterQuery}
|
||||
`,
|
||||
queryParams,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue