Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

backend: Remove checked-in compiled binary #726

Closed
wants to merge 102 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
a042496
chore: bump all go deps (#507)
hay-kot Jul 23, 2023
dc94465
fix(deps): update module github.com/swaggo/http-swagger to v2 (#506)
renovate[bot] Jul 23, 2023
27dad0e
fix(deps): update module github.com/swaggo/http-swagger to v2 (#508)
renovate[bot] Jul 23, 2023
06eb6c1
fix 3 places where API URLs were not constructed by function route (#…
db8200 Jul 23, 2023
0167809
ui: rework location/labels pages (#475)
hay-kot Jul 27, 2023
371fc0a
chore(deps): update dependency mkdocs-material to v9.1.21 (#512)
renovate[bot] Jul 29, 2023
c5ae6b1
feat: more currency support (#520)
hay-kot Jul 31, 2023
02ce52d
fix: assert/asserts (#521)
hay-kot Jul 31, 2023
895017b
fix: label prop not being passed to password input (#522)
hay-kot Jul 31, 2023
5a219f6
feat: support cmd+s / ctrl+s and rework button display on edit (#523)
hay-kot Jul 31, 2023
8c7d91e
fix: prevent resetting dialog state on error (#524)
hay-kot Jul 31, 2023
22bbaae
feat: add support for create + add more for all create modals and sup…
hay-kot Jul 31, 2023
3f0e65a
include rootless dockerfile
hay-kot Aug 2, 2023
275e106
build nightly rootless
hay-kot Aug 2, 2023
272cc5a
chore(deps): update dependency vitest to ^0.34.0 (#529)
renovate[bot] Aug 2, 2023
2e2eed1
try node 18
hay-kot Aug 2, 2023
cceec06
specify h3 dependency
hay-kot Aug 2, 2023
2cbcc8b
feat: WebSocket based implementation of server sent events for cache …
hay-kot Aug 2, 2023
b5987f2
feat: set cookies' expires attribute and fix remember me (#530)
gucheen Aug 10, 2023
9fa17be
update lock file
hay-kot Aug 10, 2023
5438898
feat: add currencies XAG and XAU (#535)
tctlrd Aug 23, 2023
0876deb
fix websocket over secure connection (#542)
hay-kot Aug 24, 2023
94fd9c3
fix: mobile "Create and Add Another" goes off screen (#540)
JonathanGawrych Aug 31, 2023
c89aa73
fix(deps): update module github.com/rs/zerolog to v1.30.0 (#517)
renovate[bot] Sep 14, 2023
5f41960
fix(deps): update module modernc.org/sqlite to v1.25.0 (#531)
renovate[bot] Sep 14, 2023
5739b20
chore(deps): update dependency eslint-config-prettier to v9 (#533)
renovate[bot] Sep 14, 2023
fbc7e6e
fix: minor typo (#546)
Aaron-von-Awesome Sep 14, 2023
455163d
fix(deps): update module golang.org/x/crypto to v0.13.0 (#532)
renovate[bot] Sep 14, 2023
fc56984
fix(deps): update module github.com/google/uuid to v1.3.1 (#551)
renovate[bot] Sep 14, 2023
744a5bb
fix(deps): update module github.com/swaggo/swag to v1.16.2 (#552)
renovate[bot] Sep 14, 2023
e68b7cf
fix(deps): update module github.com/go-playground/validator/v10 to v1…
renovate[bot] Oct 6, 2023
a9712c4
chore(deps): update dependency mkdocs-material to v9.4.4 (#553)
renovate[bot] Oct 6, 2023
f13bf29
pr: fixed incorrect sum of the total items price (#568)
hay-kot Oct 6, 2023
a33cf54
fix(deps): update module github.com/containrrr/shoutrrr to v0.8.0 (#555)
renovate[bot] Oct 6, 2023
b28bb2c
fix(deps): update module github.com/yeqown/go-qrcode/writer/standard …
renovate[bot] Oct 6, 2023
f3f9672
fix: ensure loading in toggled (#571)
hay-kot Oct 6, 2023
2b31d46
fix(deps): update module github.com/rs/zerolog to v1.31.0 (#569)
renovate[bot] Oct 6, 2023
1952b9f
fix(deps): update module golang.org/x/crypto to v0.14.0 (#570)
renovate[bot] Oct 6, 2023
db16d3f
feat: make selectables clearable (#572)
hay-kot Oct 6, 2023
63a966c
fix: field values request fails (#573)
hay-kot Oct 6, 2023
318b8be
feat: primary images (#576)
hay-kot Oct 7, 2023
0dc4fa5
fix(deps): update module modernc.org/sqlite to v1.26.0 (#574)
renovate[bot] Oct 7, 2023
2cd3c15
chore(deps): update dependency nuxt to v3.7.4 (#554)
renovate[bot] Oct 7, 2023
1365bdf
refactor: rewrite to cookie based auth (#578)
hay-kot Oct 7, 2023
d8482f3
Revert "chore(deps): update dependency nuxt to v3.7.4 (#554)" (#580)
hay-kot Oct 7, 2023
ae4b953
fix: infinite redirect issue (#583)
hay-kot Oct 10, 2023
0995478
fix: restore location section (#587)
hay-kot Oct 15, 2023
e5f66d9
chore(deps): update dependency mkdocs-material to v9.4.8 (#592)
renovate[bot] Nov 15, 2023
3e2ab29
chore(deps): update docker/setup-buildx-action action to v3 (#579)
renovate[bot] Nov 15, 2023
b08e521
chore(deps): update actions/checkout action to v4 (#575)
renovate[bot] Nov 15, 2023
4738a9b
chore: rewrite generator to resolve strange name generation (#612)
hay-kot Nov 16, 2023
c0e8e34
chore: bump all go dependencies (#614)
hay-kot Nov 16, 2023
b408318
fix: filepath sep on windows (#615)
hay-kot Nov 16, 2023
51ba15f
fix: ensure urls isn't encoded (#618)
hay-kot Nov 16, 2023
da22074
feat : Validate bark, ntfy, generic+ shortcut (#591)
chessmango Nov 16, 2023
db27d34
chore(deps): update pnpm/action-setup action to v2.4.0 (#511)
renovate[bot] Nov 16, 2023
80e2071
fix: use theme aware background color (#619)
hay-kot Nov 16, 2023
a70ee33
chore(deps): update actions/setup-node action to v4 (#621)
renovate[bot] Nov 16, 2023
eeae790
feat: expose timeout variables (#622)
hay-kot Nov 16, 2023
e65d44f
fix(deps): update dependency @pinia/nuxt to ^0.5.0 (#620)
renovate[bot] Nov 16, 2023
2eafa8e
chore(deps): update dependency @vite-pwa/nuxt to ^0.2.0 (#616)
renovate[bot] Nov 16, 2023
2594d4c
chore(deps): update dependency @types/markdown-it to v13 (#577)
renovate[bot] Nov 16, 2023
afbc6a4
fix: images in child items (#623)
hay-kot Nov 16, 2023
8cc0f30
fix: allow zeroing out asset ids (#624)
hay-kot Nov 16, 2023
9edbda3
feat: set version flag (#632)
hay-kot Nov 24, 2023
10c030a
docs: Fix a bunch of grammar and spelling, rephrased some sentences t…
kevinholtkamp Nov 30, 2023
7ec22ed
chore(deps): update dependency mkdocs-material to v9.4.14 (#630)
renovate[bot] Nov 30, 2023
db00e7a
chore(deps): update goreleaser/goreleaser-action action to v5 (#626)
renovate[bot] Nov 30, 2023
d1d98bc
chore(deps): update docker/setup-qemu-action action to v3 (#625)
renovate[bot] Nov 30, 2023
321a83b
fix/feat: primary photo auto set and auto-set primary photo (#651)
hay-kot Dec 1, 2023
4d9131b
fix: loading causing stale data to present in form(#650)
hay-kot Dec 1, 2023
f2363b8
fix: ignore /api paths from service workers (#649)
hay-kot Dec 1, 2023
014fdea
fix(deps): update module github.com/hay-kot/httpkit to v0.0.5 (#643)
renovate[bot] Dec 1, 2023
126c06a
fix(deps): update module golang.org/x/crypto to v0.16.0 (#645)
renovate[bot] Dec 1, 2023
b559216
fix(deps): update github.com/gocarina/gocsv digest to b87c2d0 (#629)
renovate[bot] Dec 1, 2023
8a85b18
chore(deps): update dependency mkdocs-material to v9.5.2 (#654)
renovate[bot] Dec 12, 2023
0bc3969
chore(deps): update actions/setup-go action to v5 (#653)
renovate[bot] Dec 12, 2023
ff2577a
chore(deps): update dependency vitest to v1 (#652)
renovate[bot] Dec 12, 2023
5229436
fix(deps): update dependency markdown-it to v14 (#655)
renovate[bot] Dec 12, 2023
8538877
feat: extract auth into provider (#663)
hay-kot Dec 12, 2023
85c8e47
fix: ensure rows are closed (#670)
hay-kot Dec 16, 2023
3ee150e
feat: add log statements + remove auto redirect (#671)
hay-kot Dec 16, 2023
b918310
fix: Render newlines in markdown fields (#682)
zebrapurring Dec 25, 2023
e8449b3
fix: inaccruate 401 & sql busy error (#679)
hay-kot Jan 4, 2024
f3f2116
fix(deps): update module golang.org/x/crypto to v0.17.0 [security] (#…
renovate[bot] Jan 4, 2024
d8e4962
feat: show quantity in card view if quantity == 0 (hay-kot/homebox#67…
bee-eater Jan 4, 2024
8ede42f
fix(deps): update module github.com/google/uuid to v1.5.0 (#664)
renovate[bot] Jan 4, 2024
6d8260b
fix(deps): update module github.com/go-chi/chi/v5 to v5.0.11 (#698)
renovate[bot] Jan 4, 2024
d920e1e
chore(deps): update dependency mkdocs-material to v9.5.3 (#697)
renovate[bot] Jan 4, 2024
d2bde3f
fix: task swag (#710)
quoing Jan 17, 2024
c4b9238
feat: user defined currencies (#700)
hay-kot Jan 18, 2024
f2f7809
feat: enable search by serial number or model number (#677)
zebrapurring Jan 18, 2024
d374fae
fix(deps): update module golang.org/x/crypto to v0.18.0 (#706)
renovate[bot] Jan 18, 2024
b3b81a3
chore(deps): update dependency mkdocs-material to v9.5.4 (#716)
renovate[bot] Jan 19, 2024
6ee4103
fix(deps): update module github.com/mattn/go-sqlite3 to v1.14.19 (#668)
renovate[bot] Jan 19, 2024
94399a9
fix(deps): update module github.com/go-playground/validator/v10 to v1…
renovate[bot] Jan 20, 2024
de4081d
fix(deps): update module modernc.org/sqlite to v1.28.0 (#667)
renovate[bot] Jan 20, 2024
b8b706e
chore(deps): update dependency mkdocs-material to v9.5.5 (#720)
renovate[bot] Jan 24, 2024
59a5a17
fix(deps): update module github.com/google/uuid to v1.6.0 (#719)
renovate[bot] Jan 24, 2024
858cdec
fix(deps): update module github.com/mattn/go-sqlite3 to v1.14.20 (#723)
renovate[bot] Jan 26, 2024
4bc8778
backend: Remove checked-in compiled binary
LINKIWI Jan 28, 2024
3e9e70e
Add backend/api to .gitignore
LINKIWI Jan 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",
"features": {
"golang": "1.20"
"golang": "1.21"
}
}
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
**/secrets.dev.yaml
**/values.dev.yaml
README.md
!Dockerfile.rootless
6 changes: 3 additions & 3 deletions .github/workflows/partial-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
Go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.21"

- name: Install Task
uses: arduino/setup-task@v1
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/partial-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v2.4.0
with:
version: 6.0.2

Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -44,15 +44,15 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.21"

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18

- uses: pnpm/action-setup@v2.2.4
- uses: pnpm/action-setup@v2.4.0
with:
version: 6.0.2

Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/partial-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ jobs:
name: "Publish Homebox"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.20"

- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all

- name: install buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
install: true

Expand All @@ -44,7 +44,7 @@ jobs:
env:
CR_PAT: ${{ secrets.GH_TOKEN }}

- name: build nightly the image
- name: build nightly image
if: ${{ inputs.release == false }}
run: |
docker build --push --no-cache \
Expand All @@ -53,6 +53,16 @@ jobs:
--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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: "Deploy Nightly to Fly.io"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5

- uses: pnpm/action-setup@v2
with:
Expand All @@ -41,7 +41,7 @@ jobs:
cp -r ./.output/public ../backend/app/api/static/

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
workdir: "backend"
distribution: goreleaser
Expand All @@ -67,7 +67,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ node_modules
dist

.pnpm-store
backend/api
backend/app/api/app
backend/app/api/__debug_bin
dist/
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"editor.formatOnSave": false,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
Expand Down
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Contributing

## We Develop with Github
## We Develop with GitHub

We use github to host code, to track issues and feature requests, as well as accept pull requests.
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:
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 API's, update the documentation.
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 can need to ensure that you have the following tools installed:
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)
Expand All @@ -31,27 +31,27 @@ If you're using `taskfile` you can run `task --list-all` for a list of all comma

### 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.
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 the frontend server.
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.
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.
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.
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Build Nuxt
FROM node:17-alpine as frontend-builder
FROM node:18-alpine as frontend-builder
WORKDIR /app
RUN npm install -g pnpm
COPY frontend/package.json frontend/pnpm-lock.yaml ./
Expand Down Expand Up @@ -32,7 +32,7 @@ FROM alpine:latest

ENV HBOX_MODE=production
ENV HBOX_STORAGE_DATA=/data/
ENV HBOX_STORAGE_SQLITE_URL=/data/homebox.db?_fk=1
ENV HBOX_STORAGE_SQLITE_URL=/data/homebox.db?_pragma=busy_timeout=2000&_pragma=journal_mode=WAL&_fk=1

RUN apk --no-cache add ca-certificates
RUN mkdir /app
Expand Down
43 changes: 29 additions & 14 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,43 @@ tasks:
- cd backend && go mod tidy
- cd frontend && pnpm install --shamefully-hoist

generate:
desc: |
Generates collateral files from the backend project
including swagger docs and typescripts type for the frontend
deps:
- db:generate
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:
- cd backend/app/api/static && swag fmt --dir=../
- cd backend/app/api/static && swag init --dir=../,../../../internal,../../../pkgs --parseDependency
- |
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
- cp ./backend/app/api/static/docs/swagger.json docs/docs/api/openapi-2.0.json
sources:
- "./backend/app/api/**/*"
- "./backend/internal/data/**"
- "./backend/internal/core/services/**/*"
- "./backend/app/tools/typegen/main.go"
- ./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)
Expand Down Expand Up @@ -139,4 +154,4 @@ tasks:
- task: go:all
- task: ui:check
- task: ui:fix
- task: test:ci
- task: test:ci
Loading