Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
6d72172
build(deps): bump modernc.org/sqlite from 1.32.0 to 1.33.0
dependabot[bot] Sep 9, 2024
0b15f7f
build(deps): bump modernc.org/sqlite from 1.32.0 to 1.33.0
lukewhrit Sep 10, 2024
348de41
build(deps): bump modernc.org/sqlite from 1.33.0 to 1.33.1
dependabot[bot] Sep 16, 2024
9ee00a4
build: merge pull request #452
lukewhrit Sep 16, 2024
1fa11e2
feat(web): basic reader mode
lukewhrit Nov 11, 2024
cae17a0
feat(web): add reader mode
lukewhrit Nov 17, 2024
03e52f1
fix(authentication): db stubs
lukewhrit Nov 17, 2024
6361f7d
feat(database): add authentication methods (untested)
lukewhrit Nov 17, 2024
8edf35c
build(deps): bump modernc.org/sqlite from 1.33.1 to 1.34.1
dependabot[bot] Nov 18, 2024
c027545
feat(authentication): signup and signin routes
lukewhrit Nov 19, 2024
7757bc2
chore: merge pr #455
lukewhrit Nov 19, 2024
c62343c
feat(validation): signin/signup request validation
lukewhrit Nov 19, 2024
5175ffe
fix(database/sqlite): fix typo in schema
lukewhrit Nov 19, 2024
5c2da8b
build(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0
dependabot[bot] Nov 25, 2024
c378de6
build(deps): bump modernc.org/sqlite from 1.34.1 to 1.34.2
dependabot[bot] Dec 9, 2024
d3838e6
build(deps): merge dependabot pr
lukewhrit Dec 14, 2024
d25732f
build(deps): merge dependabot pr
lukewhrit Dec 14, 2024
ef31981
build(deps): bump golang.org/x/crypto from 0.29.0 to 0.31.0
dependabot[bot] Dec 14, 2024
1d0728d
build(deps): merge dependabot pr
lukewhrit Dec 14, 2024
9dc3c9c
build(deps): bump github.com/go-chi/chi/v5 from 5.1.0 to 5.2.0
dependabot[bot] Dec 16, 2024
dc2fc50
build(deps): bump modernc.org/sqlite from 1.34.2 to 1.34.4
dependabot[bot] Dec 23, 2024
47a2e7d
build(deps): bump github.com/alecthomas/chroma/v2 from 2.14.0 to 2.15.0
dependabot[bot] Jan 6, 2025
a128eab
build(deps): bump golang.org/x/crypto from 0.31.0 to 0.32.0
dependabot[bot] Jan 13, 2025
2044718
build(deps): bump github.com/go-chi/chi/v5 from 5.1.0 to 5.2.0
lukewhrit Jan 19, 2025
1b052e5
build(deps): bump modernc.org/sqlite from 1.34.2 to 1.34.4
lukewhrit Jan 19, 2025
8843e0b
build(deps): bump github.com/alecthomas/chroma/v2 from 2.14.0 to 2.15.0
lukewhrit Jan 19, 2025
3a2d68d
build(deps): bump golang.org/x/crypto from 0.31.0 to 0.32.0
lukewhrit Jan 19, 2025
994b517
build(deps): bump modernc.org/sqlite from 1.34.4 to 1.34.5
dependabot[bot] Jan 20, 2025
142ba2e
build(deps): bump modernc.org/sqlite from 1.34.4 to 1.34.5
lukewhrit Jan 25, 2025
da7163a
build(deps): bump github.com/go-chi/chi/v5 from 5.2.0 to 5.2.1
dependabot[bot] Feb 10, 2025
3fd3c6d
build(deps): bump golang.org/x/crypto from 0.32.0 to 0.33.0
dependabot[bot] Feb 10, 2025
599ae4f
build(deps): bump golang.org/x/crypto from 0.32.0 to 0.33.0
lukewhrit Feb 16, 2025
41fafc0
build(deps): bump github.com/go-chi/chi/v5 from 5.2.0 to 5.2.1
lukewhrit Feb 16, 2025
305c0d6
build(deps): bump modernc.org/sqlite from 1.34.5 to 1.36.1
dependabot[bot] Mar 17, 2025
f0f4284
build(deps): bump github.com/rs/zerolog from 1.33.0 to 1.34.0
dependabot[bot] Mar 24, 2025
cd3ae65
build(deps): bump github.com/go-sql-driver/mysql from 1.8.1 to 1.9.1
dependabot[bot] Mar 24, 2025
3ea3910
build(deps): bump github.com/go-sql-driver/mysql from 1.8.1 to 1.9.1
lukewhrit Mar 29, 2025
af76a66
build(deps): bump github.com/rs/zerolog from 1.33.0 to 1.34.0
lukewhrit Mar 29, 2025
48f9e36
build(deps): bump modernc.org/sqlite from 1.34.5 to 1.36.1
lukewhrit Mar 29, 2025
9d087df
build(deps): bump github.com/alecthomas/chroma/v2 from 2.15.0 to 2.16.0
dependabot[bot] Apr 7, 2025
bb8eb52
build(deps): bump github.com/alecthomas/chroma/v2 from 2.15.0 to 2.16.0
lukewhrit Apr 13, 2025
f3a9043
build(deps): bump github.com/go-sql-driver/mysql from 1.9.1 to 1.9.3
dependabot[bot] Jun 16, 2025
1842d49
build(deps): bump github.com/go-chi/chi/v5 from 5.2.1 to 5.2.2
dependabot[bot] Jun 23, 2025
e08ccca
Allow saving using OS specific hotkeys
lilleswing Aug 6, 2025
d11d249
feat(authentication): sign up / sign in methods
lukewhrit Aug 6, 2025
2f9e549
build(deps): bump github.com/go-sql-driver/mysql from 1.9.1 to 1.9.2
lukewhrit Aug 29, 2025
d3583a0
build(deps): bump github.com/go-chi/chi/v5 from 5.2.1 to 5.2.2
lukewhrit Aug 29, 2025
4916de1
fix: update dependencies
Dec 19, 2025
a047186
ci: update go version in workflows
Dec 19, 2025
9736073
docs: update code of conduct and readme
Dec 19, 2025
0c0be6d
build(deps): bump modernc.org/sqlite from 1.40.1 to 1.41.0
dependabot[bot] Dec 22, 2025
6a05c11
build(deps): bump modernc.org/sqlite from 1.40.1 to 1.41.0
lukewhrit Dec 23, 2025
1af3cf7
Initial plan
Copilot Dec 23, 2025
fa4cf60
Add missing tests for server endpoints and util functions
Copilot Dec 23, 2025
147ee53
Add error case tests for create and fetch endpoints
Copilot Dec 23, 2025
df8fd7e
chore(ci): update codecov config to ignore authentication files
Copilot Dec 23, 2025
ea92a38
test: improve coverage for HandleCreateBody and createDocument error …
Copilot Dec 23, 2025
82cce77
test: add comprehensive tests for auth helpers and improve coverage
Copilot Dec 23, 2025
3da897f
test: add comprehensive unit tests for server API and utilities
Copilot Dec 23, 2025
6c4d4a6
Merge pull request #514 from lukewhrit/copilot/add-unit-tests-for-ser…
lukewhrit Dec 23, 2025
0227add
build(deps): bump modernc.org/sqlite from 1.41.0 to 1.42.2
dependabot[bot] Dec 29, 2025
c90a4b3
Merge pull request #515 from lukewhrit/dependabot/go_modules/develop/…
lukewhrit Jan 3, 2026
1fc1c73
feat: add migration tools
lukewhrit Jan 3, 2026
3847f56
fix(512): sqlite database URI parsing logic
lukewhrit Jan 3, 2026
16026a5
fix: migrations
lukewhrit Jan 4, 2026
b630561
tests: a HandleCreateBody call with no content should fail
lukewhrit Jan 4, 2026
88e1542
Merge branch 'develop' into save-pr
lukewhrit Jan 4, 2026
7f929ef
Merge pull request #498 from lilleswing/save-pr
lukewhrit Jan 4, 2026
289e265
feat: signup/signin pages
lukewhrit Jan 4, 2026
4fa9ce3
feat: frontend auth integration
lukewhrit Jan 4, 2026
a8b559f
feat(server/authentication): proper redirect flow, session cookies, etc
lukewhrit Jan 4, 2026
2265858
feat: accounts page, only show account buttons when enabled, fix erro…
lukewhrit Jan 6, 2026
aca80ba
fix: show username on document page
lukewhrit Jan 6, 2026
d1de78b
fix: make cookie secure
lukewhrit Jan 6, 2026
cb09316
feat: signout button
lukewhrit Jan 6, 2026
f0a7fa4
feat: configuration options for cookies, and added expiry, etc.
lukewhrit Jan 6, 2026
4cbe964
ci(release): amd64 and arm64 container images
lukewhrit Jan 6, 2026
9325726
build(deps): bump github.com/alecthomas/chroma/v2 from 2.21.1 to 2.22.0
dependabot[bot] Jan 12, 2026
2a2dd67
build(deps): bump modernc.org/sqlite from 1.42.2 to 1.43.0
dependabot[bot] Jan 12, 2026
8eaca06
Merge pull request #517 from lukewhrit/dependabot/go_modules/develop/…
lukewhrit Jan 15, 2026
d58842c
Merge pull request #516 from lukewhrit/dependabot/go_modules/develop/…
lukewhrit 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
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <hello@aurieh.services> or
reported by contacting the project team at <hello@spaceb.in> or
<lukewhrit@pm.me>. All complaints will be reviewed and investigated and will
result in a response that is deemed necessary and appropriate to the
circumstances. The project team is obligated to maintain confidentiality with
Expand Down
9 changes: 7 additions & 2 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
ignore:
- "cmd/" #
- "internal/database" # External library
- "cmd/" # CLI entry point
- "internal/database" # External library and generated fakes
- "internal/util/logger.go" # External library
- "internal/util/authentication.go" # Authentication not in current scope
- "internal/server/authentication.go" # Authentication not in current scope
- "internal/server/config.go" # Simple struct encoding, cannot error
- "internal/util/helpers.go:83-111" # HandleSignupBody - auth only
- "internal/util/helpers.go:114-142" # HandleSigninBody - auth only
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ updates:
interval: weekly
target-branch: develop
open-pull-requests-limit: 10
reviewers:
- lukewhrit
assignees:
- lukewhrit
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
- name: setup go
uses: actions/setup-go@v4
with:
go-version: 1.22.4
go-version: 1.25.5
- name: run make
run: make spacebin
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
- name: setup go
uses: actions/setup-go@v4
with:
go-version: 1.22.4
go-version: 1.25.5
- name: run make
run: make format
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: Publish containers for release

on:
release:
types: [published]
Expand All @@ -17,6 +15,11 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
Expand Down Expand Up @@ -44,6 +47,7 @@ jobs:
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fetch-depth: 2
- uses: actions/setup-go@v4
with:
go-version: 1.22.4
go-version: 1.25.5
- name: Run coverage
run: go test ./... -race -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage to Codecov
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ certs/
/Godeps/

# End of https://www.toptal.com/developers/gitignore/api/go
*.out
*.cov
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
golang 1.25.5
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
OUT := bin/spacebin
MIGRATIONS_DIR := internal/database/migrations

.PHONY: clean
.PHONY: clean migrate-up migrate-down

all: spacebin

Expand All @@ -23,3 +24,13 @@ test:
coverage:
go test ./... -v -race -coverprofile=coverage.out
go tool cover -html=coverage.out

migrate-up:
@if [ -z "$(MIGRATIONS_DRIVER)" ]; then echo "MIGRATIONS_DRIVER must be set (postgres|mysql|sqlite)"; exit 1; fi
@command -v migrate >/dev/null 2>&1 || { echo "golang-migrate CLI (migrate) is required on PATH"; exit 127; }
migrate -path $(MIGRATIONS_DIR)/$(MIGRATIONS_DRIVER) -database "$(SPIRIT_CONNECTION_URI)" up

migrate-down:
@if [ -z "$(MIGRATIONS_DRIVER)" ]; then echo "MIGRATIONS_DRIVER must be set (postgres|mysql|sqlite)"; exit 1; fi
@command -v migrate >/dev/null 2>&1 || { echo "golang-migrate CLI (migrate) is required on PATH"; exit 127; }
migrate -path $(MIGRATIONS_DIR)/$(MIGRATIONS_DRIVER) -database "$(SPIRIT_CONNECTION_URI)" down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ Pastebins are a type of online content storage service where users can store pla
- [x] Syntax highlighting for all the most popular languages and Raw text mode
- [x] SQLite, MySQL, and PostgreSQL Support
- [x] Basic Auth for private instances
- [ ] Account system
- [ ] Password-protected encrypted pastes
- [ ] Paste collections
- [ ] Reader view mode (Markdown is formatted and word wrapping is enabled)
- [ ] QR Codes

**Vote on future features: [Image/file uploading](https://github.com/lukewhrit/spacebin/discussions/446), [Account system](https://github.com/lukewhrit/spacebin/discussions/447)**

Looking for a URL shortener too? Try [redeyes](https://github.com/lukewhrit/redeyes).
**Vote on future features: [Image/file uploading](https://github.com/lukewhrit/spacebin/discussions/446)**

## Table of Contents

Expand Down
10 changes: 5 additions & 5 deletions cmd/spacebin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ func main() {
}

// Perform migrations
if err := db.Migrate(context.Background()); err != nil {
log.Fatal().
Err(err).
Msg("Failed migrations; Could not create DOCUMENTS tables.")
}
// if err := db.Migrate(context.Background()); err != nil {
// log.Fatal().
// Err(err).
// Msg("Failed migrations; Could not create DOCUMENTS tables.")
// }

// Create a new server and register middleware, security headers, static files, and handlers
m := server.NewServer(&config.Config, db)
Expand Down
48 changes: 24 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
module github.com/lukewhrit/spacebin

go 1.22.4
go 1.25

require (
github.com/caarlos0/env/v9 v9.0.0
github.com/go-chi/chi/v5 v5.1.0
github.com/go-chi/cors v1.2.1
github.com/go-chi/httprate v0.14.1
github.com/go-chi/chi/v5 v5.2.3
github.com/go-chi/cors v1.2.2
github.com/go-chi/httprate v0.15.0
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
github.com/lib/pq v1.10.9
github.com/lukewhrit/phrase v1.0.0
github.com/rs/zerolog v1.33.0
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
github.com/rs/zerolog v1.34.0
github.com/stretchr/testify v1.10.0
golang.org/x/exp v0.0.0-20251209150349-8475f28825e9
)

require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/dlclark/regexp2 v1.11.0 // indirect
github.com/dlclark/regexp2 v1.11.5 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
modernc.org/libc v1.55.3 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.8.0 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
modernc.org/libc v1.67.1 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
)

require (
github.com/alecthomas/chroma/v2 v2.14.0
github.com/alecthomas/chroma/v2 v2.22.0
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-sql-driver/mysql v1.8.1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/go-sql-driver/mysql v1.9.3
github.com/golang-migrate/migrate/v4 v4.19.1
github.com/gomarkdown/markdown v0.0.0-20250810172220-2e2c11897d1a
github.com/kr/pretty v0.3.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.23.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
golang.org/x/crypto v0.46.0
golang.org/x/sys v0.39.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/sqlite v1.32.0
modernc.org/sqlite v1.43.0
)
Loading
Loading