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 v1.0.0 #1715

Merged
merged 10 commits into from
Dec 18, 2024
Merged
2 changes: 1 addition & 1 deletion .github/workflows/deployment-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
NEXT_VERSION: ${{ needs.release.outputs.version }}
DEPLOY_LATEST: ${{ github.ref_name == 'main' }}
DEPLOY_BETA: ${{ github.ref_name == 'beta' }}
PUSH_IMAGE: ${{ github.event_name != 'workflow_dispatch' || github.events.inputs.push-image == 'true' }}
PUSH_IMAGE: ${{ github.event_name != 'workflow_dispatch' || github.events.inputs.push-image == true }}
steps:
- uses: actions/checkout@v4
- name: Discord notification
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
WORKDIR /app

# gettext is required for envsubst
RUN apk add --no-cache redis nginx bash gettext
RUN apk add --no-cache redis nginx bash gettext su-exec
RUN mkdir /appdata
VOLUME /appdata
RUN mkdir /secrets
Expand All @@ -43,14 +43,12 @@
RUN chmod +x /usr/bin/homarr

# Don't run production as root
RUN chown -R nextjs:nodejs /appdata
RUN chown -R nextjs:nodejs /secrets
RUN mkdir -p /var/cache/nginx && chown -R nextjs:nodejs /var/cache/nginx && \
mkdir -p /var/log/nginx && chown -R nextjs:nodejs /var/log/nginx && \
mkdir -p /var/lib/nginx && chown -R nextjs:nodejs /var/lib/nginx && \
touch /run/nginx/nginx.pid && chown -R nextjs:nodejs /run/nginx/nginx.pid && \
mkdir -p /etc/nginx/templates /etc/nginx/ssl/certs && chown -R nextjs:nodejs /etc/nginx
USER nextjs

COPY --from=builder /app/apps/nextjs/next.config.mjs .
COPY --from=builder /app/apps/nextjs/package.json .
Expand All @@ -67,6 +65,8 @@
COPY --from=builder --chown=nextjs:nodejs /app/apps/nextjs/.next/static ./apps/nextjs/.next/static
COPY --from=builder --chown=nextjs:nodejs /app/apps/nextjs/public ./apps/nextjs/public
COPY --chown=nextjs:nodejs scripts/run.sh ./run.sh
COPY scripts/entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
COPY --chown=nextjs:nodejs scripts/generateRandomSecureKey.js ./generateRandomSecureKey.js
COPY --chown=nextjs:nodejs packages/redis/redis.conf /app/redis.conf
COPY --chown=nextjs:nodejs nginx.conf /etc/nginx/templates/nginx.conf
Expand All @@ -75,6 +75,7 @@
ENV DB_URL='/appdata/db/db.sqlite'
ENV DB_DIALECT='sqlite'
ENV DB_DRIVER='better-sqlite3'
ENV AUTH_PROVIDERS='credentials'

Check warning on line 78 in Dockerfile

View workflow job for this annotation

GitHub Actions / Deploy docker image

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "AUTH_PROVIDERS") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

ENTRYPOINT [ "/app/entrypoint.sh" ]
CMD ["sh", "run.sh"]
6 changes: 3 additions & 3 deletions apps/nextjs/src/components/layout/header/user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { CurrentUserAvatar } from "~/components/user-avatar";
import { UserAvatarMenu } from "~/components/user-avatar-menu";

export const UserButton = async () => {
const data = await api.updateChecker.getAvailableUpdates();
const session = await auth();
const isAdmin = session?.user.permissions.includes("admin");
const data = isAdmin ? await api.updateChecker.getAvailableUpdates() : undefined;
return (
<UserAvatarMenu availableUpdates={isAdmin ? data : undefined}>
<UserAvatarMenu availableUpdates={data}>
<UnstyledButton>
<Indicator disabled={data.length === 0 || !isAdmin} size={15} processing withBorder>
<Indicator disabled={data?.length === 0 || !isAdmin} size={15} processing withBorder>
<CurrentUserAvatar size="md" />
</Indicator>
</UnstyledButton>
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/versions/package-reader.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fsPromises from "fs/promises";
import { glob } from "glob";

import packageJson from "~/../package.json";
import packageJson from "../../../../package.json";

const getPackageVersion = () => packageJson.version;
const getDependenciesAsync = async (): Promise<PackageJsonDependencies> => {
Expand Down
33 changes: 7 additions & 26 deletions packages/api/src/router/integration/integration-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ import {
} from "@homarr/db/schema/sqlite";
import type { IntegrationSecretKind } from "@homarr/definitions";
import {
getIntegrationKindsByCategory,
getPermissionsWithParents,
integrationDefs,
integrationKinds,
integrationSecretKindObject,
isIntegrationWithSearchSupport,
} from "@homarr/definitions";
import { integrationCreatorFromSecrets } from "@homarr/integrations";
import { integrationCreator } from "@homarr/integrations";
import { validation, z } from "@homarr/validation";

import { createOneIntegrationMiddleware } from "../../middlewares/integration";
import { createTRPCRouter, permissionRequiredProcedure, protectedProcedure, publicProcedure } from "../../trpc";
import { throwIfActionForbiddenAsync } from "./integration-access";
import { testConnectionAsync } from "./integration-test-connection";
Expand Down Expand Up @@ -90,7 +91,7 @@ export const integrationRouter = createTRPCRouter({
where: inArray(
integrations.kind,
objectEntries(integrationDefs)
.filter(([_, integration]) => integration.supportsSearch)
.filter(([_, integration]) => [...integration.category].includes("search"))
.map(([kind, _]) => kind),
),
});
Expand Down Expand Up @@ -383,31 +384,11 @@ export const integrationRouter = createTRPCRouter({
});
}),
searchInIntegration: protectedProcedure
.unstable_concat(createOneIntegrationMiddleware("query", ...getIntegrationKindsByCategory("search")))
.input(z.object({ integrationId: z.string(), query: z.string() }))
.query(async ({ ctx, input }) => {
const integration = await ctx.db.query.integrations.findFirst({
where: eq(integrations.id, input.integrationId),
with: {
secrets: true,
},
});

if (!integration) {
throw new TRPCError({
code: "NOT_FOUND",
message: "The requested integration does not exist",
});
}

if (!isIntegrationWithSearchSupport(integration)) {
throw new TRPCError({
code: "BAD_REQUEST",
message: "The requested integration does not support searching",
});
}

const integrationInstance = integrationCreatorFromSecrets(integration);
return await integrationInstance.searchAsync(input.query);
const integrationInstance = integrationCreator(ctx.integration);
return await integrationInstance.searchAsync(encodeURI(input.query));
}),
});

Expand Down
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@t3-oss/env-nextjs": "^0.11.1",
"bcrypt": "^5.1.1",
"cookies": "^0.9.1",
"ldapts": "7.2.2",
"ldapts": "7.3.0",
"next": "^14.2.20",
"next-auth": "5.0.0-beta.25",
"react": "^19.0.0",
Expand Down
49 changes: 25 additions & 24 deletions packages/definitions/src/docs/homarr-docs-sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type HomarrDocumentationPath =
| "/blog/2023/11/10/authentication"
| "/blog/2023/12/22/updated-documentation"
| "/blog/2024/09/23/version-1.0"
| "/blog/2024/12/17/open-beta-1.0"
| "/blog/archive"
| "/blog/authors"
| "/blog/authors/ajnart"
Expand All @@ -33,6 +34,7 @@ export type HomarrDocumentationPath =
| "/blog/tags/update"
| "/blog/tags/version"
| "/blog/translations"
| "/search"
| "/docs/tags"
| "/docs/tags/active-directory"
| "/docs/tags/ad-guard"
Expand All @@ -44,7 +46,6 @@ export type HomarrDocumentationPath =
| "/docs/tags/apps"
| "/docs/tags/banner"
| "/docs/tags/blocking"
| "/docs/tags/board"
| "/docs/tags/boards"
| "/docs/tags/bookmark"
| "/docs/tags/bookmarks"
Expand All @@ -56,10 +57,12 @@ export type HomarrDocumentationPath =
| "/docs/tags/connections"
| "/docs/tags/customization"
| "/docs/tags/data-sources"
| "/docs/tags/database"
| "/docs/tags/developer"
| "/docs/tags/development"
| "/docs/tags/dns"
| "/docs/tags/docker"
| "/docs/tags/donation"
| "/docs/tags/edit-mode"
| "/docs/tags/env"
| "/docs/tags/environment-variables"
Expand All @@ -71,6 +74,8 @@ export type HomarrDocumentationPath =
| "/docs/tags/hardware"
| "/docs/tags/health"
| "/docs/tags/help"
| "/docs/tags/icon-picker"
| "/docs/tags/icon-repositories"
| "/docs/tags/icons"
| "/docs/tags/iframe"
| "/docs/tags/images"
Expand All @@ -84,17 +89,18 @@ export type HomarrDocumentationPath =
| "/docs/tags/links"
| "/docs/tags/lists"
| "/docs/tags/management"
| "/docs/tags/media"
| "/docs/tags/monitoring"
| "/docs/tags/news"
| "/docs/tags/notebook"
| "/docs/tags/notes"
| "/docs/tags/oidc"
| "/docs/tags/open-collective"
| "/docs/tags/open-media-vault"
| "/docs/tags/overseerr"
| "/docs/tags/permissions"
| "/docs/tags/pi-hole"
| "/docs/tags/ping"
| "/docs/tags/preferences"
| "/docs/tags/programming"
| "/docs/tags/proxmox"
| "/docs/tags/proxy"
Expand All @@ -112,47 +118,44 @@ export type HomarrDocumentationPath =
| "/docs/tags/table"
| "/docs/tags/technical-documentation"
| "/docs/tags/text"
| "/docs/tags/theming"
| "/docs/tags/torrent"
| "/docs/tags/traefik"
| "/docs/tags/translations"
| "/docs/tags/unraid"
| "/docs/tags/user"
| "/docs/tags/uploads"
| "/docs/tags/usenet"
| "/docs/tags/users"
| "/docs/tags/variables"
| "/docs/tags/widgets"
| "/docs/advanced/command-line"
| "/docs/advanced/command-line/password-recovery"
| "/docs/advanced/configuration/environment-variables"
| "/docs/advanced/configuration/keyboard-shortcuts"
| "/docs/advanced/configuration/proxies-and-certificates"
| "/docs/advanced/customizations/board-customization"
| "/docs/advanced/customizations/dark-mode"
| "/docs/advanced/customizations/icons"
| "/docs/advanced/customizations/user-preferences"
| "/docs/advanced/sso"
| "/docs/advanced/development/getting-started"
| "/docs/advanced/environment-variables"
| "/docs/advanced/icons"
| "/docs/advanced/keyboard-shortcuts"
| "/docs/advanced/proxy"
| "/docs/advanced/single-sign-on"
| "/docs/category/advanced"
| "/docs/category/developer-guide"
| "/docs/category/community"
| "/docs/category/developer-guides"
| "/docs/category/getting-started"
| "/docs/category/installation"
| "/docs/category/installation-1"
| "/docs/category/integrations"
| "/docs/category/management"
| "/docs/category/more"
| "/docs/category/widgets"
| "/docs/community/donate"
| "/docs/community/faq"
| "/docs/community/get-in-touch"
| "/docs/community/license"
| "/docs/community/translations"
| "/docs/development/getting-started"
| "/docs/getting-started"
| "/docs/getting-started/after-the-installation"
| "/docs/getting-started/glossary"
| "/docs/getting-started/installation/docker"
| "/docs/getting-started/installation/easy-panel"
| "/docs/getting-started/installation/helm"
| "/docs/getting-started/installation/home-assistant"
| "/docs/getting-started/installation/kubernetes"
| "/docs/getting-started/installation/portainer"
| "/docs/getting-started/installation/qnap"
| "/docs/getting-started/installation/saltbox"
Expand All @@ -172,26 +175,24 @@ export type HomarrDocumentationPath =
| "/docs/management/apps"
| "/docs/management/boards"
| "/docs/management/integrations"
| "/docs/management/media"
| "/docs/management/search-engines"
| "/docs/management/settings"
| "/docs/management/users"
| "/docs/widgets/bookmarks"
| "/docs/widgets/calendar-widget"
| "/docs/widgets/clock-widget"
| "/docs/widgets/dashdot-widget"
| "/docs/widgets/calendar"
| "/docs/widgets/clock"
| "/docs/widgets/dns-hole"
| "/docs/widgets/download-speed-widget"
| "/docs/widgets/downloads"
| "/docs/widgets/health-monitoring"
| "/docs/widgets/home-assistant"
| "/docs/widgets/iframe"
| "/docs/widgets/indexer-manager"
| "/docs/widgets/media-requests"
| "/docs/widgets/media-server"
| "/docs/widgets/notebook"
| "/docs/widgets/rss-widget"
| "/docs/widgets/torrent-widget"
| "/docs/widgets/usenet-widget"
| "/docs/widgets/rss"
| "/docs/widgets/video"
| "/docs/widgets/weather-widget"
| "/docs/widgets/weather"
| ""
| "/sitemap.xml";
2 changes: 1 addition & 1 deletion packages/definitions/src/group.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const everyoneGroup = "everyone";
export const credentialsAdminGroup = "admin";
export const credentialsAdminGroup = "credentials-admin";
Loading
Loading