mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-23 14:13:53 +01:00
Compare commits
13 Commits
v0.22.0-rc
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad87991619 | ||
|
|
7a7c10c052 | ||
|
|
41c0ccf628 | ||
|
|
3d5545bf4d | ||
|
|
7bac55f50e | ||
|
|
2d1d3d927b | ||
|
|
540028a22e | ||
|
|
14b0d51894 | ||
|
|
4334f926c0 | ||
|
|
1088972ff0 | ||
|
|
55e247ac71 | ||
|
|
05a2700718 | ||
|
|
06c11cdcd5 |
@@ -243,6 +243,6 @@ jobs:
|
|||||||
uses: actions/attest-build-provenance@v1
|
uses: actions/attest-build-provenance@v1
|
||||||
if: (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/'))
|
if: (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/'))
|
||||||
with:
|
with:
|
||||||
subject-name: ${{ env.DOCKERHUB_REPO }}
|
subject-name: docker.io/${{ env.DOCKERHUB_REPO }}
|
||||||
subject-digest: ${{ steps.push-dockerhub.outputs.digest }}
|
subject-digest: ${{ steps.push-dockerhub.outputs.digest }}
|
||||||
push-to-registry: true
|
push-to-registry: true
|
||||||
|
|||||||
@@ -245,6 +245,6 @@ jobs:
|
|||||||
uses: actions/attest-build-provenance@v1
|
uses: actions/attest-build-provenance@v1
|
||||||
if: (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/'))
|
if: (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/'))
|
||||||
with:
|
with:
|
||||||
subject-name: ${{ env.DOCKERHUB_REPO }}
|
subject-name: docker.io/${{ env.DOCKERHUB_REPO }}
|
||||||
subject-digest: ${{ steps.push-dockerhub.outputs.digest }}
|
subject-digest: ${{ steps.push-dockerhub.outputs.digest }}
|
||||||
push-to-registry: true
|
push-to-registry: true
|
||||||
|
|||||||
2
.github/workflows/docker-publish.yaml
vendored
2
.github/workflows/docker-publish.yaml
vendored
@@ -236,6 +236,6 @@ jobs:
|
|||||||
uses: actions/attest-build-provenance@v1
|
uses: actions/attest-build-provenance@v1
|
||||||
if: (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/'))
|
if: (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/'))
|
||||||
with:
|
with:
|
||||||
subject-name: ${{ env.DOCKERHUB_REPO }}
|
subject-name: docker.io/${{ env.DOCKERHUB_REPO }}
|
||||||
subject-digest: ${{ steps.push-dockerhub.outputs.digest }}
|
subject-digest: ${{ steps.push-dockerhub.outputs.digest }}
|
||||||
push-to-registry: true
|
push-to-registry: true
|
||||||
|
|||||||
14
.scaffold/go.sum
Normal file
14
.scaffold/go.sum
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
entgo.io/ent v0.14.5 h1:Rj2WOYJtCkWyFo6a+5wB3EfBRP0rnx1fMk6gGA0UUe4=
|
||||||
|
entgo.io/ent v0.14.5/go.mod h1:zTzLmWtPvGpmSwtkaayM2cm5m819NdM7z7tYPq3vN0U=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||||
|
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||||
|
github.com/sysadminsmedia/homebox/backend v0.0.0-20251212183312-2d1d3d927bfd h1:QULUJSgHc4rSlTjb2qYT6FIgwDWFCqEpnYqc/ltsrkk=
|
||||||
|
github.com/sysadminsmedia/homebox/backend v0.0.0-20251212183312-2d1d3d927bfd/go.mod h1:jB+tPmHtPDM1VnAjah0gvcRfP/s7c+rtQwpA8cvZD/U=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
@@ -325,8 +325,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
|
|||||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
|
||||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
|
||||||
github.com/mattn/go-sqlite3 v1.14.32 h1:JD12Ag3oLy1zQA+BNn74xRgaBbdhbNIDYvQUEuuErjs=
|
github.com/mattn/go-sqlite3 v1.14.32 h1:JD12Ag3oLy1zQA+BNn74xRgaBbdhbNIDYvQUEuuErjs=
|
||||||
github.com/mattn/go-sqlite3 v1.14.32/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
github.com/mattn/go-sqlite3 v1.14.32/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||||
github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY=
|
github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY=
|
||||||
@@ -349,8 +347,6 @@ github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOF
|
|||||||
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||||
github.com/olahol/melody v1.4.0 h1:Pa5SdeZL/zXPi1tJuMAPDbl4n3gQOThSL6G1p4qZ4SI=
|
github.com/olahol/melody v1.4.0 h1:Pa5SdeZL/zXPi1tJuMAPDbl4n3gQOThSL6G1p4qZ4SI=
|
||||||
github.com/olahol/melody v1.4.0/go.mod h1:GgkTl6Y7yWj/HtfD48Q5vLKPVoZOH+Qqgfa7CvJgJM4=
|
github.com/olahol/melody v1.4.0/go.mod h1:GgkTl6Y7yWj/HtfD48Q5vLKPVoZOH+Qqgfa7CvJgJM4=
|
||||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
|
|
||||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
|
||||||
github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU=
|
github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU=
|
||||||
github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=
|
github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=
|
||||||
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
|
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
|
||||||
@@ -393,10 +389,6 @@ github.com/shirou/gopsutil/v4 v4.25.11 h1:X53gB7muL9Gnwwo2evPSE+SfOrltMoR6V3xJAX
|
|||||||
github.com/shirou/gopsutil/v4 v4.25.11/go.mod h1:EivAfP5x2EhLp2ovdpKSozecVXn1TmuG7SMzs/Wh4PU=
|
github.com/shirou/gopsutil/v4 v4.25.11/go.mod h1:EivAfP5x2EhLp2ovdpKSozecVXn1TmuG7SMzs/Wh4PU=
|
||||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
||||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
||||||
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
|
|
||||||
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
|
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
|
||||||
github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo=
|
github.com/spiffe/go-spiffe/v2 v2.6.0 h1:l+DolpxNWYgruGQVV0xsfeya3CsC7m8iBzDnMpsbLuo=
|
||||||
github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs=
|
github.com/spiffe/go-spiffe/v2 v2.6.0/go.mod h1:gm2SeUoMZEtpnzPNs2Csc0D/gX33k1xIx7lEzqblHEs=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- +goose Up
|
||||||
|
ALTER TABLE users ALTER COLUMN password DROP NOT NULL;
|
||||||
@@ -97,12 +97,35 @@ func ToItemAttachment(attachment *ent.Attachment) ItemAttachment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// normalizePath converts backslashes to forward slashes and trims slashes from both ends
|
||||||
|
// This ensures consistent path separators for blob storage which expects forward slashes
|
||||||
|
func normalizePath(path string) string {
|
||||||
|
path = strings.ReplaceAll(path, "\\", "/")
|
||||||
|
return strings.Trim(path, "/")
|
||||||
|
}
|
||||||
|
|
||||||
func (r *AttachmentRepo) path(gid uuid.UUID, hash string) string {
|
func (r *AttachmentRepo) path(gid uuid.UUID, hash string) string {
|
||||||
return filepath.Join(gid.String(), "documents", hash)
|
// Always use forward slashes for consistency across platforms
|
||||||
|
// This ensures paths are stored in the database with forward slashes
|
||||||
|
return fmt.Sprintf("%s/documents/%s", gid.String(), hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *AttachmentRepo) fullPath(relativePath string) string {
|
func (r *AttachmentRepo) fullPath(relativePath string) string {
|
||||||
return filepath.Join(r.storage.PrefixPath, relativePath)
|
// Normalize path separators to forward slashes for blob storage
|
||||||
|
// The blob library expects forward slashes in keys regardless of OS
|
||||||
|
normalizedRelativePath := normalizePath(relativePath)
|
||||||
|
|
||||||
|
// Always use forward slashes when joining paths for blob storage
|
||||||
|
if r.storage.PrefixPath == "" {
|
||||||
|
return normalizedRelativePath
|
||||||
|
}
|
||||||
|
normalizedPrefix := normalizePath(r.storage.PrefixPath)
|
||||||
|
|
||||||
|
if normalizedPrefix == "" {
|
||||||
|
return normalizedRelativePath
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf("%s/%s", normalizedPrefix, normalizedRelativePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *AttachmentRepo) GetFullPath(relativePath string) string {
|
func (r *AttachmentRepo) GetFullPath(relativePath string) string {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/sysadminsmedia/homebox/backend/internal/data/ent"
|
"github.com/sysadminsmedia/homebox/backend/internal/data/ent"
|
||||||
"github.com/sysadminsmedia/homebox/backend/internal/data/ent/attachment"
|
"github.com/sysadminsmedia/homebox/backend/internal/data/ent/attachment"
|
||||||
|
"github.com/sysadminsmedia/homebox/backend/internal/sys/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAttachmentRepo_Create(t *testing.T) {
|
func TestAttachmentRepo_Create(t *testing.T) {
|
||||||
@@ -281,3 +282,58 @@ func TestAttachmentRepo_SettingPhotoPrimaryStillWorks(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.False(t, photo1.Primary, "Photo 1 should no longer be primary after setting Photo 2 as primary")
|
assert.False(t, photo1.Primary, "Photo 1 should no longer be primary after setting Photo 2 as primary")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAttachmentRepo_PathNormalization(t *testing.T) {
|
||||||
|
// Test that paths always use forward slashes
|
||||||
|
repo := &AttachmentRepo{
|
||||||
|
storage: config.Storage{
|
||||||
|
PrefixPath: ".data",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
testGUID := uuid.MustParse("eb6bf410-a1a8-478d-a803-ca3948368a0c")
|
||||||
|
testHash := "f295eb01-18a9-4631-a797-70bd9623edd4.png"
|
||||||
|
|
||||||
|
// Test path() method - should always return forward slashes
|
||||||
|
relativePath := repo.path(testGUID, testHash)
|
||||||
|
assert.Equal(t, "eb6bf410-a1a8-478d-a803-ca3948368a0c/documents/f295eb01-18a9-4631-a797-70bd9623edd4.png", relativePath)
|
||||||
|
assert.NotContains(t, relativePath, "\\", "path() should not contain backslashes")
|
||||||
|
|
||||||
|
// Test fullPath() with forward slash input (from database)
|
||||||
|
fullPath := repo.fullPath("eb6bf410-a1a8-478d-a803-ca3948368a0c/documents/f295eb01-18a9-4631-a797-70bd9623edd4.png")
|
||||||
|
assert.Equal(t, ".data/eb6bf410-a1a8-478d-a803-ca3948368a0c/documents/f295eb01-18a9-4631-a797-70bd9623edd4.png", fullPath)
|
||||||
|
assert.NotContains(t, fullPath, "\\", "fullPath() should not contain backslashes")
|
||||||
|
|
||||||
|
// Test fullPath() with backslash input (legacy Windows paths from old database)
|
||||||
|
fullPathWithBackslash := repo.fullPath("eb6bf410-a1a8-478d-a803-ca3948368a0c\\documents\\f295eb01-18a9-4631-a797-70bd9623edd4.png")
|
||||||
|
assert.Equal(t, ".data/eb6bf410-a1a8-478d-a803-ca3948368a0c/documents/f295eb01-18a9-4631-a797-70bd9623edd4.png", fullPathWithBackslash)
|
||||||
|
assert.NotContains(t, fullPathWithBackslash, "\\", "fullPath() should normalize backslashes to forward slashes")
|
||||||
|
|
||||||
|
// Test with Windows-style prefix path
|
||||||
|
repoWindows := &AttachmentRepo{
|
||||||
|
storage: config.Storage{
|
||||||
|
PrefixPath: ".data",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
fullPathWindows := repoWindows.fullPath("eb6bf410-a1a8-478d-a803-ca3948368a0c/documents/f295eb01-18a9-4631-a797-70bd9623edd4.png")
|
||||||
|
assert.NotContains(t, fullPathWindows, "\\", "fullPath() should normalize Windows paths")
|
||||||
|
|
||||||
|
// Test empty prefix
|
||||||
|
repoNoPrefix := &AttachmentRepo{
|
||||||
|
storage: config.Storage{
|
||||||
|
PrefixPath: "",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
fullPathNoPrefix := repoNoPrefix.fullPath("eb6bf410-a1a8-478d-a803-ca3948368a0c/documents/f295eb01-18a9-4631-a797-70bd9623edd4.png")
|
||||||
|
assert.Equal(t, "eb6bf410-a1a8-478d-a803-ca3948368a0c/documents/f295eb01-18a9-4631-a797-70bd9623edd4.png", fullPathNoPrefix)
|
||||||
|
|
||||||
|
// Test with single slash prefix (like in tests)
|
||||||
|
repoSlashPrefix := &AttachmentRepo{
|
||||||
|
storage: config.Storage{
|
||||||
|
PrefixPath: "/",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
fullPathSlashPrefix := repoSlashPrefix.fullPath("eb6bf410-a1a8-478d-a803-ca3948368a0c/documents/f295eb01-18a9-4631-a797-70bd9623edd4.png")
|
||||||
|
assert.Equal(t, "eb6bf410-a1a8-478d-a803-ca3948368a0c/documents/f295eb01-18a9-4631-a797-70bd9623edd4.png", fullPathSlashPrefix)
|
||||||
|
assert.NotContains(t, fullPathSlashPrefix, "//", "fullPath() should not have double slashes")
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ aside: false
|
|||||||
| HBOX_WEB_IDLE_TIMEOUT | 30s | Idle timeout of HTTP server |
|
| HBOX_WEB_IDLE_TIMEOUT | 30s | Idle timeout of HTTP server |
|
||||||
| HBOX_STORAGE_CONN_STRING | file:///./ | path to the data directory, do not change this if you're using docker |
|
| HBOX_STORAGE_CONN_STRING | file:///./ | path to the data directory, do not change this if you're using docker |
|
||||||
| HBOX_STORAGE_PREFIX_PATH | .data | prefix path for the storage, if not set the storage will be used as is |
|
| HBOX_STORAGE_PREFIX_PATH | .data | prefix path for the storage, if not set the storage will be used as is |
|
||||||
| HBOX_LOG_LEVEL | `info` | log level to use, can be one of `trace`, `debug`, `info`, `warn`, `error`, `critical` |
|
| HBOX_LOG_LEVEL | `info` | log level to use, can be one of `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic` |
|
||||||
| HBOX_LOG_FORMAT | `text` | log format to use, can be one of: `text`, `json` |
|
| HBOX_LOG_FORMAT | `text` | log format to use, can be one of: `text`, `json` |
|
||||||
| HBOX_MAILER_HOST | | email host to use, if not set no email provider will be used |
|
| HBOX_MAILER_HOST | | email host to use, if not set no email provider will be used |
|
||||||
| HBOX_MAILER_PORT | 587 | email port to use |
|
| HBOX_MAILER_PORT | 587 | email port to use |
|
||||||
@@ -71,6 +71,7 @@ aside: false
|
|||||||
| HBOX_THUMBNAIL_ENABLED | true | enable thumbnail generation for images, supports PNG, JPEG, AVIF, WEBP, GIF file types |
|
| HBOX_THUMBNAIL_ENABLED | true | enable thumbnail generation for images, supports PNG, JPEG, AVIF, WEBP, GIF file types |
|
||||||
| HBOX_THUMBNAIL_WIDTH | 500 | width for generated thumbnails in pixels |
|
| HBOX_THUMBNAIL_WIDTH | 500 | width for generated thumbnails in pixels |
|
||||||
| HBOX_THUMBNAIL_HEIGHT | 500 | height for generated thumbnails in pixels |
|
| HBOX_THUMBNAIL_HEIGHT | 500 | height for generated thumbnails in pixels |
|
||||||
|
| HBOX_BARCODE_TOKEN_BARCODESPIDER | | API token for BarcodeSpider.com service used for barcode product lookups. If not set, barcode product lookups will not be performed. |
|
||||||
|
|
||||||
### HBOX_WEB_HOST examples
|
### HBOX_WEB_HOST examples
|
||||||
|
|
||||||
@@ -204,70 +205,79 @@ If you're deploying without docker you can use command line arguments to configu
|
|||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
Usage: api [options] [arguments]
|
Options:
|
||||||
|
--barcode-token-barcodespider <string>
|
||||||
OPTIONS
|
--database-database <string>
|
||||||
--mode/$HBOX_MODE <string> (default: development)
|
--database-driver <string> (default: sqlite3)
|
||||||
--web-port/$HBOX_WEB_PORT <string> (default: 7745)
|
--database-host <string>
|
||||||
--web-host/$HBOX_WEB_HOST <string>
|
--database-password <string>
|
||||||
--web-max-upload-size/$HBOX_WEB_MAX_UPLOAD_SIZE <int> (default: 10)
|
--database-port <string>
|
||||||
--storage-conn-string/$HBOX_STORAGE_CONN_STRING <string> (default: file:///./)
|
--database-pub-sub-conn-string <string> (default: mem://{{ .Topic }})
|
||||||
--storage-prefix-path/$HBOX_STORAGE_PREFIX_PATH <string> (default: .data)
|
--database-sqlite-path <string> (default: ./.data/homebox.db?_pragma=busy_timeout=999&_pragma=journal_mode=WAL&_fk=1&_time_format=sqlite)
|
||||||
--log-level/$HBOX_LOG_LEVEL <string> (default: info)
|
--database-ssl-cert <string>
|
||||||
--log-format/$HBOX_LOG_FORMAT <string> (default: text)
|
--database-ssl-key <string>
|
||||||
--mailer-host/$HBOX_MAILER_HOST <string>
|
--database-ssl-mode <string> (default: require)
|
||||||
--mailer-port/$HBOX_MAILER_PORT <int>
|
--database-ssl-root-cert <string>
|
||||||
--mailer-username/$HBOX_MAILER_USERNAME <string>
|
--database-username <string>
|
||||||
--mailer-password/$HBOX_MAILER_PASSWORD <string>
|
--debug-enabled <bool> (default: false)
|
||||||
--mailer-from/$HBOX_MAILER_FROM <string>
|
--debug-port <string> (default: 4000)
|
||||||
--demo/$HBOX_DEMO <bool>
|
--demo <bool>
|
||||||
--debug-enabled/$HBOX_DEBUG_ENABLED <bool> (default: false)
|
-h, --help display this help message
|
||||||
--debug-port/$HBOX_DEBUG_PORT <string> (default: 4000)
|
--label-maker-additional-information <string>
|
||||||
--database-driver/$HBOX_DATABASE_DRIVER <string> (default: sqlite3)
|
--label-maker-bold-font-path <string>
|
||||||
--database-sqlite-path/$HBOX_DATABASE_SQLITE_PATH <string> (default: ./.data/homebox.db?_pragma=busy_timeout=999&_pragma=journal_mode=WAL&_fk=1&_time_format=sqlite)
|
--label-maker-dynamic-length <bool> (default: true)
|
||||||
--database-host/$HBOX_DATABASE_HOST <string>
|
--label-maker-font-size <float> (default: 32.0)
|
||||||
--database-port/$HBOX_DATABASE_PORT <string>
|
--label-maker-height <int> (default: 200)
|
||||||
--database-username/$HBOX_DATABASE_USERNAME <string>
|
--label-maker-label-service-timeout <int>
|
||||||
--database-password/$HBOX_DATABASE_PASSWORD <string>
|
--label-maker-label-service-url <string>
|
||||||
--database-database/$HBOX_DATABASE_DATABASE <string>
|
--label-maker-margin <int> (default: 32)
|
||||||
--database-ssl-mode/$HBOX_DATABASE_SSL_MODE <string> (default: prefer)
|
--label-maker-padding <int> (default: 32)
|
||||||
--options-allow-registration/$HBOX_OPTIONS_ALLOW_REGISTRATION <bool> (default: true)
|
--label-maker-print-command <string>
|
||||||
--options-auto-increment-asset-id/$HBOX_OPTIONS_AUTO_INCREMENT_ASSET_ID <bool> (default: true)
|
--label-maker-regular-font-path <string>
|
||||||
--options-currency-config/$HBOX_OPTIONS_CURRENCY_CONFIG <string>
|
--label-maker-width <int> (default: 526)
|
||||||
--options-github-release-check/$HBOX_OPTIONS_GITHUB_RELEASE_CHECK <bool> (default: true)
|
--log-format <string> (default: text)
|
||||||
--options-allow-analytics/$HBOX_OPTIONS_ALLOW_ANALYTICS <bool> (default: false)
|
--log-level <string> (default: info)
|
||||||
--options-allow-local-login/$HBOX_OPTIONS_ALLOW_LOCAL_LOGIN <bool> (default: true)
|
--mailer-from <string>
|
||||||
--options-trust-proxy/$HBOX_OPTIONS_TRUST_PROXY <bool> (default: false)
|
--mailer-host <string>
|
||||||
--options-hostname/$HBOX_OPTIONS_HOSTNAME <string>
|
--mailer-password <string>
|
||||||
--oidc-enabled/$HBOX_OIDC_ENABLED <bool> (default: false)
|
--mailer-port <int>
|
||||||
--oidc-issuer-url/$HBOX_OIDC_ISSUER_URL <string>
|
--mailer-username <string>
|
||||||
--oidc-client-id/$HBOX_OIDC_CLIENT_ID <string>
|
--mode <string> (default: development)
|
||||||
--oidc-client-secret/$HBOX_OIDC_CLIENT_SECRET <string>
|
--oidc-allowed-groups <string>
|
||||||
--oidc-scope/$HBOX_OIDC_SCOPE <string> (default: openid profile email)
|
--oidc-auto-redirect <bool> (default: false)
|
||||||
--oidc-allowed-groups/$HBOX_OIDC_ALLOWED_GROUPS <string>
|
--oidc-button-text <string> (default: Sign in with OIDC)
|
||||||
--oidc-auto-redirect/$HBOX_OIDC_AUTO_REDIRECT <bool> (default: false)
|
--oidc-client-id <string>
|
||||||
--oidc-verify-email/$HBOX_OIDC_VERIFY_EMAIL <bool> (default: false)
|
--oidc-client-secret <string>
|
||||||
--oidc-group-claim/$HBOX_OIDC_GROUP_CLAIM <string> (default: groups)
|
--oidc-email-claim <string> (default: email)
|
||||||
--oidc-email-claim/$HBOX_OIDC_EMAIL_CLAIM <string> (default: email)
|
--oidc-email-verified-claim <string> (default: email_verified)
|
||||||
--oidc-name-claim/$HBOX_OIDC_NAME_CLAIM <string> (default: name)
|
--oidc-enabled <bool> (default: false)
|
||||||
--oidc-email-verified-claim/$HBOX_OIDC_EMAIL_VERIFIED_CLAIM <string> (default: email_verified)
|
--oidc-group-claim <string> (default: groups)
|
||||||
--oidc-button-text/$HBOX_OIDC_BUTTON_TEXT <string> (default: Sign in with OIDC)
|
--oidc-issuer-url <string>
|
||||||
--oidc-state-expiry/$HBOX_OIDC_STATE_EXPIRY <duration> (default: 10m)
|
--oidc-name-claim <string> (default: name)
|
||||||
--oidc-request-timeout/$HBOX_OIDC_REQUEST_TIMEOUT <duration> (default: 30s)
|
--oidc-request-timeout <duration> (default: 30s)
|
||||||
--label-maker-width/$HBOX_LABEL_MAKER_WIDTH <int> (default: 526)
|
--oidc-scope <string> (default: openid profile email)
|
||||||
--label-maker-height/$HBOX_LABEL_MAKER_HEIGHT <int> (default: 200)
|
--oidc-state-expiry <duration> (default: 10m)
|
||||||
--label-maker-padding/$HBOX_LABEL_MAKER_PADDING <int> (default: 32)
|
--oidc-verify-email <bool> (default: false)
|
||||||
--label-maker-margin/$HBOX_LABEL_MAKER_MARGIN <int> (default: 32)
|
--options-allow-analytics <bool> (default: false)
|
||||||
--label-maker-font-size/$HBOX_LABEL_MAKER_FONT_SIZE <float> (default: 32.0)
|
--options-allow-local-login <bool> (default: true)
|
||||||
--label-maker-print-command/$HBOX_LABEL_MAKER_PRINT_COMMAND <string>
|
--options-allow-registration <bool> (default: true)
|
||||||
--label-maker-dynamic-length/$HBOX_LABEL_MAKER_DYNAMIC_LENGTH <bool> (default: true)
|
--options-auto-increment-asset-id <bool> (default: true)
|
||||||
--label-maker-additional-information/$HBOX_LABEL_MAKER_ADDITIONAL_INFORMATION <string>
|
--options-currency-config <string>
|
||||||
--label-maker-regular-font-path/$HBOX_LABEL_MAKER_REGULAR_FONT_PATH <string>
|
--options-github-release-check <bool> (default: true)
|
||||||
--label-maker-bold-font-path/$HBOX_LABEL_MAKER_BOLD_FONT_PATH <string>
|
--options-hostname <string>
|
||||||
--thumbnail-enabled/$HBOX_THUMBNAIL_ENABLED <bool> (default: true)
|
--options-trust-proxy <bool> (default: false)
|
||||||
--thumbnail-width/$HBOX_THUMBNAIL_WIDTH <int> (default: 500)
|
--storage-conn-string <string> (default: file:///./)
|
||||||
--thumbnail-height/$HBOX_THUMBNAIL_HEIGHT <int> (default: 500)
|
--storage-prefix-path <string> (default: .data)
|
||||||
--help/-h display this help message
|
--thumbnail-enabled <bool> (default: true)
|
||||||
|
--thumbnail-height <int> (default: 500)
|
||||||
|
--thumbnail-width <int> (default: 500)
|
||||||
|
-v, --version display version
|
||||||
|
--web-host <string>
|
||||||
|
--web-idle-timeout <duration> (default: 30s)
|
||||||
|
--web-max-upload-size <int> (default: 10)
|
||||||
|
--web-port <string> (default: 7745)
|
||||||
|
--web-read-timeout <duration> (default: 10s)
|
||||||
|
--web-write-timeout <duration> (default: 10s)
|
||||||
```
|
```
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|||||||
@@ -30,19 +30,19 @@ the bucket name in the connection string.
|
|||||||
### S3-Compatible Storage
|
### S3-Compatible Storage
|
||||||
|
|
||||||
You can also use S3-compatible storage by setting the `HBOX_STORAGE_CONN_STRING` to
|
You can also use S3-compatible storage by setting the `HBOX_STORAGE_CONN_STRING` to
|
||||||
`s3://my-bucket?awssdk=v2&endpoint=http://my-s3-compatible-endpoint.tld&disableSSL=true&s3ForcePathStyle=true`.
|
`s3://my-bucket?awssdk=v2&endpoint=http://my-s3-compatible-endpoint.tld&disable_https=true&s3ForcePathStyle=true`.
|
||||||
|
|
||||||
This allows you to connect to S3-compatible services like MinIO, DigitalOcean Spaces, or any other service that supports
|
This allows you to connect to S3-compatible services like MinIO, DigitalOcean Spaces, or any other service that supports
|
||||||
the S3 API. Configure the `disableSSL`, `s3ForcePathStyle`, and `endpoint` parameters as needed for your specific
|
the S3 API. Configure the `disable_https`, `s3ForcePathStyle`, and `endpoint` parameters as needed for your specific
|
||||||
service.
|
service.
|
||||||
|
|
||||||
#### Tested S3-Compatible Storage
|
#### Tested S3-Compatible Storage
|
||||||
|
|
||||||
| Service | Working | Connection String |
|
| Service | Working | Connection String |
|
||||||
|---------------------|---------|--------------------------------------------------------------------------------------------------------------------------|
|
|---------------------|---------|--------------------------------------------------------------------------------------------------------------------------|
|
||||||
| MinIO | Yes | `s3://my-bucket?awssdk=v2&endpoint=http://minio:9000&disableSSL=true&s3ForcePathStyle=true` |
|
| MinIO | Yes | `s3://my-bucket?awssdk=v2&endpoint=http://minio:9000&disable_https=true&s3ForcePathStyle=true` |
|
||||||
| Cloudflare R2 | Yes | `s3://my-bucket?awssdk=v2&endpoint=https://<account-id>.r2.cloudflarestorage.com&disableSSL=false&s3ForcePathStyle=true` |
|
| Cloudflare R2 | Yes | `s3://my-bucket?awssdk=v2&endpoint=https://<account-id>.r2.cloudflarestorage.com&disable_https=false&s3ForcePathStyle=true` |
|
||||||
| Backblaze B2 | Yes | `s3://my-bucket?awssdk=v2&endpoint=https://s3.us-west-004.backblazeb2.com&disableSSL=false&s3ForcePathStyle=true` |
|
| Backblaze B2 | Yes | `s3://my-bucket?awssdk=v2&endpoint=https://s3.us-west-004.backblazeb2.com&disable_https=false&s3ForcePathStyle=true` |
|
||||||
|
|
||||||
::: info
|
::: info
|
||||||
If you know of any other S3-compatible storage that works with Homebox, please let us know or create a pull request to update the table.
|
If you know of any other S3-compatible storage that works with Homebox, please let us know or create a pull request to update the table.
|
||||||
@@ -57,7 +57,7 @@ Additionally, the parameters in the URL can be used to configure specific S3 set
|
|||||||
features.)
|
features.)
|
||||||
- `endpoint`: The custom endpoint for S3-compatible storage services.
|
- `endpoint`: The custom endpoint for S3-compatible storage services.
|
||||||
- `s3ForcePathStyle`: Whether to force path-style access (set to `true` or `false`).
|
- `s3ForcePathStyle`: Whether to force path-style access (set to `true` or `false`).
|
||||||
- `disableSSL`: Whether to disable SSL (set to `true` or `false`).
|
- `disable_https`: Whether to disable SSL (set to `true` or `false`).
|
||||||
- `sseType`: The server-side encryption type (e.g., `AES256` or `aws:kms` or `aws:kms:dsse`).
|
- `sseType`: The server-side encryption type (e.g., `AES256` or `aws:kms` or `aws:kms:dsse`).
|
||||||
- `kmskeyid`: The KMS key ID for server-side encryption.
|
- `kmskeyid`: The KMS key ID for server-side encryption.
|
||||||
- `fips`: Whether to use FIPS endpoints (set to `true` or `false`).
|
- `fips`: Whether to use FIPS endpoints (set to `true` or `false`).
|
||||||
|
|||||||
Reference in New Issue
Block a user