Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a68ebbb
build(nix): replace by bun
anhgelus Feb 10, 2026
6147c50
build(go): install templ as tool
anhgelus Feb 10, 2026
4c66d53
ci(actions): remove build via nix to use native
anhgelus Feb 10, 2026
887e5f6
docs(info): update install method in README
anhgelus Feb 10, 2026
f60fc33
build(just): avoid forcing hivemind, glauth and air if not needed
anhgelus Feb 10, 2026
4d63161
build(js): generate js dynamically
anhgelus Feb 10, 2026
93e9b74
feat(cli): panic instead of logging after a fatal error
anhgelus Feb 10, 2026
cd50995
Merge branch 'build/remove-nix' into refactor/cli
anhgelus Feb 12, 2026
32a258e
refactor(cli): use flag package and simplify arg parsing
anhgelus Feb 12, 2026
ad2c86f
Merge branch 'main' into refactor/cli
anhgelus Feb 12, 2026
255b4c6
refactor(cli): generalize course json creation
anhgelus Feb 12, 2026
2518caf
refactor(cli): generate automatically options based on flags
anhgelus Feb 12, 2026
51708cd
fix(cli): missing case handling in update
anhgelus Feb 12, 2026
8250b85
style(cli): move context to first param
anhgelus Feb 12, 2026
82402ac
fix(cli): using old usage in create
anhgelus Feb 12, 2026
8338a97
refactor(cli): rewrite parse args in polybased
anhgelus Feb 12, 2026
8f52af3
build(go): install air as tool
anhgelus Feb 12, 2026
ff1c778
feat(polybased): generalize context usage and clean
anhgelus Feb 12, 2026
59e4df2
refactor(polybased): use context for auth
anhgelus Feb 12, 2026
b8f1eab
feat(polybased): dev mode to hot reload static files
anhgelus Feb 12, 2026
8496fda
feat(frontend): better colors for badges
anhgelus Feb 12, 2026
460ad6b
feat(frontend): course kind in bold
anhgelus Feb 12, 2026
17b4b66
feat(frontend): increase gap between semesters
anhgelus Feb 12, 2026
d6164e5
feat(frontend): display full semester name
anhgelus Feb 12, 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
4 changes: 2 additions & 2 deletions .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ root = "."
tmp_dir = "target/cache"

[build]
cmd = "templ generate && go build -o target/cache/polybased ./polybased"
full_bin = "./target/cache/polybased -c polybase.cfg"
cmd = "go build -o target/cache/polybased ./polybased"
full_bin = "./target/cache/polybased -c polybase.cfg -skip-ldap -dev"
include_ext = ["go", "templ", "css"]
exclude_dir = ["target"]
exclude_regex = ["_templ\\.go$"]
Expand Down
36 changes: 24 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,50 @@ concurrency:
group: deploy-polybase
cancel-in-progress: false

env:
TARGET_OS: "openbsd"
TARGET_FOLDER: "target"

jobs:
build:
name: Build polybase package
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install nix
uses: cachix/install-nix-action@v22
- name: Install Go
uses: actions/setup-go@v6
with:
nix_path: nixpkgs=channel:nixos-unstable
go-version: '1.25'

- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Install just and scdoc
run: sudo apt install -y just scdoc

- name: Install deps
run: bun i

- name: Build package
run: nix build
- name: Build and publish
run: just publish

- name: Upload build result
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: result
path: result/
path: $TARGET_FOLDER/

deploy:
name: Deploy to openbsd server
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build result
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
name: result
path: result/
path: $TARGET_FOLDER/

- name: Install SSH key
uses: shimataro/ssh-key-action@v2
Expand All @@ -53,5 +65,5 @@ jobs:

- name: Deploy to server
run: |
scp -r result/* ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOSTNAME }}:/tmp/
scp -r $TARGET_FOLDER/* ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOSTNAME }}:/tmp/
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOSTNAME }} 'cd /tmp && sh install.sh'
29 changes: 18 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,34 @@ jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version: 1.23

- name: Code
uses: actions/checkout@v3
go-version: '1.25'

- name: Check diff between gofmt and code
run: diff <(gofmt -d .) <(echo -n)
build:
name: Build polybase package
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install nix
uses: cachix/install-nix-action@v22
- name: Install Go
uses: actions/setup-go@v6
with:
nix_path: nixpkgs=channel:nixos-unstable
go-version: '1.24'

- name: Install Bun
uses: oven-sh/setup-bun@v2

- name: Install just and scdoc
run: sudo apt install -y just scdoc

- name: Install deps
run: bun i

- name: Build package
run: nix build
run: just build
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
/views/*_templ.go
/views/*_templ.txt
/static/css/styles.css
/static/js/
/results
.idea
/result
docker-compose.yml
node_modules
8 changes: 4 additions & 4 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ldap: glauth -c glauth.cfg
tailwind: tailwindcss -w -i static/css/main.css -o static/css/styles.css -m
templ: templ generate --watch --proxy="http://127.0.0.1:8080"
go: air
ldap: just dev-ldap
frontend: just dev-frontend
templ: just dev
go: just dev-air
50 changes: 19 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,41 @@ Self-hosted user database with LDAP authentication.
- `polybased/`: Web interface (Go + HTMX)
- `internal/`: Core backend logic with tests

## Requirements
## Usage

- Go 1.21+
- SQLite
- Tailwind CSS
- Templ
To develop or to build polybase, you must have Go 1.24+ and Bun installed.
We are using `just` as a command runner.

## Nix Users

```shell
nix develop
Build:
```bash
just build
```

## Other Users

Install dependencies:

- `go install github.com/air-verse/air@latest`
- `go install github.com/a-h/templ/cmd/templ@v0.3.906`
- `npm install -g tailwindcss@3`
- requires just, Hivemind, and GLAuth

Build:

```shell
just build
Publish:
```bash
just publish
```

Development:

```shell
just dev # hot reload
```bash
just dev # basic backend
just dev-ldap # ldap
just dev-frontend # frontend
just dev-rw # test high packet loss
just dev-hivemind # if you have hivemind installed (start dev, dev-ldap, dev-frontend and dev-air)
just migrate # initialize database
just clean # remove artifacts
```

## LDAP Development
### LDAP Development

Start GLAuth development LDAP server:

```shell
We use GLAuth as a development LDAP server.
Start it with:
```bash
glauth -c glauth.cfg
```

Test accounts:

Test accounts are:
- `paul:paul*`
- `ionys:ionys*`
- `lydia:lydia*`
Expand Down
Loading
Loading