Compare commits

...

16 commits

Author SHA1 Message Date
Mike Cao
d23ad5f272 Merge branch 'master' into dev
Some checks failed
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
# Conflicts:
#	.github/workflows/cd.yml
#	package.json
#	pnpm-lock.yaml
#	src/lib/date.ts
#	src/lib/schema.ts
2025-10-04 13:38:58 -07:00
Mike Cao
35c27589b7 Updated workflow to only run on tag publish.
Some checks failed
Node.js CI / build (mysql, 18.18, 10) (push) Has been cancelled
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
2025-10-04 13:32:40 -07:00
Mike Cao
aaf92058d4 Merge remote-tracking branch 'origin/master' 2025-10-04 12:36:49 -07:00
Mike Cao
b152cfe480 Added workflow to delete untagged images. 2025-10-04 12:36:39 -07:00
Mike Cao
82813f312a Added workflow to delete untagged images. 2025-10-04 12:12:39 -07:00
Mike Cao
2d0104382c Don't build Docker images for dev. 2025-10-04 11:44:37 -07:00
Mike Cao
5c0dacf58d Fix build. 2025-10-04 11:29:34 -07:00
Mike Cao
eca6b069f6
Merge pull request #3633 from mcnaveen/fix/asia-kolkata-tz
Some checks failed
Create docker images / Build, push, and deploy (push) Has been cancelled
Create docker images / Build, push, and deploy-1 (push) Has been cancelled
Node.js CI / build (mysql, 18.18, 10) (push) Has been cancelled
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled
feat (timezone): normalization function for handling legacy timezone identifiers
2025-09-24 12:55:20 -07:00
mcnaveen
9e1fe2e363
Enhance timezone handling by adding normalization for 'Asia/Calcutta' to 'Asia/Kolkata' and updating validation schema to use normalized timezones. 2025-09-24 16:45:58 +05:30
Mike Cao
9ee8f301ed
Merge pull request #3582 from fnwbr/master
Some checks are pending
Create docker images / Build, push, and deploy (push) Waiting to run
Create docker images / Build, push, and deploy-1 (push) Waiting to run
Node.js CI / build (mysql, 18.18, 10) (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
`POST /api/websites/<id>`: Make name and domain optional in the validation schema
2025-09-23 17:53:40 -07:00
Mike Cao
077eeceb88
Merge pull request #3628 from umami-software/dependabot/npm_and_yarn/next-15.4.7
Bump next from 15.3.3 to 15.4.7
2025-09-23 17:52:43 -07:00
Mike Cao
e191d9dae4
Merge pull request #3631 from umami-software/mikecao-patch-1
Add ISO country codes to constants
2025-09-23 17:51:40 -07:00
Mike Cao
a6966179f5
Add ISO country codes to constants 2025-09-23 17:50:40 -07:00
dependabot[bot]
9a543d8966
Bump next from 15.3.3 to 15.4.7
Bumps [next](https://github.com/vercel/next.js) from 15.3.3 to 15.4.7.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v15.3.3...v15.4.7)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.4.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-23 05:31:11 +00:00
Florian Weber
49055ebc7d Add test for updating a website with only shareId 2025-08-19 14:43:42 +00:00
Florian Weber
7343ee4593 /api/website/<id>: Make name and domain fields optional in POST request schema 2025-08-19 14:43:33 +00:00
6 changed files with 66 additions and 34 deletions

View file

@ -2,17 +2,8 @@ name: Create docker images
on:
push:
branches:
- master
- main
- dev
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches:
- master
- main
- dev
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
@ -22,8 +13,6 @@ jobs:
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
strategy:
@ -33,25 +22,22 @@ jobs:
steps:
- uses: actions/checkout@v5
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
# Install cosign (for image signing)
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry docker.io
if: github.event_name != 'pull_request' && github.repository == 'umami-software/umami'
- name: Log into Docker Hub
if: github.repository == 'umami-software/umami'
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log into ghcr registry
if: github.event_name != 'pull_request'
- name: Log into GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
@ -69,14 +55,8 @@ jobs:
latest=auto
prefix=${{ matrix.db-type }}-
tags: |
type=ref,event=branch
type=ref,event=pr
# output 1.1.2
type=semver,pattern={{version}}
# output 1.1
type=semver,pattern={{major}}.{{minor}}
# output 1
type=semver,pattern={{major}}
- name: Build and push Docker image
@ -86,15 +66,14 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64
build-args: DATABASE_TYPE=${{ matrix.db-type }}
push: ${{ github.event_name != 'pull_request' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Sign the resulting Docker image digest except on PRs.
# Sign the published image digest
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}

View file

@ -0,0 +1,22 @@
name: Delete untagged GHCR images
on:
workflow_dispatch: # Run manually from the Actions tab
jobs:
cleanup:
name: Delete all untagged images
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Delete untagged GHCR images
uses: actions/delete-package-versions@v5
with:
package-name: "umami" # 👈 change if your GHCR package name differs
package-type: "container"
delete-only-untagged-versions: true
min-versions-to-keep: 0

View file

@ -149,6 +149,21 @@ describe('Website API tests', () => {
});
});
it('Updates a website with only shareId.', () => {
cy.request({
method: 'POST',
url: `/api/websites/${websiteId}`,
headers: {
'Content-Type': 'application/json',
Authorization: Cypress.env('authorization'),
},
body: { shareId: 'ABCDEF' },
}).then(response => {
expect(response.status).to.eq(200);
expect(response.body).to.have.property('shareId', 'ABCDEF');
});
});
it('Resets a website by removing all data related to the website.', () => {
cy.request({
method: 'POST',

View file

@ -103,9 +103,18 @@ export const DATE_FORMATS = {
year: 'yyyy',
};
const TIMEZONE_MAPPINGS: Record<string, string> = {
'Asia/Calcutta': 'Asia/Kolkata',
};
export function normalizeTimezone(timezone: string): string {
return TIMEZONE_MAPPINGS[timezone] || timezone;
}
export function isValidTimezone(timezone: string) {
try {
Intl.DateTimeFormat(undefined, { timeZone: timezone });
const normalizedTimezone = normalizeTimezone(timezone);
Intl.DateTimeFormat(undefined, { timeZone: normalizedTimezone });
return true;
} catch {
return false;

View file

@ -277,6 +277,10 @@ function getSchema() {
}
function getClient() {
if (!process.env.DATABASE_URL) {
return null;
}
const prisma = new UmamiPrismaClient({
url: process.env.DATABASE_URL,
prismaClient: PrismaClient,

View file

@ -1,10 +1,13 @@
import { z } from 'zod';
import { isValidTimezone } from '@/lib/date';
import { isValidTimezone, normalizeTimezone } from '@/lib/date';
import { UNIT_TYPES } from './constants';
export const timezoneParam = z.string().refine(value => isValidTimezone(value), {
message: 'Invalid timezone',
});
export const timezoneParam = z
.string()
.refine((value: string) => isValidTimezone(value), {
message: 'Invalid timezone',
})
.transform((value: string) => normalizeTimezone(value));
export const unitParam = z.string().refine(value => UNIT_TYPES.includes(value), {
message: 'Invalid unit',