Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): automatic release v0.1.0 #1196

Merged
merged 28 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
da2c8fa
chore(deps): update dependency jsdom to ^25.0.1 (#1163)
homarr-renovate[bot] Sep 22, 2024
df7ba1e
chore(deps): update pascalgn/automerge-action action to v0.16.4 (#1164)
homarr-renovate[bot] Sep 22, 2024
6aa5adf
fix(deps): update dependency typescript-eslint to ^8.7.0 (#1165)
homarr-renovate[bot] Sep 23, 2024
cc29cb8
refactor: replace custom no integration selected logic with existing …
Meierschlumpf Sep 23, 2024
f3858f0
chore(deps): update dependency @types/node to ^20.16.6 (#1169)
homarr-renovate[bot] Sep 23, 2024
141c651
chore(deps): update dependency eslint to ^9.11.1 (#1167)
homarr-renovate[bot] Sep 23, 2024
07f72f7
chore(deps): update dependency @types/react to ^18.3.9 (#1170)
homarr-renovate[bot] Sep 24, 2024
36915d9
feat: DnsHole feature parity with oldmarr (#1145)
SeDemal Sep 24, 2024
ea0c35f
chore(deps): update dependency @types/node to ^20.16.7 (#1174)
homarr-renovate[bot] Sep 25, 2024
e2414f5
fix(deps): update dependency @tanstack/react-query-devtools to ^5.58.…
homarr-renovate[bot] Sep 25, 2024
16e7f93
fix(deps): update dependency @auth/core to ^0.35.1 (#1176)
homarr-renovate[bot] Sep 25, 2024
4e431b4
fix(deps): update dependency @auth/drizzle-adapter to ^1.5.1 (#1177)
homarr-renovate[bot] Sep 25, 2024
78230b1
fix(deps): update mantine monorepo to ^7.13.0 (#1178)
homarr-renovate[bot] Sep 25, 2024
f495383
fix(deps): update dependency @auth/core to ^0.35.2 (#1180)
homarr-renovate[bot] Sep 25, 2024
b2143ed
fix(deps): update tiptap monorepo to v2.7.3 (#1182)
homarr-renovate[bot] Sep 25, 2024
d029f48
fix: various issues with docker image workflow (#1172)
MaienM Sep 25, 2024
80e896f
chore(deps): update dependency @types/node to ^20.16.8 (#1183)
homarr-renovate[bot] Sep 25, 2024
65f2611
fix: container image always being on AMD64 arch (#1173)
MaienM Sep 25, 2024
17d6229
fix(deps): update dependency @auth/drizzle-adapter to ^1.5.2 (#1181)
homarr-renovate[bot] Sep 25, 2024
4795c8c
fix(deps): update tiptap monorepo to v2.7.4 (#1186)
homarr-renovate[bot] Sep 26, 2024
2dd21d6
chore(deps): update dependency @types/node to ^20.16.9 (#1185)
homarr-renovate[bot] Sep 26, 2024
a30be7b
feat: add env variable to disable db migrations on startup (#1179)
Meierschlumpf Sep 26, 2024
8f7ed05
fix: issue with color scheme in layout (#1168)
Meierschlumpf Sep 26, 2024
1bce7a3
fix(deps): update dependency @tabler/icons-react to ^3.18.0 (#1188)
homarr-renovate[bot] Sep 26, 2024
f6c7271
fix(deps): update dependency tldts to ^6.1.48 (#1190)
homarr-renovate[bot] Sep 27, 2024
2245e7a
fix(deps): update dependency eslint-plugin-react to ^7.37.0 (#1189)
homarr-renovate[bot] Sep 27, 2024
3ead13e
chore(deps): update dependency @types/node to ^20.16.10 (#1191)
homarr-renovate[bot] Sep 27, 2024
f2c3d10
chore(deps): update dependency @types/react to ^18.3.10 (#1192)
homarr-renovate[bot] Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/deployment-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
node-version: [20]
steps:
- name: Discord notification
if: ${{ github.events.inputs.send-notifications || true }}
if: ${{ github.events.inputs.send-notifications != false }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
Expand All @@ -52,7 +52,7 @@ jobs:
token: ${{ github.token }}
branch: dev
- name: Discord notification
if: ${{ github.events.inputs.send-notifications || true }}
if: ${{ github.events.inputs.send-notifications != false }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
Expand All @@ -66,7 +66,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Discord notification
if: ${{ github.events.inputs.send-notifications || true }}
if: ${{ github.events.inputs.send-notifications != false }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
Expand Down Expand Up @@ -120,14 +120,14 @@ jobs:
env:
SKIP_ENV_VALIDATION: true
- name: Discord notification
if: ${{ github.events.inputs.send-notifications || true && (github.events.inputs.push-image == 'true' || github.events.inputs.push-image == null) }}
if: ${{ github.events.inputs.send-notifications != false && (github.events.inputs.push-image == 'true' || github.events.inputs.push-image == null) }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: "Deployment of image has completed. Image ID is '${{ steps.buildPushAction.outputs.imageid }}'."
- name: Discord notification
if: ${{ github.events.inputs.send-notifications || true && !(github.events.inputs.push-image == 'true' || github.events.inputs.push-image == null) }}
if: ${{ github.events.inputs.send-notifications != false && !(github.events.inputs.push-image == 'true' || github.events.inputs.push-image == null) }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployment-weekly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- id: automerge
if: ${{ steps.semver.outputs.bump != 'major' }}
name: automerge
uses: "pascalgn/[email protected].3"
uses: "pascalgn/[email protected].4"
env:
GITHUB_TOKEN: ${{ steps.obtainMergeToken.outputs.token }}
MERGE_METHOD: merge # we prefer merge commits for merging to master
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 node:20.17.0-alpine AS base
FROM node:20.17.0-alpine AS base

FROM base AS builder
RUN apk add --no-cache libc6-compat
Expand Down
20 changes: 10 additions & 10 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
"@homarr/ui": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@homarr/widgets": "workspace:^0.1.0",
"@mantine/colors-generator": "^7.12.2",
"@mantine/core": "^7.12.2",
"@mantine/hooks": "^7.12.2",
"@mantine/modals": "^7.12.2",
"@mantine/tiptap": "^7.12.2",
"@mantine/colors-generator": "^7.13.0",
"@mantine/core": "^7.13.0",
"@mantine/hooks": "^7.13.0",
"@mantine/modals": "^7.13.0",
"@mantine/tiptap": "^7.13.0",
"@million/lint": "1.0.0-rc.84",
"@t3-oss/env-nextjs": "^0.11.1",
"@tabler/icons-react": "^3.17.0",
"@tabler/icons-react": "^3.18.0",
"@tanstack/react-query": "^5.56.2",
"@tanstack/react-query-devtools": "^5.56.2",
"@tanstack/react-query-devtools": "^5.58.0",
"@tanstack/react-query-next-experimental": "5.56.2",
"@trpc/client": "next",
"@trpc/next": "next",
Expand Down Expand Up @@ -79,13 +79,13 @@
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/chroma-js": "2.4.4",
"@types/node": "^20.16.5",
"@types/node": "^20.16.10",
"@types/prismjs": "^1.26.4",
"@types/react": "^18.3.8",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@types/swagger-ui-react": "^4.18.3",
"concurrently": "^9.0.1",
"eslint": "^9.11.0",
"eslint": "^9.11.1",
"node-loader": "^2.0.0",
"prettier": "^3.3.3",
"typescript": "^5.6.2"
Expand Down
8 changes: 6 additions & 2 deletions apps/nextjs/src/app/[locale]/_client-providers/mantine.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
"use client";

import { useState } from "react";
import type { PropsWithChildren } from "react";
import { useState } from "react";
import type { MantineColorScheme, MantineColorSchemeManager } from "@mantine/core";
import { createTheme, isMantineColorScheme, MantineProvider } from "@mantine/core";
import dayjs from "dayjs";

import { clientApi } from "@homarr/api/client";
import { useSession } from "@homarr/auth/client";
import { parseCookies, setClientCookie } from "@homarr/common";

export const CustomMantineProvider = ({ children }: PropsWithChildren) => {
const manager = useColorSchemeManager();
Expand Down Expand Up @@ -50,7 +52,8 @@ function useColorSchemeManager(): MantineColorSchemeManager {
}

try {
return (window.localStorage.getItem(key) as MantineColorScheme | undefined) ?? defaultValue;
const cookies = parseCookies(document.cookie);
return (cookies[key] as MantineColorScheme | undefined) ?? defaultValue;
} catch {
return defaultValue;
}
Expand All @@ -61,6 +64,7 @@ function useColorSchemeManager(): MantineColorSchemeManager {
if (session) {
mutateColorScheme({ colorScheme: value });
}
setClientCookie(key, value, { expires: dayjs().add(1, "year").toDate() });
window.localStorage.setItem(key, value);
} catch (error) {
console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.", error);
Expand Down
4 changes: 3 additions & 1 deletion apps/nextjs/src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import "@homarr/spotlight/styles.css";
import "@homarr/ui/styles.css";
import "~/styles/scroll-area.scss";

import { cookies } from "next/headers";

import { env } from "@homarr/auth/env.mjs";
import { auth } from "@homarr/auth/next";
import { ModalProvider } from "@homarr/modals";
Expand Down Expand Up @@ -53,7 +55,7 @@ export const viewport: Viewport = {

export default async function Layout(props: { children: React.ReactNode; params: { locale: string } }) {
const session = await auth();
const colorScheme = session?.user.colorScheme;
const colorScheme = cookies().get("homarr-color-scheme")?.value ?? "light";

const StackedProvider = composeWrappers([
(innerProps) => {
Expand Down
4 changes: 2 additions & 2 deletions apps/tasks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
"@homarr/eslint-config": "workspace:^0.2.0",
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/node": "^20.16.5",
"@types/node": "^20.16.10",
"dotenv-cli": "^7.4.2",
"eslint": "^9.11.0",
"eslint": "^9.11.1",
"prettier": "^3.3.3",
"tsx": "4.13.3",
"typescript": "^5.6.2"
Expand Down
2 changes: 1 addition & 1 deletion apps/websocket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/ws": "^8.5.12",
"eslint": "^9.11.0",
"eslint": "^9.11.1",
"prettier": "^3.3.3",
"typescript": "^5.6.2"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@vitest/coverage-v8": "^2.1.1",
"@vitest/ui": "^2.1.1",
"cross-env": "^7.0.3",
"jsdom": "^25.0.0",
"jsdom": "^25.0.1",
"prettier": "^3.3.3",
"testcontainers": "^10.13.1",
"turbo": "^2.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@homarr/eslint-config": "workspace:^0.2.0",
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"eslint": "^9.11.0",
"eslint": "^9.11.1",
"typescript": "^5.6.2"
}
}
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/dockerode": "^3.3.31",
"eslint": "^9.11.0",
"eslint": "^9.11.1",
"prettier": "^3.3.3",
"typescript": "^5.6.2"
}
Expand Down
66 changes: 45 additions & 21 deletions packages/api/src/router/widgets/dns-hole.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,68 @@
import { TRPCError } from "@trpc/server";
import { observable } from "@trpc/server/observable";

import type { Modify } from "@homarr/common/types";
import type { Integration } from "@homarr/db/schema/sqlite";
import type { IntegrationKindByCategory, WidgetKind } from "@homarr/definitions";
import { getIntegrationKindsByCategory } from "@homarr/definitions";
import { integrationCreator } from "@homarr/integrations";
import type { DnsHoleSummary } from "@homarr/integrations/types";
import { logger } from "@homarr/log";
import { createCacheChannel } from "@homarr/redis";
import { controlsInputSchema } from "@homarr/integrations/types";
import { createItemAndIntegrationChannel } from "@homarr/redis";
import { z } from "@homarr/validation";

import { controlsInputSchema } from "../../../../integrations/src/pi-hole/pi-hole-types";
import { createManyIntegrationMiddleware, createOneIntegrationMiddleware } from "../../middlewares/integration";
import { createTRPCRouter, publicProcedure } from "../../trpc";

export const dnsHoleRouter = createTRPCRouter({
summary: publicProcedure
.input(z.object({ widgetKind: z.enum(["dnsHoleSummary", "dnsHoleControls"]) }))
.unstable_concat(createManyIntegrationMiddleware("query", ...getIntegrationKindsByCategory("dnsHole")))
.query(async ({ ctx }) => {
.query(async ({ input: { widgetKind }, ctx }) => {
const results = await Promise.all(
ctx.integrations.map(async (integration) => {
const cache = createCacheChannel<DnsHoleSummary>(`dns-hole-summary:${integration.id}`);
const { data } = await cache.consumeAsync(async () => {
const client = integrationCreator(integration);

return await client.getSummaryAsync().catch((err) => {
logger.error("dns-hole router - ", err);
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message: `Failed to fetch DNS Hole summary for ${integration.name} (${integration.id})`,
});
});
});
ctx.integrations.map(async ({ decryptedSecrets: _, ...integration }) => {
const channel = createItemAndIntegrationChannel<DnsHoleSummary>(widgetKind, integration.id);
const { data: summary, timestamp } = (await channel.getAsync()) ?? { data: null, timestamp: new Date(0) };

return {
integrationId: integration.id,
integrationKind: integration.kind,
summary: data,
integration,
timestamp,
summary,
};
}),
);
return results;
}),

subscribeToSummary: publicProcedure
.input(z.object({ widgetKind: z.enum(["dnsHoleSummary", "dnsHoleControls"]) }))
.unstable_concat(createManyIntegrationMiddleware("query", ...getIntegrationKindsByCategory("dnsHole")))
.subscription(({ input: { widgetKind }, ctx }) => {
return observable<{
integration: Modify<Integration, { kind: IntegrationKindByCategory<"dnsHole"> }>;
timestamp: Date;
summary: DnsHoleSummary;
}>((emit) => {
const unsubscribes: (() => void)[] = [];
for (const integrationWithSecrets of ctx.integrations) {
const { decryptedSecrets: _, ...integration } = integrationWithSecrets;
const channel = createItemAndIntegrationChannel<DnsHoleSummary>(widgetKind as WidgetKind, integration.id);
const unsubscribe = channel.subscribe((summary) => {
emit.next({
integration,
timestamp: new Date(),
summary,
});
});
unsubscribes.push(unsubscribe);
}
return () => {
unsubscribes.forEach((unsubscribe) => {
unsubscribe();
});
};
});
}),

enable: publicProcedure
.unstable_concat(createOneIntegrationMiddleware("interact", ...getIntegrationKindsByCategory("dnsHole")))
.mutation(async ({ ctx: { integration } }) => {
Expand Down
8 changes: 7 additions & 1 deletion packages/api/src/router/widgets/downloads.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { observable } from "@trpc/server/observable";

import type { Modify } from "@homarr/common/types";
import type { Integration } from "@homarr/db/schema/sqlite";
import type { IntegrationKindByCategory } from "@homarr/definitions";
import { getIntegrationKindsByCategory } from "@homarr/definitions";
import type { DownloadClientJobsAndStatus } from "@homarr/integrations";
import { downloadClientItemSchema, integrationCreator } from "@homarr/integrations";
Expand Down Expand Up @@ -33,7 +35,11 @@ export const downloadsRouter = createTRPCRouter({
subscribeToJobsAndStatuses: publicProcedure
.unstable_concat(createDownloadClientIntegrationMiddleware("query"))
.subscription(({ ctx }) => {
return observable<{ integration: Integration; timestamp: Date; data: DownloadClientJobsAndStatus }>((emit) => {
return observable<{
integration: Modify<Integration, { kind: IntegrationKindByCategory<"downloadClient"> }>;
timestamp: Date;
data: DownloadClientJobsAndStatus;
}>((emit) => {
const unsubscribes: (() => void)[] = [];
for (const integrationWithSecrets of ctx.integrations) {
const { decryptedSecrets: _, ...integration } = integrationWithSecrets;
Expand Down
23 changes: 19 additions & 4 deletions packages/auth/callbacks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { cookies } from "next/headers";
import type { Adapter } from "@auth/core/adapters";
import dayjs from "dayjs";
import type { NextAuthConfig } from "next-auth";

import type { Database } from "@homarr/db";
Expand Down Expand Up @@ -52,12 +53,12 @@ export const createSessionCallback = (db: Database): NextAuthCallbackOf<"session
};

export const createSignInCallback =
(adapter: Adapter, isCredentialsRequest: boolean): NextAuthCallbackOf<"signIn"> =>
(adapter: Adapter, db: Database, isCredentialsRequest: boolean): NextAuthCallbackOf<"signIn"> =>
async ({ user }) => {
if (!isCredentialsRequest) return true;

// https://github.com/nextauthjs/next-auth/issues/6106
if (!adapter.createSession) {
if (!adapter.createSession || !user.id) {
return false;
}

Expand All @@ -66,8 +67,7 @@ export const createSignInCallback =

await adapter.createSession({
sessionToken,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
userId: user.id!,
userId: user.id,
expires: sessionExpires,
});

Expand All @@ -79,6 +79,21 @@ export const createSignInCallback =
secure: true,
});

const dbUser = await db.query.users.findFirst({
where: eq(users.id, user.id),
columns: {
colorScheme: true,
},
});

if (!dbUser) return false;

// We use a cookie as localStorage is not shared with server (otherwise flickering would occur)
cookies().set("homarr-color-scheme", dbUser.colorScheme, {
path: "/",
expires: dayjs().add(1, "year").toDate(),
});

return true;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/auth/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const createConfiguration = (isCredentialsRequest: boolean, headers: Read
]),
callbacks: {
session: createSessionCallback(db),
signIn: createSignInCallback(adapter, isCredentialsRequest),
signIn: createSignInCallback(adapter, db, isCredentialsRequest),
},
redirectProxyUrl: createRedirectUri(headers, "/api/auth"),
secret: "secret-is-not-defined-yet", // TODO: This should be added later
Expand Down
6 changes: 3 additions & 3 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
"prettier": "@homarr/prettier-config",
"dependencies": {
"@auth/core": "^0.35.0",
"@auth/drizzle-adapter": "^1.5.0",
"@auth/core": "^0.35.2",
"@auth/drizzle-adapter": "^1.5.2",
"@homarr/common": "workspace:^0.1.0",
"@homarr/db": "workspace:^0.1.0",
"@homarr/definitions": "workspace:^0.1.0",
Expand All @@ -45,7 +45,7 @@
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/bcrypt": "5.0.2",
"@types/cookies": "0.9.0",
"eslint": "^9.11.0",
"eslint": "^9.11.1",
"prettier": "^3.3.3",
"typescript": "^5.6.2"
}
Expand Down
Loading