Compare commits

...
Author SHA1 Message Date
Releases Homarr 1fa0fc50c5 chore(release): 1.0.0-beta.8 [skip ci] 2024-12-25 14:19:38 +00:00
homarr-releases[bot] e9a1dae857 chore(release): automatic release v1.0.0 2024-12-25 14:18:45 +00:00
Meier Lukas e37279fe80 fix: oldmarr import user casing wrong (#1784) 2024-12-25 15:17:51 +01:00
homarr-renovate[bot] 82c6ce7b77 fix(deps): update dependency drizzle-orm to ^0.38.3 (#1783)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-25 12:25:14 +00:00
homarr-renovate[bot] 555212e2dc fix(deps): update dependency drizzle-zod to ^0.6.1 (#1782)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-25 10:53:06 +00:00
homarr-crowdin[bot] c831539772 chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2024-12-25 00:43:00 +00:00
homarr-renovate[bot] 3e2ffbd7bf fix(deps): update dependency @ctrl/transmission to ^7.2.0 (#1777)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-24 20:33:01 +00:00
Thomas Camlong 22d7f676eb chore(lang): updated translations from crowdin (#1774)
* New translations en.json (Hebrew)

* New translations en.json (Hebrew)
2024-12-24 21:26:29 +01:00
homarr-crowdin[bot] 23bf262f4e chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2024-12-24 20:26:03 +00:00
homarr-renovate[bot] ecae80d741 fix(deps): update dependency @ctrl/deluge to ^7.1.0 (#1776)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-24 20:16:58 +00:00
Releases Homarr 162e8adf4c chore(release): 1.0.0-beta.7 [skip ci] 2024-12-24 13:34:42 +00:00
homarr-releases[bot] 620ec0315f chore(release): automatic release v1.0.0 2024-12-24 13:33:47 +00:00
Meier Lukas 8df398c3c7 feat(apps): remove url variables (#1771) 2024-12-24 14:16:24 +01:00
Meier Lukas 425359be02 fix(board): item background and border overridden by mantine card styles (#1769) 2024-12-24 14:16:11 +01:00
Meier Lukas 8893b72fe3 fix(board): tiles order not respected on firefox (#1770) 2024-12-24 14:15:58 +01:00
Meier Lukas b9483379dd fix(onboard): missing admin permission assignment for external group (#1764) 2024-12-24 14:15:46 +01:00
Meier Lukas 0336803550 fix(auth): oidc redirect does not respect https protocol (#1763) 2024-12-24 14:15:34 +01:00
Meier Lukas e220087e96 fix(icons): local icon repository does not work with medias (#1765) 2024-12-24 14:15:18 +01:00
Manuel f127c9325c config: update issue templates (#1751) 2024-12-24 13:05:59 +00:00
homarr-renovate[bot] c410b06a15 fix(deps): update tanstack-query monorepo to ^5.62.10 (#1772)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-24 12:25:11 +00:00
Thomas Camlong ce755efe4d chore(lang): updated translations from crowdin (#1760)
* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Hebrew)

* New translations en.json (Hebrew)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)
2024-12-24 11:01:14 +01:00
homarr-renovate[bot] 8b416a6dd3 fix(deps): update dependency @ctrl/qbittorrent to ^9.2.0 (#1768)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-24 04:18:59 +00:00
homarr-renovate[bot] fe95334aa7 fix(deps): update dependency eslint-plugin-react to ^7.37.3 (#1767)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-24 03:02:21 +00:00
homarr-crowdin[bot] b0facfd77a chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2024-12-24 00:44:22 +00:00
homarr-renovate[bot] 01db27c34f fix(deps): update dependency react-error-boundary to v5 (#1748)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-23 20:17:53 +01:00
homarr-renovate[bot] 999cf58625 chore(deps): update dependency dotenv-cli to v8 (#1741)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-23 20:14:01 +01:00
homarr-renovate[bot] 9223dd06ee fix(deps): update dependency typescript-eslint to ^8.18.2 (#1762)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-23 17:34:06 +00:00
homarr-renovate[bot] 42da2b9b06 fix(deps): update tanstack-query monorepo to ^5.62.9 (#1761)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-23 17:15:12 +00:00
Thomas CamlongandMeier Lukas a73eed63eb chore(lang): updated translations from crowdin (#1754)
* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Hungarian)

---------

Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2024-12-23 12:01:12 +01:00
homarr-crowdin[bot] 44dcc72d43 chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2024-12-23 10:51:54 +00:00
homarr-renovate[bot] d02ded5511 fix(deps): update dependency mysql2 to v3.12.0 (#1758)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-23 10:38:45 +00:00
homarr-renovate[bot] dfacb08dbd fix(deps): update mantine monorepo to ^7.15.2 (#1757)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-23 10:17:37 +00:00
homarr-renovate[bot] 4e85bbbad0 fix(deps): update dependency jotai to ^2.11.0 (#1756)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-23 06:21:05 +00:00
ManuelandMeier Lukas d78c6ed529 fix: copy media link (#1750)
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2024-12-22 20:20:33 +01:00
Thomas CamlongandMeier Lukas 210ce3669f chore(lang): updated translations from crowdin (#1747)
* New translations en.json (German)

* New translations en.json (German)

* New translations en.json (German)

---------

Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2024-12-22 18:39:19 +01:00
homarr-crowdin[bot] 44e5346d75 chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2024-12-22 17:25:57 +00:00
Meier Lukas d34d665229 docs: update crowdin badge to new translation project (#1745) 2024-12-22 15:40:57 +01:00
Thomas CamlongandMeier Lukas b6dc38483d chore(lang): updated translations from crowdin (#1738)
* New translations en.json (Turkish)

* New translations en.json (Turkish)

* New translations en.json (German)

* New translations en.json (Turkish)

* New translations en.json (German)

* New translations en.json (Hebrew)

* New translations en.json (Chinese Simplified)

* New translations en.json (Hebrew)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Simplified)

---------

Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2024-12-21 12:13:42 +01:00
homarr-crowdin[bot] a7e387e54c chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2024-12-21 11:10:45 +00:00
homarr-crowdin[bot] 189f35f3cb chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2024-12-21 11:05:13 +00:00
Releases Homarr 3c8d4f5018 chore(release): 1.0.0-beta.6 [skip ci] 2024-12-20 19:13:19 +00:00
homarr-releases[bot] 2b59f19a7f chore(release): automatic release v1.0.0 2024-12-20 19:12:27 +00:00
homarr-renovate[bot] fff1da88bd fix(deps): update dependency next-intl to v3.26.3 (#1740)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-20 13:23:18 +00:00
homarr-renovate[bot] 720fdb772c fix(deps): update dependency ioredis to v5.4.2 (#1739)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-20 12:25:58 +00:00
homarr-renovate[bot] a225bdd70c chore(deps): update pnpm to v9.15.1 (#1737)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-20 00:55:05 +00:00
homarr-crowdin[bot] e40c348352 chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2024-12-20 00:44:25 +00:00
Thomas Camlong 28e1175565 chore(lang): updated translations from crowdin (#1734)
* New translations en.json (Slovak)

* New translations en.json (Slovak)
2024-12-19 23:28:56 +01:00
homarr-crowdin[bot] b450b00934 chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2024-12-19 22:28:10 +00:00
Thomas CamlongandMeier Lukas 8e0bf87c56 chore(lang): updated translations from crowdin (#1722)
* New translations en.json (Hungarian)

* New translations en.json (Russian)

* New translations en.json (Turkish)

* New translations en.json (Hungarian)

* New translations en.json (Turkish)

* New translations en.json (Hungarian)

* New translations en.json (Turkish)

* New translations en.json (Turkish)

* New translations en.json (Chinese Traditional)

* New translations en.json (Czech)

---------

Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
2024-12-19 19:45:58 +01:00
homarr-crowdin[bot] 9e061f8fc7 chore(lang): updated translations from crowdin
Co-authored-by: Crowdin Homarr <190541745+homarr-crowdin[bot]@users.noreply.github.com>
2024-12-19 18:34:13 +00:00
Releases Homarr 10855bd84c chore(release): 1.0.0-beta.5 [skip ci] 2024-12-19 16:52:00 +00:00
homarr-releases[bot] 93d5ca683b chore(release): automatic release v1.0.0 2024-12-19 16:51:02 +00:00
Meier Lukas d2584b63c5 fix: always require db-user and password for mysql (#1730) 2024-12-19 17:48:10 +01:00
Meier Lukas 8c1156240c fix: about version is one behind because of missing package-json update in deploy (#1725) 2024-12-19 16:11:12 +01:00
Meier Lukas bb7f751481 fix: update of dev branch has no credentials (#1724) 2024-12-19 16:10:55 +01:00
Meier Lukas 1e8a5359b7 fix: allow additional file-type for oldmarr import (#1723) 2024-12-19 16:10:33 +01:00
Meier Lukas 550bca6dee fix: mysql operations not working (#1728) 2024-12-19 16:10:22 +01:00
homarr-renovate[bot] 2ae3d938ee fix(deps): update tiptap monorepo to v2.10.4 (#1729)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-19 13:05:35 +00:00
homarr-renovate[bot] 2b4bc8352e fix(deps): update nextjs monorepo to ^14.2.21 (#1727)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-19 11:16:50 +00:00
homarr-renovate[bot] c0f681637d fix(deps): update dependency tldts to ^6.1.69 (#1726)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-19 11:15:50 +00:00
Thomas Camlong 92cd1c5bd0 chore(lang): updated translations from crowdin (#1721)
* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Czech)

* New translations en.json (Danish)

* New translations en.json (German)

* New translations en.json (Greek)

* New translations en.json (Hebrew)

* New translations en.json (Hungarian)

* New translations en.json (Italian)

* New translations en.json (Japanese)

* New translations en.json (Korean)

* New translations en.json (Lithuanian)

* New translations en.json (Dutch)

* New translations en.json (Norwegian)

* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Slovak)

* New translations en.json (Slovenian)

* New translations en.json (Swedish)

* New translations en.json (Turkish)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Traditional)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Croatian)

* New translations en.json (Latvian)

* New translations en.json (Cree)

* New translations en.json (Turkish)

* New translations en.json (Hebrew)

* New translations en.json (Russian)

* New translations en.json (Turkish)
2024-12-19 07:59:10 +01:00
homarr-renovate[bot] 3b7e6cc083 fix(deps): update dependency zod-form-data to ^2.0.4 (#1719)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-18 18:46:07 +00:00
homarr-renovate[bot] 61afab518f fix(deps): update dependency undici to v7.2.0 (#1718)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-18 18:20:57 +00:00
homarr-renovate[bot] a7bd664c5c fix(deps): update dependency zod-form-data to ^2.0.3 (#1717)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-18 17:34:58 +00:00
homarr-renovate[bot] a2c3bee66c chore(deps): update dependency @types/react to ^19.0.2 (#1716)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-18 16:21:01 +00:00
SeDemal b6dad438c2 feat: Add quick filters for integration and status + minor UI improvement from feedback (#1641) 2024-12-18 15:16:54 +01:00
Releases Homarr 044c60bdec chore(release): 1.0.0-beta.4 [skip ci] 2024-12-18 13:16:17 +00:00
homarr-releases[bot] de8485d5c3 chore(release): automatic release v1.0.0 2024-12-18 13:15:07 +00:00
SeDemal 26b6ca2445 refactor: Move integration search flag to categories (#1637) 2024-12-18 14:14:31 +01:00
Manuel 63a7be35a4 fix: jellyfin integration does not allow username password auth (#1714) 2024-12-18 14:10:58 +01:00
Meier Lukas 1baa9fc74c fix: docker statup permission issue (#1709) 2024-12-18 14:10:43 +01:00
Meier Lukas a51999457b fix: import sidebar issues (#1712) 2024-12-18 13:52:10 +01:00
Manuel 5fbbf037ce fix: permission required for home page (#1711) 2024-12-18 13:28:20 +01:00
Meier Lukas 3c0f272707 fix: conflicts between common admin group for ldap or oidc and credentials default group (#1710) 2024-12-18 13:18:01 +01:00
Meier Lukas d2b4bf5ae4 chore: update homarr-docs-sitemap (#1707) 2024-12-18 11:30:12 +01:00
Meier Lukas d803087345 fix: about version reads nextjs package-json (#1706) 2024-12-18 11:29:49 +01:00
homarr-renovate[bot] d3a883a252 fix(deps): update dependency next-intl to v3.26.2 (#1703)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-18 08:58:00 +00:00
homarr-renovate[bot] 694350583a fix(deps): update dependency ldapts to v7.3.0 (#1696)
Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com>
2024-12-17 20:17:45 +00:00
Releases Homarr ecc4586d02 chore(release): 1.0.0-beta.3 [skip ci] 2024-12-17 20:12:24 +00:00
homarr-releases[bot] ce4fa5ff67 chore(release): automatic release v1.0.0 2024-12-17 20:11:19 +00:00
Meier Lukas 649506b56a fix: boolean checks do not work correctly in deploy workflow 2024-12-17 21:10:21 +01:00
182 changed files with 14639 additions and 6545 deletions

No files matched your search

+58 -17
View File
@@ -1,37 +1,78 @@
name: 🐞 Bug Report
description: Create a bug report to help us improve
description: Report that something is broken, not working as intended or causes side-effects
title: "bug: "
labels: ["🐞❔ unconfirmed bug"]
labels: ["needs triage"]
body:
- type: textarea
attributes:
label: Provide environment information
description: |
Run this command in your project root and paste the results in a code block:
```bash
npx envinfo --system --binaries
```
validations:
required: true
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of the bug, as well as what you expected to happen when encountering it.
validations:
required: true
- type: input
- type: textarea
attributes:
label: Link to reproduction
description: Please provide a link to a reproduction of the bug. Issues without a reproduction repo may be ignored.
label: Steps to reproduce
description: Describe how to reproduce your bug. Steps, code snippets, reproduction repos etc.
validations:
required: true
- type: textarea
attributes:
label: To reproduce
description: Describe how to reproduce your bug. Steps, code snippets, reproduction repos etc.
label: Impact
description: How big is the impact of this bug? Does it make Homarr unusable? Is there any workaround that you're aware of?
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Add any other information related to the bug here, screenshots if applicable.
- type: dropdown
id: version
attributes:
label: Version
description: What version of Homarr are you running?
options:
- 1.0.0-beta
- Other (describe in "additional information")
default: 0
validations:
required: true
- type: dropdown
id: installationMethod
attributes:
label: Installation method
description: How do you run Homarr? Post docker-compose, configs or screenshots if applicable.
options:
- Docker Run
- Docker Compose
- Portainer
- Helm
- QNAP
- Saltbox
- EasyPanel
- Unraid Apps
- TrueNAS Apps
- Synology
- HomeAssistant Addon
- From Source
- Other (describe in "additional information")
default: 0
validations:
required: true
- type: dropdown
id: browser
attributes:
label: Browser
description: If relevant, what browser do you use?
options:
- Firefox
- Edge (Chromium)
- Edge (Proprietary)
- Chrome
- Safari
- Vivaldi
- Brave
- Samsung Internet
- Other (describe in "additional information")
default: 0
validations:
required: false
+2 -12
View File
@@ -2,26 +2,16 @@
# See here: https://github.com/vercel/next.js/blob/canary/.github/ISSUE_TEMPLATE/3.feature_request.yml
name: 🛠 Feature Request
description: Create a feature request for the core packages
description: Request a new feature that you would like to have implemented
title: "feat: "
labels: ["✨ enhancement"]
labels: ["needs triage"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to file a feature request. Please fill out this form as completely as possible.
- type: textarea
attributes:
label: Describe the feature you'd like to request
description: Please describe the feature as clear and concise as possible. Remember to add context as to why you believe this feature is needed.
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like to see
description: Please describe the solution you would like to see. Adding example usage is a good way to provide context.
validations:
required: true
- type: textarea
attributes:
label: Additional information
+40
View File
@@ -0,0 +1,40 @@
name: 🛠 Integration request
description: Request support for a new integration (eg. Sonarr, Radarr)
title: "feat: "
labels: ["needs triage"]
body:
- type: input
attributes:
label: Project Website
description: Post the link to the website of the application. Paste the official link.
placeholder: ex. https://sonarr.tv/
validations:
required: true
- type: textarea
attributes:
label: Describe what data should be consumed by Homarr
description: Please describe what data Homarr should fetch from the integration. Specify in what interval data should be fetched and whether the user can also perform write operations (eg. deleting a movie or adding a user).
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Add any other information related to the integration.
- type: dropdown
attributes:
label: Public API available?
description: Is there a public API available, that we can consume in Homarr?
options:
- Yes, available on a website
- Yes, available in the application itself
- No
validations:
required: true
- type: dropdown
attributes:
label: Are you willing to contribute this yourself?
options:
- Yes
- No
validations:
required: true
+30
View File
@@ -0,0 +1,30 @@
name: 🛠 Widget request
description: Request a new widget (eg. Clock, Calendar, ...)
title: "feat: "
labels: ["needs triage"]
body:
- type: input
attributes:
label: Compatible integrations
description: Post a list of the integrations that should be compatible with this widget. Divide using comma. Leave empty if no integration is needed.
placeholder: ex. Sonarr, Radarr, Lidarr, Readarr, Nextcloud
validations:
required: false
- type: textarea
attributes:
label: Describe what data should be displayed
description: Please describe what data Homarr should display. Describe how elements should be intractable and what actions the user can perform.
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Add any other information related to the widget.
- type: dropdown
attributes:
label: Are you willing to contribute this yourself?
options:
- Yes
- No
validations:
required: true
+15 -5
View File
@@ -40,6 +40,7 @@ jobs:
SKIP_RELEASE: ${{ github.event_name == 'workflow_dispatch' || github.ref_name == 'dev' }}
outputs:
version: ${{ steps.read-semver.outputs.version || steps.version-fallback.outputs.version }}
git_ref: ${{ steps.read-git-ref.outputs.ref || github.ref }}
steps:
- run: echo "Skipping release for workflow_dispatch event"
@@ -87,9 +88,16 @@ jobs:
run: |
git fetch --tags
echo "version=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT"
- name: Read git ref
if: env.SKIP_RELEASE == 'false'
id: read-git-ref
run: |
echo "ref=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Update dev branch
if: env.SKIP_RELEASE == 'false'
continue-on-error: true # Prevent pipeline from failing when merge fails
env:
GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }}
run: |
git fetch origin dev
git checkout dev
@@ -104,9 +112,11 @@ 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
with:
ref: ${{ needs.release.outputs.git_ref }}
- name: Discord notification
if: ${{ github.events.inputs.send-notifications != false }}
env:
@@ -130,8 +140,8 @@ jobs:
with:
images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
tags: |
${{ env.DEPLOY_LATEST == true && 'type=raw,value=latest' || null }}
${{ env.DEPLOY_BETA == true && 'type=raw,value=beta' || null }}
${{ env.DEPLOY_LATEST == 'true' && 'type=raw,value=latest' || null }}
${{ env.DEPLOY_BETA == 'true' && 'type=raw,value=beta' || null }}
type=raw,value=${{ env.NEXT_VERSION }}
- name: Build and maybe push
id: buildPushAction
@@ -139,7 +149,7 @@ jobs:
with:
platforms: linux/amd64,linux/arm64
context: .
push: ${{ env.PUSH_IMAGE}}
push: ${{ env.PUSH_IMAGE }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
network: host
@@ -150,4 +160,4 @@ jobs:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: "Deployment of image has completed for branch ${{ github.ref_name }}. Image ID is '${{ steps.buildPushAction.outputs.imageid }}'. ${{ env.PUSH_IMAGE == true && '' || 'This was a dry run' }}"
args: "Deployment of image has completed for branch ${{ github.ref_name }}. Image ID is '${{ steps.buildPushAction.outputs.imageid }}'. ${{ env.PUSH_IMAGE == 'true' && '' || 'This was a dry run' }}"
+80
View File
@@ -1,3 +1,83 @@
## [1.0.0-beta.8](https://github.com/homarr-labs/homarr/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2024-12-25)
### Bug Fixes
* **deps:** update dependency @ctrl/deluge to ^7.1.0 ([#1776](https://github.com/homarr-labs/homarr/issues/1776)) ([ecae80d](https://github.com/homarr-labs/homarr/commit/ecae80d741213f12ff08f87992cc4d906cbe0085))
* **deps:** update dependency @ctrl/transmission to ^7.2.0 ([#1777](https://github.com/homarr-labs/homarr/issues/1777)) ([3e2ffbd](https://github.com/homarr-labs/homarr/commit/3e2ffbd7bf2793ff58136ed75b38e0d96b4a5ca8))
* **deps:** update dependency drizzle-orm to ^0.38.3 ([#1783](https://github.com/homarr-labs/homarr/issues/1783)) ([82c6ce7](https://github.com/homarr-labs/homarr/commit/82c6ce7b77023881bd4c74fb43437e777f9b219e))
* **deps:** update dependency drizzle-zod to ^0.6.1 ([#1782](https://github.com/homarr-labs/homarr/issues/1782)) ([555212e](https://github.com/homarr-labs/homarr/commit/555212e2dc82c4b71b8c25a5f20964b3441b5ab9))
* oldmarr import user casing wrong ([#1784](https://github.com/homarr-labs/homarr/issues/1784)) ([e37279f](https://github.com/homarr-labs/homarr/commit/e37279fe8071773f1a9773e3233bc81cbb336798))
## [1.0.0-beta.7](https://github.com/homarr-labs/homarr/compare/v1.0.0-beta.6...v1.0.0-beta.7) (2024-12-24)
### Features
* **apps:** remove url variables ([#1771](https://github.com/homarr-labs/homarr/issues/1771)) ([8df398c](https://github.com/homarr-labs/homarr/commit/8df398c3c706369f6990719603a357c161606f81))
### Bug Fixes
* **auth:** oidc redirect does not respect https protocol ([#1763](https://github.com/homarr-labs/homarr/issues/1763)) ([0336803](https://github.com/homarr-labs/homarr/commit/033680355044b1ebfa5d8fe07b59929bbcfcb3a0))
* **board:** item background and border overridden by mantine card styles ([#1769](https://github.com/homarr-labs/homarr/issues/1769)) ([425359b](https://github.com/homarr-labs/homarr/commit/425359be02f66242f7db0dc77bed0355495e21d5))
* **board:** tiles order not respected on firefox ([#1770](https://github.com/homarr-labs/homarr/issues/1770)) ([8893b72](https://github.com/homarr-labs/homarr/commit/8893b72fe363691b91b6aca75d4ad37f4b8e9f6a))
* copy media link ([#1750](https://github.com/homarr-labs/homarr/issues/1750)) ([d78c6ed](https://github.com/homarr-labs/homarr/commit/d78c6ed5299e1f975c2e85ec3ecad38e00457677))
* **deps:** update dependency @ctrl/qbittorrent to ^9.2.0 ([#1768](https://github.com/homarr-labs/homarr/issues/1768)) ([8b416a6](https://github.com/homarr-labs/homarr/commit/8b416a6dd354b22a3e4f527b793dde2c538b1e6a))
* **deps:** update dependency eslint-plugin-react to ^7.37.3 ([#1767](https://github.com/homarr-labs/homarr/issues/1767)) ([fe95334](https://github.com/homarr-labs/homarr/commit/fe95334aa70c95faefcf904591fa9d33159b0905))
* **deps:** update dependency jotai to ^2.11.0 ([#1756](https://github.com/homarr-labs/homarr/issues/1756)) ([4e85bbb](https://github.com/homarr-labs/homarr/commit/4e85bbbad034f08ab84e331d376b7a9c6f54e507))
* **deps:** update dependency mysql2 to v3.12.0 ([#1758](https://github.com/homarr-labs/homarr/issues/1758)) ([d02ded5](https://github.com/homarr-labs/homarr/commit/d02ded5511aa2d54307db0ac7f4e0a5dee5a707d))
* **deps:** update dependency react-error-boundary to v5 ([#1748](https://github.com/homarr-labs/homarr/issues/1748)) ([01db27c](https://github.com/homarr-labs/homarr/commit/01db27c34f3daf6e67e35bbd357df31dcb154b41))
* **deps:** update dependency typescript-eslint to ^8.18.2 ([#1762](https://github.com/homarr-labs/homarr/issues/1762)) ([9223dd0](https://github.com/homarr-labs/homarr/commit/9223dd06ee0c2b51e036f607d7b3252c61ab77ea))
* **deps:** update mantine monorepo to ^7.15.2 ([#1757](https://github.com/homarr-labs/homarr/issues/1757)) ([dfacb08](https://github.com/homarr-labs/homarr/commit/dfacb08dbddb6864646ece2fca6978207f0c58ac))
* **deps:** update tanstack-query monorepo to ^5.62.10 ([#1772](https://github.com/homarr-labs/homarr/issues/1772)) ([c410b06](https://github.com/homarr-labs/homarr/commit/c410b06a15ed5426931ad764cc861f66f11a40da))
* **deps:** update tanstack-query monorepo to ^5.62.9 ([#1761](https://github.com/homarr-labs/homarr/issues/1761)) ([42da2b9](https://github.com/homarr-labs/homarr/commit/42da2b9b062bd8a08c37e45ab129953e8b0e3624))
* **icons:** local icon repository does not work with medias ([#1765](https://github.com/homarr-labs/homarr/issues/1765)) ([e220087](https://github.com/homarr-labs/homarr/commit/e220087e96c7096303b1d245ccf3941118e692f3))
* **onboard:** missing admin permission assignment for external group ([#1764](https://github.com/homarr-labs/homarr/issues/1764)) ([b948337](https://github.com/homarr-labs/homarr/commit/b9483379dd56a8dab2b9b636b66b970da4cf9d83))
## [1.0.0-beta.6](https://github.com/homarr-labs/homarr/compare/v1.0.0-beta.5...v1.0.0-beta.6) (2024-12-20)
### Bug Fixes
* **deps:** update dependency ioredis to v5.4.2 ([#1739](https://github.com/homarr-labs/homarr/issues/1739)) ([720fdb7](https://github.com/homarr-labs/homarr/commit/720fdb772c2142e23b2bfa2ecaddf0063fbe192c))
* **deps:** update dependency next-intl to v3.26.3 ([#1740](https://github.com/homarr-labs/homarr/issues/1740)) ([fff1da8](https://github.com/homarr-labs/homarr/commit/fff1da88bd44162b08a76f8b2f49e2b929fc56e8))
## [1.0.0-beta.5](https://github.com/homarr-labs/homarr/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2024-12-19)
### Features
* Add quick filters for integration and status + minor UI improvement from feedback ([#1641](https://github.com/homarr-labs/homarr/issues/1641)) ([b6dad43](https://github.com/homarr-labs/homarr/commit/b6dad438c2f44aa8d7a740c1a22c9d4c39edf43e))
### Bug Fixes
* about version is one behind because of missing package-json update in deploy ([#1725](https://github.com/homarr-labs/homarr/issues/1725)) ([8c11562](https://github.com/homarr-labs/homarr/commit/8c1156240c8a0d332301ae6dd0a4521f3db19d9a))
* allow additional file-type for oldmarr import ([#1723](https://github.com/homarr-labs/homarr/issues/1723)) ([1e8a535](https://github.com/homarr-labs/homarr/commit/1e8a5359b78e28db7683ba837a962685446c6c32))
* always require db-user and password for mysql ([#1730](https://github.com/homarr-labs/homarr/issues/1730)) ([d2584b6](https://github.com/homarr-labs/homarr/commit/d2584b63c55ca143a2b5dc6a71cb00fd5612b78a))
* **deps:** update dependency tldts to ^6.1.69 ([#1726](https://github.com/homarr-labs/homarr/issues/1726)) ([c0f6816](https://github.com/homarr-labs/homarr/commit/c0f681637db1d6e7abdf3326b3a3c17283440d09))
* **deps:** update dependency undici to v7.2.0 ([#1718](https://github.com/homarr-labs/homarr/issues/1718)) ([61afab5](https://github.com/homarr-labs/homarr/commit/61afab518f6193a700a547faffa4619b28fb0837))
* **deps:** update dependency zod-form-data to ^2.0.3 ([#1717](https://github.com/homarr-labs/homarr/issues/1717)) ([a7bd664](https://github.com/homarr-labs/homarr/commit/a7bd664c5cee578574bf37b7149a2142be9f8b7a))
* **deps:** update dependency zod-form-data to ^2.0.4 ([#1719](https://github.com/homarr-labs/homarr/issues/1719)) ([3b7e6cc](https://github.com/homarr-labs/homarr/commit/3b7e6cc083220a0e3a0cf4f5243c073067ba5bc7))
* **deps:** update nextjs monorepo to ^14.2.21 ([#1727](https://github.com/homarr-labs/homarr/issues/1727)) ([2b4bc83](https://github.com/homarr-labs/homarr/commit/2b4bc8352efa1e2cffb71a6d4d6e42f941358f02))
* **deps:** update tiptap monorepo to v2.10.4 ([#1729](https://github.com/homarr-labs/homarr/issues/1729)) ([2ae3d93](https://github.com/homarr-labs/homarr/commit/2ae3d938eeea5bd49a74d9c09b4cb2c680b059d0))
* mysql operations not working ([#1728](https://github.com/homarr-labs/homarr/issues/1728)) ([550bca6](https://github.com/homarr-labs/homarr/commit/550bca6dee743a4ed68ec15677304ecfd7a9a385))
* update of dev branch has no credentials ([#1724](https://github.com/homarr-labs/homarr/issues/1724)) ([bb7f751](https://github.com/homarr-labs/homarr/commit/bb7f7514814d49a77ac79f63d68923d08148573e))
## [1.0.0-beta.4](https://github.com/homarr-labs/homarr/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2024-12-18)
### Bug Fixes
* about version reads nextjs package-json ([#1706](https://github.com/homarr-labs/homarr/issues/1706)) ([d803087](https://github.com/homarr-labs/homarr/commit/d8030873452d2248d79d16a2fc4464ff2fbb478d))
* conflicts between common admin group for ldap or oidc and credentials default group ([#1710](https://github.com/homarr-labs/homarr/issues/1710)) ([3c0f272](https://github.com/homarr-labs/homarr/commit/3c0f272707ee66fd00bffb0d16e30df98b4f1aff))
* **deps:** update dependency ldapts to v7.3.0 ([#1696](https://github.com/homarr-labs/homarr/issues/1696)) ([6943505](https://github.com/homarr-labs/homarr/commit/694350583a0e53014a950c4a5bed4d487ad4ca7b))
* **deps:** update dependency next-intl to v3.26.2 ([#1703](https://github.com/homarr-labs/homarr/issues/1703)) ([d3a883a](https://github.com/homarr-labs/homarr/commit/d3a883a252167612f3f64579730c8f26453897e3))
* docker statup permission issue ([#1709](https://github.com/homarr-labs/homarr/issues/1709)) ([1baa9fc](https://github.com/homarr-labs/homarr/commit/1baa9fc74cf15df8ead7bbe6d1615f7bf0895813))
* import sidebar issues ([#1712](https://github.com/homarr-labs/homarr/issues/1712)) ([a519994](https://github.com/homarr-labs/homarr/commit/a51999457b57c042b543768bc1ef43647d62a85d))
* jellyfin integration does not allow username password auth ([#1714](https://github.com/homarr-labs/homarr/issues/1714)) ([63a7be3](https://github.com/homarr-labs/homarr/commit/63a7be35a4cf0f11610c2097afc32d2ced0ef9e1))
* permission required for home page ([#1711](https://github.com/homarr-labs/homarr/issues/1711)) ([5fbbf03](https://github.com/homarr-labs/homarr/commit/5fbbf037ce8a06642533c7f68c1c34ed8b01e4e4))
## [1.0.0-beta.3](https://github.com/homarr-labs/homarr/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2024-12-17)
### Bug Fixes
* boolean checks do not work correctly in deploy workflow ([649506b](https://github.com/homarr-labs/homarr/commit/649506b56a5f3cbbee9b782b637730f2196785cc))
## [1.0.0-beta.2](https://github.com/homarr-labs/homarr/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2024-12-17)
### Bug Fixes
+4 -3
View File
@@ -26,7 +26,7 @@ FROM base AS runner
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
@@ -43,14 +43,12 @@ RUN echo $'#!/bin/bash\ncd /app/apps/cli && node ./cli.cjs "$@"' > /usr/bin/homa
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 .
@@ -67,6 +65,8 @@ COPY --from=builder --chown=nextjs:nodejs /app/apps/nextjs/.next/standalone ./
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
@@ -77,4 +77,5 @@ ENV DB_DIALECT='sqlite'
ENV DB_DRIVER='better-sqlite3'
ENV AUTH_PROVIDERS='credentials'
ENTRYPOINT [ "/app/entrypoint.sh" ]
CMD ["sh", "run.sh"]
+1
View File
@@ -1,5 +1,6 @@
// Importing env files here to validate on build
import "@homarr/auth/env.mjs";
import "@homarr/db/env.mjs";
import MillionLint from "@million/lint";
import createNextIntlPlugin from "next-intl/plugin";
+13 -13
View File
@@ -38,18 +38,18 @@
"@homarr/ui": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@homarr/widgets": "workspace:^0.1.0",
"@mantine/colors-generator": "^7.15.1",
"@mantine/core": "^7.15.1",
"@mantine/dropzone": "^7.15.1",
"@mantine/hooks": "^7.15.1",
"@mantine/modals": "^7.15.1",
"@mantine/tiptap": "^7.15.1",
"@mantine/colors-generator": "^7.15.2",
"@mantine/core": "^7.15.2",
"@mantine/dropzone": "^7.15.2",
"@mantine/hooks": "^7.15.2",
"@mantine/modals": "^7.15.2",
"@mantine/tiptap": "^7.15.2",
"@million/lint": "1.0.14",
"@t3-oss/env-nextjs": "^0.11.1",
"@tabler/icons-react": "^3.26.0",
"@tanstack/react-query": "^5.62.8",
"@tanstack/react-query-devtools": "^5.62.8",
"@tanstack/react-query-next-experimental": "5.62.8",
"@tanstack/react-query": "^5.62.10",
"@tanstack/react-query-devtools": "^5.62.10",
"@tanstack/react-query-next-experimental": "5.62.10",
"@trpc/client": "next",
"@trpc/next": "next",
"@trpc/react-query": "next",
@@ -63,14 +63,14 @@
"dotenv": "^16.4.7",
"flag-icons": "^7.2.3",
"glob": "^11.0.0",
"jotai": "^2.10.4",
"jotai": "^2.11.0",
"mantine-react-table": "2.0.0-beta.7",
"next": "^14.2.20",
"next": "^14.2.21",
"postcss-preset-mantine": "^1.17.0",
"prismjs": "^1.29.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-error-boundary": "^4.1.2",
"react-error-boundary": "^5.0.0",
"react-simple-code-editor": "^0.14.1",
"sass": "^1.83.0",
"superjson": "2.2.2",
@@ -84,7 +84,7 @@
"@types/chroma-js": "2.4.5",
"@types/node": "^22.10.2",
"@types/prismjs": "^1.26.5",
"@types/react": "^19.0.1",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@types/swagger-ui-react": "^4.18.3",
"concurrently": "^9.1.0",
@@ -4,7 +4,7 @@ import { Card, Center, Stack, Text, Title } from "@mantine/core";
import { auth } from "@homarr/auth/next";
import { isProviderEnabled } from "@homarr/auth/server";
import { and, db, eq } from "@homarr/db";
import { invites } from "@homarr/db/schema/sqlite";
import { invites } from "@homarr/db/schema";
import { getScopedI18n } from "@homarr/translation/server";
import { HomarrLogoWithTitle } from "~/components/layout/logo/homarr-logo";
@@ -2,7 +2,7 @@ import { IconHomeOff } from "@tabler/icons-react";
import { auth } from "@homarr/auth/next";
import { db } from "@homarr/db";
import { boards } from "@homarr/db/schema/sqlite";
import { boards } from "@homarr/db/schema";
import { getI18n } from "@homarr/translation/server";
import type { BoardNotFoundProps } from "~/components/board/not-found";
@@ -24,10 +24,19 @@ export const ImportDropZone = ({ loading, updateFile }: ImportDropZoneProps) =>
}}
acceptColor="blue.6"
rejectColor="red.6"
accept={[MIME_TYPES.zip]}
accept={[MIME_TYPES.zip, "application/x-zip-compressed"]}
loading={loading}
multiple={false}
maxSize={1024 * 1024 * 1024 * 64} // 64 MB
onReject={(rejections) => {
console.error(
"Rejected files",
rejections.map(
(rejection) =>
`File: ${rejection.file.name} size=${rejection.file.size} fileType=${rejection.file.type}\n - ${rejection.errors.map((error) => error.message).join("\n - ")}`,
),
);
}}
>
<Group justify="center" gap="xl" mih={220} style={{ pointerEvents: "none" }}>
<Dropzone.Accept>
@@ -6,7 +6,6 @@ import { IconBox, IconPencil } from "@tabler/icons-react";
import type { RouterOutputs } from "@homarr/api";
import { api } from "@homarr/api/server";
import { auth } from "@homarr/auth/next";
import { parseAppHrefWithVariablesServer } from "@homarr/common/server";
import { getI18n, getScopedI18n } from "@homarr/translation/server";
import { ManageContainer } from "~/components/manage/manage-container";
@@ -82,8 +81,8 @@ const AppCard = async ({ app }: AppCardProps) => {
</Text>
)}
{app.href && (
<Anchor href={parseAppHrefWithVariablesServer(app.href)} lineClamp={1} size="sm" w="min-content">
{parseAppHrefWithVariablesServer(app.href)}
<Anchor href={app.href} lineClamp={1} size="sm" w="min-content">
{app.href}
</Anchor>
)}
</Stack>
@@ -13,10 +13,7 @@ interface CopyMediaProps {
export const CopyMedia = ({ media }: CopyMediaProps) => {
const t = useI18n();
const url =
typeof window !== "undefined"
? `${window.location.protocol}://${window.location.hostname}:${window.location.port}/api/user-medias/${media.id}`
: "";
const url = typeof window !== "undefined" ? `${window.location.origin}/api/user-medias/${media.id}` : "";
return (
<CopyButton value={url}>
@@ -3,7 +3,7 @@ import { notFound } from "next/navigation";
import { auth } from "@homarr/auth/next";
import { isProviderEnabled } from "@homarr/auth/server";
import { db, inArray } from "@homarr/db";
import { groups } from "@homarr/db/schema/sqlite";
import { groups } from "@homarr/db/schema";
import { everyoneGroup } from "@homarr/definitions";
import { getScopedI18n } from "@homarr/translation/server";
+1 -1
View File
@@ -8,7 +8,7 @@ import { hashPasswordAsync } from "@homarr/auth";
import type { Session } from "@homarr/auth";
import { createSessionAsync } from "@homarr/auth/server";
import { db, eq } from "@homarr/db";
import { apiKeys } from "@homarr/db/schema/sqlite";
import { apiKeys } from "@homarr/db/schema";
import { logger } from "@homarr/log";
const handlerAsync = async (req: NextRequest) => {
@@ -3,7 +3,7 @@ import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
import { db, eq } from "@homarr/db";
import { medias } from "@homarr/db/schema/sqlite";
import { medias } from "@homarr/db/schema";
export async function GET(_req: NextRequest, { params }: { params: { id: string } }) {
const image = await db.query.medias.findFirst({
@@ -10,6 +10,12 @@ import { useSectionContext } from "./section-context";
export const SectionContent = () => {
const { section, innerSections, refs } = useSectionContext();
const board = useRequiredBoard();
/**
* IMPORTANT: THE ORDER OF THE BELOW ITEMS HAS TO MATCH THE ORDER OF
* THE ITEMS RENDERED WITH GRIDSTACK, OTHERWISE THE ITEMS WILL BE MIXED UP
* @see https://github.com/homarr-labs/homarr/pull/1770
*/
const sortedItems = useMemo(() => {
return [
...section.items.map((item) => ({ ...item, type: "item" as const })),
@@ -19,7 +25,7 @@ export const SectionContent = () => {
return itemA.xOffset - itemB.xOffset;
}
return itemA.yOffset - itemB.xOffset;
return itemA.yOffset - itemB.yOffset;
});
}, [section.items, innerSections]);
@@ -7,6 +7,6 @@
--background-color: rgb(from var(--mantine-color-white) r g b / var(--opacity));
--border-color: rgb(from var(--mantine-color-gray-3) r g b / var(--opacity));
}
background-color: var(--background-color);
border-color: var(--border-color);
background-color: var(--background-color) !important;
border-color: var(--border-color) !important;
}
@@ -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>
-26
View File
@@ -1,10 +1,6 @@
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
const isUsingDbUrl = Boolean(process.env.DB_URL);
const isUsingDbHost = Boolean(process.env.DB_HOST);
const isUsingDbCredentials = process.env.DB_DRIVER === "mysql2";
export const env = createEnv({
shared: {
VERCEL_URL: z
@@ -19,21 +15,6 @@ export const env = createEnv({
* built with invalid env vars.
*/
server: {
DB_DRIVER: z.enum(["better-sqlite3", "mysql2"]).default("better-sqlite3"),
// If the DB_HOST is set, the DB_URL is optional
DB_URL: isUsingDbHost ? z.string().optional() : z.string(),
DB_HOST: isUsingDbUrl ? z.string().optional() : z.string(),
DB_PORT: isUsingDbUrl
? z.string().regex(/\d+/).transform(Number).optional()
: z
.string()
.regex(/\d+/)
.transform(Number)
.refine((number) => number >= 1)
.default("3306"),
DB_USER: isUsingDbCredentials ? z.string() : z.string().optional(),
DB_PASSWORD: isUsingDbCredentials ? z.string() : z.string().optional(),
DB_NAME: isUsingDbUrl ? z.string().optional() : z.string(),
// Comma separated list of docker hostnames that can be used to connect to query the docker endpoints (localhost:2375,host.docker.internal:2375, ...)
DOCKER_HOSTNAMES: z.string().optional(),
DOCKER_PORTS: z.number().optional(),
@@ -51,13 +32,6 @@ export const env = createEnv({
runtimeEnv: {
VERCEL_URL: process.env.VERCEL_URL,
PORT: process.env.PORT,
DB_URL: process.env.DB_URL,
DB_HOST: process.env.DB_HOST,
DB_USER: process.env.DB_USER,
DB_PASSWORD: process.env.DB_PASSWORD,
DB_NAME: process.env.DB_NAME,
DB_PORT: process.env.DB_PORT,
DB_DRIVER: process.env.DB_DRIVER,
NODE_ENV: process.env.NODE_ENV,
DOCKER_HOSTNAMES: process.env.DOCKER_HOSTNAMES,
DOCKER_PORTS: process.env.DOCKER_PORTS,
+1 -1
View File
@@ -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> => {
+2 -2
View File
@@ -38,14 +38,14 @@
"dayjs": "^1.11.13",
"dotenv": "^16.4.7",
"superjson": "2.2.2",
"undici": "7.1.1"
"undici": "7.2.0"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/node": "^22.10.2",
"dotenv-cli": "^7.4.4",
"dotenv-cli": "^8.0.0",
"eslint": "^9.17.0",
"prettier": "^3.4.2",
"tsx": "4.19.2",
+2 -2
View File
@@ -10,8 +10,8 @@
<a href="https://github.com/homarr-labs/homarr/actions/workflows/deployment-docker-image.yml">
  <img title="Docker CI Status" src="https://github.com/homarr-labs/homarr/actions/workflows/deployment-docker-image.yml/badge.svg" alt="CI Status">
</a>
<a href=https://translate.homarr.dev/>
<img title="Translations" src="https://badges.crowdin.net/homarr/localized.svg" />
<a href="https://crowdin.com/project/homarr_labs">
<img title="Translations" src="https://badges.crowdin.net/homarr_labs/localized.svg" />
</a>
<a href="https://discord.gg/aCsmEV5RgA">
  <img title="Discord" src="https://discordapp.com/api/guilds/972958686051962910/widget.png?style=shield">
+1 -1
View File
@@ -21,7 +21,7 @@ http {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
}
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "homarr",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.8",
"private": true,
"scripts": {
"build": "cross-env CI=true turbo build",
@@ -52,7 +52,7 @@
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.1.8"
},
"packageManager": "pnpm@9.15.0",
"packageManager": "pnpm@9.15.1",
"engines": {
"node": ">=22.12.0"
},
@@ -3,7 +3,7 @@ import { Umami } from "@umami/node";
import { count, db } from "@homarr/db";
import { getServerSettingByKeyAsync } from "@homarr/db/queries";
import { integrations, items, users } from "@homarr/db/schema/sqlite";
import { integrations, items, users } from "@homarr/db/schema";
import { logger } from "@homarr/log";
import type { defaultServerSettings } from "@homarr/server-settings";
+2 -1
View File
@@ -27,6 +27,7 @@
"@homarr/cron-jobs": "workspace:^0.1.0",
"@homarr/db": "workspace:^0.1.0",
"@homarr/definitions": "workspace:^0.1.0",
"@homarr/icons": "workspace:^0.1.0",
"@homarr/integrations": "workspace:^0.1.0",
"@homarr/log": "workspace:^",
"@homarr/old-import": "workspace:^0.1.0",
@@ -40,7 +41,7 @@
"@trpc/react-query": "next",
"@trpc/server": "next",
"dockerode": "^4.0.2",
"next": "^14.2.20",
"next": "^14.2.21",
"react": "^19.0.0",
"superjson": "2.2.2",
"trpc-to-openapi": "^2.1.0"
+1 -1
View File
@@ -7,7 +7,7 @@ import { decryptSecret } from "@homarr/common/server";
import type { AtLeastOneOf } from "@homarr/common/types";
import type { Database } from "@homarr/db";
import { and, eq, inArray } from "@homarr/db";
import { integrations } from "@homarr/db/schema/sqlite";
import { integrations } from "@homarr/db/schema";
import type { IntegrationKind } from "@homarr/definitions";
import { z } from "@homarr/validation";
+1 -1
View File
@@ -1,7 +1,7 @@
import { TRPCError } from "@trpc/server";
import { and, eq } from "@homarr/db";
import { items } from "@homarr/db/schema/sqlite";
import { items } from "@homarr/db/schema";
import type { WidgetKind } from "@homarr/definitions";
import { z } from "@homarr/validation";
+1 -1
View File
@@ -1,7 +1,7 @@
import { createSaltAsync, hashPasswordAsync } from "@homarr/auth";
import { generateSecureRandomToken } from "@homarr/common/server";
import { createId, db } from "@homarr/db";
import { apiKeys } from "@homarr/db/schema/sqlite";
import { apiKeys } from "@homarr/db/schema";
import { createTRPCRouter, permissionRequiredProcedure } from "../trpc";
+1 -1
View File
@@ -1,7 +1,7 @@
import { TRPCError } from "@trpc/server";
import { asc, createId, eq, inArray, like } from "@homarr/db";
import { apps } from "@homarr/db/schema/sqlite";
import { apps } from "@homarr/db/schema";
import { selectAppSchema } from "@homarr/db/validationSchemas";
import { validation, z } from "@homarr/validation";
@@ -2,7 +2,7 @@ import SuperJSON from "superjson";
import type { Session } from "@homarr/auth";
import { db, eq, or } from "@homarr/db";
import { items } from "@homarr/db/schema/sqlite";
import { items } from "@homarr/db/schema";
import type { WidgetComponentProps } from "../../../../widgets/src";
+1 -1
View File
@@ -15,7 +15,7 @@ import {
items,
sections,
users,
} from "@homarr/db/schema/sqlite";
} from "@homarr/db/schema";
import type { WidgetKind } from "@homarr/definitions";
import { getPermissionsWithParents, widgetKinds } from "@homarr/definitions";
import { importOldmarrAsync } from "@homarr/old-import";
@@ -4,7 +4,7 @@ import type { Session } from "@homarr/auth";
import { constructBoardPermissions } from "@homarr/auth/shared";
import type { Database, SQL } from "@homarr/db";
import { eq, inArray } from "@homarr/db";
import { boardGroupPermissions, boardUserPermissions, groupMembers } from "@homarr/db/schema/sqlite";
import { boardGroupPermissions, boardUserPermissions, groupMembers } from "@homarr/db/schema";
import type { BoardPermission } from "@homarr/definitions";
/**
@@ -3,7 +3,7 @@ import type Docker from "dockerode";
import type { Container } from "dockerode";
import { db, like, or } from "@homarr/db";
import { icons } from "@homarr/db/schema/sqlite";
import { icons } from "@homarr/db/schema";
import type { DockerContainerState } from "@homarr/definitions";
import { logger } from "@homarr/log";
import { createCacheChannel } from "@homarr/redis";
+8 -2
View File
@@ -2,7 +2,7 @@ import { TRPCError } from "@trpc/server";
import type { Database } from "@homarr/db";
import { and, createId, eq, like, not, sql } from "@homarr/db";
import { groupMembers, groupPermissions, groups } from "@homarr/db/schema/sqlite";
import { groupMembers, groupPermissions, groups } from "@homarr/db/schema";
import { everyoneGroup } from "@homarr/definitions";
import { validation, z } from "@homarr/validation";
@@ -152,11 +152,17 @@ export const groupRouter = createTRPCRouter({
.mutation(async ({ input, ctx }) => {
await checkSimilarNameAndThrowAsync(ctx.db, input.name);
const groupId = createId();
await ctx.db.insert(groups).values({
id: createId(),
id: groupId,
name: input.name,
});
await ctx.db.insert(groupPermissions).values({
groupId,
permission: "admin",
});
await nextOnboardingStepAsync(ctx.db, undefined);
}),
createGroup: permissionRequiredProcedure
+1 -1
View File
@@ -3,7 +3,7 @@ import type { AnySQLiteTable } from "drizzle-orm/sqlite-core";
import { isProviderEnabled } from "@homarr/auth/server";
import type { Database } from "@homarr/db";
import { count } from "@homarr/db";
import { apps, boards, groups, integrations, invites, users } from "@homarr/db/schema/sqlite";
import { apps, boards, groups, integrations, invites, users } from "@homarr/db/schema";
import { createTRPCRouter, publicProcedure } from "../trpc";
+1 -1
View File
@@ -1,5 +1,5 @@
import { count, like } from "@homarr/db";
import { icons } from "@homarr/db/schema/sqlite";
import { icons } from "@homarr/db/schema";
import { validation } from "@homarr/validation";
import { createTRPCRouter, publicProcedure } from "../trpc";
@@ -4,7 +4,7 @@ import type { Session } from "@homarr/auth";
import { constructIntegrationPermissions } from "@homarr/auth/shared";
import type { Database, SQL } from "@homarr/db";
import { eq, inArray } from "@homarr/db";
import { groupMembers, integrationGroupPermissions, integrationUserPermissions } from "@homarr/db/schema/sqlite";
import { groupMembers, integrationGroupPermissions, integrationUserPermissions } from "@homarr/db/schema";
import type { IntegrationPermission } from "@homarr/definitions";
/**
@@ -11,18 +11,19 @@ import {
integrations,
integrationSecrets,
integrationUserPermissions,
} from "@homarr/db/schema/sqlite";
} from "@homarr/db/schema";
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";
@@ -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),
),
});
@@ -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));
}),
});
@@ -1,5 +1,5 @@
import { decryptSecret } from "@homarr/common/server";
import type { Integration } from "@homarr/db/schema/sqlite";
import type { Integration } from "@homarr/db/schema";
import type { IntegrationKind, IntegrationSecretKind } from "@homarr/definitions";
import { getAllSecretKindOptions } from "@homarr/definitions";
import { integrationCreator, IntegrationTestConnectionError } from "@homarr/integrations";
+1 -1
View File
@@ -2,7 +2,7 @@ import { randomBytes } from "crypto";
import { TRPCError } from "@trpc/server";
import { asc, createId, eq } from "@homarr/db";
import { invites } from "@homarr/db/schema/sqlite";
import { invites } from "@homarr/db/schema";
import { selectInviteSchema } from "@homarr/db/validationSchemas";
import { z } from "@homarr/validation";
+22 -2
View File
@@ -1,7 +1,9 @@
import { TRPCError } from "@trpc/server";
import type { InferInsertModel } from "@homarr/db";
import { and, createId, desc, eq, like } from "@homarr/db";
import { medias } from "@homarr/db/schema/sqlite";
import { iconRepositories, icons, medias } from "@homarr/db/schema";
import { createLocalImageUrl, LOCAL_ICON_REPOSITORY_SLUG, mapMediaToIcon } from "@homarr/icons/local";
import { validation, z } from "@homarr/validation";
import { createTRPCRouter, permissionRequiredProcedure, protectedProcedure } from "../../trpc";
@@ -52,13 +54,29 @@ export const mediaRouter = createTRPCRouter({
.mutation(async ({ ctx, input }) => {
const content = Buffer.from(await input.file.arrayBuffer());
const id = createId();
await ctx.db.insert(medias).values({
const media = {
id,
creatorId: ctx.session.user.id,
content,
size: input.file.size,
contentType: input.file.type,
name: input.file.name,
} satisfies InferInsertModel<typeof medias>;
await ctx.db.insert(medias).values(media);
const localIconRepository = await ctx.db.query.iconRepositories.findFirst({
where: eq(iconRepositories.slug, LOCAL_ICON_REPOSITORY_SLUG),
});
if (!localIconRepository) return id;
const icon = mapMediaToIcon(media);
await ctx.db.insert(icons).values({
id: createId(),
checksum: icon.checksum,
name: icon.fileNameWithExtension,
url: icon.imageUrl,
iconRepositoryId: localIconRepository.id,
});
return id;
@@ -67,6 +85,7 @@ export const mediaRouter = createTRPCRouter({
const dbMedia = await ctx.db.query.medias.findFirst({
where: eq(medias.id, input.id),
columns: {
id: true,
creatorId: true,
},
});
@@ -87,5 +106,6 @@ export const mediaRouter = createTRPCRouter({
}
await ctx.db.delete(medias).where(eq(medias.id, input.id));
await ctx.db.delete(icons).where(eq(icons.url, createLocalImageUrl(input.id)));
}),
});
@@ -3,7 +3,7 @@ import { objectEntries } from "@homarr/common";
import type { MaybePromise } from "@homarr/common/types";
import type { Database } from "@homarr/db";
import { eq } from "@homarr/db";
import { groups, onboarding } from "@homarr/db/schema/sqlite";
import { groups, onboarding } from "@homarr/db/schema";
import type { OnboardingStep } from "@homarr/definitions";
import { credentialsAdminGroup } from "@homarr/definitions";
@@ -1,4 +1,4 @@
import { onboarding } from "@homarr/db/schema/sqlite";
import { onboarding } from "@homarr/db/schema";
import { onboardingSteps } from "@homarr/definitions";
import { z, zodEnumFromArray } from "@homarr/validation";
@@ -1,7 +1,7 @@
import { TRPCError } from "@trpc/server";
import { createId, eq, like, sql } from "@homarr/db";
import { searchEngines } from "@homarr/db/schema/sqlite";
import { searchEngines } from "@homarr/db/schema";
import { validation } from "@homarr/validation";
import { createTRPCRouter, permissionRequiredProcedure, protectedProcedure } from "../../trpc";
+1 -1
View File
@@ -3,7 +3,7 @@ import { describe, expect, test, vi } from "vitest";
import type { Session } from "@homarr/auth";
import { createId } from "@homarr/db";
import { apps } from "@homarr/db/schema/sqlite";
import { apps } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import type { GroupPermissionKey } from "@homarr/definitions";
+1 -1
View File
@@ -17,7 +17,7 @@ import {
sections,
serverSettings,
users,
} from "@homarr/db/schema/sqlite";
} from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import type { BoardPermission, GroupPermissionKey } from "@homarr/definitions";
@@ -2,7 +2,7 @@ import { describe, expect, test, vi } from "vitest";
import * as authShared from "@homarr/auth/shared";
import { createId, eq } from "@homarr/db";
import { boards, users } from "@homarr/db/schema/sqlite";
import { boards, users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import { throwIfActionForbiddenAsync } from "../../board/board-access";
+1 -1
View File
@@ -3,7 +3,7 @@ import { describe, expect, test, vi } from "vitest";
import type { Session } from "@homarr/auth";
import * as env from "@homarr/auth/env.mjs";
import { createId, eq } from "@homarr/db";
import { groupMembers, groupPermissions, groups, users } from "@homarr/db/schema/sqlite";
import { groupMembers, groupPermissions, groups, users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import type { GroupPermissionKey } from "@homarr/definitions";
@@ -2,7 +2,7 @@ import { describe, expect, test, vi } from "vitest";
import * as authShared from "@homarr/auth/shared";
import { createId, eq } from "@homarr/db";
import { integrations, users } from "@homarr/db/schema/sqlite";
import { integrations, users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import { throwIfActionForbiddenAsync } from "../../integration/integration-access";
@@ -4,7 +4,7 @@ import { describe, expect, test, vi } from "vitest";
import type { Session } from "@homarr/auth";
import { encryptSecret } from "@homarr/common/server";
import { createId } from "@homarr/db";
import { integrations, integrationSecrets } from "@homarr/db/schema/sqlite";
import { integrations, integrationSecrets } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import type { GroupPermissionKey } from "@homarr/definitions";
+1 -1
View File
@@ -3,7 +3,7 @@ import { describe, expect, test, vi } from "vitest";
import type { Session } from "@homarr/auth";
import { createId } from "@homarr/db";
import { invites, users } from "@homarr/db/schema/sqlite";
import { invites, users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import { inviteRouter } from "../invite";
@@ -3,7 +3,7 @@ import { describe, expect, test, vi } from "vitest";
import type { Session } from "@homarr/auth";
import { createId } from "@homarr/db";
import { serverSettings } from "@homarr/db/schema/sqlite";
import { serverSettings } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import { defaultServerSettings, defaultServerSettingsKeys } from "@homarr/server-settings";
+10 -10
View File
@@ -2,8 +2,8 @@ import { describe, expect, it, test, vi } from "vitest";
import type { Session } from "@homarr/auth";
import type { Database } from "@homarr/db";
import { createId, eq, schema } from "@homarr/db";
import { onboarding, users } from "@homarr/db/schema/sqlite";
import { createId, eq } from "@homarr/db";
import { invites, onboarding, users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import type { GroupPermissionKey, OnboardingStep } from "@homarr/definitions";
@@ -121,7 +121,7 @@ describe("register should create a user with valid invitation", () => {
await db.insert(users).values({
id: userId,
});
await db.insert(schema.invites).values({
await db.insert(invites).values({
id: inviteId,
token: inviteToken,
creatorId: userId,
@@ -176,7 +176,7 @@ describe("register should create a user with valid invitation", () => {
await db.insert(users).values({
id: userId,
});
await db.insert(schema.invites).values({
await db.insert(invites).values({
id: inviteId,
token: inviteToken,
creatorId: userId,
@@ -211,7 +211,7 @@ describe("editProfile shoud update user", () => {
const emailVerified = new Date(2024, 0, 5);
await db.insert(schema.users).values({
await db.insert(users).values({
id: defaultOwnerId,
name: "TEST 1",
email: "abc@gmail.com",
@@ -226,7 +226,7 @@ describe("editProfile shoud update user", () => {
});
// assert
const user = await db.select().from(schema.users).where(eq(schema.users.id, defaultOwnerId));
const user = await db.select().from(users).where(eq(users.id, defaultOwnerId));
expect(user).toHaveLength(1);
expect(user[0]).containSubset({
@@ -245,7 +245,7 @@ describe("editProfile shoud update user", () => {
session: defaultSession,
});
await db.insert(schema.users).values({
await db.insert(users).values({
id: defaultOwnerId,
name: "TEST 1",
email: "abc@gmail.com",
@@ -260,7 +260,7 @@ describe("editProfile shoud update user", () => {
});
// assert
const user = await db.select().from(schema.users).where(eq(schema.users.id, defaultOwnerId));
const user = await db.select().from(users).where(eq(users.id, defaultOwnerId));
expect(user).toHaveLength(1);
expect(user[0]).containSubset({
@@ -295,11 +295,11 @@ describe("delete should delete user", () => {
},
];
await db.insert(schema.users).values(initialUsers);
await db.insert(users).values(initialUsers);
await caller.delete({ userId: defaultOwnerId });
const usersInDb = await db.select().from(schema.users);
const usersInDb = await db.select().from(users);
expect(usersInDb).toHaveLength(2);
expect(usersInDb[0]).containSubset(initialUsers[0]);
expect(usersInDb[1]).containSubset(initialUsers[2]);
+3 -3
View File
@@ -2,8 +2,8 @@ import { TRPCError } from "@trpc/server";
import { createSaltAsync, hashPasswordAsync } from "@homarr/auth";
import type { Database } from "@homarr/db";
import { and, createId, eq, like, schema } from "@homarr/db";
import { groupMembers, groupPermissions, groups, invites, users } from "@homarr/db/schema/sqlite";
import { and, createId, eq, like } from "@homarr/db";
import { groupMembers, groupPermissions, groups, invites, users } from "@homarr/db/schema";
import { selectUserSchema } from "@homarr/db/validationSchemas";
import { credentialsAdminGroup } from "@homarr/definitions";
import type { SupportedAuthProvider } from "@homarr/definitions";
@@ -509,7 +509,7 @@ const createUserAsync = async (db: Database, input: Omit<z.infer<typeof validati
const username = input.username.toLowerCase();
const userId = createId();
await db.insert(schema.users).values({
await db.insert(users).values({
id: userId,
name: username,
email: input.email,
+1 -1
View File
@@ -1,7 +1,7 @@
import { observable } from "@trpc/server/observable";
import type { Modify } from "@homarr/common/types";
import type { Integration } from "@homarr/db/schema/sqlite";
import type { Integration } from "@homarr/db/schema";
import type { IntegrationKindByCategory } from "@homarr/definitions";
import { getIntegrationKindsByCategory } from "@homarr/definitions";
import { integrationCreator } from "@homarr/integrations";
+1 -1
View File
@@ -1,7 +1,7 @@
import { observable } from "@trpc/server/observable";
import type { Modify } from "@homarr/common/types";
import type { Integration } from "@homarr/db/schema/sqlite";
import type { Integration } from "@homarr/db/schema";
import type { IntegrationKindByCategory } from "@homarr/definitions";
import { getIntegrationKindsByCategory } from "@homarr/definitions";
import type { DownloadClientJobsAndStatus } from "@homarr/integrations";
+1 -1
View File
@@ -2,7 +2,7 @@ import { TRPCError } from "@trpc/server";
import SuperJSON from "superjson";
import { eq } from "@homarr/db";
import { items } from "@homarr/db/schema/sqlite";
import { items } from "@homarr/db/schema";
import { z } from "@homarr/validation";
import { createTRPCRouter, protectedProcedure } from "../../trpc";
+1 -1
View File
@@ -3,7 +3,7 @@ import { DrizzleAdapter } from "@auth/drizzle-adapter";
import type { Database } from "@homarr/db";
import { and, eq } from "@homarr/db";
import { accounts, sessions, users } from "@homarr/db/schema/sqlite";
import { accounts, sessions, users } from "@homarr/db/schema";
import type { SupportedAuthProvider } from "@homarr/definitions";
export const createAdapter = (db: Database, provider: SupportedAuthProvider | "unknown"): Adapter => {
+1 -1
View File
@@ -4,7 +4,7 @@ import type { NextAuthConfig } from "next-auth";
import type { Session } from "@homarr/auth";
import type { Database } from "@homarr/db";
import { eq, inArray } from "@homarr/db";
import { groupMembers, groupPermissions, users } from "@homarr/db/schema/sqlite";
import { groupMembers, groupPermissions, users } from "@homarr/db/schema";
import { getPermissionsWithChildren } from "@homarr/definitions";
export const getCurrentUserPermissionsAsync = async (db: Database, userId: string) => {
+1 -1
View File
@@ -4,7 +4,7 @@ import type { NextAuthConfig } from "next-auth";
import { and, eq, inArray } from "@homarr/db";
import type { Database } from "@homarr/db";
import { groupMembers, groups, users } from "@homarr/db/schema/sqlite";
import { groupMembers, groups, users } from "@homarr/db/schema";
import { colorSchemeCookieKey, everyoneGroup } from "@homarr/definitions";
import { logger } from "@homarr/log";
+2 -2
View File
@@ -33,8 +33,8 @@
"@t3-oss/env-nextjs": "^0.11.1",
"bcrypt": "^5.1.1",
"cookies": "^0.9.1",
"ldapts": "7.2.2",
"next": "^14.2.20",
"ldapts": "7.3.0",
"next": "^14.2.21",
"next-auth": "5.0.0-beta.25",
"react": "^19.0.0",
"react-dom": "^19.0.0"
@@ -2,7 +2,7 @@ import type { Session } from "next-auth";
import type { Database } from "@homarr/db";
import { and, eq, inArray, or } from "@homarr/db";
import { boards, boardUserPermissions, groupMembers } from "@homarr/db/schema/sqlite";
import { boards, boardUserPermissions, groupMembers } from "@homarr/db/schema";
import type { IntegrationPermission } from "@homarr/definitions";
import { constructIntegrationPermissions } from "./integration-permissions";
@@ -1,7 +1,7 @@
import type { Session } from "next-auth";
import { db, eq, inArray } from "@homarr/db";
import { groupMembers, integrationGroupPermissions, integrationUserPermissions } from "@homarr/db/schema/sqlite";
import { groupMembers, integrationGroupPermissions, integrationUserPermissions } from "@homarr/db/schema";
import { constructIntegrationPermissions } from "./integration-permissions";
@@ -3,14 +3,7 @@ import { describe, expect, test, vi } from "vitest";
import type { InferInsertModel } from "@homarr/db";
import { createId } from "@homarr/db";
import {
boardGroupPermissions,
boards,
boardUserPermissions,
groupMembers,
groups,
users,
} from "@homarr/db/schema/sqlite";
import { boardGroupPermissions, boards, boardUserPermissions, groupMembers, groups, users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import * as integrationPermissions from "../integration-permissions";
@@ -2,7 +2,7 @@ import bcrypt from "bcrypt";
import type { Database } from "@homarr/db";
import { and, eq } from "@homarr/db";
import { users } from "@homarr/db/schema/sqlite";
import { users } from "@homarr/db/schema";
import { logger } from "@homarr/log";
import type { validation, z } from "@homarr/validation";
@@ -2,7 +2,7 @@ import { CredentialsSignin } from "@auth/core/errors";
import type { Database, InferInsertModel } from "@homarr/db";
import { and, createId, eq } from "@homarr/db";
import { users } from "@homarr/db/schema/sqlite";
import { users } from "@homarr/db/schema";
import { logger } from "@homarr/log";
import type { validation } from "@homarr/validation";
import { z } from "@homarr/validation";
@@ -23,7 +23,8 @@ export const OidcProvider = (headers: ReadonlyHeaders | null): OIDCConfig<Profil
authorization: {
params: {
scope: env.AUTH_OIDC_SCOPE_OVERWRITE,
redirect_uri: createRedirectUri(headers, "/api/auth/callback/oidc"),
// We fallback to https as generally oidc providers require https
redirect_uri: createRedirectUri(headers, "/api/auth/callback/oidc", "https"),
},
},
profile(profile) {
@@ -1,7 +1,7 @@
import { describe, expect, test } from "vitest";
import { createId } from "@homarr/db";
import { users } from "@homarr/db/schema/sqlite";
import { users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import { createSaltAsync, hashPasswordAsync } from "../../security";
@@ -3,7 +3,7 @@ import { describe, expect, test, vi } from "vitest";
import type { Database } from "@homarr/db";
import { and, createId, eq } from "@homarr/db";
import { groups, users } from "@homarr/db/schema/sqlite";
import { groups, users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import { authorizeWithLdapCredentialsAsync } from "../credentials/authorization/ldap-authorization";
+6 -2
View File
@@ -8,12 +8,16 @@ import { extractBaseUrlFromHeaders } from "@homarr/common";
* @param pathname
* @returns
*/
export const createRedirectUri = (headers: ReadonlyHeaders | null, pathname: string) => {
export const createRedirectUri = (
headers: ReadonlyHeaders | null,
pathname: string,
fallbackProtocol: "http" | "https" = "http",
) => {
if (!headers) {
return pathname;
}
const baseUrl = extractBaseUrlFromHeaders(headers);
const baseUrl = extractBaseUrlFromHeaders(headers, fallbackProtocol);
const path = pathname.startsWith("/") ? pathname : `/${pathname}`;
+1 -1
View File
@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { users } from "@homarr/db/schema/sqlite";
import { users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import { createAdapter } from "../adapter";
+1 -1
View File
@@ -3,7 +3,7 @@ import type { AdapterUser } from "@auth/core/adapters";
import type { JWT } from "next-auth/jwt";
import { describe, expect, test, vi } from "vitest";
import { groupMembers, groupPermissions, groups, users } from "@homarr/db/schema/sqlite";
import { groupMembers, groupPermissions, groups, users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import * as definitions from "@homarr/definitions";
+1 -1
View File
@@ -5,7 +5,7 @@ import { describe, expect, test, vi } from "vitest";
import { eq } from "@homarr/db";
import type { Database } from "@homarr/db";
import { groupMembers, groups, users } from "@homarr/db/schema/sqlite";
import { groupMembers, groups, users } from "@homarr/db/schema";
import { createDb } from "@homarr/db/test";
import { colorSchemeCookieKey, everyoneGroup } from "@homarr/definitions";
+1 -1
View File
@@ -3,7 +3,7 @@ import { command, string } from "@drizzle-team/brocli";
import { hashPasswordAsync } from "@homarr/auth";
import { generateSecureRandomToken } from "@homarr/common/server";
import { and, db, eq } from "@homarr/db";
import { sessions, users } from "@homarr/db/schema/sqlite";
import { sessions, users } from "@homarr/db/schema";
export const resetPassword = command({
name: "reset-password",
+2 -3
View File
@@ -27,9 +27,8 @@
"dependencies": {
"@homarr/log": "workspace:^0.1.0",
"dayjs": "^1.11.13",
"next": "^14.2.20",
"react": "^19.0.0",
"tldts": "^6.1.68"
"next": "^14.2.21",
"react": "^19.0.0"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",
-23
View File
@@ -1,23 +0,0 @@
import * as tldts from "tldts";
const safeParseTldts = (url: string) => {
try {
return tldts.parse(url);
} catch {
return null;
}
};
export const parseAppHrefWithVariables = <TInput extends string | null>(url: TInput, currentHref: string): TInput => {
if (!url || url.length === 0) return url;
const tldtsResult = safeParseTldts(currentHref);
const urlObject = new URL(currentHref);
return url
.replaceAll("[homarr_base]", `${urlObject.protocol}//${urlObject.hostname}`)
.replaceAll("[homarr_hostname]", tldtsResult?.hostname ?? "")
.replaceAll("[homarr_domain]", tldtsResult?.domain ?? "")
.replaceAll("[homarr_protocol]", urlObject.protocol.replace(":", "")) as TInput;
};
-6
View File
@@ -1,6 +0,0 @@
import { parseAppHrefWithVariables } from "./base";
export const parseAppHrefWithVariablesClient = <TInput extends string | null>(url: TInput): TInput => {
if (typeof window === "undefined") return url;
return parseAppHrefWithVariables(url, window.location.href);
};
-8
View File
@@ -1,8 +0,0 @@
import { headers } from "next/headers";
import { extractBaseUrlFromHeaders } from "../url";
import { parseAppHrefWithVariables } from "./base";
export const parseAppHrefWithVariablesServer = <TInput extends string | null>(url: TInput): TInput => {
return parseAppHrefWithVariables(url, extractBaseUrlFromHeaders(headers()));
};
-1
View File
@@ -1,2 +1 @@
export * from "./app-url/client";
export * from "./revalidate-path-action";
-1
View File
@@ -1,3 +1,2 @@
export * from "./app-url/server";
export * from "./security";
export * from "./encryption";
+10 -2
View File
@@ -4,8 +4,16 @@ export const removeTrailingSlash = (path: string) => {
return path.at(-1) === "/" ? path.substring(0, path.length - 1) : path;
};
export const extractBaseUrlFromHeaders = (headers: ReadonlyHeaders): `${string}://${string}` => {
let protocol = headers.get("x-forwarded-proto") ?? "http";
export const extractBaseUrlFromHeaders = (
headers: ReadonlyHeaders,
fallbackProtocol: "http" | "https" = "http",
): `${string}://${string}` => {
let protocol = headers.get("x-forwarded-proto");
// If the protocol is not set or an empty string
if (!protocol) {
protocol = fallbackProtocol;
}
// @see https://support.glitch.com/t/x-forwarded-proto-contains-multiple-protocols/17219
if (protocol.includes(",")) {
+1 -1
View File
@@ -3,7 +3,7 @@ import { EVERY_WEEK } from "@homarr/cron-jobs-core/expressions";
import type { InferInsertModel } from "@homarr/db";
import { db, inArray } from "@homarr/db";
import { createId } from "@homarr/db/client";
import { iconRepositories, icons } from "@homarr/db/schema/sqlite";
import { iconRepositories, icons } from "@homarr/db/schema";
import { fetchIconsAsync } from "@homarr/icons";
import { logger } from "@homarr/log";
+1 -1
View File
@@ -5,7 +5,7 @@ import SuperJSON from "superjson";
import type { Modify } from "@homarr/common/types";
import { EVERY_5_MINUTES } from "@homarr/cron-jobs-core/expressions";
import { db, eq } from "@homarr/db";
import { items } from "@homarr/db/schema/sqlite";
import { items } from "@homarr/db/schema";
import { logger } from "@homarr/log";
import { createItemChannel } from "@homarr/redis";
import { z } from "@homarr/validation";
@@ -1,7 +1,7 @@
import { env } from "@homarr/auth/env.mjs";
import { NEVER } from "@homarr/cron-jobs-core/expressions";
import { db, eq, inArray } from "@homarr/db";
import { sessions, users } from "@homarr/db/schema/sqlite";
import { sessions, users } from "@homarr/db/schema";
import { supportedAuthProviders } from "@homarr/definitions";
import { logger } from "@homarr/log";
+10 -10
View File
@@ -1,19 +1,19 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import * as dotenv from "dotenv";
import type { Config } from "drizzle-kit";
dotenv.config({ path: "../../.env" });
import { env } from "../env.mjs";
export default {
dialect: "mysql",
schema: "./schema",
casing: "snake_case",
dbCredentials: {
host: process.env.DB_HOST!,
user: process.env.DB_USER!,
password: process.env.DB_PASSWORD!,
database: process.env.DB_NAME!,
port: parseInt(process.env.DB_PORT!),
},
dbCredentials: env.DB_URL
? { url: env.DB_URL }
: {
host: env.DB_HOST,
user: env.DB_USER,
password: env.DB_PASSWORD,
database: env.DB_NAME,
port: env.DB_PORT,
},
out: "./migrations/mysql",
} satisfies Config;
+2 -4
View File
@@ -1,13 +1,11 @@
import * as dotenv from "dotenv";
import type { Config } from "drizzle-kit";
dotenv.config({ path: "../../.env" });
import { env } from "../env.mjs";
export default {
dialect: "sqlite",
schema: "./schema",
casing: "snake_case",
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
dbCredentials: { url: process.env.DB_URL! },
dbCredentials: { url: env.DB_URL },
out: "./migrations/sqlite",
} satisfies Config;
+10 -10
View File
@@ -7,6 +7,7 @@ import mysql from "mysql2";
import { logger } from "@homarr/log";
import { env } from "./env.mjs";
import * as mysqlSchema from "./schema/mysql";
import * as sqliteSchema from "./schema/sqlite";
@@ -15,7 +16,7 @@ type HomarrDatabase = BetterSQLite3Database<typeof sqliteSchema>;
const init = () => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!connection) {
switch (process.env.DB_DRIVER) {
switch (env.DB_DRIVER) {
case "mysql2":
initMySQL2();
break;
@@ -36,7 +37,7 @@ class WinstonDrizzleLogger implements Logger {
}
const initBetterSqlite = () => {
connection = new Database(process.env.DB_URL);
connection = new Database(env.DB_URL);
database = drizzleSqlite(connection, {
schema: sqliteSchema,
logger: new WinstonDrizzleLogger(),
@@ -45,16 +46,15 @@ const initBetterSqlite = () => {
};
const initMySQL2 = () => {
if (!process.env.DB_HOST) {
connection = mysql.createConnection({ uri: process.env.DB_URL });
if (!env.DB_HOST) {
connection = mysql.createConnection({ uri: env.DB_URL });
} else {
connection = mysql.createConnection({
host: process.env.DB_HOST,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
database: process.env.DB_NAME!,
port: Number(process.env.DB_PORT),
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
host: env.DB_HOST,
database: env.DB_NAME,
port: env.DB_PORT,
user: env.DB_USER,
password: env.DB_PASSWORD,
});
}
+60
View File
@@ -0,0 +1,60 @@
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
const drivers = {
betterSqlite3: "better-sqlite3",
mysql2: "mysql2",
};
const isDriver = (driver) => process.env.DB_DRIVER === driver;
const isUsingDbHost = Boolean(process.env.DB_HOST);
const onlyAllowUrl = isDriver(drivers.betterSqlite3);
const urlRequired = onlyAllowUrl || !isUsingDbHost;
const hostRequired = isUsingDbHost && !onlyAllowUrl;
export const env = createEnv({
/**
* Specify your server-side environment variables schema here. This way you can ensure the app isn't
* built with invalid env vars.
*/
server: {
DB_DRIVER: z
.union([z.literal(drivers.betterSqlite3), z.literal(drivers.mysql2)], {
message: `Invalid database driver, supported are ${Object.keys(drivers).join(", ")}`,
})
.default(drivers.betterSqlite3),
...(urlRequired
? {
DB_URL: z.string(),
}
: {}),
...(hostRequired
? {
DB_HOST: z.string(),
DB_PORT: z
.string()
.regex(/\d+/)
.transform(Number)
.refine((number) => number >= 1)
.default("3306"),
DB_USER: z.string(),
DB_PASSWORD: z.string(),
DB_NAME: z.string(),
}
: {}),
},
/**
* Destructure all variables from `process.env` to make sure they aren't tree-shaken away.
*/
runtimeEnv: {
DB_DRIVER: process.env.DB_DRIVER,
DB_URL: process.env.DB_URL,
DB_HOST: process.env.DB_HOST,
DB_USER: process.env.DB_USER,
DB_PASSWORD: process.env.DB_PASSWORD,
DB_NAME: process.env.DB_NAME,
DB_PORT: process.env.DB_PORT,
},
skipValidation:
Boolean(process.env.CI) || Boolean(process.env.SKIP_ENV_VALIDATION) || process.env.npm_lifecycle_event === "lint",
});
-4
View File
@@ -1,10 +1,6 @@
import Database from "better-sqlite3";
import { database } from "./driver";
import * as sqliteSchema from "./schema/sqlite";
// Export only the types from the sqlite schema as we're using that.
export const schema = sqliteSchema;
export * from "drizzle-orm";
+10 -10
View File
@@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { drizzle } from "drizzle-orm/mysql2";
import { migrate } from "drizzle-orm/mysql2/migrator";
import mysql from "mysql2";
import type { Database } from "../..";
import { env } from "../../env.mjs";
import * as mysqlSchema from "../../schema/mysql";
import { seedDataAsync } from "../seed";
@@ -11,15 +11,15 @@ const migrationsFolder = process.argv[2] ?? ".";
const migrateAsync = async () => {
const mysql2 = mysql.createConnection(
process.env.DB_HOST
? {
host: process.env.DB_HOST,
database: process.env.DB_NAME!,
port: Number(process.env.DB_PORT),
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
}
: { uri: process.env.DB_URL },
env.DB_URL
? { uri: env.DB_URL }
: {
host: env.DB_HOST,
database: env.DB_NAME,
port: env.DB_PORT,
user: env.DB_USER,
password: env.DB_PASSWORD,
},
);
const db = drizzle(mysql2, {
+1 -1
View File
@@ -6,8 +6,8 @@ import { defaultServerSettings, defaultServerSettingsKeys } from "@homarr/server
import { createId, eq } from "..";
import type { Database } from "..";
import { onboarding, serverSettings } from "../schema";
import { groups } from "../schema/mysql";
import { onboarding, serverSettings } from "../schema/sqlite";
export const seedDataAsync = async (db: Database) => {
await seedEveryoneGroupAsync(db);
+4 -3
View File
@@ -2,15 +2,16 @@ import Database from "better-sqlite3";
import { drizzle } from "drizzle-orm/better-sqlite3";
import { migrate } from "drizzle-orm/better-sqlite3/migrator";
import { schema } from "../..";
import { env } from "../../env.mjs";
import * as sqliteSchema from "../../schema/sqlite";
import { seedDataAsync } from "../seed";
const migrationsFolder = process.argv[2] ?? ".";
const migrateAsync = async () => {
const sqlite = new Database(process.env.DB_URL?.replace("file:", ""));
const sqlite = new Database(env.DB_URL.replace("file:", ""));
const db = drizzle(sqlite, { schema, casing: "snake_case" });
const db = drizzle(sqlite, { schema: sqliteSchema, casing: "snake_case" });
migrate(db, { migrationsFolder });
+17 -15
View File
@@ -7,10 +7,11 @@
"exports": {
".": "./index.ts",
"./client": "./client.ts",
"./schema/sqlite": "./schema/sqlite.ts",
"./schema": "./schema/index.ts",
"./test": "./test/index.ts",
"./queries": "./queries/index.ts",
"./validationSchemas": "./validationSchemas.ts"
"./validationSchemas": "./validationSchemas.ts",
"./env.mjs": "./env.mjs"
},
"main": "./index.ts",
"types": "./index.ts",
@@ -21,16 +22,16 @@
"clean": "rm -rf .turbo node_modules",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"migration:mysql:drop": "drizzle-kit drop --config ./configs/mysql.config.ts",
"migration:mysql:generate": "drizzle-kit generate --config ./configs/mysql.config.ts",
"migration:mysql:run": "drizzle-kit migrate --config ./configs/mysql.config.ts && pnpm run seed",
"migration:sqlite:drop": "drizzle-kit drop --config ./configs/sqlite.config.ts",
"migration:sqlite:generate": "drizzle-kit generate --config ./configs/sqlite.config.ts",
"migration:sqlite:run": "drizzle-kit migrate --config ./configs/sqlite.config.ts && pnpm run seed",
"push:mysql": "drizzle-kit push --config ./configs/mysql.config.ts",
"push:sqlite": "drizzle-kit push --config ./configs/sqlite.config.ts",
"migration:mysql:drop": "pnpm with-env drizzle-kit drop --config ./configs/mysql.config.ts",
"migration:mysql:generate": "pnpm with-env drizzle-kit generate --config ./configs/mysql.config.ts",
"migration:mysql:run": "pnpm with-env drizzle-kit migrate --config ./configs/mysql.config.ts && pnpm run seed",
"migration:sqlite:drop": "pnpm with-env drizzle-kit drop --config ./configs/sqlite.config.ts",
"migration:sqlite:generate": "pnpm with-env drizzle-kit generate --config ./configs/sqlite.config.ts",
"migration:sqlite:run": "pnpm with-env drizzle-kit migrate --config ./configs/sqlite.config.ts && pnpm run seed",
"push:mysql": "pnpm with-env drizzle-kit push --config ./configs/mysql.config.ts",
"push:sqlite": "pnpm with-env drizzle-kit push --config ./configs/sqlite.config.ts",
"seed": "pnpm with-env tsx ./migrations/run-seed.ts",
"studio": "drizzle-kit studio --config ./configs/sqlite.config.ts",
"studio": "pnpm with-env drizzle-kit studio --config ./configs/sqlite.config.ts",
"typecheck": "tsc --noEmit",
"with-env": "dotenv -e ../../.env --"
},
@@ -42,20 +43,21 @@
"@homarr/log": "workspace:^0.1.0",
"@homarr/server-settings": "workspace:^0.1.0",
"@paralleldrive/cuid2": "^2.2.2",
"@t3-oss/env-nextjs": "^0.11.1",
"@testcontainers/mysql": "^10.16.0",
"better-sqlite3": "^11.7.0",
"dotenv": "^16.4.7",
"drizzle-kit": "^0.30.1",
"drizzle-orm": "^0.38.2",
"drizzle-zod": "^0.6.0",
"mysql2": "3.11.5"
"drizzle-orm": "^0.38.3",
"drizzle-zod": "^0.6.1",
"mysql2": "3.12.0"
},
"devDependencies": {
"@homarr/eslint-config": "workspace:^0.2.0",
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@types/better-sqlite3": "7.6.12",
"dotenv-cli": "^7.4.4",
"dotenv-cli": "^8.0.0",
"eslint": "^9.17.0",
"prettier": "^3.4.2",
"tsx": "4.19.2",
+1 -1
View File
@@ -3,7 +3,7 @@ import type { WidgetKind } from "@homarr/definitions";
import type { Database } from "..";
import { inArray } from "..";
import type { inferSupportedIntegrations } from "../../widgets/src";
import { items } from "../schema/sqlite";
import { items } from "../schema";
export const getItemsWithIntegrationsAsync = async <TKind extends WidgetKind>(
db: Database,
+1 -1
View File
@@ -5,7 +5,7 @@ import { defaultServerSettings, defaultServerSettingsKeys } from "@homarr/server
import type { Database } from "..";
import { eq } from "..";
import { serverSettings } from "../schema/sqlite";
import { serverSettings } from "../schema";
export const getServerSettingsAsync = async (db: Database) => {
const settings = await db.query.serverSettings.findMany();
+45
View File
@@ -0,0 +1,45 @@
import type { InferSelectModel } from "drizzle-orm";
import * as mysqlSchema from "./mysql";
import * as sqliteSchema from "./sqlite";
type Schema = typeof sqliteSchema;
const schema = process.env.DB_DRIVER === "mysql2" ? (mysqlSchema as unknown as Schema) : sqliteSchema;
// Sadly we can't use export * from here as we have multiple possible exports
export const {
accounts,
apiKeys,
apps,
boardGroupPermissions,
boardUserPermissions,
boards,
groupMembers,
groupPermissions,
groups,
iconRepositories,
icons,
integrationGroupPermissions,
integrationItems,
integrationSecrets,
integrationUserPermissions,
integrations,
invites,
items,
medias,
onboarding,
searchEngines,
sections,
serverSettings,
sessions,
users,
verificationTokens,
} = schema;
export type User = InferSelectModel<typeof schema.users>;
export type Account = InferSelectModel<typeof schema.accounts>;
export type Session = InferSelectModel<typeof schema.sessions>;
export type VerificationToken = InferSelectModel<typeof schema.verificationTokens>;
export type Integration = InferSelectModel<typeof schema.integrations>;
export type IntegrationSecret = InferSelectModel<typeof schema.integrationSecrets>;
-8
View File
@@ -1,6 +1,5 @@
import type { AdapterAccount } from "@auth/core/adapters";
import type { DayOfWeek } from "@mantine/dates";
import type { InferSelectModel } from "drizzle-orm";
import { relations, sql } from "drizzle-orm";
import type { AnySQLiteColumn } from "drizzle-orm/sqlite-core";
import { blob, index, int, primaryKey, sqliteTable, text } from "drizzle-orm/sqlite-core";
@@ -567,10 +566,3 @@ export const searchEngineRelations = relations(searchEngines, ({ one }) => ({
references: [integrations.id],
}),
}));
export type User = InferSelectModel<typeof users>;
export type Account = InferSelectModel<typeof accounts>;
export type Session = InferSelectModel<typeof sessions>;
export type VerificationToken = InferSelectModel<typeof verificationTokens>;
export type Integration = InferSelectModel<typeof integrations>;
export type IntegrationSecret = InferSelectModel<typeof integrationSecrets>;
Loaded 100 of 182 files, more files were not shown because too many files have changed in this diff. Show more