diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 54cade4..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster -ARG VARIANT=16-bullseye -FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT} - -RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 87730fb..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,40 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/typescript-node -{ - "name": "Node.js & TypeScript", - "build": { - "dockerfile": "Dockerfile", - // Update 'VARIANT' to pick a Node version: 18, 16, 14. - // Append -bullseye or -buster to pin to an OS version. - // Use -bullseye variants on local on arm64/Apple Silicon. - "args": { - "VARIANT": "18-bullseye" - } - }, - - // Configure tool-specific properties. - "customizations": { - // Configure properties specific to VS Code. - "vscode": { - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "dbaeumer.vscode-eslint" - ] - } - }, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [ - 7745, - 3000 - ], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "go install github.com/go-task/task/v3/cmd/task@latest && npm install -g pnpm && task setup", - - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "node", - "features": { - "golang": "1.21" - } -} diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 804ab22..0000000 --- a/.dockerignore +++ /dev/null @@ -1,25 +0,0 @@ -**/.classpath -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/*.*proj.user -**/*.dbmdl -**/*.jfm -**/bin -**/charts -**/docker-compose* -**/compose* -**/Dockerfile* -**/node_modules -**/npm-debug.log -**/obj -**/secrets.dev.yaml -**/values.dev.yaml -README.md -!Dockerfile.rootless diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 4626298..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: [hay-kot] diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 309cf28..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -name: "Bug Report" -description: "Submit a bug report for the current release" -labels: ["bug"] -body: - - type: checkboxes - id: checks - attributes: - label: First Check - description: Please confirm and check all the following options. - options: - - label: This is not a feature request - required: true - - label: I added a very descriptive title to this issue. - required: true - - label: I used the GitHub search to find a similar issue and didn't find it. - required: true - - label: I searched the documentation, with the integrated search. - required: true - - label: I already read the docs and didn't find an answer. - required: true - - type: input - id: homebox-version - attributes: - label: Homebox Version - validations: - required: true - - type: textarea - id: description - attributes: - label: What is the issue you are experiencing? - placeholder: A clear and concise description of what the bug is. - validations: - required: true - - type: textarea - id: reproduction - attributes: - description: If you do not provide a way to reproduce the issue, your issue will likely be closed. - label: How can the maintainer reproduce the issue? - placeholder: A clear step-by-step guide on how to reproduce the issue. - validations: - required: true - - type: dropdown - id: os - attributes: - label: Deployment - description: What Deployment system are you using? - multiple: true - options: - - Docker (Linux) - - Docker (Windows) - - Docker (Synology) - - Unraid - - Other - validations: - required: true - - type: textarea - id: os-details - attributes: - label: Deployment Details - description: You can add more details about your operating system here, in particular if you chose "Other". If you are experiencing issues with deployment, please provide your docker-compose or docker commands diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index 550daf4..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: "Feature Request" -description: "Submit a feature request for the current release" -labels: ["feature-request"] -body: - - type: textarea - id: problem-statement - attributes: - label: What is the problem you are trying to solve with this feature? - placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - - type: textarea - id: feature-solution - attributes: - label: What is the solution you are proposing? - placeholder: A clear and concise description of what you want to happen. - - type: textarea - id: feature-alternatives - attributes: - label: What alternatives have you considered? - placeholder: A clear and concise description of any alternative solutions or features you've considered. - - type: textarea - id: feature-details - attributes: - label: Additional context - placeholder: Add any other context or screenshots about the feature request here. - - type: checkboxes - id: checks - attributes: - label: Contributions - description: Please confirm the following - options: - - label: I have searched through existing issues and feature requests to see if my idea has already been proposed. - required: true - - label: If this feature is accepted, I would be willing to help implement and maintain this feature. - required: false - - label: If this feature is accepted, I'm willing to sponsor the development of this feature. - required: false diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index f4e8f04..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,72 +0,0 @@ - - -## What type of PR is this? - -_(REQUIRED)_ - - - -- bug -- cleanup -- documentation -- feature - -## What this PR does / why we need it: - -_(REQUIRED)_ - - - -## Which issue(s) this PR fixes: - -_(REQUIRED)_ - - - -## Special notes for your reviewer: - -_(fill-in or delete this section)_ - - - -## Testing - -_(fill-in or delete this section)_ - - - -## Release Notes - -_(REQUIRED)_ - - -```release-note -``` \ No newline at end of file diff --git a/.github/workflows/partial-backend.yaml b/.github/workflows/partial-backend.yaml deleted file mode 100644 index fe4dac2..0000000 --- a/.github/workflows/partial-backend.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Go Build/Test - -on: - workflow_call: - -jobs: - Go: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - - name: Install Task - uses: arduino/setup-task@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: golangci-lint - uses: golangci/golangci-lint-action@v4 - with: - # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: latest - - # Optional: working directory, useful for monorepos - working-directory: backend - args: --timeout=6m - - - name: Build API - run: task go:build - - - name: Test - run: task go:coverage diff --git a/.github/workflows/partial-frontend.yaml b/.github/workflows/partial-frontend.yaml deleted file mode 100644 index f849406..0000000 --- a/.github/workflows/partial-frontend.yaml +++ /dev/null @@ -1,64 +0,0 @@ -name: Frontend / E2E - -on: - workflow_call: - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: pnpm/action-setup@v3.0.0 - with: - version: 6.0.2 - - - name: Install dependencies - run: pnpm install --shamefully-hoist - working-directory: frontend - - - name: Run Lint - run: pnpm run lint:ci - working-directory: frontend - - - name: Run Typecheck - run: pnpm run typecheck - working-directory: frontend - - integration-tests: - name: Integration Tests - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Task - uses: arduino/setup-task@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - - uses: actions/setup-node@v4 - with: - node-version: 18 - - - uses: pnpm/action-setup@v3.0.0 - with: - version: 6.0.2 - - - name: Install dependencies - run: pnpm install - working-directory: frontend - - - name: Run Integration Tests - run: task test:ci diff --git a/.github/workflows/partial-publish.yaml b/.github/workflows/partial-publish.yaml deleted file mode 100644 index 542171d..0000000 --- a/.github/workflows/partial-publish.yaml +++ /dev/null @@ -1,89 +0,0 @@ -name: Frontend / E2E - -on: - workflow_call: - inputs: - tag: - required: true - type: string - release: - required: false - type: boolean - default: false - - secrets: - GH_TOKEN: - required: true - -jobs: - publish: - name: "Publish Homebox" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.20" - - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v3 - with: - image: tonistiigi/binfmt:latest - platforms: all - - - name: install buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - install: true - - - name: login to container registry - run: docker login ghcr.io --username hay-kot --password $CR_PAT - env: - CR_PAT: ${{ secrets.GH_TOKEN }} - - - name: build nightly image - if: ${{ inputs.release == false }} - run: | - docker build --push --no-cache \ - --tag=ghcr.io/hay-kot/homebox:${{ inputs.tag }} \ - --build-arg=COMMIT=$(git rev-parse HEAD) \ - --build-arg=BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ - --platform=linux/amd64,linux/arm64,linux/arm/v7 . - - - name: build nightly-rootless image - if: ${{ inputs.release == false }} - run: | - docker build --push --no-cache \ - --tag=ghcr.io/hay-kot/homebox:${{ inputs.tag }}-rootless \ - --build-arg=COMMIT=$(git rev-parse HEAD) \ - --build-arg=BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ - --file Dockerfile.rootless \ - --platform=linux/amd64,linux/arm64,linux/arm/v7 . - - - name: build release tagged the image - if: ${{ inputs.release == true }} - run: | - docker build --push --no-cache \ - --tag ghcr.io/hay-kot/homebox:nightly \ - --tag ghcr.io/hay-kot/homebox:latest \ - --tag ghcr.io/hay-kot/homebox:${{ inputs.tag }} \ - --build-arg VERSION=${{ inputs.tag }} \ - --build-arg COMMIT=$(git rev-parse HEAD) \ - --build-arg BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ - --platform linux/amd64,linux/arm64,linux/arm/v7 . - - - name: build release tagged the rootless image - if: ${{ inputs.release == true }} - run: | - docker build --push --no-cache \ - --tag ghcr.io/hay-kot/homebox:nightly-rootless \ - --tag ghcr.io/hay-kot/homebox:latest-rootless \ - --tag ghcr.io/hay-kot/homebox:${{ inputs.tag }}-rootless \ - --build-arg VERSION=${{ inputs.tag }} \ - --build-arg COMMIT=$(git rev-parse HEAD) \ - --build-arg BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ - --platform linux/amd64,linux/arm64,linux/arm/v7 \ - --file Dockerfile.rootless . diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index e91e8ec..0000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: Publish Dockers - -on: - push: - branches: - - main - -env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} - -jobs: - deploy: - name: "Deploy Nightly to Fly.io" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: superfly/flyctl-actions/setup-flyctl@master - - run: flyctl deploy --remote-only - - publish-nightly: - name: "Publish Nightly" - if: github.event_name != 'release' - uses: hay-kot/homebox/.github/workflows/partial-publish.yaml@main - with: - tag: nightly - secrets: - GH_TOKEN: ${{ secrets.CR_PAT }} - - diff --git a/.github/workflows/pull-requests.yaml b/.github/workflows/pull-requests.yaml deleted file mode 100644 index f39539b..0000000 --- a/.github/workflows/pull-requests.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: Pull Request CI - -on: - pull_request: - branches: - - main - -jobs: - backend-tests: - name: "Backend Server Tests" - uses: ./.github/workflows/partial-backend.yaml - - frontend-tests: - name: "Frontend and End-to-End Tests" - uses: ./.github/workflows/partial-frontend.yaml \ No newline at end of file diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml deleted file mode 100644 index 8ac7c54..0000000 --- a/.github/workflows/tag.yaml +++ /dev/null @@ -1,77 +0,0 @@ -name: Publish Release - -on: - push: - tags: - - v* - -env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} - -jobs: - backend-tests: - name: "Backend Server Tests" - uses: hay-kot/homebox/.github/workflows/partial-backend.yaml@main - - frontend-tests: - name: "Frontend and End-to-End Tests" - uses: hay-kot/homebox/.github/workflows/partial-frontend.yaml@main - - goreleaser: - name: goreleaser - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v5 - - - uses: pnpm/action-setup@v2 - with: - version: 7.30.1 - - - name: Build Frontend and Copy to Backend - working-directory: frontend - run: | - pnpm install --shamefully-hoist - pnpm run build - cp -r ./.output/public ../backend/app/api/static/ - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v5 - with: - workdir: "backend" - distribution: goreleaser - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - publish-tag: - name: "Publish Tag" - uses: hay-kot/homebox/.github/workflows/partial-publish.yaml@main - with: - release: true - tag: ${{ github.ref_name }} - secrets: - GH_TOKEN: ${{ secrets.CR_PAT }} - - deploy-docs: - name: Deploy docs - needs: - - publish-tag - - goreleaser - runs-on: ubuntu-latest - steps: - - name: Checkout main - uses: actions/checkout@v4 - - - name: Deploy docs - uses: mhausenblas/mkdocs-deploy-gh-pages@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CONFIG_FILE: docs/mkdocs.yml - EXTRA_PACKAGES: build-base \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d247138..0000000 --- a/.gitignore +++ /dev/null @@ -1,57 +0,0 @@ -# Project Specific -backend/.data/* -config.yml -homebox.db -.idea -.DS_Store -test-mailer.json -node_modules - -*.venv -# If you prefer the allow list template instead of the deny list, see community template: -# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore -# -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -# Go workspace file -go.work -.task/ -backend/.env -build/* - -# Output Directory for Nuxt/Frontend during build step -backend/app/api/public/* -!backend/app/api/public/.gitkeep - -node_modules -*.log* -.nuxt -.nitro -.cache -.output -.env -dist - -.pnpm-store -backend/app/api/app -backend/app/api/__debug_bin -dist/ - -# Nuxt Publish Dir -backend/app/api/static/public/* -!backend/app/api/static/public/.gitkeep -backend/api \ No newline at end of file diff --git a/backend/app/api/static/public/.gitkeep b/.nojekyll similarity index 100% rename from backend/app/api/static/public/.gitkeep rename to .nojekyll diff --git a/.scaffold/model/scaffold.yaml b/.scaffold/model/scaffold.yaml deleted file mode 100644 index 028d2fa..0000000 --- a/.scaffold/model/scaffold.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# yaml-language-server: $schema=https://hay-kot.github.io/scaffold/schema.json -messages: - pre: | - # Ent Model Generation - - With Boilerplate! - post: | - Complete! - -questions: - - name: "model" - prompt: - message: "What is the name of the model? (PascalCase)" - required: true - - - name: "by_group" - prompt: - confirm: "Include a Group Edge? (group_id -> id)" - required: true - -rewrites: - - from: 'templates/model.go' - to: 'backend/internal/data/ent/schema/{{ lower .Scaffold.model }}.go' - -inject: - - name: "Insert Groups Edge" - path: 'backend/internal/data/ent/schema/group.go' - at: // $scaffold_edge - template: | - {{- if .Scaffold.by_group -}} - owned("{{ lower .Scaffold.model }}s", {{ .Scaffold.model }}.Type), - {{- end -}} diff --git a/.scaffold/model/templates/model.go b/.scaffold/model/templates/model.go deleted file mode 100644 index b73ac16..0000000 --- a/.scaffold/model/templates/model.go +++ /dev/null @@ -1,40 +0,0 @@ -package schema - -import ( - "entgo.io/ent" - - "github.com/hay-kot/homebox/backend/internal/data/ent/schema/mixins" -) - -type {{ .Scaffold.model }} struct { - ent.Schema -} - -func ({{ .Scaffold.model }}) Mixin() []ent.Mixin { - return []ent.Mixin{ - mixins.BaseMixin{}, - {{- if .Scaffold.by_group }} - GroupMixin{ref: "{{ snakecase .Scaffold.model }}s"}, - {{- end }} - } -} - -// Fields of the {{ .Scaffold.model }}. -func ({{ .Scaffold.model }}) Fields() []ent.Field { - return []ent.Field{ - // field.String("name"). - } -} - -// Edges of the {{ .Scaffold.model }}. -func ({{ .Scaffold.model }}) Edges() []ent.Edge { - return []ent.Edge{ - // edge.From("group", Group.Type). - } -} - -func ({{ .Scaffold.model }}) Indexes() []ent.Index { - return []ent.Index{ - // index.Fields("token"), - } -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index d375395..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "compounds": [ - { - "name": "Full Stack", - "configurations": ["Launch Backend", "Launch Frontend"], - "stopAll": true - } - ], - "configurations": [ - { - "name": "Launch Backend", - "type": "go", - "request": "launch", - "mode": "debug", - "program": "${workspaceRoot}/backend/app/api/", - "args": [], - "env": { - "HBOX_DEMO": "true", - "HBOX_LOG_LEVEL": "debug", - "HBOX_DEBUG_ENABLED": "true", - "HBOX_STORAGE_DATA": "${workspaceRoot}/backend/.data", - "HBOX_STORAGE_SQLITE_URL": "${workspaceRoot}/backend/.data/homebox.db?_fk=1" - }, - }, - { - "name": "Launch Frontend", - "type": "node", - "request": "launch", - "runtimeExecutable": "pnpm", - "runtimeArgs": [ - "run", - "dev" - ], - "cwd": "${workspaceFolder}/frontend", - "serverReadyAction": { - "action": "debugWithChrome", - "pattern": "Local: http://localhost:([0-9]+)", - "uriFormat": "http://localhost:%s", - "webRoot": "${workspaceFolder}/frontend" - } - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 09c7a0e..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "yaml.schemas": { - "https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml" - }, - "explorer.fileNesting.enabled": true, - "explorer.fileNesting.patterns": { - "package.json": "package-lock.json, yarn.lock, .eslintrc.js, tsconfig.json, .prettierrc, .editorconfig, pnpm-lock.yaml, postcss.config.js, tailwind.config.js", - "docker-compose.yml": "Dockerfile, .dockerignore, docker-compose.dev.yml, docker-compose.yml", - "README.md": "LICENSE, SECURITY.md" - }, - "cSpell.words": [ - "debughandlers", - "Homebox" - ], - // use ESLint to format code on save - "editor.formatOnSave": false, - "editor.defaultFormatter": "dbaeumer.vscode-eslint", - "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit" - }, - "[typescript]": { - "editor.defaultFormatter": "dbaeumer.vscode-eslint" - }, - "eslint.format.enable": true, - "css.validate": false, - "tailwindCSS.includeLanguages": { - "vue": "html", - "vue-html": "html" - }, - "editor.quickSuggestions": { - "strings": true - }, - "tailwindCSS.experimental.configFile": "./frontend/tailwind.config.js" -} diff --git a/404.html b/404.html new file mode 100644 index 0000000..7160a14 --- /dev/null +++ b/404.html @@ -0,0 +1,418 @@ + + + + + + + + + + + + + + + + + + Homebox + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ +

404 - Not found

+ +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 52b2a0f..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,57 +0,0 @@ -# Contributing - -## We Develop with GitHub - -We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. - -## Branch Flow - -We use the `main` branch as the development branch. All PRs should be made to the `main` branch from a feature branch. To create a pull request, you can use the following steps: - -1. Fork the repository and create a new branch from `main`. -2. If you've added code that should be tested, add tests. -3. If you've changed APIs, update the documentation. -4. Ensure that the test suite and linters pass -5. Issue your pull request - -## How To Get Started - -### Prerequisites - -There is a devcontainer available for this project. If you are using VSCode, you can use the devcontainer to get started. If you are not using VSCode, you need to ensure that you have the following tools installed: - -- [Go 1.19+](https://golang.org/doc/install) -- [Swaggo](https://github.com/swaggo/swag) -- [Node.js 16+](https://nodejs.org/en/download/) -- [pnpm](https://pnpm.io/installation) -- [Taskfile](https://taskfile.dev/#/installation) (Optional but recommended) -- For code generation, you'll need to have `python3` available on your path. In most cases, this is already installed and available. - -If you're using `taskfile` you can run `task --list-all` for a list of all commands and their descriptions. - -### Setup - -If you're using the taskfile, you can use the `task setup` command to run the required setup commands. Otherwise, you can review the commands required in the `Taskfile.yml` file. - -Note that when installing dependencies with pnpm you must use the `--shamefully-hoist` flag. If you don't use this flag, you will get an error when running the frontend server. - -### API Development Notes - -start command `task go:run` - -1. API Server does not auto reload. You'll need to restart the server after making changes. -2. Unit tests should be written in Go, however, end-to-end or user story tests should be written in TypeScript using the client library in the frontend directory. - -### Frontend Development Notes - -start command `task: ui:dev` - -1. The frontend is a Vue 3 app with Nuxt.js that uses Tailwind and DaisyUI for styling. -2. We're using Vitest for our automated testing. You can run these with `task ui:watch`. -3. Tests require the API server to be running, and in some cases the first run will fail due to a race condition. If this happens, just run the tests again and they should pass. - -## Publishing Release - -Create a new tag in GitHub with the version number vX.X.X. This will trigger a new release to be created. - -Test -> Goreleaser -> Publish Release -> Trigger Docker Builds -> Deploy Docs + Fly.io Demo \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 11d5c74..0000000 --- a/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ - -# Build Nuxt -FROM r.batts.cloud/nodejs:18 as frontend-builder -WORKDIR /app -RUN npm install -g pnpm@latest-9 -COPY frontend/package.json frontend/pnpm-lock.yaml ./ -RUN pnpm install --frozen-lockfile --shamefully-hoist -COPY frontend . -RUN pnpm build - -# Build API -FROM r.batts.cloud/golang:1.24 AS builder -ARG BUILD_TIME -ARG COMMIT -ARG VERSION -RUN apt update && \ - apt install -y git build-essential gcc g++ - -WORKDIR /go/src/app -COPY ./backend . -RUN go get -d -v ./... -RUN rm -rf ./app/api/public -COPY --from=frontend-builder /app/.output/public ./app/api/static/public -RUN CGO_ENABLED=0 GOOS=linux go build \ - -ldflags "-s -w -X main.commit=$COMMIT -X main.buildTime=$BUILD_TIME -X main.version=$VERSION" \ - -o /go/bin/api \ - -v ./app/api/*.go - -# Production Stage -FROM r.batts.cloud/debian:trixie - -ENV HBOX_MODE=production -ENV HBOX_STORAGE_DATA=/data/ -ENV HBOX_STORAGE_SQLITE_URL=/data/homebox.db?_pragma=busy_timeout=2000&_pragma=journal_mode=WAL&_fk=1 - -RUN mkdir /app -COPY --from=builder /go/bin/api /app - -RUN chmod +x /app/api - -LABEL Name=homebox Version=0.0.1 -LABEL org.opencontainers.image.source="https://github.com/hay-kot/homebox" -EXPOSE 7745 -WORKDIR /app -VOLUME [ "/data" ] - -ENTRYPOINT [ "/app/api" ] -CMD [ "/data/config.yml" ] diff --git a/Dockerfile.rootless b/Dockerfile.rootless deleted file mode 100644 index e1c98aa..0000000 --- a/Dockerfile.rootless +++ /dev/null @@ -1,53 +0,0 @@ - -# Build Nuxt -FROM node:17-alpine as frontend-builder -WORKDIR /app -RUN npm install -g pnpm -COPY frontend/package.json frontend/pnpm-lock.yaml ./ -RUN pnpm install --frozen-lockfile --shamefully-hoist -COPY frontend . -RUN pnpm build - -# Build API -FROM golang:alpine AS builder -ARG BUILD_TIME -ARG COMMIT -ARG VERSION -RUN apk update && \ - apk upgrade && \ - apk add --update git build-base gcc g++ - -WORKDIR /go/src/app -COPY ./backend . -RUN go get -d -v ./... -RUN rm -rf ./app/api/public -COPY --from=frontend-builder /app/.output/public ./app/api/static/public -RUN CGO_ENABLED=0 GOOS=linux go build \ - -ldflags "-s -w -X main.commit=$COMMIT -X main.buildTime=$BUILD_TIME -X main.version=$VERSION" \ - -o /go/bin/api \ - -v ./app/api/*.go && \ - chmod +x /go/bin/api && \ - # create a directory so that we can copy it in the next stage - mkdir /data - -# Production Stage -FROM gcr.io/distroless/static - -ENV HBOX_MODE=production -ENV HBOX_STORAGE_DATA=/data/ -ENV HBOX_STORAGE_SQLITE_URL=/data/homebox.db?_fk=1 - -# Copy the binary and the (empty) /data dir and -# change the ownership to the low-privileged user -COPY --from=builder --chown=nonroot /go/bin/api /app -COPY --from=builder --chown=nonroot /data /data - -LABEL Name=homebox Version=0.0.1 -LABEL org.opencontainers.image.source="https://github.com/hay-kot/homebox" -EXPOSE 7745 -VOLUME [ "/data" ] - -# Drop root and run as low-privileged user -USER nonroot -ENTRYPOINT [ "/app" ] -CMD [ "/data/config.yml" ] diff --git a/LICENSE b/LICENSE deleted file mode 100644 index bae94e1..0000000 --- a/LICENSE +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 148322b..0000000 --- a/README.md +++ /dev/null @@ -1,43 +0,0 @@ -
- -
- -

HomeBox

-

- Docs - | - Demo - | - Discord -

- -## Quick Start - -[Configuration & Docker Compose](https://hay-kot.github.io/homebox/quick-start) - -```bash -# If using the rootless image, ensure data -# folder has correct permissions -mkdir -p /path/to/data/folder -chown 65532:65532 -R /path/to/data/folder -docker run -d \ - --name homebox \ - --restart unless-stopped \ - --publish 3100:7745 \ - --env TZ=Europe/Bucharest \ - --volume /path/to/data/folder/:/data \ - ghcr.io/hay-kot/homebox:latest -# ghcr.io/hay-kot/homebox:latest-rootless -``` - - -## Contributing - -Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. - -If you are not a coder, you can still contribute financially. Financial contributions help me prioritize working on this project over others and helps me know that there is a real demand for project development. - -Buy Me A Coffee -## Credits - -- Logo by [@lakotelman](https://github.com/lakotelman) diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 56b13b5..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,9 +0,0 @@ -# Security Policy - -## Supported Versions - -Since this software is still considered beta/WIP support is always only given for the latest version. - -## Reporting a Vulnerability - -Please open a normal public issue if you have any security related concerns. \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml deleted file mode 100644 index 4d9c1aa..0000000 --- a/Taskfile.yml +++ /dev/null @@ -1,157 +0,0 @@ -version: "3" - -env: - HBOX_LOG_LEVEL: debug - HBOX_STORAGE_SQLITE_URL: .data/homebox.db?_pragma=busy_timeout=1000&_pragma=journal_mode=WAL&_fk=1 - HBOX_OPTIONS_ALLOW_REGISTRATION: true - UNSAFE_DISABLE_PASSWORD_PROJECTION: "yes_i_am_sure" -tasks: - setup: - desc: Install development dependencies - cmds: - - go install github.com/swaggo/swag/cmd/swag@latest - - cd backend && go mod tidy - - cd frontend && pnpm install --shamefully-hoist - - swag: - desc: Generate swagger docs - dir: backend/app/api/static/ - vars: - API: "../" - INTERNAL: "../../../internal" - PKGS: "../../../pkgs" - cmds: - - swag fmt --dir={{ .API }} - - swag init --dir={{ .API }},{{ .INTERNAL }}/core/services,{{ .INTERNAL }}/data/repo --parseDependency - sources: - - "./backend/app/api/**/*" - - "./backend/internal/data/**" - - "./backend/internal/core/services/**/*" - - "./backend/app/tools/typegen/main.go" - - typescript-types: - desc: Generates typescript types from swagger definition - cmds: - - | - npx swagger-typescript-api \ - --no-client \ - --modular \ - --path ./backend/app/api/static/docs/swagger.json \ - --output ./frontend/lib/api/types - - go run ./backend/app/tools/typegen/main.go ./frontend/lib/api/types/data-contracts.ts - sources: - - ./backend/app/tools/typegen/main.go - - ./backend/app/api/static/docs/swagger.json - - generate: - deps: - - db:generate - cmds: - - task: swag - - task: typescript-types - - cp ./backend/app/api/static/docs/swagger.json docs/docs/api/openapi-2.0.json - - go:run: - desc: Starts the backend api server (depends on generate task) - dir: backend - deps: - - generate - cmds: - - go run ./app/api/ {{ .CLI_ARGS }} - silent: false - - go:test: - desc: Runs all go tests using gotestsum - supports passing gotestsum args - dir: backend - cmds: - - gotestsum {{ .CLI_ARGS }} ./... - - go:coverage: - desc: Runs all go tests with -race flag and generates a coverage report - dir: backend - cmds: - - go test -race -coverprofile=coverage.out -covermode=atomic ./app/... ./internal/... ./pkgs/... -v -cover - silent: true - - go:tidy: - desc: Runs go mod tidy on the backend - dir: backend - cmds: - - go mod tidy - - go:lint: - desc: Runs golangci-lint - dir: backend - cmds: - - golangci-lint run ./... - - go:all: - desc: Runs all go test and lint related tasks - cmds: - - task: go:tidy - - task: go:lint - - task: go:test - - go:build: - desc: Builds the backend binary - dir: backend - cmds: - - go build -o ../build/backend ./app/api - - db:generate: - desc: Run Entgo.io Code Generation - dir: backend/internal/ - cmds: - - | - go generate ./... - sources: - - "./backend/internal/data/ent/schema/**/*" - - db:migration: - desc: Runs the database diff engine to generate a SQL migration files - deps: - - db:generate - cmds: - - cd backend && go run app/tools/migrations/main.go {{ .CLI_ARGS }} - - ui:watch: - desc: Starts the vitest test runner in watch mode - dir: frontend - cmds: - - pnpm run test:watch - - ui:dev: - desc: Run frontend development server - dir: frontend - cmds: - - pnpm dev - - ui:fix: - desc: Runs prettier and eslint on the frontend - dir: frontend - cmds: - - pnpm run lint:fix - - ui:check: - desc: Runs type checking - dir: frontend - cmds: - - pnpm run typecheck - - test:ci: - desc: Runs end-to-end test on a live server (only for use in CI) - cmds: - - cd backend && go build ./app/api - - backend/api & - - sleep 5 - - cd frontend && pnpm run test:ci - silent: true - - pr: - desc: Runs all tasks required for a PR - cmds: - - task: generate - - task: go:all - - task: ui:check - - task: ui:fix - - task: test:ci diff --git a/docs/docs/api/openapi-2.0.json b/api/openapi-2.0.json similarity index 95% rename from docs/docs/api/openapi-2.0.json rename to api/openapi-2.0.json index b10c93a..837c889 100644 --- a/docs/docs/api/openapi-2.0.json +++ b/api/openapi-2.0.json @@ -143,25 +143,6 @@ } } }, - "/v1/currency": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "Base" - ], - "summary": "Currency", - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/currencies.Currency" - } - } - } - } - }, "/v1/groups": { "get": { "security": [ @@ -422,16 +403,6 @@ "description": "location Ids", "name": "locations", "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "parent Ids", - "name": "parentIds", - "in": "query" } ], "responses": { @@ -1010,42 +981,6 @@ } } }, - "/v1/items/{id}/path": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "Items" - ], - "summary": "Get the full path of an item", - "parameters": [ - { - "type": "string", - "description": "Item ID", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/repo.ItemPath" - } - } - } - } - } - }, "/v1/labels": { "get": { "security": [ @@ -1632,7 +1567,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/v1.APISummary" + "$ref": "#/definitions/v1.ApiSummary" } } } @@ -1703,12 +1638,6 @@ "schema": { "$ref": "#/definitions/v1.LoginForm" } - }, - { - "type": "string", - "description": "auth provider", - "name": "provider", - "in": "query" } ], "responses": { @@ -1887,23 +1816,6 @@ } }, "definitions": { - "currencies.Currency": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "local": { - "type": "string" - }, - "name": { - "type": "string" - }, - "symbol": { - "type": "string" - } - } - }, "repo.DocumentOut": { "type": "object", "properties": { @@ -2079,6 +1991,12 @@ "$ref": "#/definitions/repo.ItemAttachment" } }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/repo.ItemSummary" + } + }, "createdAt": { "type": "string" }, @@ -2112,13 +2030,9 @@ }, "location": { "description": "Edges", - "allOf": [ - { - "$ref": "#/definitions/repo.LocationSummary" - } - ], "x-nullable": true, - "x-omitempty": true + "x-omitempty": true, + "$ref": "#/definitions/repo.LocationSummary" }, "manufacturer": { "type": "string" @@ -2134,13 +2048,9 @@ "type": "string" }, "parent": { - "allOf": [ - { - "$ref": "#/definitions/repo.ItemSummary" - } - ], "x-nullable": true, - "x-omitempty": true + "x-omitempty": true, + "$ref": "#/definitions/repo.ItemSummary" }, "purchaseFrom": { "type": "string" @@ -2197,20 +2107,6 @@ } } }, - "repo.ItemPath": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/repo.ItemType" - } - } - }, "repo.ItemSummary": { "type": "object", "properties": { @@ -2240,13 +2136,9 @@ }, "location": { "description": "Edges", - "allOf": [ - { - "$ref": "#/definitions/repo.LocationSummary" - } - ], "x-nullable": true, - "x-omitempty": true + "x-omitempty": true, + "$ref": "#/definitions/repo.LocationSummary" }, "name": { "type": "string" @@ -2263,17 +2155,6 @@ } } }, - "repo.ItemType": { - "type": "string", - "enum": [ - "location", - "item" - ], - "x-enum-varnames": [ - "ItemTypeLocation", - "ItemTypeItem" - ] - }, "repo.ItemUpdate": { "type": "object", "properties": { @@ -2366,6 +2247,7 @@ "type": "string" }, "warrantyExpires": { + "description": "Sold", "type": "string" } } @@ -2539,6 +2421,7 @@ "type": "object", "properties": { "completedDate": { + "description": "Sold", "type": "string" }, "cost": { @@ -2555,6 +2438,7 @@ "type": "string" }, "scheduledDate": { + "description": "Sold", "type": "string" } } @@ -2566,6 +2450,7 @@ ], "properties": { "completedDate": { + "description": "Sold", "type": "string" }, "cost": { @@ -2579,6 +2464,7 @@ "type": "string" }, "scheduledDate": { + "description": "Sold", "type": "string" } } @@ -2587,6 +2473,7 @@ "type": "object", "properties": { "completedDate": { + "description": "Sold", "type": "string" }, "cost": { @@ -2600,6 +2487,7 @@ "type": "string" }, "scheduledDate": { + "description": "Sold", "type": "string" } } @@ -2835,7 +2723,15 @@ } } }, - "v1.APISummary": { + "v1.ActionAmountResult": { + "type": "object", + "properties": { + "completed": { + "type": "integer" + } + } + }, + "v1.ApiSummary": { "type": "object", "properties": { "allowRegistration": { @@ -2864,14 +2760,6 @@ } } }, - "v1.ActionAmountResult": { - "type": "object", - "properties": { - "completed": { - "type": "integer" - } - } - }, "v1.Build": { "type": "object", "properties": { diff --git a/assets/images/favicon.png b/assets/images/favicon.png new file mode 100644 index 0000000..1cf13b9 Binary files /dev/null and b/assets/images/favicon.png differ diff --git a/docs/docs/assets/img/favicon.svg b/assets/img/favicon.svg similarity index 100% rename from docs/docs/assets/img/favicon.svg rename to assets/img/favicon.svg diff --git a/docs/docs/assets/img/lilbox.svg b/assets/img/lilbox.svg similarity index 100% rename from docs/docs/assets/img/lilbox.svg rename to assets/img/lilbox.svg diff --git a/assets/javascripts/bundle.51d95adb.min.js b/assets/javascripts/bundle.51d95adb.min.js new file mode 100644 index 0000000..b20ec68 --- /dev/null +++ b/assets/javascripts/bundle.51d95adb.min.js @@ -0,0 +1,29 @@ +"use strict";(()=>{var Hi=Object.create;var xr=Object.defineProperty;var Pi=Object.getOwnPropertyDescriptor;var $i=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,Ii=Object.getPrototypeOf,Er=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable;var on=(e,t,r)=>t in e?xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P=(e,t)=>{for(var r in t||(t={}))Er.call(t,r)&&on(e,r,t[r]);if(kt)for(var r of kt(t))an.call(t,r)&&on(e,r,t[r]);return e};var sn=(e,t)=>{var r={};for(var n in e)Er.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kt)for(var n of kt(e))t.indexOf(n)<0&&an.call(e,n)&&(r[n]=e[n]);return r};var Ht=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $i(t))!Er.call(e,o)&&o!==r&&xr(e,o,{get:()=>t[o],enumerable:!(n=Pi(t,o))||n.enumerable});return e};var yt=(e,t,r)=>(r=e!=null?Hi(Ii(e)):{},Fi(t||!e||!e.__esModule?xr(r,"default",{value:e,enumerable:!0}):r,e));var fn=Ht((wr,cn)=>{(function(e,t){typeof wr=="object"&&typeof cn!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(wr,function(){"use strict";function e(r){var n=!0,o=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(T){return!!(T&&T!==document&&T.nodeName!=="HTML"&&T.nodeName!=="BODY"&&"classList"in T&&"contains"in T.classList)}function f(T){var Ke=T.type,We=T.tagName;return!!(We==="INPUT"&&a[Ke]&&!T.readOnly||We==="TEXTAREA"&&!T.readOnly||T.isContentEditable)}function c(T){T.classList.contains("focus-visible")||(T.classList.add("focus-visible"),T.setAttribute("data-focus-visible-added",""))}function u(T){T.hasAttribute("data-focus-visible-added")&&(T.classList.remove("focus-visible"),T.removeAttribute("data-focus-visible-added"))}function p(T){T.metaKey||T.altKey||T.ctrlKey||(s(r.activeElement)&&c(r.activeElement),n=!0)}function m(T){n=!1}function d(T){s(T.target)&&(n||f(T.target))&&c(T.target)}function h(T){s(T.target)&&(T.target.classList.contains("focus-visible")||T.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(i),i=window.setTimeout(function(){o=!1},100),u(T.target))}function v(T){document.visibilityState==="hidden"&&(o&&(n=!0),B())}function B(){document.addEventListener("mousemove",z),document.addEventListener("mousedown",z),document.addEventListener("mouseup",z),document.addEventListener("pointermove",z),document.addEventListener("pointerdown",z),document.addEventListener("pointerup",z),document.addEventListener("touchmove",z),document.addEventListener("touchstart",z),document.addEventListener("touchend",z)}function re(){document.removeEventListener("mousemove",z),document.removeEventListener("mousedown",z),document.removeEventListener("mouseup",z),document.removeEventListener("pointermove",z),document.removeEventListener("pointerdown",z),document.removeEventListener("pointerup",z),document.removeEventListener("touchmove",z),document.removeEventListener("touchstart",z),document.removeEventListener("touchend",z)}function z(T){T.target.nodeName&&T.target.nodeName.toLowerCase()==="html"||(n=!1,re())}document.addEventListener("keydown",p,!0),document.addEventListener("mousedown",m,!0),document.addEventListener("pointerdown",m,!0),document.addEventListener("touchstart",m,!0),document.addEventListener("visibilitychange",v,!0),B(),r.addEventListener("focus",d,!0),r.addEventListener("blur",h,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var un=Ht(Sr=>{(function(e){var t=function(){try{return!!Symbol.iterator}catch(c){return!1}},r=t(),n=function(c){var u={next:function(){var p=c.shift();return{done:p===void 0,value:p}}};return r&&(u[Symbol.iterator]=function(){return u}),u},o=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},i=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},a=function(){var c=function(p){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var m=typeof p;if(m!=="undefined")if(m==="string")p!==""&&this._fromString(p);else if(p instanceof c){var d=this;p.forEach(function(re,z){d.append(z,re)})}else if(p!==null&&m==="object")if(Object.prototype.toString.call(p)==="[object Array]")for(var h=0;hd[0]?1:0}),c._entries&&(c._entries={});for(var p=0;p1?i(d[1]):"")}})})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Sr);(function(e){var t=function(){try{var o=new e.URL("b","http://a");return o.pathname="c d",o.href==="http://a/c%20d"&&o.searchParams}catch(i){return!1}},r=function(){var o=e.URL,i=function(f,c){typeof f!="string"&&(f=String(f)),c&&typeof c!="string"&&(c=String(c));var u=document,p;if(c&&(e.location===void 0||c!==e.location.href)){c=c.toLowerCase(),u=document.implementation.createHTMLDocument(""),p=u.createElement("base"),p.href=c,u.head.appendChild(p);try{if(p.href.indexOf(c)!==0)throw new Error(p.href)}catch(T){throw new Error("URL unable to set base "+c+" due to "+T)}}var m=u.createElement("a");m.href=f,p&&(u.body.appendChild(m),m.href=m.href);var d=u.createElement("input");if(d.type="url",d.value=f,m.protocol===":"||!/:/.test(m.href)||!d.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:m});var h=new e.URLSearchParams(this.search),v=!0,B=!0,re=this;["append","delete","set"].forEach(function(T){var Ke=h[T];h[T]=function(){Ke.apply(h,arguments),v&&(B=!1,re.search=h.toString(),B=!0)}}),Object.defineProperty(this,"searchParams",{value:h,enumerable:!0});var z=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==z&&(z=this.search,B&&(v=!1,this.searchParams._fromString(this.search),v=!0))}})},a=i.prototype,s=function(f){Object.defineProperty(a,f,{get:function(){return this._anchorElement[f]},set:function(c){this._anchorElement[f]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(f){s(f)}),Object.defineProperty(a,"search",{get:function(){return this._anchorElement.search},set:function(f){this._anchorElement.search=f,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(a,{toString:{get:function(){var f=this;return function(){return f.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(f){this._anchorElement.href=f,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(f){this._anchorElement.pathname=f},enumerable:!0},origin:{get:function(){var f={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=f&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(f){},enumerable:!0},username:{get:function(){return""},set:function(f){},enumerable:!0}}),i.createObjectURL=function(f){return o.createObjectURL.apply(o,arguments)},i.revokeObjectURL=function(f){return o.revokeObjectURL.apply(o,arguments)},e.URL=i};if(t()||r(),e.location!==void 0&&!("origin"in e.location)){var n=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:n,enumerable:!0})}catch(o){setInterval(function(){e.location.origin=n()},100)}}})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Sr)});var Qr=Ht((Lt,Kr)=>{/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */(function(t,r){typeof Lt=="object"&&typeof Kr=="object"?Kr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Lt=="object"?Lt.ClipboardJS=r():t.ClipboardJS=r()})(Lt,function(){return function(){var e={686:function(n,o,i){"use strict";i.d(o,{default:function(){return ki}});var a=i(279),s=i.n(a),f=i(370),c=i.n(f),u=i(817),p=i.n(u);function m(j){try{return document.execCommand(j)}catch(O){return!1}}var d=function(O){var w=p()(O);return m("cut"),w},h=d;function v(j){var O=document.documentElement.getAttribute("dir")==="rtl",w=document.createElement("textarea");w.style.fontSize="12pt",w.style.border="0",w.style.padding="0",w.style.margin="0",w.style.position="absolute",w.style[O?"right":"left"]="-9999px";var k=window.pageYOffset||document.documentElement.scrollTop;return w.style.top="".concat(k,"px"),w.setAttribute("readonly",""),w.value=j,w}var B=function(O,w){var k=v(O);w.container.appendChild(k);var F=p()(k);return m("copy"),k.remove(),F},re=function(O){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},k="";return typeof O=="string"?k=B(O,w):O instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(O==null?void 0:O.type)?k=B(O.value,w):(k=p()(O),m("copy")),k},z=re;function T(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?T=function(w){return typeof w}:T=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},T(j)}var Ke=function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},w=O.action,k=w===void 0?"copy":w,F=O.container,q=O.target,Le=O.text;if(k!=="copy"&&k!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(q!==void 0)if(q&&T(q)==="object"&&q.nodeType===1){if(k==="copy"&&q.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(k==="cut"&&(q.hasAttribute("readonly")||q.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Le)return z(Le,{container:F});if(q)return k==="cut"?h(q):z(q,{container:F})},We=Ke;function Ie(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ie=function(w){return typeof w}:Ie=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},Ie(j)}function Ti(j,O){if(!(j instanceof O))throw new TypeError("Cannot call a class as a function")}function nn(j,O){for(var w=0;w0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof F.action=="function"?F.action:this.defaultAction,this.target=typeof F.target=="function"?F.target:this.defaultTarget,this.text=typeof F.text=="function"?F.text:this.defaultText,this.container=Ie(F.container)==="object"?F.container:document.body}},{key:"listenClick",value:function(F){var q=this;this.listener=c()(F,"click",function(Le){return q.onClick(Le)})}},{key:"onClick",value:function(F){var q=F.delegateTarget||F.currentTarget,Le=this.action(q)||"copy",Rt=We({action:Le,container:this.container,target:this.target(q),text:this.text(q)});this.emit(Rt?"success":"error",{action:Le,text:Rt,trigger:q,clearSelection:function(){q&&q.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(F){return yr("action",F)}},{key:"defaultTarget",value:function(F){var q=yr("target",F);if(q)return document.querySelector(q)}},{key:"defaultText",value:function(F){return yr("text",F)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(F){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return z(F,q)}},{key:"cut",value:function(F){return h(F)}},{key:"isSupported",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],q=typeof F=="string"?[F]:F,Le=!!document.queryCommandSupported;return q.forEach(function(Rt){Le=Le&&!!document.queryCommandSupported(Rt)}),Le}}]),w}(s()),ki=Ri},828:function(n){var o=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,f){for(;s&&s.nodeType!==o;){if(typeof s.matches=="function"&&s.matches(f))return s;s=s.parentNode}}n.exports=a},438:function(n,o,i){var a=i(828);function s(u,p,m,d,h){var v=c.apply(this,arguments);return u.addEventListener(m,v,h),{destroy:function(){u.removeEventListener(m,v,h)}}}function f(u,p,m,d,h){return typeof u.addEventListener=="function"?s.apply(null,arguments):typeof m=="function"?s.bind(null,document).apply(null,arguments):(typeof u=="string"&&(u=document.querySelectorAll(u)),Array.prototype.map.call(u,function(v){return s(v,p,m,d,h)}))}function c(u,p,m,d){return function(h){h.delegateTarget=a(h.target,p),h.delegateTarget&&d.call(u,h)}}n.exports=f},879:function(n,o){o.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},o.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||o.node(i[0]))},o.string=function(i){return typeof i=="string"||i instanceof String},o.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}},370:function(n,o,i){var a=i(879),s=i(438);function f(m,d,h){if(!m&&!d&&!h)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(h))throw new TypeError("Third argument must be a Function");if(a.node(m))return c(m,d,h);if(a.nodeList(m))return u(m,d,h);if(a.string(m))return p(m,d,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(m,d,h){return m.addEventListener(d,h),{destroy:function(){m.removeEventListener(d,h)}}}function u(m,d,h){return Array.prototype.forEach.call(m,function(v){v.addEventListener(d,h)}),{destroy:function(){Array.prototype.forEach.call(m,function(v){v.removeEventListener(d,h)})}}}function p(m,d,h){return s(document.body,m,d,h)}n.exports=f},817:function(n){function o(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var f=window.getSelection(),c=document.createRange();c.selectNodeContents(i),f.removeAllRanges(),f.addRange(c),a=f.toString()}return a}n.exports=o},279:function(n){function o(){}o.prototype={on:function(i,a,s){var f=this.e||(this.e={});return(f[i]||(f[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var f=this;function c(){f.off(i,c),a.apply(s,arguments)}return c._=a,this.on(i,c,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),f=0,c=s.length;for(f;f{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var is=/["'&<>]/;Jo.exports=as;function as(e){var t=""+e,r=is.exec(t);if(!r)return t;var n,o="",i=0,a=0;for(i=r.index;i0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function D(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n1||s(m,d)})})}function s(m,d){try{f(n[m](d))}catch(h){p(i[0][3],h)}}function f(m){m.value instanceof Xe?Promise.resolve(m.value.v).then(c,u):p(i[0][2],m)}function c(m){s("next",m)}function u(m){s("throw",m)}function p(m,d){m(d),i.shift(),i.length&&s(i[0][0],i[0][1])}}function mn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof xe=="function"?xe(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,f){a=e[i](a),o(s,f,a.done,a.value)})}}function o(i,a,s,f){Promise.resolve(f).then(function(c){i({value:c,done:s})},a)}}function A(e){return typeof e=="function"}function at(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var $t=at(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: +`+r.map(function(n,o){return o+1+") "+n.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=r}});function De(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Fe=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=xe(a),f=s.next();!f.done;f=s.next()){var c=f.value;c.remove(this)}}catch(v){t={error:v}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var u=this.initialTeardown;if(A(u))try{u()}catch(v){i=v instanceof $t?v.errors:[v]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var m=xe(p),d=m.next();!d.done;d=m.next()){var h=d.value;try{dn(h)}catch(v){i=i!=null?i:[],v instanceof $t?i=D(D([],W(i)),W(v.errors)):i.push(v)}}}catch(v){n={error:v}}finally{try{d&&!d.done&&(o=m.return)&&o.call(m)}finally{if(n)throw n.error}}}if(i)throw new $t(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)dn(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&De(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&De(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Or=Fe.EMPTY;function It(e){return e instanceof Fe||e&&"closed"in e&&A(e.remove)&&A(e.add)&&A(e.unsubscribe)}function dn(e){A(e)?e():e.unsubscribe()}var Ae={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var st={setTimeout:function(e,t){for(var r=[],n=2;n0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?Or:(this.currentObservers=null,s.push(r),new Fe(function(){n.currentObservers=null,De(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new U;return r.source=this,r},t.create=function(r,n){return new wn(r,n)},t}(U);var wn=function(e){ne(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Or},t}(E);var Et={now:function(){return(Et.delegate||Date).now()},delegate:void 0};var wt=function(e){ne(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Et);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,f=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),f=0;f0?e.prototype.requestAsyncId.call(this,r,n,o):(r.actions.push(this),r._scheduled||(r._scheduled=ut.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,n,o){var i;if(o===void 0&&(o=0),o!=null?o>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,o);var a=r.actions;n!=null&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==n&&(ut.cancelAnimationFrame(n),r._scheduled=void 0)},t}(Ut);var On=function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var o=this.actions,i;r=r||o.shift();do if(i=r.execute(r.state,r.delay))break;while((r=o[0])&&r.id===n&&o.shift());if(this._active=!1,i){for(;(r=o[0])&&r.id===n&&o.shift();)r.unsubscribe();throw i}},t}(Wt);var we=new On(Tn);var R=new U(function(e){return e.complete()});function Dt(e){return e&&A(e.schedule)}function kr(e){return e[e.length-1]}function Qe(e){return A(kr(e))?e.pop():void 0}function Se(e){return Dt(kr(e))?e.pop():void 0}function Vt(e,t){return typeof kr(e)=="number"?e.pop():t}var pt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function zt(e){return A(e==null?void 0:e.then)}function Nt(e){return A(e[ft])}function qt(e){return Symbol.asyncIterator&&A(e==null?void 0:e[Symbol.asyncIterator])}function Kt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Ki(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Qt=Ki();function Yt(e){return A(e==null?void 0:e[Qt])}function Gt(e){return ln(this,arguments,function(){var r,n,o,i;return Pt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Xe(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,Xe(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Xe(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Bt(e){return A(e==null?void 0:e.getReader)}function $(e){if(e instanceof U)return e;if(e!=null){if(Nt(e))return Qi(e);if(pt(e))return Yi(e);if(zt(e))return Gi(e);if(qt(e))return _n(e);if(Yt(e))return Bi(e);if(Bt(e))return Ji(e)}throw Kt(e)}function Qi(e){return new U(function(t){var r=e[ft]();if(A(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Yi(e){return new U(function(t){for(var r=0;r=2;return function(n){return n.pipe(e?_(function(o,i){return e(o,i,n)}):me,Oe(1),r?He(t):zn(function(){return new Xt}))}}function Nn(){for(var e=[],t=0;t=2,!0))}function fe(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new E}:t,n=e.resetOnError,o=n===void 0?!0:n,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,f=s===void 0?!0:s;return function(c){var u,p,m,d=0,h=!1,v=!1,B=function(){p==null||p.unsubscribe(),p=void 0},re=function(){B(),u=m=void 0,h=v=!1},z=function(){var T=u;re(),T==null||T.unsubscribe()};return g(function(T,Ke){d++,!v&&!h&&B();var We=m=m!=null?m:r();Ke.add(function(){d--,d===0&&!v&&!h&&(p=jr(z,f))}),We.subscribe(Ke),!u&&d>0&&(u=new et({next:function(Ie){return We.next(Ie)},error:function(Ie){v=!0,B(),p=jr(re,o,Ie),We.error(Ie)},complete:function(){h=!0,B(),p=jr(re,a),We.complete()}}),$(T).subscribe(u))})(c)}}function jr(e,t){for(var r=[],n=2;ne.next(document)),e}function K(e,t=document){return Array.from(t.querySelectorAll(e))}function V(e,t=document){let r=se(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function se(e,t=document){return t.querySelector(e)||void 0}function _e(){return document.activeElement instanceof HTMLElement&&document.activeElement||void 0}function tr(e){return L(b(document.body,"focusin"),b(document.body,"focusout")).pipe(ke(1),l(()=>{let t=_e();return typeof t!="undefined"?e.contains(t):!1}),N(e===_e()),Y())}function Be(e){return{x:e.offsetLeft,y:e.offsetTop}}function Yn(e){return L(b(window,"load"),b(window,"resize")).pipe(Ce(0,we),l(()=>Be(e)),N(Be(e)))}function rr(e){return{x:e.scrollLeft,y:e.scrollTop}}function dt(e){return L(b(e,"scroll"),b(window,"resize")).pipe(Ce(0,we),l(()=>rr(e)),N(rr(e)))}var Bn=function(){if(typeof Map!="undefined")return Map;function e(t,r){var n=-1;return t.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(r,n){var o=e(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,o=e(n,r);~o&&n.splice(o,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!zr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xa?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!zr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,o=ya.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Jn=function(e,t){for(var r=0,n=Object.keys(t);r0},e}(),Zn=typeof WeakMap!="undefined"?new WeakMap:new Bn,eo=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Ea.getInstance(),n=new Ra(t,r,this);Zn.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){eo.prototype[e]=function(){var t;return(t=Zn.get(this))[e].apply(t,arguments)}});var ka=function(){return typeof nr.ResizeObserver!="undefined"?nr.ResizeObserver:eo}(),to=ka;var ro=new E,Ha=I(()=>H(new to(e=>{for(let t of e)ro.next(t)}))).pipe(x(e=>L(Te,H(e)).pipe(C(()=>e.disconnect()))),J(1));function de(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ge(e){return Ha.pipe(S(t=>t.observe(e)),x(t=>ro.pipe(_(({target:r})=>r===e),C(()=>t.unobserve(e)),l(()=>de(e)))),N(de(e)))}function bt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function ar(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}var no=new E,Pa=I(()=>H(new IntersectionObserver(e=>{for(let t of e)no.next(t)},{threshold:0}))).pipe(x(e=>L(Te,H(e)).pipe(C(()=>e.disconnect()))),J(1));function sr(e){return Pa.pipe(S(t=>t.observe(e)),x(t=>no.pipe(_(({target:r})=>r===e),C(()=>t.unobserve(e)),l(({isIntersecting:r})=>r))))}function oo(e,t=16){return dt(e).pipe(l(({y:r})=>{let n=de(e),o=bt(e);return r>=o.height-n.height-t}),Y())}var cr={drawer:V("[data-md-toggle=drawer]"),search:V("[data-md-toggle=search]")};function io(e){return cr[e].checked}function qe(e,t){cr[e].checked!==t&&cr[e].click()}function je(e){let t=cr[e];return b(t,"change").pipe(l(()=>t.checked),N(t.checked))}function $a(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ia(){return L(b(window,"compositionstart").pipe(l(()=>!0)),b(window,"compositionend").pipe(l(()=>!1))).pipe(N(!1))}function ao(){let e=b(window,"keydown").pipe(_(t=>!(t.metaKey||t.ctrlKey)),l(t=>({mode:io("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),_(({mode:t,type:r})=>{if(t==="global"){let n=_e();if(typeof n!="undefined")return!$a(n,r)}return!0}),fe());return Ia().pipe(x(t=>t?R:e))}function Me(){return new URL(location.href)}function ot(e){location.href=e.href}function so(){return new E}function co(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)co(e,r)}function M(e,t,...r){let n=document.createElement(e);if(t)for(let o of Object.keys(t))typeof t[o]!="undefined"&&(typeof t[o]!="boolean"?n.setAttribute(o,t[o]):n.setAttribute(o,""));for(let o of r)co(n,o);return n}function fr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function fo(){return location.hash.substring(1)}function uo(e){let t=M("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Fa(){return b(window,"hashchange").pipe(l(fo),N(fo()),_(e=>e.length>0),J(1))}function po(){return Fa().pipe(l(e=>se(`[id="${e}"]`)),_(e=>typeof e!="undefined"))}function Nr(e){let t=matchMedia(e);return Zt(r=>t.addListener(()=>r(t.matches))).pipe(N(t.matches))}function lo(){let e=matchMedia("print");return L(b(window,"beforeprint").pipe(l(()=>!0)),b(window,"afterprint").pipe(l(()=>!1))).pipe(N(e.matches))}function qr(e,t){return e.pipe(x(r=>r?t():R))}function ur(e,t={credentials:"same-origin"}){return ve(fetch(`${e}`,t)).pipe(ce(()=>R),x(r=>r.status!==200?Tt(()=>new Error(r.statusText)):H(r)))}function Ue(e,t){return ur(e,t).pipe(x(r=>r.json()),J(1))}function mo(e,t){let r=new DOMParser;return ur(e,t).pipe(x(n=>n.text()),l(n=>r.parseFromString(n,"text/xml")),J(1))}function pr(e){let t=M("script",{src:e});return I(()=>(document.head.appendChild(t),L(b(t,"load"),b(t,"error").pipe(x(()=>Tt(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(l(()=>{}),C(()=>document.head.removeChild(t)),Oe(1))))}function ho(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function bo(){return L(b(window,"scroll",{passive:!0}),b(window,"resize",{passive:!0})).pipe(l(ho),N(ho()))}function vo(){return{width:innerWidth,height:innerHeight}}function go(){return b(window,"resize",{passive:!0}).pipe(l(vo),N(vo()))}function yo(){return Q([bo(),go()]).pipe(l(([e,t])=>({offset:e,size:t})),J(1))}function lr(e,{viewport$:t,header$:r}){let n=t.pipe(X("size")),o=Q([n,r]).pipe(l(()=>Be(e)));return Q([r,t,o]).pipe(l(([{height:i},{offset:a,size:s},{x:f,y:c}])=>({offset:{x:a.x-f,y:a.y-c+i},size:s})))}(()=>{function e(n,o){parent.postMessage(n,o||"*")}function t(...n){return n.reduce((o,i)=>o.then(()=>new Promise(a=>{let s=document.createElement("script");s.src=i,s.onload=a,document.body.appendChild(s)})),Promise.resolve())}var r=class{constructor(n){this.url=n,this.onerror=null,this.onmessage=null,this.onmessageerror=null,this.m=a=>{a.source===this.w&&(a.stopImmediatePropagation(),this.dispatchEvent(new MessageEvent("message",{data:a.data})),this.onmessage&&this.onmessage(a))},this.e=(a,s,f,c,u)=>{if(s===this.url.toString()){let p=new ErrorEvent("error",{message:a,filename:s,lineno:f,colno:c,error:u});this.dispatchEvent(p),this.onerror&&this.onerror(p)}};let o=new EventTarget;this.addEventListener=o.addEventListener.bind(o),this.removeEventListener=o.removeEventListener.bind(o),this.dispatchEvent=o.dispatchEvent.bind(o);let i=document.createElement("iframe");i.width=i.height=i.frameBorder="0",document.body.appendChild(this.iframe=i),this.w.document.open(),this.w.document.write(` + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + +

Building The Binary

+

This document describes how to build the project from source code.

+

Prerequisites

+

TODO

+

Building

+

TODO

+

Running

+

TODO

+ + + + + + +
+
+ + +
+ +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 6b57760..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,11 +0,0 @@ -services: - homebox: - image: homebox - build: - context: . - dockerfile: ./Dockerfile - args: - - COMMIT=head - - BUILD_TIME=0001-01-01T00:00:00Z - ports: - - 3100:7745 diff --git a/docs/docs/assets/img/homebox-email-banner.jpg b/docs/docs/assets/img/homebox-email-banner.jpg deleted file mode 100644 index e611c43..0000000 Binary files a/docs/docs/assets/img/homebox-email-banner.jpg and /dev/null differ diff --git a/docs/docs/build.md b/docs/docs/build.md deleted file mode 100644 index e9af902..0000000 --- a/docs/docs/build.md +++ /dev/null @@ -1,15 +0,0 @@ -# Building The Binary - -This document describes how to build the project from source code. - -## Prerequisites - -TODO - -## Building - -TODO - -## Running - -TODO \ No newline at end of file diff --git a/docs/docs/import-csv.md b/docs/docs/import-csv.md deleted file mode 100644 index 6ed4f4b..0000000 --- a/docs/docs/import-csv.md +++ /dev/null @@ -1,83 +0,0 @@ -# CSV Imports - -## Quick Start - -Using the CSV import is the recommended way for adding items to the database. It is always going to be the fastest way to import any large number of items and provides the most flexibility when it comes to adding items. - -**Current Limitations** - - - Imports only support importing items, locations, and labels - - Imports and Exports do not support attachments. Attachments must be uploaded after import - - CSV Exports do not support nested path exports (e.g. `Home / Office / Desk`) and will only export the Items direct parent, (though imports _do_ support nested paths) - - Cannot specify item-to-item relationships (e.g. `Item A` is a child of `Item B`) - -!!! tip "File Formats" - The CSV import supports both CSV and TSV files. The only difference is the delimiter used. CSV files use a comma `,` as the delimiter and TSV files use a tab `\t` as the delimiter. The file extension does not matter. - -## CSV Reference - -Below are the supported columns. They are case-sensitive, can be in any ordered or can be omitted unless otherwise specified. - -### Special Syntax Columns - -`HB.import_ref` - -: Import Refs are unique strings that can be used to deduplicate imports. Before an item is imported, we check the database for a matching ref. If the ref exists, we skip the creation of that item. - - * String Type - * Max 100 Characters - - Import Refs are used to de-duplicate imports. It is HIGHLY recommended that you use them to manage your items if you intend to manage your inventory via CSV import/export. If you do not use import refs, you will end up with duplicate items in your database on subsequent imports. - - !!! tip - - Specifying import refs also allows you to update existing items via the CSV import. If you specify an import ref that already exists in the database, we will update the existing item instead of creating a new one. - -`HB.location` - -: This is the location of the item that will be created. These are de-duplicated and won't create another instance when reused. - - * Supports Path Separators for nested locations (e.g. `Home / Office / Desk`) - -`HB.labels` - -: List of labels to apply to the item separated by a `;` can be existing or new labels. - -`HB.field.{field_name}` (e.g. `HB.field.Serial Number`) - -: This is a special column that allows you to add custom fields to the item. The column name must start with `HB.field.` followed by the name of the field. The value of the column will be the value of the field. - - - If the cell value is empty, it will be ignored. - -### Standard Columns - -| Column | Type | Description | -|----------------------|---------------|-----------------------------------------------| -| HB.quantity | Integer | The quantity of items to create | -| HB.name | String | Name of the item | -| HB.asset_id | AssetID | Asset ID for the item | -| HB.description | String | Description of the item | -| HB.insured | Boolean | Whether or not the item is insured | -| HB.serial_number | String | Serial number of the item | -| HB.model_number | String | Model of the item | -| HB.manufacturer | String | Manufacturer of the item | -| HB.notes | String (1000) | General notes about the product | -| HB.purchase_from | String | Name of the place the item was purchased from | -| HB.purchase_price | Float64 | | -| HB.purchase_time | Date | Date the item was purchased | -| HB.lifetime_warranty | Boolean | true or false - case insensitive | -| HB.warranty_expires | Date | Date in the format | -| HB.warranty_details | String | Details about the warranty | -| HB.sold_to | String | Name of the person the item was sold to | -| HB.sold_time | Date | Date the item was sold | -| HB.sold_price | Float64 | | -| HB.sold_notes | String (1000) | | - -**Type Key** - -| Type | Format | -|---------|-----------------------------------------------------| -| String | Max 255 Characters unless otherwise specified | -| Date | YYYY-MM-DD | -| Boolean | true or false, yes or no, 1 or 0 - case insensitive | -| AssetID | 000-000 | diff --git a/docs/docs/index.md b/docs/docs/index.md deleted file mode 100644 index 188dac5..0000000 --- a/docs/docs/index.md +++ /dev/null @@ -1,56 +0,0 @@ -

-
- -
- Homebox -
-

-

- Docs - | - Demo - | - Discord -

- - - -Homebox is the inventory and organization system built for the Home User! With a focus on simplicity and ease of use, Homebox is the perfect solution for your home inventory, organization, and management needs. While developing this project, I've tried to keep the following principles in mind: - -- _Simple_ - Homebox is designed to be simple and easy to use. No complicated setup or configuration required. Use either a single docker container, or deploy yourself by compiling the binary for your platform of choice. -- _Blazingly Fast_ - Homebox is written in Go, which makes it extremely fast and requires minimal resources to deploy. In general idle memory usage is less than 50MB for the whole container. -- _Portable_ - Homebox is designed to be portable and run on anywhere. We use SQLite and an embedded Web UI to make it easy to deploy, use, and backup. - -## Project Status - -Homebox is currently in early active development and is currently in **beta** stage. This means that the project may still be unstable and clunky. Overall, we are striving to not introduce any breaking changes and have checks in place to ensure migrations and upgrades are smooth. However, we do not guarantee that there will be no breaking changes. We will try to keep the documentation up to date as we make changes. - -## Features - -- Create and Manage _Items_ by providing a name and a description - That's it! Homebox requires only a few details to be provided to create an item, after that you can specify as much detail as you want, or hide away some of the things you won't ever need. -- Optional Details for Items include - - Warranty Information - - Sold To Information - - Purchased From Information - - Item Identifications (Serial, Model, etc) - - Categorized Attachments (Images, Manuals, General) - - Arbitrary/Custom Fields -- CSV Import/Export for quickly creating and managing items -- Custom Reporting - - Bill of Materials Export - - QR Code Label Generator -- Organize _Items_ by creating _Labels_ and _Locations_ and assigning them to items. -- Multi-Tenant Support - All users are placed in a group and can only see items in their group. Invite family members to your group, or share an instance among friends! - - -## Why Not Use Something Else? - -There are a lot of great inventory management systems out there, but none of them _really_ fit my needs as a home user. Snipe-IT is a fantastic product that has so many robust features and management options which makes it easy to become overwhelmed and confused. I wanted something that was simple and easy to use that didn't require a lot of cognitive overhead to manage. I primarily built this to organize my IOT devices and save my warranty and documentation information in a central, searchable location. - -### Spreadsheet - -That's a fair point. If your needs can be fulfilled by a Spreadsheet, I'd suggest using that instead. I've found spreadsheets get pretty unwieldy when you have a lot of data, and it's hard to keep track of what's where. I also wanted to be able to search and filter my data in a more robust way than a spreadsheet can provide. I also wanted to leave the door open for more advanced features in the future like maintenance logs, moving label generators, and more. - -### Snipe-It? - -Snipe-It is the gold standard for IT management. If your use-case is to manage consumables and IT physical infrastructure, I highly suggest you look at Snipe-It over Homebox, it's just more purpose built for that use case. Homebox is, in contrast, purpose built for the home user, which means that we try to focus on keeping things simple and easy to use. Lowering the friction for creating items and managing them is a key goal of Homebox which means you lose out on some of the more advanced features. In most cases, this is a good trade-off. \ No newline at end of file diff --git a/docs/docs/quick-start.md b/docs/docs/quick-start.md deleted file mode 100644 index 278b442..0000000 --- a/docs/docs/quick-start.md +++ /dev/null @@ -1,109 +0,0 @@ -# Quick Start - -## Docker Run - -Great for testing out the application, but not recommended for stable use. Checkout the docker-compose for the recommended deployment. - -For each image there are two tags, respectively the regular tag and $TAG-rootless, which uses a non-root image. - -```sh -# If using the rootless image, ensure data -# folder has correct permissions -$ mkdir -p /path/to/data/folder -$ chown 65532:65532 -R /path/to/data/folder -# --------------------------------------- -# Run the image -$ docker run -d \ - --name homebox \ - --restart unless-stopped \ - --publish 3100:7745 \ - --env TZ=Europe/Bucharest \ - --volume /path/to/data/folder/:/data \ - ghcr.io/hay-kot/homebox:latest -# ghcr.io/hay-kot/homebox:latest-rootless - -``` - -## Docker-Compose - -```yaml -services: - homebox: - image: ghcr.io/hay-kot/homebox:latest -# image: ghcr.io/hay-kot/homebox:latest-rootless - container_name: homebox - restart: always - environment: - - HBOX_LOG_LEVEL=info - - HBOX_LOG_FORMAT=text - - HBOX_WEB_MAX_UPLOAD_SIZE=10 - volumes: - - homebox-data:/data/ - ports: - - 3100:7745 - -volumes: - homebox-data: - driver: local -``` - -!!! note - If you use the `rootless` image, and instead of using named volumes you would prefer using a hostMount directly (e.g., `volumes: [ /path/to/data/folder:/data ]`) you need to `chown` the chosen directory in advance to the `65532` user (as shown in the Docker example above). - -## Env Variables & Configuration - -| Variable | Default | Description | -| ------------------------------------ | ---------------------- | ---------------------------------------------------------------------------------- | -| HBOX_MODE | production | application mode used for runtime behavior can be one of: development, production | -| HBOX_WEB_PORT | 7745 | port to run the web server on, if you're using docker do not change this | -| HBOX_WEB_HOST | | host to run the web server on, if you're using docker do not change this | -| HBOX_OPTIONS_ALLOW_REGISTRATION | true | allow users to register themselves | -| HBOX_OPTIONS_AUTO_INCREMENT_ASSET_ID | true | auto increments the asset_id field for new items | -| HBOX_OPTIONS_CURRENCY_CONFIG | | json configuration file containing additional currencie | -| HBOX_WEB_MAX_UPLOAD_SIZE | 10 | maximum file upload size supported in MB | -| HBOX_WEB_READ_TIMEOUT | 10 | Read timeout of HTTP sever | -| HBOX_WEB_WRITE_TIMEOUT | 10 | Write timeout of HTTP server | -| HBOX_WEB_IDLE_TIMEOUT | 30 | Idle timeout of HTTP server | -| HBOX_STORAGE_DATA | /data/ | path to the data directory, do not change this if you're using docker | -| HBOX_STORAGE_SQLITE_URL | /data/homebox.db?_fk=1 | sqlite database url, if you're using docker do not change this | -| HBOX_LOG_LEVEL | info | log level to use, can be one of: trace, debug, info, warn, error, critical | -| 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_PORT | 587 | email port to use | -| HBOX_MAILER_USERNAME | | email user to use | -| HBOX_MAILER_PASSWORD | | email password to use | -| HBOX_MAILER_FROM | | email from address to use | -| HBOX_SWAGGER_HOST | 7745 | swagger host to use, if not set swagger will be disabled | -| HBOX_SWAGGER_SCHEMA | http | swagger schema to use, can be one of: http, https | - -!!! tip "CLI Arguments" - If you're deploying without docker you can use command line arguments to configure the application. Run `homebox --help` for more information. - - ```sh - Usage: api [options] [arguments] - - OPTIONS - --mode/$HBOX_MODE (default: development) - --web-port/$HBOX_WEB_PORT (default: 7745) - --web-host/$HBOX_WEB_HOST - --web-max-upload-size/$HBOX_WEB_MAX_UPLOAD_SIZE (default: 10) - --storage-data/$HBOX_STORAGE_DATA (default: ./.data) - --storage-sqlite-url/$HBOX_STORAGE_SQLITE_URL (default: ./.data/homebox.db?_fk=1) - --log-level/$HBOX_LOG_LEVEL (default: info) - --log-format/$HBOX_LOG_FORMAT (default: text) - --mailer-host/$HBOX_MAILER_HOST - --mailer-port/$HBOX_MAILER_PORT - --mailer-username/$HBOX_MAILER_USERNAME - --mailer-password/$HBOX_MAILER_PASSWORD - --mailer-from/$HBOX_MAILER_FROM - --swagger-host/$HBOX_SWAGGER_HOST (default: localhost:7745) - --swagger-scheme/$HBOX_SWAGGER_SCHEME (default: http) - --demo/$HBOX_DEMO - --debug-enabled/$HBOX_DEBUG_ENABLED (default: false) - --debug-port/$HBOX_DEBUG_PORT (default: 4000) - --options-allow-registration/$HBOX_OPTIONS_ALLOW_REGISTRATION (default: true) - --options-auto-increment-asset-id/$HBOX_OPTIONS_AUTO_INCREMENT_ASSET_ID (default: true) - --options-currency-config/$HBOX_OPTIONS_CURRENCY_CONFIG - --help/-h - display this help message - ``` diff --git a/docs/docs/tips-tricks.md b/docs/docs/tips-tricks.md deleted file mode 100644 index a5ed05a..0000000 --- a/docs/docs/tips-tricks.md +++ /dev/null @@ -1,80 +0,0 @@ -# Tips and Tricks - -## Custom Fields - -Custom fields are a great way to add any extra information to your item. The following types are supported: - -- [x] Text -- [ ] Integer (Future) -- [ ] Boolean (Future) -- [ ] Timestamp (Future) - -Custom fields are appended to the main details section of your item. - -!!! tip - Homebox Custom Fields also have special support for URLs. Provide a URL (`https://google.com`) and it will be automatically converted to a clickable link in the UI. Optionally, you can also use Markdown syntax to add a custom text to the button. `[Google](https://google.com)` - -## Managing Asset IDs - -Homebox provides the option to auto-set asset IDs, this is the default behavior. These can be used for tracking assets with printable tags or labels. You can disable this behavior via a command line flag or ENV variable. See [configuration](../quick-start#env-variables-configuration) for more details. - -Example ID: `000-001` - -Asset IDs are partially managed by Homebox, but have a flexible implementation to allow for unique use cases. IDs are non-unique at the database level, so there is nothing stopping a user from manually setting duplicate IDs for various items. There are two recommended approaches to manage Asset IDs: - -### 1. Auto Incrementing IDs - -This is the default behavior likely to experience the most consistency. Whenever creating or importing an item, that item receives the next available ID. This is recommended for most users. - -### 2. Auto Incrementing IDs with Reset - -In some cases, you may want to skip some items such as consumables, or items that are loosely tracked. In this case, we recommend that you leave auto-incrementing IDs enabled _however_ when you create a new item that you want to skip, you can go to that item and reset the ID to 0. This will remove it from the auto-incrementing sequence, and the next item will receive the next available ID. - -!!! tip - If you're migrating from an older version, there is an action on the user's profile page to assign IDs to all items. This will assign the next available ID to all items in order of their creation. You should __only do this once__ during the migration process. You should be especially cautious with this if you're using the reset feature described in [option number 2](#2-auto-incrementing-ids-with-reset) - -## QR Codes - -:octicons-tag-24: 0.7.0 - -Homebox has a built-in QR code generator that can be used to generate QR codes for your items. This is useful for tracking items with a mobile device. You can generate a QR code for any item by clicking the QR code icon in the top right of the item details page. The same can be done for the Labels and Locations page. Currently, support is limited to generating one-off QR Codes. - -However, the API endpoint is available for generating QR codes on the fly for any item (or any other data) if you provide a valid API key in the query parameters. An example url would look like `/api/v1/qrcode?data=https://homebox.fly.dev/item/{uuid}`. Currently, the easiest way to get an API token is to use one from an existing URL of the QR Code in the API key, but this will be improved in the future. - -:octicons-tag-24: v0.8.0 - -In version 0.8.0 We've added a custom label generation. On the tools page, there is now a link to the label-generator page where you can generate labels based on Asset ID for your inventory. These are still in early development, so please provide feedback. There's also more information on the implementation on the label generator page. - -[Demo](https://homebox.fly.dev/reports/label-generator) - -## Scheduled Maintenance Notifications - -:octicons-tag-24: v0.9.0 - -Homebox uses [shoutrrr](https://containrrr.dev/shoutrrr/0.7/) to send notifications. This allows you to send notifications to a variety of services. On your profile page, you can add notification URLs to your profile which will be used to send notifications when a maintenance event is scheduled. - -**Notifications are sent on the day the maintenance is scheduled at or around 8am.** - -As of `v0.9.0` we have limited support for complex scheduling of maintenance events. If you have requests for extended functionality, please open an issue on GitHub or reach out on Discord. We're still gauging the demand for this feature. - - -## Custom Currencies - -:octicons-tag-24: v0.11.0 - -Homebox allows you to add additional currencies to your instance by specify a JSON file containing the currencies you want to add. - -**Environment Variable:** `HBOX_OPTIONS_CURRENCY_CONFIG` - -### Example - -```json -[ - { - "code": "AED", - "local": "United Arab Emirates", - "symbol": "د.إ", - "name": "United Arab Emirates Dirham" - }, -] -``` diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml deleted file mode 100644 index 65bd2e1..0000000 --- a/docs/mkdocs.yml +++ /dev/null @@ -1,57 +0,0 @@ -site_name: Homebox -site_url: https://hay-kot.github.io/homebox/ -repo_name: Homebox -repo_url: https://github.com/hay-kot/homebox -use_directory_urls: true -theme: - name: material - palette: - # Palette toggle for light mode - - scheme: homebox - toggle: - icon: material/brightness-7 - name: Switch to dark mode - - # Palette toggle for dark mode - - scheme: slate - toggle: - icon: material/brightness-4 - name: Switch to light mode - - features: - - content.code.annotate - - navigation.instant - - navigation.expand - - navigation.sections - - navigation.tabs.sticky - - navigation.tabs - favicon: assets/img/favicon.svg - logo: assets/img/favicon.svg - -plugins: - - tags - -extra_css: - - assets/stylesheets/extras.css - -markdown_extensions: - - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg - - def_list - - pymdownx.highlight - - pymdownx.superfences - - pymdownx.tasklist: - custom_checkbox: true - - admonition - - attr_list - - pymdownx.superfences - -nav: - - Home: - - Home: index.md - - Quick Start: quick-start.md - - Tips and Tricks: tips-tricks.md - - Import and Export: import-csv.md - - Building The Binary: build.md - - API: "https://redocly.github.io/redoc/?url=https://hay-kot.github.io/homebox/api/openapi-2.0.json" diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index d7301ed..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -mkdocs-material==9.5.12 \ No newline at end of file diff --git a/fly.toml b/fly.toml deleted file mode 100644 index 22dca66..0000000 --- a/fly.toml +++ /dev/null @@ -1,44 +0,0 @@ -# fly.toml file generated for homebox on 2022-09-08T16:00:08-08:00 - -app = "homebox" -kill_signal = "SIGINT" -kill_timeout = 5 -processes = [] - -[build.args] - COMMIT = "HEAD" - VERSION = "nightly" - -[env] - PORT = "7745" - HBOX_DEMO = "true" - -[experimental] - allowed_public_ports = [] - auto_rollback = true - -[[services]] - http_checks = [] - internal_port = 7745 - processes = ["app"] - protocol = "tcp" - script_checks = [] - [services.concurrency] - hard_limit = 25 - soft_limit = 20 - type = "connections" - - [[services.ports]] - force_https = true - handlers = ["http"] - port = 80 - - [[services.ports]] - handlers = ["tls", "http"] - port = 443 - - [[services.tcp_checks]] - grace_period = "1s" - interval = "15s" - restart_limit = 0 - timeout = "2s" diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js deleted file mode 100644 index c567952..0000000 --- a/frontend/.eslintrc.js +++ /dev/null @@ -1,52 +0,0 @@ -module.exports = { - env: { - browser: true, - es2021: true, - node: true, - }, - extends: [ - "eslint:recommended", - "plugin:vue/essential", - "plugin:@typescript-eslint/recommended", - "@nuxtjs/eslint-config-typescript", - "plugin:vue/vue3-recommended", - "plugin:prettier/recommended", - ], - parserOptions: { - ecmaVersion: "latest", - parser: "@typescript-eslint/parser", - sourceType: "module", - }, - plugins: ["vue", "@typescript-eslint"], - rules: { - "no-console": 0, - "no-unused-vars": "off", - "vue/multi-word-component-names": "off", - "vue/no-setup-props-destructure": 0, - "vue/no-multiple-template-root": 0, - "vue/no-v-model-argument": 0, - "@typescript-eslint/consistent-type-imports": "error", - "@typescript-eslint/ban-ts-comment": 0, - "@typescript-eslint/no-unused-vars": [ - "error", - { - ignoreRestSiblings: true, - destructuredArrayIgnorePattern: "_", - caughtErrors: "none", - }, - ], - "prettier/prettier": [ - "warn", - { - arrowParens: "avoid", - semi: true, - tabWidth: 2, - useTabs: false, - vueIndentScriptAndStyle: true, - singleQuote: false, - trailingComma: "es5", - printWidth: 120, - }, - ], - }, -}; diff --git a/frontend/.nuxtignore b/frontend/.nuxtignore deleted file mode 100644 index 5e5ef76..0000000 --- a/frontend/.nuxtignore +++ /dev/null @@ -1 +0,0 @@ -pages/**/*.ts \ No newline at end of file diff --git a/frontend/app.vue b/frontend/app.vue deleted file mode 100644 index 8c48eb8..0000000 --- a/frontend/app.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/frontend/assets/css/main.css b/frontend/assets/css/main.css deleted file mode 100644 index 89b2e1c..0000000 --- a/frontend/assets/css/main.css +++ /dev/null @@ -1,26 +0,0 @@ -.text-no-transform { - text-transform: none !important; -} - -.btn { - text-transform: none !important; -} - -/* transparent subtle scrollbar */ -::-webkit-scrollbar { - width: 0.2em; - background-color: #F5F5F5; -} - -::-webkit-scrollbar-thumb { - background-color: rgba(0,0,0,.2); -} - -::-webkit-scrollbar-track { - -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); - background-color: #F5F5F5; -} - -::-webkit-scrollbar-thumb:hover { - background-color: #9B9B9B; -} \ No newline at end of file diff --git a/frontend/components/App/Header.vue b/frontend/components/App/Header.vue deleted file mode 100644 index b42da7f..0000000 --- a/frontend/components/App/Header.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - diff --git a/frontend/components/App/HeaderDecor.vue b/frontend/components/App/HeaderDecor.vue deleted file mode 100644 index e1b0484..0000000 --- a/frontend/components/App/HeaderDecor.vue +++ /dev/null @@ -1,494 +0,0 @@ - - diff --git a/frontend/components/App/ImportDialog.vue b/frontend/components/App/ImportDialog.vue deleted file mode 100644 index 3e4002c..0000000 --- a/frontend/components/App/ImportDialog.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - diff --git a/frontend/components/App/Logo.vue b/frontend/components/App/Logo.vue deleted file mode 100644 index da16ab6..0000000 --- a/frontend/components/App/Logo.vue +++ /dev/null @@ -1,48 +0,0 @@ - diff --git a/frontend/components/App/Toast.vue b/frontend/components/App/Toast.vue deleted file mode 100644 index d713714..0000000 --- a/frontend/components/App/Toast.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/frontend/components/Base/Button.vue b/frontend/components/Base/Button.vue deleted file mode 100644 index 915ef51..0000000 --- a/frontend/components/Base/Button.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - diff --git a/frontend/components/Base/Card.vue b/frontend/components/Base/Card.vue deleted file mode 100644 index ef39331..0000000 --- a/frontend/components/Base/Card.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - diff --git a/frontend/components/Base/Container.vue b/frontend/components/Base/Container.vue deleted file mode 100644 index a67bee8..0000000 --- a/frontend/components/Base/Container.vue +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/frontend/components/Base/Modal.vue b/frontend/components/Base/Modal.vue deleted file mode 100644 index c1e7591..0000000 --- a/frontend/components/Base/Modal.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/frontend/components/Base/SectionHeader.vue b/frontend/components/Base/SectionHeader.vue deleted file mode 100644 index da25def..0000000 --- a/frontend/components/Base/SectionHeader.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - diff --git a/frontend/components/DetailAction.vue b/frontend/components/DetailAction.vue deleted file mode 100644 index 4512344..0000000 --- a/frontend/components/DetailAction.vue +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/frontend/components/Form/Autocomplete.vue b/frontend/components/Form/Autocomplete.vue deleted file mode 100644 index 9d7c8bb..0000000 --- a/frontend/components/Form/Autocomplete.vue +++ /dev/null @@ -1,175 +0,0 @@ - - - diff --git a/frontend/components/Form/Autocomplete2.vue b/frontend/components/Form/Autocomplete2.vue deleted file mode 100644 index d9fe64a..0000000 --- a/frontend/components/Form/Autocomplete2.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - diff --git a/frontend/components/Form/Checkbox.vue b/frontend/components/Form/Checkbox.vue deleted file mode 100644 index ebf4322..0000000 --- a/frontend/components/Form/Checkbox.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/frontend/components/Form/DatePicker.vue b/frontend/components/Form/DatePicker.vue deleted file mode 100644 index e4bc7bc..0000000 --- a/frontend/components/Form/DatePicker.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - - - diff --git a/frontend/components/Form/Multiselect.vue b/frontend/components/Form/Multiselect.vue deleted file mode 100644 index e961f7f..0000000 --- a/frontend/components/Form/Multiselect.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - diff --git a/frontend/components/Form/Password.vue b/frontend/components/Form/Password.vue deleted file mode 100644 index 6303c0c..0000000 --- a/frontend/components/Form/Password.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/frontend/components/Form/Select.vue b/frontend/components/Form/Select.vue deleted file mode 100644 index 919720f..0000000 --- a/frontend/components/Form/Select.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - diff --git a/frontend/components/Form/TextArea.vue b/frontend/components/Form/TextArea.vue deleted file mode 100644 index 0580f8e..0000000 --- a/frontend/components/Form/TextArea.vue +++ /dev/null @@ -1,72 +0,0 @@ -