Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0b3a5f4
Update step-security/harden-runner action to v2.11.1 (#212)
renovate[bot] Apr 1, 2025
a318f19
Update step-security/harden-runner action to v2.12.0 (#214)
renovate[bot] Apr 22, 2025
e368c17
Update oven-sh/setup-bun action to v2.0.2 (#215)
renovate[bot] Apr 27, 2025
17943e9
Update actions/attest-build-provenance action to v2.3.0 (#216)
renovate[bot] Apr 28, 2025
0d33a3d
Update step-security/harden-runner action to v2.12.1 (#218)
renovate[bot] Jun 11, 2025
4e32eb5
Update actions/attest-build-provenance action to v2.4.0 (#219)
renovate[bot] Jun 12, 2025
954b92d
Update ncipollo/release-action action to v1.17.0 (#222)
renovate[bot] Jun 29, 2025
87bd5a2
Update ncipollo/release-action action to v1.18.0 (#223)
renovate[bot] Jun 30, 2025
83c673e
Update step-security/harden-runner action to v2.12.2 (#224)
renovate[bot] Jun 30, 2025
3cc2702
Update dependency lefthook to ~1.12.0 (#225)
renovate[bot] Jul 8, 2025
8a53c6d
Update step-security/harden-runner action to v2.13.0 (#226)
renovate[bot] Jul 16, 2025
ee0cddc
Update dependency hono to ~4.9.0 (#229)
renovate[bot] Aug 8, 2025
e181645
Update actions/checkout action to v5 (#231)
renovate[bot] Aug 11, 2025
8fc9a97
Update actions/attest-build-provenance action to v3 (#232)
renovate[bot] Aug 31, 2025
c33a1b6
Update ncipollo/release-action action to v1.20.0 (#233)
renovate[bot] Sep 7, 2025
baee594
Update step-security/harden-runner action to v2.13.1 (#234)
renovate[bot] Sep 9, 2025
fb528d1
Update dependency lefthook to ~1.13.0 (#235)
renovate[bot] Sep 11, 2025
7bae575
Update dependency hono to ~4.10.0 (#236)
renovate[bot] Oct 17, 2025
8afee66
Update dependency lefthook to v2 (#237)
renovate[bot] Nov 4, 2025
f59a7bf
Update dependency typescript to ~5.8.0 || ~5.9.0 (#228)
renovate[bot] Nov 4, 2025
5fc0378
Update step-security/harden-runner action to v2.13.2 (#238)
renovate[bot] Nov 5, 2025
1fbd760
Lock file maintenance (#239)
renovate[bot] Nov 17, 2025
0ec8654
Update actions/checkout action to v5.0.1 (#240)
renovate[bot] Nov 18, 2025
6dde482
Update actions/checkout action to v6 (#241)
renovate[bot] Nov 20, 2025
5cb032b
Lock file maintenance (#242)
renovate[bot] Nov 24, 2025
2197223
Lock file maintenance (#243)
renovate[bot] Dec 1, 2025
9b380f2
Update step-security/harden-runner action to v2.13.3 (#244)
renovate[bot] Dec 2, 2025
78379bb
Update actions/checkout action to v6.0.1 (#245)
renovate[bot] Dec 2, 2025
31529b6
Lock file maintenance (#247)
renovate[bot] Dec 8, 2025
c69ebd8
Lock file maintenance (#250)
renovate[bot] Dec 15, 2025
498ae7f
Lock file maintenance (#252)
renovate[bot] Dec 22, 2025
fec85a8
Update actions/attest-build-provenance action to v3.1.0 (#251)
renovate[bot] Dec 27, 2025
f889f30
Update step-security/harden-runner action to v2.14.0 (#248)
renovate[bot] Dec 27, 2025
8e1b1d0
Lock file maintenance (#253)
renovate[bot] Dec 29, 2025
ab17fcc
Database subsystem (#189)
inetol Jan 4, 2026
5631017
Misc improvements (#256)
inetol Jan 4, 2026
aa603ae
Misc improvements (#258)
inetol Jan 5, 2026
7b38eef
Update dependency rolldown to v1.0.0-beta.59 (#260)
renovate[bot] Jan 7, 2026
8dafb17
Optimizar store.dispose (#261)
inetol Jan 7, 2026
9cbb326
Use hono tiny preset (#263)
inetol Jan 8, 2026
8136bc1
List user documents endpoint (#262)
inetol Jan 8, 2026
0df4110
Hashing en columnas sensibles (#259)
inetol Jan 11, 2026
addee9b
Document compression options (#264)
inetol Jan 12, 2026
588efaf
Document streams optimization (#265)
inetol Jan 14, 2026
7b01102
"Deobjectify" (#266)
inetol Jan 14, 2026
8d717cf
Update dependencies (#268)
inetol Jan 14, 2026
795a468
Patch module resolution (#269)
inetol Jan 15, 2026
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
15 changes: 8 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
*

# Project files
!/bun.lock
!/bunfig.toml
!/lib/**
!/src/**
!/.npmrc
!/deno.json
!/deno.lock
!/LICENSE
!/mise.toml
!/package.json
!/tsconfig.json

# SRC
!/src/**
!/rolldown.config.ts
!/tsconfig.json
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://spec.editorconfig.org/#supported-pairs

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 2
trim_trailing_whitespace = true

[{*.json,*.jsonc}]
insert_final_newline = false

[{*.yaml,*.yml}]
insert_final_newline = false

[*.html]
insert_final_newline = false
71 changes: 51 additions & 20 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,40 +1,71 @@
#? Rename or copy this file to ".env" and set the variables there.
#?
#? Rename this file to ".env" and edit the values as needed.
#?
#?####################
#? VARIABLE STRUCTURE:
#?####################
#? [ default ] : type < min - max >
#? ^ ^ ^
#? | | |
#? | | +---- RANGE between two values (these included)
#? | | +---- RANGE between two values (inclusive)
#? | +-------------- TYPE of the variable
#? +------------------------ DEFAULT value applied if not set
#? +------------------------ DEFAULT value if not set
#?
#?###################
#? COMMENT STRUCTURE:
#?###################
#? "#?#..." or "###..." are used to comment a section line.
#? "#?" is used to comment a help line.
#? "##" is used to comment a description line.
#? "#" is used to comment a variable line.
#? "#?#...", "###..." for section headers
#? "#?" for help
#? "##" for description
#? "#" for variable definitions
#?
#? You should remove the comment on variable lines only if you want to set the variable.

##########
## SERVER:
##########
## Set log verbosity [3]:integer
#? (0=none <- 1=error <- 2=warn <- 3=info <- 4=debug)
#LOGLEVEL=3
## Log level: [3]:integer<0-4>
#? 0=none, 1=error, 2=warn, 3=info, 4=debug
#JSPB_LOG_VERBOSITY=3

## Include timestamps in logs?: [true]:boolean
#JSPB_LOG_TIME=true

## Port for the server [4000]:integer
#PORT=4000
## Hostname to bind: [::]:string
#JSPB_HOSTNAME=::

## Is website served over HTTPS? [true]:boolean
#TLS=true
## Port to bind: [4000]:integer<0-65535>
#JSPB_PORT=4000

############
## DOCUMENT:
############
## Maximum document size in kilobytes [1024]:integer
#DOCUMENT_MAXSIZE=1024
## Maximum size per document: [1mb]:string
#? 0=disabled, units: b/k(i)b/m(i)b/g(i)b/t(i)b
#JSPB_DOCUMENT_SIZE=1mb

## Compress document?: [true]:boolean
#? It doesn't apply retroactively to existing documents.
#JSPB_DOCUMENT_COMPRESSION=true

## Delete documents older than: [0]:string
#? 0=disabled, units: s/m/h/d/w/M/y
#JSPB_DOCUMENT_AGE=0

## Delete anonymous documents older than: [7d]:string
#? 0=disabled, units: s/m/h/d/w/M/y
#JSPB_DOCUMENT_ANONYMOUS_AGE=7d

########
## USER:
########
## Allow user registration?: [true]:boolean
#? Root user can always create new users.
#JSPB_USER_REGISTER=true

## Restore the root user?: [false]:boolean
#? Make sure to disable this again after successful recovery.
#JSPB_USER_ROOT_RECOVERY=false

########
## TASK:
########
## Cleanup task cron schedule: [0 1 * * *]:string
#? https://crontab.guru/#0_1_*_*_*
#JSPB_TASK_SWEEPER=0 1 * * *
24 changes: 12 additions & 12 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"lockFileMaintenance": {
"enabled": true,
"automerge": true
},
"packageRules": [
{
"matchUpdateTypes": ["patch"],
"automerge": true
}
]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended", "customManagers:biomeVersions"],
"lockFileMaintenance": {
"enabled": true,
"automerge": true
},
"packageRules": [
{
"matchUpdateTypes": ["patch"],
"automerge": true
}
]
}
139 changes: 62 additions & 77 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
- build-release

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}
cancel-in-progress: false

permissions:
Expand All @@ -41,18 +41,18 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
egress-policy: "audit"

- name: Setup Bun
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1
- name: Setup mise-en-place
uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1

- name: Save context
id: ctx
env:
CTX_BRANCH: ${{ github.head_ref || github.ref_name }}
CTX_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
CTX_BRANCH: "${{ github.head_ref || github.ref_name }}"
CTX_SHA: "${{ github.event.pull_request.head.sha || github.sha }}"
run: |
echo "branch=${CTX_BRANCH}" >>"$GITHUB_OUTPUT"
echo "sha=${CTX_SHA}" >>"$GITHUB_OUTPUT"
Expand All @@ -61,8 +61,8 @@ jobs:
- name: Save tags
id: tags
env:
BRANCH: ${{ steps.ctx.outputs.branch }}
SHA_SHORT: ${{ steps.ctx.outputs.sha_short }}
BRANCH: "${{ steps.ctx.outputs.branch }}"
SHA_SHORT: "${{ steps.ctx.outputs.sha_short }}"
run: |
TIMESTAMP="$(date +%Y.%m.%d)"

Expand All @@ -76,61 +76,46 @@ jobs:
echo "extended=${TIMESTAMP}-${SHA_SHORT}" >>"$GITHUB_OUTPUT"

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

- name: Install deps
run: bun install --frozen-lockfile
persist-credentials: "false"

- name: Build artifact
run: |
bun run build:server

bun run build:standalone:darwin-arm64
chmod 755 ./dist/server
tar -c --owner=0 --group=0 --mtime='now' --utc .env.example LICENSE README.md -C ./dist/ server | xz -z -6 >./dist/backend_${{ steps.tags.outputs.tag }}_darwin-arm64.tar.xz
tar -tJf ./dist/backend_${{ steps.tags.outputs.tag }}_darwin-arm64.tar.xz >/dev/null

bun run build:standalone:linux-amd64-glibc
chmod 755 ./dist/server
tar -c --owner=0 --group=0 --mtime='now' --utc .env.example LICENSE README.md -C ./dist/ server | xz -z -6 >./dist/backend_${{ steps.tags.outputs.tag }}_linux-amd64-glibc.tar.xz
tar -tJf ./dist/backend_${{ steps.tags.outputs.tag }}_linux-amd64-glibc.tar.xz >/dev/null

bun run build:standalone:linux-amd64-musl
chmod 755 ./dist/server
tar -c --owner=0 --group=0 --mtime='now' --utc .env.example LICENSE README.md -C ./dist/ server | xz -z -6 >./dist/backend_${{ steps.tags.outputs.tag }}_linux-amd64-musl.tar.xz
tar -tJf ./dist/backend_${{ steps.tags.outputs.tag }}_linux-amd64-musl.tar.xz >/dev/null

bun run build:standalone:linux-arm64-glibc
chmod 755 ./dist/server
tar -c --owner=0 --group=0 --mtime='now' --utc .env.example LICENSE README.md -C ./dist/ server | xz -z -6 >./dist/backend_${{ steps.tags.outputs.tag }}_linux-arm64-glibc.tar.xz
tar -tJf ./dist/backend_${{ steps.tags.outputs.tag }}_linux-arm64-glibc.tar.xz >/dev/null

bun run build:standalone:linux-arm64-musl
chmod 755 ./dist/server
tar -c --owner=0 --group=0 --mtime='now' --utc .env.example LICENSE README.md -C ./dist/ server | xz -z -6 >./dist/backend_${{ steps.tags.outputs.tag }}_linux-arm64-musl.tar.xz
tar -tJf ./dist/backend_${{ steps.tags.outputs.tag }}_linux-arm64-musl.tar.xz >/dev/null

bun run build:standalone:windows-amd64
chmod 755 ./dist/server.exe
zip -j -X -9 -l -o ./dist/backend_${{ steps.tags.outputs.tag }}_windows-amd64.zip .env.example LICENSE README.md ./dist/server.exe
zip -T ./dist/backend_${{ steps.tags.outputs.tag }}_windows-amd64.zip
mise run build:standalone:darwin-arm64
chmod 755 ./dist/backend.darwin-arm64
tar -c --owner=0 --group=0 --mtime='now' --utc .env.example LICENSE README.md -C ./dist/ backend.darwin-arm64 | xz -z -6 >./dist/backend-${{ steps.tags.outputs.tag }}_darwin-arm64.tar.xz
tar -tJf ./dist/backend-${{ steps.tags.outputs.tag }}_darwin-arm64.tar.xz >/dev/null

mise run build:standalone:linux-amd64
chmod 755 ./dist/backend.linux-amd64
tar -c --owner=0 --group=0 --mtime='now' --utc .env.example LICENSE README.md -C ./dist/ backend.linux-amd64 | xz -z -6 >./dist/backend-${{ steps.tags.outputs.tag }}_linux-amd64.tar.xz
tar -tJf ./dist/backend-${{ steps.tags.outputs.tag }}_linux-amd64.tar.xz >/dev/null

mise run build:standalone:linux-arm64
chmod 755 ./dist/backend.linux-arm64
tar -c --owner=0 --group=0 --mtime='now' --utc .env.example LICENSE README.md -C ./dist/ backend.linux-arm64 | xz -z -6 >./dist/backend-${{ steps.tags.outputs.tag }}_linux-arm64.tar.xz
tar -tJf ./dist/backend-${{ steps.tags.outputs.tag }}_linux-arm64.tar.xz >/dev/null

mise run build:standalone:windows-amd64
chmod 755 ./dist/backend.windows-amd64.exe
zip -j -X -9 -l -o ./dist/backend-${{ steps.tags.outputs.tag }}_windows-amd64.zip .env.example LICENSE README.md ./dist/backend.windows-amd64.exe
zip -T ./dist/backend-${{ steps.tags.outputs.tag }}_windows-amd64.zip

- if: inputs.artifact-action == 'build-release'
name: Release artifact
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
with:
name: ${{ steps.tags.outputs.extended }}
tag: ${{ steps.tags.outputs.extended }}
artifacts: dist/*.tar.xz,dist/*.zip
makeLatest: true
prerelease: ${{ steps.ctx.outputs.branch != 'stable' }}
generateReleaseNotes: ${{ steps.ctx.outputs.branch == 'stable' }}
name: "${{ steps.tags.outputs.extended }}"
tag: "${{ steps.tags.outputs.extended }}"
artifacts: "dist/*.tar.xz,dist/*.zip"
makeLatest: "true"
prerelease: "${{ steps.ctx.outputs.branch != 'stable' }}"
generateReleaseNotes: "${{ steps.ctx.outputs.branch == 'stable' }}"

- if: inputs.artifact-action == 'build-release'
name: Attest artifact
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0
with:
subject-path: |
dist/*.tar.xz
Expand All @@ -150,15 +135,15 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
egress-policy: "audit"

- name: Save context
id: ctx
env:
CTX_BRANCH: ${{ github.head_ref || github.ref_name }}
CTX_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
CTX_BRANCH: "${{ github.head_ref || github.ref_name }}"
CTX_SHA: "${{ github.event.pull_request.head.sha || github.sha }}"
run: |
echo "branch=${CTX_BRANCH}" >>"$GITHUB_OUTPUT"
echo "sha=${CTX_SHA}" >>"$GITHUB_OUTPUT"
Expand All @@ -167,9 +152,9 @@ jobs:
- name: Save tags
id: tags
env:
BRANCH: ${{ steps.ctx.outputs.branch }}
SHA: ${{ steps.ctx.outputs.sha }}
SHA_SHORT: ${{ steps.ctx.outputs.sha_short }}
BRANCH: "${{ steps.ctx.outputs.branch }}"
SHA: "${{ steps.ctx.outputs.sha }}"
SHA_SHORT: "${{ steps.ctx.outputs.sha_short }}"
run: |
TIMESTAMP="$(date +%Y.%m.%d)"
TIMESTAMP_ISO="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
Expand All @@ -189,20 +174,20 @@ jobs:
echo "list=${TAGS[*]}" >>"$GITHUB_OUTPUT"

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
persist-credentials: "false"

- name: Build image
id: build-image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2.13
with:
containerfiles: Dockerfile
platforms: linux/amd64,linux/arm64
image: ${{ github.repository }}
layers: true
oci: true
tags: ${{ steps.tags.outputs.list }}
containerfiles: "Dockerfile"
platforms: "linux/amd64,linux/arm64"
image: "${{ github.repository }}"
layers: "true"
oci: "true"
tags: "${{ steps.tags.outputs.list }}"
extra-args: |
--squash
--identity-label=false
Expand All @@ -214,23 +199,23 @@ jobs:
name: Login to GHCR
uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1.7
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"
registry: "${{ env.REGISTRY }}"

- if: inputs.image-action == 'build-release'
name: Push to GHCR
id: push-image
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2.8
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.REGISTRY }}
image: "${{ steps.build-image.outputs.image }}"
tags: "${{ steps.build-image.outputs.tags }}"
registry: "${{ env.REGISTRY }}"

- if: inputs.image-action == 'build-release'
name: Attest image
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0
with:
subject-name: "${{ env.REGISTRY }}/${{ steps.build-image.outputs.image }}"
subject-digest: ${{ steps.push-image.outputs.digest }}
push-to-registry: false
subject-digest: "${{ steps.push-image.outputs.digest }}"
push-to-registry: "false"
Loading
Loading