Showing preview only (710K chars total). Download the full file or copy to clipboard to get everything.
Repository: steveiliop56/tinyauth
Branch: main
Commit: d71a8e03cc4a
Files: 209
Total size: 657.9 KB
Directory structure:
gitextract_u5ucyfy8/
├── .coderabbit.yaml
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── dependabot.yml
│ └── workflows/
│ ├── ci.yml
│ ├── nightly.yml
│ ├── release.yml
│ ├── sponsors.yml
│ └── stale.yml
├── .gitignore
├── .gitmodules
├── .vscode/
│ └── launch.json
├── .zed/
│ └── debug.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Dockerfile
├── Dockerfile.dev
├── Dockerfile.distroless
├── FUNDING.yml
├── LICENSE
├── Makefile
├── README.md
├── SECURITY.md
├── air.toml
├── assets/
│ ├── discohook.json
│ └── logo.xcf
├── cmd/
│ └── tinyauth/
│ ├── create_oidc_client.go
│ ├── create_user.go
│ ├── generate_totp.go
│ ├── healthcheck.go
│ ├── tinyauth.go
│ ├── verify_user.go
│ └── version.go
├── codecov.yml
├── crowdin.yml
├── docker-compose.dev.yml
├── docker-compose.example.yml
├── frontend/
│ ├── .gitignore
│ ├── .prettierignore
│ ├── .prettierrc
│ ├── Dockerfile.dev
│ ├── components.json
│ ├── eslint.config.js
│ ├── index.html
│ ├── package.json
│ ├── public/
│ │ └── site.webmanifest
│ ├── src/
│ │ ├── App.tsx
│ │ ├── components/
│ │ │ ├── auth/
│ │ │ │ ├── login-form.tsx
│ │ │ │ └── totp-form.tsx
│ │ │ ├── domain-warning/
│ │ │ │ └── domain-warning.tsx
│ │ │ ├── icons/
│ │ │ │ ├── github.tsx
│ │ │ │ ├── google.tsx
│ │ │ │ ├── microsoft.tsx
│ │ │ │ ├── oauth.tsx
│ │ │ │ ├── pocket-id.tsx
│ │ │ │ └── tailscale.tsx
│ │ │ ├── language/
│ │ │ │ └── language.tsx
│ │ │ ├── layout/
│ │ │ │ └── layout.tsx
│ │ │ ├── providers/
│ │ │ │ └── theme-provider.tsx
│ │ │ ├── theme-toggle/
│ │ │ │ └── theme-toggle.tsx
│ │ │ └── ui/
│ │ │ ├── button.tsx
│ │ │ ├── card.tsx
│ │ │ ├── dropdown-menu.tsx
│ │ │ ├── form.tsx
│ │ │ ├── input-otp.tsx
│ │ │ ├── input.tsx
│ │ │ ├── label.tsx
│ │ │ ├── oauth-button.tsx
│ │ │ ├── select.tsx
│ │ │ ├── separator.tsx
│ │ │ ├── sonner.tsx
│ │ │ └── tooltip.tsx
│ │ ├── context/
│ │ │ ├── app-context.tsx
│ │ │ └── user-context.tsx
│ │ ├── index.css
│ │ ├── lib/
│ │ │ ├── hooks/
│ │ │ │ ├── oidc.ts
│ │ │ │ └── redirect-uri.ts
│ │ │ ├── i18n/
│ │ │ │ ├── i18n.ts
│ │ │ │ ├── locales/
│ │ │ │ │ ├── af-ZA.json
│ │ │ │ │ ├── ar-SA.json
│ │ │ │ │ ├── ca-ES.json
│ │ │ │ │ ├── cs-CZ.json
│ │ │ │ │ ├── da-DK.json
│ │ │ │ │ ├── de-DE.json
│ │ │ │ │ ├── el-GR.json
│ │ │ │ │ ├── en-US.json
│ │ │ │ │ ├── en.json
│ │ │ │ │ ├── es-ES.json
│ │ │ │ │ ├── fi-FI.json
│ │ │ │ │ ├── fr-FR.json
│ │ │ │ │ ├── he-IL.json
│ │ │ │ │ ├── hu-HU.json
│ │ │ │ │ ├── it-IT.json
│ │ │ │ │ ├── ja-JP.json
│ │ │ │ │ ├── ko-KR.json
│ │ │ │ │ ├── nl-NL.json
│ │ │ │ │ ├── no-NO.json
│ │ │ │ │ ├── pl-PL.json
│ │ │ │ │ ├── pt-BR.json
│ │ │ │ │ ├── pt-PT.json
│ │ │ │ │ ├── ro-RO.json
│ │ │ │ │ ├── ru-RU.json
│ │ │ │ │ ├── sr-SP.json
│ │ │ │ │ ├── sv-SE.json
│ │ │ │ │ ├── tr-TR.json
│ │ │ │ │ ├── uk-UA.json
│ │ │ │ │ ├── vi-VN.json
│ │ │ │ │ ├── zh-CN.json
│ │ │ │ │ └── zh-TW.json
│ │ │ │ └── locales.ts
│ │ │ └── utils.ts
│ │ ├── main.tsx
│ │ ├── pages/
│ │ │ ├── authorize-page.tsx
│ │ │ ├── continue-page.tsx
│ │ │ ├── error-page.tsx
│ │ │ ├── forgot-password-page.tsx
│ │ │ ├── login-page.tsx
│ │ │ ├── logout-page.tsx
│ │ │ ├── not-found-page.tsx
│ │ │ ├── totp-page.tsx
│ │ │ └── unauthorized-page.tsx
│ │ ├── schemas/
│ │ │ ├── app-context-schema.ts
│ │ │ ├── login-schema.ts
│ │ │ ├── oidc-schemas.ts
│ │ │ ├── totp-schema.ts
│ │ │ └── user-context-schema.ts
│ │ └── vite-env.d.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ └── vite.config.ts
├── gen/
│ ├── gen.go
│ ├── gen_env.go
│ └── gen_md.go
├── go.mod
├── go.sum
├── internal/
│ ├── assets/
│ │ ├── assets.go
│ │ └── migrations/
│ │ ├── 000001_init_sqlite.down.sql
│ │ ├── 000001_init_sqlite.up.sql
│ │ ├── 000002_oauth_name.down.sql
│ │ ├── 000002_oauth_name.up.sql
│ │ ├── 000003_oauth_sub.down.sql
│ │ ├── 000003_oauth_sub.up.sql
│ │ ├── 000004_created_at.down.sql
│ │ ├── 000004_created_at.up.sql
│ │ ├── 000005_oidc_session.down.sql
│ │ ├── 000005_oidc_session.up.sql
│ │ ├── 000006_oidc_nonce.down.sql
│ │ └── 000006_oidc_nonce.up.sql
│ ├── bootstrap/
│ │ ├── app_bootstrap.go
│ │ ├── db_bootstrap.go
│ │ ├── router_bootstrap.go
│ │ └── service_bootstrap.go
│ ├── config/
│ │ └── config.go
│ ├── controller/
│ │ ├── context_controller.go
│ │ ├── context_controller_test.go
│ │ ├── health_controller.go
│ │ ├── oauth_controller.go
│ │ ├── oidc_controller.go
│ │ ├── oidc_controller_test.go
│ │ ├── proxy_controller.go
│ │ ├── proxy_controller_test.go
│ │ ├── resources_controller.go
│ │ ├── resources_controller_test.go
│ │ ├── user_controller.go
│ │ ├── user_controller_test.go
│ │ └── well_known_controller.go
│ ├── middleware/
│ │ ├── context_middleware.go
│ │ ├── ui_middleware.go
│ │ └── zerolog_middleware.go
│ ├── repository/
│ │ ├── db.go
│ │ ├── models.go
│ │ ├── oidc_queries.sql.go
│ │ └── session_queries.sql.go
│ ├── service/
│ │ ├── access_controls_service.go
│ │ ├── auth_service.go
│ │ ├── docker_service.go
│ │ ├── generic_oauth_service.go
│ │ ├── github_oauth_service.go
│ │ ├── google_oauth_service.go
│ │ ├── ldap_service.go
│ │ ├── oauth_broker_service.go
│ │ └── oidc_service.go
│ └── utils/
│ ├── app_utils.go
│ ├── app_utils_test.go
│ ├── decoders/
│ │ ├── label_decoder.go
│ │ └── label_decoder_test.go
│ ├── fs_utils.go
│ ├── fs_utils_test.go
│ ├── label_utils.go
│ ├── label_utils_test.go
│ ├── loaders/
│ │ ├── loader_env.go
│ │ ├── loader_file.go
│ │ └── loader_flag.go
│ ├── security_utils.go
│ ├── security_utils_test.go
│ ├── string_utils.go
│ ├── string_utils_test.go
│ ├── tlog/
│ │ ├── log_audit.go
│ │ ├── log_wrapper.go
│ │ └── log_wrapper_test.go
│ ├── user_utils.go
│ └── user_utils_test.go
├── patches/
│ └── nested_maps.diff
├── sql/
│ ├── oidc_queries.sql
│ ├── oidc_schemas.sql
│ ├── session_queries.sql
│ └── session_schemas.sql
└── sqlc.yml
================================================
FILE CONTENTS
================================================
================================================
FILE: .coderabbit.yaml
================================================
issue_enrichment:
auto_enrich:
enabled: false
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help improve Tinyauth
title: "[BUG]"
labels: bug
assignees: steveiliop56
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Logs**
Please include the Tinyauth logs below, make sure to not include sensitive info.
**Device (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Tinyauth [e.g. v2.1.1]
- Docker [e.g. 27.3.1]
**
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: enhancement
assignees: steveiliop56
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "bun"
directory: "/frontend"
groups:
minor-patch:
update-types:
- "patch"
- "minor"
schedule:
interval: "daily"
- package-ecosystem: "gomod"
directory: "/"
groups:
minor-patch:
update-types:
- "patch"
- "minor"
schedule:
interval: "daily"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
================================================
FILE: .github/workflows/ci.yml
================================================
name: Tinyauth CI
on:
push:
branches:
- main
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: "^1.24.0"
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Install frontend dependencies
run: |
cd frontend
bun install --frozen-lockfile
- name: Set version
run: |
echo testing > internal/assets/version
- name: Lint frontend
run: |
cd frontend
bun run lint
- name: Build frontend
run: |
cd frontend
bun run build
- name: Copy frontend
run: |
cp -r frontend/dist internal/assets/dist
- name: Run tests
run: go test -coverprofile=coverage.txt -v ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
================================================
FILE: .github/workflows/nightly.yml
================================================
name: Nightly Release
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Delete old release
run: gh release delete --cleanup-tag --yes nightly || echo release not found
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
- name: Create release
uses: softprops/action-gh-release@v2
with:
prerelease: true
tag_name: nightly
generate-metadata:
runs-on: ubuntu-latest
needs: create-release
outputs:
VERSION: ${{ steps.metadata.outputs.VERSION }}
COMMIT_HASH: ${{ steps.metadata.outputs.COMMIT_HASH }}
BUILD_TIMESTAMP: ${{ steps.metadata.outputs.BUILD_TIMESTAMP }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: nightly
- name: Generate metadata
id: metadata
run: |
echo "VERSION=nightly" >> "$GITHUB_OUTPUT"
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
echo "BUILD_TIMESTAMP=$(date '+%Y-%m-%dT%H:%M:%S')" >> "$GITHUB_OUTPUT"
binary-build:
runs-on: ubuntu-latest
needs:
- create-release
- generate-metadata
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: nightly
- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install go
uses: actions/setup-go@v5
with:
go-version: "^1.24.0"
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Install frontend dependencies
run: |
cd frontend
bun install --frozen-lockfile
- name: Install backend dependencies
run: |
go mod download
- name: Build frontend
run: |
cd frontend
bun run build
- name: Build
run: |
cp -r frontend/dist internal/assets/dist
go build -ldflags "-s -w -X github.com/steveiliop56/tinyauth/internal/config.Version=${{ needs.generate-metadata.outputs.VERSION }} -X github.com/steveiliop56/tinyauth/internal/config.CommitHash=${{ needs.generate-metadata.outputs.COMMIT_HASH }} -X github.com/steveiliop56/tinyauth/internal/config.BuildTimestamp=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}" -o tinyauth-amd64 ./cmd/tinyauth
env:
CGO_ENABLED: 0
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tinyauth-amd64
path: tinyauth-amd64
binary-build-arm:
runs-on: ubuntu-24.04-arm
needs:
- create-release
- generate-metadata
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: nightly
- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install go
uses: actions/setup-go@v5
with:
go-version: "^1.24.0"
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Install frontend dependencies
run: |
cd frontend
bun install --frozen-lockfile
- name: Install backend dependencies
run: |
go mod download
- name: Build frontend
run: |
cd frontend
bun run build
- name: Build
run: |
cp -r frontend/dist internal/assets/dist
go build -ldflags "-s -w -X github.com/steveiliop56/tinyauth/internal/config.Version=${{ needs.generate-metadata.outputs.VERSION }} -X github.com/steveiliop56/tinyauth/internal/config.CommitHash=${{ needs.generate-metadata.outputs.COMMIT_HASH }} -X github.com/steveiliop56/tinyauth/internal/config.BuildTimestamp=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}" -o tinyauth-arm64 ./cmd/tinyauth
env:
CGO_ENABLED: 0
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tinyauth-arm64
path: tinyauth-arm64
image-build:
runs-on: ubuntu-latest
needs:
- create-release
- generate-metadata
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: nightly
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
id: build
with:
platforms: linux/amd64
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/${{ github.repository_owner }}/tinyauth
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha
cache-to: type=gha,mode=max
github-token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
VERSION=${{ needs.generate-metadata.outputs.VERSION }}
COMMIT_HASH=${{ needs.generate-metadata.outputs.COMMIT_HASH }}
BUILD_TIMESTAMP=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-linux-amd64
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
image-build-distroless:
runs-on: ubuntu-latest
needs:
- create-release
- generate-metadata
- image-build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: nightly
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
id: build
with:
platforms: linux/amd64
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/${{ github.repository_owner }}/tinyauth
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
file: Dockerfile.distroless
cache-from: type=gha
cache-to: type=gha,mode=max
github-token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
VERSION=${{ needs.generate-metadata.outputs.VERSION }}
COMMIT_HASH=${{ needs.generate-metadata.outputs.COMMIT_HASH }}
BUILD_TIMESTAMP=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-distroless-linux-amd64
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
image-build-arm:
runs-on: ubuntu-24.04-arm
needs:
- create-release
- generate-metadata
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: nightly
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
id: build
with:
platforms: linux/arm64
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/${{ github.repository_owner }}/tinyauth
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha
cache-to: type=gha,mode=max
github-token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
VERSION=${{ needs.generate-metadata.outputs.VERSION }}
COMMIT_HASH=${{ needs.generate-metadata.outputs.COMMIT_HASH }}
BUILD_TIMESTAMP=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-linux-arm64
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
image-build-arm-distroless:
runs-on: ubuntu-24.04-arm
needs:
- create-release
- generate-metadata
- image-build-arm
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: nightly
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
id: build
with:
platforms: linux/arm64
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/${{ github.repository_owner }}/tinyauth
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
file: Dockerfile.distroless
cache-from: type=gha
cache-to: type=gha,mode=max
github-token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
VERSION=${{ needs.generate-metadata.outputs.VERSION }}
COMMIT_HASH=${{ needs.generate-metadata.outputs.COMMIT_HASH }}
BUILD_TIMESTAMP=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-distroless-linux-arm64
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
image-merge:
runs-on: ubuntu-latest
needs:
- image-build
- image-build-arm
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
flavor: |
latest=false
tags: |
type=raw,nightly
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ github.repository_owner }}/tinyauth@sha256:%s ' *)
image-merge-distroless:
runs-on: ubuntu-latest
needs:
- image-build-distroless
- image-build-arm-distroless
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-distroless-*
merge-multiple: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
flavor: |
latest=false
tags: |
type=raw,nightly-distroless
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ github.repository_owner }}/tinyauth@sha256:%s ' *)
update-release:
runs-on: ubuntu-latest
needs:
- binary-build
- binary-build-arm
steps:
- uses: actions/download-artifact@v4
with:
pattern: tinyauth-*
path: binaries
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v2
with:
files: binaries/*
tag_name: nightly
================================================
FILE: .github/workflows/release.yml
================================================
name: Release
on:
workflow_dispatch:
push:
tags:
- "v*"
jobs:
generate-metadata:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.metadata.outputs.VERSION }}
COMMIT_HASH: ${{ steps.metadata.outputs.COMMIT_HASH }}
BUILD_TIMESTAMP: ${{ steps.metadata.outputs.BUILD_TIMESTAMP }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate metadata
id: metadata
run: |
echo "VERSION=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
echo "BUILD_TIMESTAMP=$(date '+%Y-%m-%dT%H:%M:%S')" >> "$GITHUB_OUTPUT"
binary-build:
runs-on: ubuntu-latest
needs:
- generate-metadata
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install go
uses: actions/setup-go@v5
with:
go-version: "^1.24.0"
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Install frontend dependencies
run: |
cd frontend
bun install --frozen-lockfile
- name: Install backend dependencies
run: |
go mod download
- name: Build frontend
run: |
cd frontend
bun run build
- name: Build
run: |
cp -r frontend/dist internal/assets/dist
go build -ldflags "-s -w -X github.com/steveiliop56/tinyauth/internal/config.Version=${{ needs.generate-metadata.outputs.VERSION }} -X github.com/steveiliop56/tinyauth/internal/config.CommitHash=${{ needs.generate-metadata.outputs.COMMIT_HASH }} -X github.com/steveiliop56/tinyauth/internal/config.BuildTimestamp=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}" -o tinyauth-amd64 ./cmd/tinyauth
env:
CGO_ENABLED: 0
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tinyauth-amd64
path: tinyauth-amd64
binary-build-arm:
runs-on: ubuntu-24.04-arm
needs:
- generate-metadata
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install go
uses: actions/setup-go@v5
with:
go-version: "^1.24.0"
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Install frontend dependencies
run: |
cd frontend
bun install --frozen-lockfile
- name: Install backend dependencies
run: |
go mod download
- name: Build frontend
run: |
cd frontend
bun run build
- name: Build
run: |
cp -r frontend/dist internal/assets/dist
go build -ldflags "-s -w -X github.com/steveiliop56/tinyauth/internal/config.Version=${{ needs.generate-metadata.outputs.VERSION }} -X github.com/steveiliop56/tinyauth/internal/config.CommitHash=${{ needs.generate-metadata.outputs.COMMIT_HASH }} -X github.com/steveiliop56/tinyauth/internal/config.BuildTimestamp=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}" -o tinyauth-arm64 ./cmd/tinyauth
env:
CGO_ENABLED: 0
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tinyauth-arm64
path: tinyauth-arm64
image-build:
runs-on: ubuntu-latest
needs:
- generate-metadata
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
id: build
with:
platforms: linux/amd64
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/${{ github.repository_owner }}/tinyauth
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha
cache-to: type=gha,mode=max
github-token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
VERSION=${{ needs.generate-metadata.outputs.VERSION }}
COMMIT_HASH=${{ needs.generate-metadata.outputs.COMMIT_HASH }}
BUILD_TIMESTAMP=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-linux-amd64
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
image-build-distroless:
runs-on: ubuntu-latest
needs:
- generate-metadata
- image-build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
id: build
with:
platforms: linux/amd64
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/${{ github.repository_owner }}/tinyauth
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
file: Dockerfile.distroless
cache-from: type=gha
cache-to: type=gha,mode=max
github-token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
VERSION=${{ needs.generate-metadata.outputs.VERSION }}
COMMIT_HASH=${{ needs.generate-metadata.outputs.COMMIT_HASH }}
BUILD_TIMESTAMP=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-distroless-linux-amd64
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
image-build-arm:
runs-on: ubuntu-24.04-arm
needs:
- generate-metadata
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
id: build
with:
platforms: linux/arm64
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/${{ github.repository_owner }}/tinyauth
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha
cache-to: type=gha,mode=max
github-token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
VERSION=${{ needs.generate-metadata.outputs.VERSION }}
COMMIT_HASH=${{ needs.generate-metadata.outputs.COMMIT_HASH }}
BUILD_TIMESTAMP=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-linux-arm64
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
image-build-arm-distroless:
runs-on: ubuntu-24.04-arm
needs:
- generate-metadata
- image-build-arm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize submodules
run: |
git submodule init
git submodule update
- name: Apply patches
run: |
git apply --directory paerser/ patches/nested_maps.diff
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
id: build
with:
platforms: linux/arm64
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/${{ github.repository_owner }}/tinyauth
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
file: Dockerfile.distroless
cache-from: type=gha
cache-to: type=gha,mode=max
github-token: ${{ secrets.GITHUB_TOKEN }}
build-args: |
VERSION=${{ needs.generate-metadata.outputs.VERSION }}
COMMIT_HASH=${{ needs.generate-metadata.outputs.COMMIT_HASH }}
BUILD_TIMESTAMP=${{ needs.generate-metadata.outputs.BUILD_TIMESTAMP }}
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-distroless-linux-arm64
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
image-merge:
runs-on: ubuntu-latest
needs:
- image-build
- image-build-arm
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
flavor: |
prefix=v,onlatest=false
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ github.repository_owner }}/tinyauth@sha256:%s ' *)
image-merge-distroless:
runs-on: ubuntu-latest
needs:
- image-build-distroless
- image-build-arm-distroless
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-distroless-*
merge-multiple: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/tinyauth
flavor: |
latest=false
prefix=v
suffix=-distroless
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/${{ github.repository_owner }}/tinyauth@sha256:%s ' *)
update-release:
runs-on: ubuntu-latest
needs:
- binary-build
- binary-build-arm
steps:
- uses: actions/download-artifact@v4
with:
pattern: tinyauth-*
path: binaries
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v2
with:
files: binaries/*
================================================
FILE: .github/workflows/sponsors.yml
================================================
name: Generate Sponsors List
on:
workflow_dispatch:
jobs:
generate-sponsors:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate Sponsors
uses: JamesIves/github-sponsors-readme-action@v1
with:
token: ${{ secrets.SPONSORS_GENERATOR_PAT }}
active-only: false
file: "README.md"
template: '<a href="https://github.com/{{{ login }}}"><img src="{{{ avatarUrl }}}" width="64px" alt="User avatar: {{{ login }}}" /></a> '
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
docs: regenerate readme sponsors list
committer: GitHub <noreply@github.com>
author: GitHub <noreply@github.com>
branch: docs/update-readme
title: |
docs: regenerate readme sponsors list
labels: bot
================================================
FILE: .github/workflows/stale.yml
================================================
name: Close stale issues and PRs
on:
schedule:
- cron: 0 10 * * *
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
days-before-stale: 30
stale-pr-message: This PR has been inactive for 30 days and will be marked as stale.
stale-issue-message: This issue has been inactive for 30 days and will be marked as stale.
close-issue-message: Closed for inactivity.
close-pr-message: Closed for inactivity.
stale-issue-label: stale
stale-pr-label: stale
exempt-issue-labels: pinned
exempt-pr-labels: pinned
================================================
FILE: .gitignore
================================================
# dist
/internal/assets/dist
# binaries
/tinyauth
/tinyauth-arm64
/tinyauth-amd64
# test docker compose
/docker-compose.test*
# users file
/users.txt
# secret test file
/secret*
# apple stuff
.DS_Store
# env
/.env
# tmp directory
/tmp
# data directory
/data
# config file
/config.yml
# binary out
/tinyauth.db
/resources
# debug files
__debug_*
# infisical
/.infisical.json
# traefik data
/traefik
# generated markdown (for docs)
/config.gen.md
# testing config
config.certify.yml
================================================
FILE: .gitmodules
================================================
[submodule "paerser"]
path = paerser
url = https://github.com/traefik/paerser
ignore = all
================================================
FILE: .vscode/launch.json
================================================
{
"version": "0.2.0",
"configurations": [
{
"name": "Connect to server",
"type": "go",
"request": "attach",
"mode": "remote",
"remotePath": "/tinyauth",
"port": 4000,
"host": "127.0.0.1",
"debugAdapter": "legacy"
}
]
}
================================================
FILE: .zed/debug.json
================================================
[
{
"label": "Attach to remote Delve",
"adapter": "Delve",
"mode": "remote",
"remotePath": "/tinyauth",
"request": "attach",
"tcp_connection": {
"host": "127.0.0.1",
"port": 4000,
},
},
]
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
Contributing to Tinyauth is straightforward. Follow the steps below to set up a development server.
## Requirements
- Bun
- Golang v1.24.0 or later
- Git
- Docker
- Make
## Cloning the Repository
Start by cloning the repository:
```sh
git clone https://github.com/steveiliop56/tinyauth
cd tinyauth
```
## Initialize Submodules
The project uses Git submodules for some dependencies, so you need to initialize them with:
```sh
git submodule init
git submodule update
```
## Apply patches
Some of the dependencies must be patched in order to work correctly with the project, you can apply the patches by running:
```sh
git apply --directory paerser/ patches/nested_maps.diff
```
## Installing Requirements
While development occurs within Docker, installing the requirements locally is recommended to avoid import errors. Install the Go dependencies:
```sh
go mod tidy
```
Frontend dependencies can be installed as follows:
```sh
cd frontend/
bun install
```
## Create the `.env` file
Configuration requires an environment file. Copy the `.env.example` file to `.env` and adjust the environment variables as needed.
## Development Workflow
The development workflow is designed to run entirely within Docker, ensuring compatibility with Traefik and eliminating the need for local builds. A recommended setup involves pointing a subdomain to the local machine:
```
*.dev.example.com -> 127.0.0.1
dev.example.com -> 127.0.0.1
```
> [!NOTE]
> A domain from [sslip.io](https://sslip.io) can be used if a custom domain is
unavailable. For example, set the Tinyauth domain to `tinyauth.127.0.0.1.sslip.io` and the whoami domain to `whoami.127.0.0.1.sslip.io`.
Ensure the domains are correctly configured in the development Docker Compose file, then start the development environment:
```sh
make dev
```
In case you need to build the binary locally, you can run:
```sh
make binary
```
> [!NOTE]
> Copying the example `docker-compose.dev.yml` file to `docker-compose.test.yml`
is recommended to prevent accidental commits of sensitive information. The make recipe will automatically use `docker-compose.test.yml` as well as `docker-compose.test.prod.yml` (for the `make prod` recipe) if it exists.
================================================
FILE: Dockerfile
================================================
# Site builder
FROM oven/bun:1.3.10-alpine AS frontend-builder
WORKDIR /frontend
COPY ./frontend/package.json ./
COPY ./frontend/bun.lock ./
RUN bun install --frozen-lockfile
COPY ./frontend/public ./public
COPY ./frontend/src ./src
COPY ./frontend/eslint.config.js ./
COPY ./frontend/index.html ./
COPY ./frontend/tsconfig.json ./
COPY ./frontend/tsconfig.app.json ./
COPY ./frontend/tsconfig.node.json ./
COPY ./frontend/vite.config.ts ./
RUN bun run build
# Builder
FROM golang:1.25-alpine3.21 AS builder
ARG VERSION
ARG COMMIT_HASH
ARG BUILD_TIMESTAMP
WORKDIR /tinyauth
COPY ./paerser ./paerser
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY ./cmd ./cmd
COPY ./internal ./internal
COPY --from=frontend-builder /frontend/dist ./internal/assets/dist
RUN CGO_ENABLED=0 go build -ldflags "-s -w \
-X github.com/steveiliop56/tinyauth/internal/config.Version=${VERSION} \
-X github.com/steveiliop56/tinyauth/internal/config.CommitHash=${COMMIT_HASH} \
-X github.com/steveiliop56/tinyauth/internal/config.BuildTimestamp=${BUILD_TIMESTAMP}" ./cmd/tinyauth
# Runner
FROM alpine:3.23 AS runner
WORKDIR /tinyauth
COPY --from=builder /tinyauth/tinyauth ./
RUN mkdir -p /data
EXPOSE 3000
VOLUME ["/data"]
ENV TINYAUTH_DATABASE_PATH=/data/tinyauth.db
ENV TINYAUTH_RESOURCES_PATH=/data/resources
ENV PATH=$PATH:/tinyauth
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD ["tinyauth", "healthcheck"]
ENTRYPOINT ["tinyauth"]
================================================
FILE: Dockerfile.dev
================================================
FROM golang:1.25-alpine3.21
WORKDIR /tinyauth
COPY ./paerser ./paerser
COPY go.mod ./
COPY go.sum ./
RUN go mod download
RUN go install github.com/air-verse/air@v1.61.7
RUN go install github.com/go-delve/delve/cmd/dlv@latest
COPY ./cmd ./cmd
COPY ./internal ./internal
COPY ./air.toml ./
EXPOSE 3000
ENV TINYAUTH_DATABASE_PATH=/data/tinyauth.db
ENV TINYAUTH_RESOURCES_PATH=/data/resources
ENTRYPOINT ["air", "-c", "air.toml"]
================================================
FILE: Dockerfile.distroless
================================================
# Site builder
FROM oven/bun:1.3.10-alpine AS frontend-builder
WORKDIR /frontend
COPY ./frontend/package.json ./
COPY ./frontend/bun.lock ./
RUN bun install --frozen-lockfile
COPY ./frontend/public ./public
COPY ./frontend/src ./src
COPY ./frontend/eslint.config.js ./
COPY ./frontend/index.html ./
COPY ./frontend/tsconfig.json ./
COPY ./frontend/tsconfig.app.json ./
COPY ./frontend/tsconfig.node.json ./
COPY ./frontend/vite.config.ts ./
RUN bun run build
# Builder
FROM golang:1.25-alpine3.21 AS builder
ARG VERSION
ARG COMMIT_HASH
ARG BUILD_TIMESTAMP
WORKDIR /tinyauth
COPY ./paerser ./paerser
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY ./cmd ./cmd
COPY ./internal ./internal
COPY --from=frontend-builder /frontend/dist ./internal/assets/dist
RUN mkdir -p data
RUN CGO_ENABLED=0 go build -ldflags "-s -w \
-X github.com/steveiliop56/tinyauth/internal/config.Version=${VERSION} \
-X github.com/steveiliop56/tinyauth/internal/config.CommitHash=${COMMIT_HASH} \
-X github.com/steveiliop56/tinyauth/internal/config.BuildTimestamp=${BUILD_TIMESTAMP}" ./cmd/tinyauth
# Runner
FROM gcr.io/distroless/static-debian12:latest AS runner
WORKDIR /tinyauth
COPY --from=builder /tinyauth/tinyauth ./
# Since it's distroless, we need to copy the data directory from the builder stage
COPY --from=builder /tinyauth/data /data
EXPOSE 3000
VOLUME ["/data"]
ENV TINYAUTH_DATABASE_PATH=/data/tinyauth.db
ENV TINYAUTH_RESOURCES_PATH=/data/resources
ENV PATH=$PATH:/tinyauth
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD ["tinyauth", "healthcheck"]
ENTRYPOINT ["tinyauth"]
================================================
FILE: FUNDING.yml
================================================
github: steveiliop56
buy_me_a_coffee: steveiliop56
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is 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. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
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.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
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 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. Use with the GNU Affero General Public License.
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 Affero 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 special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 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 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 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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
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 GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
================================================
FILE: Makefile
================================================
# Go specific stuff
CGO_ENABLED := 0
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
# Build out
TAG_NAME := $(shell git describe --abbrev=0 --exact-match 2> /dev/null || echo "main")
COMMIT_HASH := $(shell git rev-parse HEAD)
BUILD_TIMESTAMP := $(shell date '+%Y-%m-%dT%H:%M:%S')
BIN_NAME := tinyauth-$(GOARCH)
# Development vars
DEV_COMPOSE := $(shell test -f "docker-compose.test.yml" && echo "docker-compose.test.yml" || echo "docker-compose.dev.yml" )
PROD_COMPOSE := $(shell test -f "docker-compose.test.prod.yml" && echo "docker-compose.test.prod.yml" || echo "docker-compose.example.yml" )
# Deps
deps:
bun install --cwd frontend
go mod download
# Clean data
clean-data:
rm -rf data/
# Clean web UI build
clean-webui:
rm -rf internal/assets/dist
rm -rf frontend/dist
# Build the web UI
webui: clean-webui
bun run --cwd frontend build
cp -r frontend/dist internal/assets
# Build the binary
binary: webui
CGO_ENABLED=$(CGO_ENABLED) go build -ldflags "-s -w \
-X github.com/steveiliop56/tinyauth/internal/config.Version=${TAG_NAME} \
-X github.com/steveiliop56/tinyauth/internal/config.CommitHash=${COMMIT_HASH} \
-X github.com/steveiliop56/tinyauth/internal/config.BuildTimestamp=${BUILD_TIMESTAMP}" \
-o ${BIN_NAME} ./cmd/tinyauth
# Build for amd64
binary-linux-amd64:
export BIN_NAME=tinyauth-amd64
export GOARCH=amd64
export GOOS=linux
$(MAKE) binary
# Build for arm64
binary-linux-arm64:
export BIN_NAME=tinyauth-arm64
export GOARCH=arm64
export GOOS=linux
$(MAKE) binary
# Go test
.PHONY: test
test:
go test -v ./...
# Development
dev:
docker compose -f $(DEV_COMPOSE) up --force-recreate --pull=always --remove-orphans --build
# Development - Infisical
dev-infisical:
infisical run --env=dev -- docker compose -f $(DEV_COMPOSE) up --force-recreate --pull=always --remove-orphans --build
# Production
prod:
docker compose -f $(PROD_COMPOSE) up --force-recreate --pull=always --remove-orphans
# Production - Infisical
prod-infisical:
infisical run --env=dev -- docker compose -f $(PROD_COMPOSE) up --force-recreate --pull=always --remove-orphans
# SQL
.PHONY: sql
sql:
sqlc generate
# Go gen
generate:
go run ./gen
================================================
FILE: README.md
================================================
<div align="center">
<img alt="Tinyauth" title="Tinyauth" width="96" src="assets/logo-rounded.png">
<h1>Tinyauth</h1>
<p>The tiniest authentication and authorization server you have ever seen.</p>
</div>
<div align="center">
<img alt="License" src="https://img.shields.io/github/license/steveiliop56/tinyauth">
<img alt="Release" src="https://img.shields.io/github/v/release/steveiliop56/tinyauth">
<img alt="Issues" src="https://img.shields.io/github/issues/steveiliop56/tinyauth">
<img alt="Tinyauth CI" src="https://github.com/steveiliop56/tinyauth/actions/workflows/ci.yml/badge.svg">
<a title="Crowdin" target="_blank" href="https://crowdin.com/project/tinyauth"><img src="https://badges.crowdin.net/tinyauth/localized.svg"></a>
</div>
<br />
Tinyauth is the simplest and tiniest authentication and authorization server you have ever seen. It is designed to both work as an authentication middleware for your apps, offering support for OAuth, LDAP and access-controls, and as a standalone authentication server. It supports all the popular proxies like Traefik, Nginx and Caddy.

> [!WARNING]
> Tinyauth is in active development and configuration may change often. Please make sure to carefully read the release notes before updating.
> [!NOTE]
> This is the main development branch. For the latest stable release, see the [documentation](https://tinyauth.app) or the latest stable tag.
## Getting Started
You can get started with Tinyauth by following the guide in the [documentation](https://tinyauth.app/docs/getting-started). There is also an available [docker-compose](./docker-compose.example.yml) file that has Traefik, Whoami and Tinyauth to demonstrate its capabilities (keep in mind that this file lives in the development branch so it may have updates that are not yet released).
## Demo
If you are still not sure if Tinyauth suits your needs you can try out the [demo](https://demo.tinyauth.app). The default username is `user` and the default password is `password`.
## Documentation
You can find documentation and guides on all of the available configuration of Tinyauth in the [website](https://tinyauth.app).
If you wish to contribute to the documentation head over to the [repository](https://github.com/steveiliop56/tinyauth-docs).
## Discord
Tinyauth has a [Discord](https://discord.gg/eHzVaCzRRd) server. Feel free to hop in to chat about self-hosting, homelabs and of course Tinyauth. See you there!
## Contributing
All contributions to the codebase are welcome! If you have any free time, feel free to pick up an [issue](https://github.com/steveiliop56/tinyauth/issues) or add your own missing features. Make sure to check out the [contributing guide](./CONTRIBUTING.md) for instructions on how to get the development server up and running.
## Localization
If you like, you can help translate Tinyauth into more languages by visiting the [Crowdin](https://crowdin.com/project/tinyauth) page.
## License
Tinyauth is licensed under the GNU General Public License v3.0. TL;DR — You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build & install instructions. For more information about the license check the [license](./LICENSE) file.
## Sponsors
A big thank you to the following people for providing me with more coffee:
<!-- sponsors --><a href="https://github.com/erwinkramer"><img src="https://github.com/erwinkramer.png" width="64px" alt="User avatar: erwinkramer" /></a> <a href="https://github.com/nicotsx"><img src="https://github.com/nicotsx.png" width="64px" alt="User avatar: nicotsx" /></a> <a href="https://github.com/SimpleHomelab"><img src="https://github.com/SimpleHomelab.png" width="64px" alt="User avatar: SimpleHomelab" /></a> <a href="https://github.com/jmadden91"><img src="https://github.com/jmadden91.png" width="64px" alt="User avatar: jmadden91" /></a> <a href="https://github.com/tribor"><img src="https://github.com/tribor.png" width="64px" alt="User avatar: tribor" /></a> <a href="https://github.com/eliasbenb"><img src="https://github.com/eliasbenb.png" width="64px" alt="User avatar: eliasbenb" /></a> <a href="https://github.com/afunworm"><img src="https://github.com/afunworm.png" width="64px" alt="User avatar: afunworm" /></a> <a href="https://github.com/chip-well"><img src="https://github.com/chip-well.png" width="64px" alt="User avatar: chip-well" /></a> <a href="https://github.com/Lancelot-Enguerrand"><img src="https://github.com/Lancelot-Enguerrand.png" width="64px" alt="User avatar: Lancelot-Enguerrand" /></a> <a href="https://github.com/allgoewer"><img src="https://github.com/allgoewer.png" width="64px" alt="User avatar: allgoewer" /></a> <a href="https://github.com/NEANC"><img src="https://github.com/NEANC.png" width="64px" alt="User avatar: NEANC" /></a> <a href="https://github.com/algorist-ahmad"><img src="https://github.com/algorist-ahmad.png" width="64px" alt="User avatar: algorist-ahmad" /></a> <!-- sponsors -->
## Acknowledgements
- **Freepik** for providing the police hat and badge.
- **Renee French** for the original gopher logo.
- **Coderabbit AI** for providing free AI code reviews.
- **Syrhu** for providing the background image of the app.
## Star History
[](https://www.star-history.com/#steveiliop56/tinyauth&Date)
================================================
FILE: SECURITY.md
================================================
# Security Policy
## Supported Versions
It is recommended to use the [latest](https://github.com/steveiliop56/tinyauth/releases/latest) available version of tinyauth. This is because it includes security fixes, new features and dependency updates. Older versions, especially major ones, are not supported and won't receive security or patch updates.
## Reporting a Vulnerability
Due to the nature of this app, it needs to be secure. If you discover any security issues or vulnerabilities in the app please contact me as soon as possible at <steve@doesmycode.work>. Please do not use the issues section to report security issues as I won't be able to patch them in time and they may get exploited by malicious actors.
================================================
FILE: air.toml
================================================
root = "/tinyauth"
tmp_dir = "tmp"
[build]
pre_cmd = ["mkdir -p internal/assets/dist", "mkdir -p /data", "echo 'backend running' > internal/assets/dist/index.html"]
cmd = "CGO_ENABLED=0 go build -gcflags=\"all=-N -l\" -o tmp/tinyauth ./cmd/tinyauth"
bin = "tmp/tinyauth"
full_bin = "dlv --listen :4000 --headless=true --api-version=2 --accept-multiclient --log=true exec tmp/tinyauth --continue --check-go-version=false"
include_ext = ["go"]
exclude_dir = ["internal/assets/dist"]
exclude_regex = [".*_test\\.go"]
stop_on_error = true
[color]
main = "magenta"
watcher = "cyan"
build = "yellow"
runner = "green"
[misc]
clean_on_exit = true
[screen]
clear_on_rebuild = false
keep_scroll = true
================================================
FILE: assets/discohook.json
================================================
{
"content": null,
"embeds": [
{
"title": "Welcome to Tinyauth Discord!",
"description": "Tinyauth is a simple authentication middleware that adds a simple login screen or OAuth with Google, Github and any provider to all of your docker apps. It supports all the popular proxies like Traefik, Nginx and Caddy.\n\n**Information**\n\n• Github: <https://github.com/steveiliop56/tinyauth>\n• Website: <https://tinyauth.app>",
"url": "https://tinyauth.app",
"color": 7002085,
"author": {
"name": "Tinyauth"
},
"footer": {
"text": "Updated at"
},
"timestamp": "2025-06-06T12:25:27.629Z",
"thumbnail": {
"url": "https://github.com/steveiliop56/tinyauth/blob/main/assets/logo.png?raw=true"
}
}
],
"attachments": []
}
================================================
FILE: cmd/tinyauth/create_oidc_client.go
================================================
package main
import (
"errors"
"fmt"
"regexp"
"strings"
"github.com/google/uuid"
"github.com/steveiliop56/tinyauth/internal/utils"
"github.com/traefik/paerser/cli"
)
func createOidcClientCmd() *cli.Command {
return &cli.Command{
Name: "create",
Description: "Create a new OIDC Client",
Configuration: nil,
Resources: nil,
AllowArg: true,
Run: func(args []string) error {
if len(args) == 0 {
return errors.New("client name is required. use tinyauth oidc create <name>")
}
clientName := args[0]
match, err := regexp.MatchString("^[a-zA-Z0-9-]*$", clientName)
if !match || err != nil {
return errors.New("client name can only contain alphanumeric characters and hyphens")
}
uuid := uuid.New()
clientId := uuid.String()
clientSecret := "ta-" + utils.GenerateString(61)
uclientName := strings.ToUpper(clientName)
lclientName := strings.ToLower(clientName)
builder := strings.Builder{}
// header
fmt.Fprintf(&builder, "Created credentials for client %s\n\n", clientName)
// credentials
fmt.Fprintf(&builder, "Client Name: %s\n", clientName)
fmt.Fprintf(&builder, "Client ID: %s\n", clientId)
fmt.Fprintf(&builder, "Client Secret: %s\n\n", clientSecret)
// env variables
fmt.Fprint(&builder, "Environment variables:\n\n")
fmt.Fprintf(&builder, "TINYAUTH_OIDC_CLIENTS_%s_CLIENTID=%s\n", uclientName, clientId)
fmt.Fprintf(&builder, "TINYAUTH_OIDC_CLIENTS_%s_CLIENTSECRET=%s\n", uclientName, clientSecret)
fmt.Fprintf(&builder, "TINYAUTH_OIDC_CLIENTS_%s_NAME=%s\n\n", uclientName, utils.Capitalize(lclientName))
// cli flags
fmt.Fprint(&builder, "CLI flags:\n\n")
fmt.Fprintf(&builder, "--oidc.clients.%s.clientid=%s\n", lclientName, clientId)
fmt.Fprintf(&builder, "--oidc.clients.%s.clientsecret=%s\n", lclientName, clientSecret)
fmt.Fprintf(&builder, "--oidc.clients.%s.name=%s\n\n", lclientName, utils.Capitalize(lclientName))
// footer
fmt.Fprintln(&builder, "You can use either option to configure your OIDC client. Make sure to save these credentials as there is no way to regenerate them.")
// print
out := builder.String()
fmt.Print(out)
return nil
},
}
}
================================================
FILE: cmd/tinyauth/create_user.go
================================================
package main
import (
"errors"
"fmt"
"strings"
"github.com/charmbracelet/huh"
"github.com/steveiliop56/tinyauth/internal/utils/tlog"
"github.com/traefik/paerser/cli"
"golang.org/x/crypto/bcrypt"
)
type CreateUserConfig struct {
Interactive bool `description:"Create a user interactively."`
Docker bool `description:"Format output for docker."`
Username string `description:"Username."`
Password string `description:"Password."`
}
func NewCreateUserConfig() *CreateUserConfig {
return &CreateUserConfig{
Interactive: false,
Docker: false,
Username: "",
Password: "",
}
}
func createUserCmd() *cli.Command {
tCfg := NewCreateUserConfig()
loaders := []cli.ResourceLoader{
&cli.FlagLoader{},
}
return &cli.Command{
Name: "create",
Description: "Create a user",
Configuration: tCfg,
Resources: loaders,
Run: func(_ []string) error {
tlog.NewSimpleLogger().Init()
if tCfg.Interactive {
form := huh.NewForm(
huh.NewGroup(
huh.NewInput().Title("Username").Value(&tCfg.Username).Validate((func(s string) error {
if s == "" {
return errors.New("username cannot be empty")
}
return nil
})),
huh.NewInput().Title("Password").Value(&tCfg.Password).Validate((func(s string) error {
if s == "" {
return errors.New("password cannot be empty")
}
return nil
})),
huh.NewSelect[bool]().Title("Format the output for Docker?").Options(huh.NewOption("Yes", true), huh.NewOption("No", false)).Value(&tCfg.Docker),
),
)
var baseTheme *huh.Theme = huh.ThemeBase()
err := form.WithTheme(baseTheme).Run()
if err != nil {
return fmt.Errorf("failed to run interactive prompt: %w", err)
}
}
if tCfg.Username == "" || tCfg.Password == "" {
return errors.New("username and password cannot be empty")
}
tlog.App.Info().Str("username", tCfg.Username).Msg("Creating user")
passwd, err := bcrypt.GenerateFromPassword([]byte(tCfg.Password), bcrypt.DefaultCost)
if err != nil {
return fmt.Errorf("failed to hash password: %w", err)
}
// If docker format is enabled, escape the dollar sign
passwdStr := string(passwd)
if tCfg.Docker {
passwdStr = strings.ReplaceAll(passwdStr, "$", "$$")
}
tlog.App.Info().Str("user", fmt.Sprintf("%s:%s", tCfg.Username, passwdStr)).Msg("User created")
return nil
},
}
}
================================================
FILE: cmd/tinyauth/generate_totp.go
================================================
package main
import (
"errors"
"fmt"
"os"
"strings"
"github.com/steveiliop56/tinyauth/internal/utils"
"github.com/steveiliop56/tinyauth/internal/utils/tlog"
"github.com/charmbracelet/huh"
"github.com/mdp/qrterminal/v3"
"github.com/pquerna/otp/totp"
"github.com/traefik/paerser/cli"
)
type GenerateTotpConfig struct {
Interactive bool `description:"Generate a TOTP secret interactively."`
User string `description:"Your current user (username:hash)."`
}
func NewGenerateTotpConfig() *GenerateTotpConfig {
return &GenerateTotpConfig{
Interactive: false,
User: "",
}
}
func generateTotpCmd() *cli.Command {
tCfg := NewGenerateTotpConfig()
loaders := []cli.ResourceLoader{
&cli.FlagLoader{},
}
return &cli.Command{
Name: "generate",
Description: "Generate a TOTP secret",
Configuration: tCfg,
Resources: loaders,
Run: func(_ []string) error {
tlog.NewSimpleLogger().Init()
if tCfg.Interactive {
form := huh.NewForm(
huh.NewGroup(
huh.NewInput().Title("Current user (username:hash)").Value(&tCfg.User).Validate((func(s string) error {
if s == "" {
return errors.New("user cannot be empty")
}
return nil
})),
),
)
var baseTheme *huh.Theme = huh.ThemeBase()
err := form.WithTheme(baseTheme).Run()
if err != nil {
return fmt.Errorf("failed to run interactive prompt: %w", err)
}
}
user, err := utils.ParseUser(tCfg.User)
if err != nil {
return fmt.Errorf("failed to parse user: %w", err)
}
docker := false
if strings.Contains(tCfg.User, "$$") {
docker = true
}
if user.TotpSecret != "" {
return fmt.Errorf("user already has a TOTP secret")
}
key, err := totp.Generate(totp.GenerateOpts{
Issuer: "Tinyauth",
AccountName: user.Username,
})
if err != nil {
return fmt.Errorf("failed to generate TOTP secret: %w", err)
}
secret := key.Secret()
tlog.App.Info().Str("secret", secret).Msg("Generated TOTP secret")
tlog.App.Info().Msg("Generated QR code")
config := qrterminal.Config{
Level: qrterminal.L,
Writer: os.Stdout,
BlackChar: qrterminal.BLACK,
WhiteChar: qrterminal.WHITE,
QuietZone: 2,
}
qrterminal.GenerateWithConfig(key.URL(), config)
user.TotpSecret = secret
// If using docker escape re-escape it
if docker {
user.Password = strings.ReplaceAll(user.Password, "$", "$$")
}
tlog.App.Info().Str("user", fmt.Sprintf("%s:%s:%s", user.Username, user.Password, user.TotpSecret)).Msg("Add the totp secret to your authenticator app then use the verify command to ensure everything is working correctly.")
return nil
},
}
}
================================================
FILE: cmd/tinyauth/healthcheck.go
================================================
package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"os"
"time"
"github.com/steveiliop56/tinyauth/internal/utils/tlog"
"github.com/traefik/paerser/cli"
)
type healthzResponse struct {
Status string `json:"status"`
Message string `json:"message"`
}
func healthcheckCmd() *cli.Command {
return &cli.Command{
Name: "healthcheck",
Description: "Perform a health check",
Configuration: nil,
Resources: nil,
AllowArg: true,
Run: func(args []string) error {
tlog.NewSimpleLogger().Init()
srvAddr := os.Getenv("TINYAUTH_SERVER_ADDRESS")
if srvAddr == "" {
srvAddr = "127.0.0.1"
}
srvPort := os.Getenv("TINYAUTH_SERVER_PORT")
if srvPort == "" {
srvPort = "3000"
}
appUrl := fmt.Sprintf("http://%s:%s", srvAddr, srvPort)
if len(args) > 0 {
appUrl = args[0]
}
if appUrl == "" {
return errors.New("Could not determine app URL")
}
tlog.App.Info().Str("app_url", appUrl).Msg("Performing health check")
client := http.Client{
Timeout: 30 * time.Second,
}
req, err := http.NewRequest("GET", appUrl+"/api/healthz", nil)
if err != nil {
return fmt.Errorf("failed to create request: %w", err)
}
resp, err := client.Do(req)
if err != nil {
return fmt.Errorf("failed to perform request: %w", err)
}
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("service is not healthy, got: %s", resp.Status)
}
defer resp.Body.Close()
var healthResp healthzResponse
body, err := io.ReadAll(resp.Body)
if err != nil {
return fmt.Errorf("failed to read response: %w", err)
}
err = json.Unmarshal(body, &healthResp)
if err != nil {
return fmt.Errorf("failed to decode response: %w", err)
}
tlog.App.Info().Interface("response", healthResp).Msg("Tinyauth is healthy")
return nil
},
}
}
================================================
FILE: cmd/tinyauth/tinyauth.go
================================================
package main
import (
"fmt"
"github.com/steveiliop56/tinyauth/internal/bootstrap"
"github.com/steveiliop56/tinyauth/internal/config"
"github.com/steveiliop56/tinyauth/internal/utils/loaders"
"github.com/steveiliop56/tinyauth/internal/utils/tlog"
"github.com/rs/zerolog/log"
"github.com/traefik/paerser/cli"
)
func main() {
tConfig := config.NewDefaultConfiguration()
loaders := []cli.ResourceLoader{
&loaders.FileLoader{},
&loaders.FlagLoader{},
&loaders.EnvLoader{},
}
cmdTinyauth := &cli.Command{
Name: "tinyauth",
Description: "The simplest way to protect your apps with a login screen",
Configuration: tConfig,
Resources: loaders,
Run: func(_ []string) error {
return runCmd(*tConfig)
},
}
cmdUser := &cli.Command{
Name: "user",
Description: "Manage Tinyauth users",
}
cmdTotp := &cli.Command{
Name: "totp",
Description: "Manage Tinyauth TOTP users",
}
cmdOidc := &cli.Command{
Name: "oidc",
Description: "Manage Tinyauth OIDC clients",
}
err := cmdTinyauth.AddCommand(versionCmd())
if err != nil {
log.Fatal().Err(err).Msg("Failed to add version command")
}
err = cmdUser.AddCommand(verifyUserCmd())
if err != nil {
log.Fatal().Err(err).Msg("Failed to add verify command")
}
err = cmdTinyauth.AddCommand(healthcheckCmd())
if err != nil {
log.Fatal().Err(err).Msg("Failed to add healthcheck command")
}
err = cmdTotp.AddCommand(generateTotpCmd())
if err != nil {
log.Fatal().Err(err).Msg("Failed to add generate command")
}
err = cmdUser.AddCommand(createUserCmd())
if err != nil {
log.Fatal().Err(err).Msg("Failed to add create command")
}
err = cmdOidc.AddCommand(createOidcClientCmd())
if err != nil {
log.Fatal().Err(err).Msg("Failed to add create command")
}
err = cmdTinyauth.AddCommand(cmdUser)
if err != nil {
log.Fatal().Err(err).Msg("Failed to add user command")
}
err = cmdTinyauth.AddCommand(cmdTotp)
if err != nil {
log.Fatal().Err(err).Msg("Failed to add totp command")
}
err = cmdTinyauth.AddCommand(cmdOidc)
if err != nil {
log.Fatal().Err(err).Msg("Failed to add oidc command")
}
err = cli.Execute(cmdTinyauth)
if err != nil {
log.Fatal().Err(err).Msg("Failed to execute command")
}
}
func runCmd(cfg config.Config) error {
logger := tlog.NewLogger(cfg.Log)
logger.Init()
tlog.App.Info().Str("version", config.Version).Msg("Starting tinyauth")
app := bootstrap.NewBootstrapApp(cfg)
err := app.Setup()
if err != nil {
return fmt.Errorf("failed to bootstrap app: %w", err)
}
return nil
}
================================================
FILE: cmd/tinyauth/verify_user.go
================================================
package main
import (
"errors"
"fmt"
"github.com/steveiliop56/tinyauth/internal/utils"
"github.com/steveiliop56/tinyauth/internal/utils/tlog"
"github.com/charmbracelet/huh"
"github.com/pquerna/otp/totp"
"github.com/traefik/paerser/cli"
"golang.org/x/crypto/bcrypt"
)
type VerifyUserConfig struct {
Interactive bool `description:"Validate a user interactively."`
Username string `description:"Username."`
Password string `description:"Password."`
Totp string `description:"TOTP code."`
User string `description:"Hash (username:hash:totp)."`
}
func NewVerifyUserConfig() *VerifyUserConfig {
return &VerifyUserConfig{
Interactive: false,
Username: "",
Password: "",
Totp: "",
User: "",
}
}
func verifyUserCmd() *cli.Command {
tCfg := NewVerifyUserConfig()
loaders := []cli.ResourceLoader{
&cli.FlagLoader{},
}
return &cli.Command{
Name: "verify",
Description: "Verify a user is set up correctly",
Configuration: tCfg,
Resources: loaders,
Run: func(_ []string) error {
tlog.NewSimpleLogger().Init()
if tCfg.Interactive {
form := huh.NewForm(
huh.NewGroup(
huh.NewInput().Title("User (username:hash:totp)").Value(&tCfg.User).Validate((func(s string) error {
if s == "" {
return errors.New("user cannot be empty")
}
return nil
})),
huh.NewInput().Title("Username").Value(&tCfg.Username).Validate((func(s string) error {
if s == "" {
return errors.New("username cannot be empty")
}
return nil
})),
huh.NewInput().Title("Password").Value(&tCfg.Password).Validate((func(s string) error {
if s == "" {
return errors.New("password cannot be empty")
}
return nil
})),
huh.NewInput().Title("TOTP Code (optional)").Value(&tCfg.Totp),
),
)
var baseTheme *huh.Theme = huh.ThemeBase()
err := form.WithTheme(baseTheme).Run()
if err != nil {
return fmt.Errorf("failed to run interactive prompt: %w", err)
}
}
user, err := utils.ParseUser(tCfg.User)
if err != nil {
return fmt.Errorf("failed to parse user: %w", err)
}
if user.Username != tCfg.Username {
return fmt.Errorf("username is incorrect")
}
err = bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(tCfg.Password))
if err != nil {
return fmt.Errorf("password is incorrect: %w", err)
}
if user.TotpSecret == "" {
if tCfg.Totp != "" {
tlog.App.Warn().Msg("User does not have TOTP secret")
}
tlog.App.Info().Msg("User verified")
return nil
}
ok := totp.Validate(tCfg.Totp, user.TotpSecret)
if !ok {
return fmt.Errorf("TOTP code incorrect")
}
tlog.App.Info().Msg("User verified")
return nil
},
}
}
================================================
FILE: cmd/tinyauth/version.go
================================================
package main
import (
"fmt"
"github.com/steveiliop56/tinyauth/internal/config"
"github.com/traefik/paerser/cli"
)
func versionCmd() *cli.Command {
return &cli.Command{
Name: "version",
Description: "Print the version number of Tinyauth",
Configuration: nil,
Resources: nil,
Run: func(_ []string) error {
fmt.Printf("Version: %s\n", config.Version)
fmt.Printf("Commit Hash: %s\n", config.CommitHash)
fmt.Printf("Build Timestamp: %s\n", config.BuildTimestamp)
return nil
},
}
}
================================================
FILE: codecov.yml
================================================
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
================================================
FILE: crowdin.yml
================================================
"base_path": "."
"base_url": "https://api.crowdin.com"
"preserve_hierarchy": true
files:
[
{
"source": "/frontend/src/lib/i18n/locales/en.json",
"translation": "/frontend/src/lib/i18n/locales/%locale%.json",
},
]
================================================
FILE: docker-compose.dev.yml
================================================
services:
traefik:
image: traefik:v3.6
command: --api.insecure=true --providers.docker
ports:
- 80:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock
whoami:
image: traefik/whoami:latest
labels:
traefik.enable: true
traefik.http.routers.whoami.rule: Host(`whoami.127.0.0.1.sslip.io`)
traefik.http.routers.whoami.middlewares: tinyauth
tinyauth-frontend:
build:
context: .
dockerfile: frontend/Dockerfile.dev
volumes:
- ./frontend/src:/frontend/src
ports:
- 5173:5173
labels:
traefik.enable: true
traefik.http.routers.tinyauth.rule: Host(`tinyauth.127.0.0.1.sslip.io`)
tinyauth-backend:
build:
context: .
dockerfile: Dockerfile.dev
args:
- VERSION=development
- COMMIT_HASH=development
- BUILD_TIMESTAMP=000-00-00T00:00:00Z
env_file: .env
volumes:
- ./internal:/tinyauth/internal
- ./cmd:/tinyauth/cmd
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/data
ports:
- 3000:3000
- 4000:4000
labels:
traefik.enable: true
traefik.http.middlewares.tinyauth.forwardauth.address: http://tinyauth-backend:3000/api/auth/traefik
traefik.http.middlewares.tinyauth.forwardauth.authResponseHeaders: remote-user, remote-sub, remote-name, remote-email, remote-groups
================================================
FILE: docker-compose.example.yml
================================================
services:
traefik:
image: traefik:v3.6
command: --api.insecure=true --providers.docker
ports:
- 80:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock
whoami:
image: traefik/whoami:latest
labels:
traefik.enable: true
traefik.http.routers.whoami.rule: Host(`whoami.example.com`)
traefik.http.routers.whoami.middlewares: tinyauth
tinyauth:
image: ghcr.io/steveiliop56/tinyauth:v5
environment:
- TINYAUTH_APPURL=https://tinyauth.example.com
- TINYAUTH_AUTH_USERS=user:$$2a$$10$$UdLYoJ5lgPsC0RKqYH/jMua7zIn0g9kPqWmhYayJYLaZQ/FTmH2/u # user:password
volumes:
- ./data:/data
labels:
traefik.enable: true
traefik.http.routers.tinyauth.rule: Host(`tinyauth.example.com`)
traefik.http.middlewares.tinyauth.forwardauth.address: http://tinyauth:3000/api/auth/traefik
================================================
FILE: frontend/.gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# Stats out
stats.html
================================================
FILE: frontend/.prettierignore
================================================
# Ignore artifacts:
dist
node_modules
bun.lock
package.json
src/lib/i18n/locales
================================================
FILE: frontend/.prettierrc
================================================
{}
================================================
FILE: frontend/Dockerfile.dev
================================================
FROM oven/bun:1.2.16-alpine
WORKDIR /frontend
COPY ./frontend/package.json ./
COPY ./frontend/bun.lock ./
RUN bun install
COPY ./frontend/public ./public
COPY ./frontend/src ./src
COPY ./frontend/eslint.config.js ./
COPY ./frontend/index.html ./
COPY ./frontend/tsconfig.json ./
COPY ./frontend/tsconfig.app.json ./
COPY ./frontend/tsconfig.node.json ./
COPY ./frontend/vite.config.ts ./
EXPOSE 5173
ENTRYPOINT ["bun", "run", "dev"]
================================================
FILE: frontend/components.json
================================================
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
================================================
FILE: frontend/eslint.config.js
================================================
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import pluginQuery from "@tanstack/eslint-plugin-query";
export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
"@tanstack/query": pluginQuery,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@tanstack/query/exhaustive-deps": "error",
},
},
);
================================================
FILE: frontend/index.html
================================================
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<meta name="apple-mobile-web-app-title" content="Tinyauth" />
<meta name="robots" content="nofollow, noindex" />
<link rel="manifest" href="/site.webmanifest" />
<title>Tinyauth</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
================================================
FILE: frontend/package.json
================================================
{
"name": "tinyauth",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"tsc": "tsc -b"
},
"dependencies": {
"@hookform/resolvers": "^5.2.2",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-label": "^2.1.8",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-separator": "^1.1.8",
"@radix-ui/react-slot": "^1.2.4",
"@tailwindcss/vite": "^4.2.1",
"@tanstack/react-query": "^5.90.21",
"axios": "^1.13.6",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"i18next": "^25.8.18",
"i18next-browser-languagedetector": "^8.2.1",
"i18next-resources-to-backend": "^1.2.1",
"input-otp": "^1.4.2",
"lucide-react": "^0.577.0",
"next-themes": "^0.4.6",
"radix-ui": "^1.4.3",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-hook-form": "^7.71.2",
"react-i18next": "^16.5.8",
"react-markdown": "^10.1.0",
"react-router": "^7.13.1",
"sonner": "^2.0.7",
"tailwind-merge": "^3.5.0",
"tailwindcss": "^4.2.1",
"zod": "^4.3.6"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@tanstack/eslint-plugin-query": "^5.91.4",
"@types/node": "^25.5.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.4",
"eslint": "^10.0.3",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.4.0",
"prettier": "3.8.1",
"rollup-plugin-visualizer": "^7.0.1",
"tw-animate-css": "^1.4.0",
"typescript": "~5.9.3",
"typescript-eslint": "^8.57.0",
"vite": "^7.3.1"
}
}
================================================
FILE: frontend/public/site.webmanifest
================================================
{
"name": "Tinyauth",
"short_name": "Tinyauth",
"icons": [
{
"src": "/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#171717",
"background_color": "#171717",
"display": "standalone"
}
================================================
FILE: frontend/src/App.tsx
================================================
import { Navigate } from "react-router";
import { useUserContext } from "./context/user-context";
export const App = () => {
const { isLoggedIn } = useUserContext();
if (isLoggedIn) {
return <Navigate to="/logout" replace />;
}
return <Navigate to="/login" replace />;
};
================================================
FILE: frontend/src/components/auth/login-form.tsx
================================================
import { useTranslation } from "react-i18next";
import { Input } from "../ui/input";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "../ui/form";
import { loginSchema, LoginSchema } from "@/schemas/login-schema";
import z from "zod";
interface Props {
onSubmit: (data: LoginSchema) => void;
loading?: boolean;
formId?: string;
}
export const LoginForm = (props: Props) => {
const { onSubmit, loading, formId } = props;
const { t } = useTranslation();
z.config({
customError: (iss) =>
iss.input === undefined ? t("fieldRequired") : t("invalidInput"),
});
const form = useForm<LoginSchema>({
resolver: zodResolver(loginSchema),
});
return (
<Form {...form}>
<form id={formId} onSubmit={form.handleSubmit(onSubmit)}>
<FormField
control={form.control}
name="username"
render={({ field }) => (
<FormItem className="mb-4 gap-0">
<FormLabel className="mb-2">{t("loginUsername")}</FormLabel>
<FormControl className="mb-1">
<Input
placeholder={t("loginUsername").toLocaleLowerCase()}
disabled={loading}
autoComplete="username"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="password"
render={({ field }) => (
<FormItem className="gap-0">
<div className="relative mb-1">
<FormLabel className="mb-2">{t("loginPassword")}</FormLabel>
<FormControl>
<Input
placeholder={t("loginPassword").toLowerCase()}
type="password"
disabled={loading}
autoComplete="current-password"
{...field}
/>
</FormControl>
<a
href="/forgot-password"
className="text-muted-foreground hover:text-muted-foreground/80 text-sm absolute right-0 bottom-[2.565rem]" // 2.565 is *just* perfect
>
{t("forgotPasswordTitle")}
</a>
</div>
<FormMessage />
</FormItem>
)}
/>
</form>
</Form>
);
};
================================================
FILE: frontend/src/components/auth/totp-form.tsx
================================================
import { Form, FormControl, FormField, FormItem } from "../ui/form";
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "../ui/input-otp";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { totpSchema, TotpSchema } from "@/schemas/totp-schema";
import { useTranslation } from "react-i18next";
import z from "zod";
interface Props {
formId: string;
onSubmit: (code: TotpSchema) => void;
}
export const TotpForm = (props: Props) => {
const { formId, onSubmit } = props;
const { t } = useTranslation();
z.config({
customError: (iss) =>
iss.input === undefined ? t("fieldRequired") : t("invalidInput"),
});
const form = useForm<TotpSchema>({
resolver: zodResolver(totpSchema),
});
const handleChange = (value: string) => {
form.setValue("code", value, { shouldDirty: true, shouldValidate: true });
if (value.length === 6) {
onSubmit({ code: value });
}
};
return (
<Form {...form}>
<form id={formId} onSubmit={form.handleSubmit(onSubmit)}>
<FormField
control={form.control}
name="code"
render={({ field }) => (
<FormItem>
<FormControl>
<InputOTP
maxLength={6}
{...field}
autoComplete="one-time-code"
autoFocus
onChange={handleChange}
>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
</FormControl>
</FormItem>
)}
/>
</form>
</Form>
);
};
================================================
FILE: frontend/src/components/domain-warning/domain-warning.tsx
================================================
import {
Card,
CardContent,
CardFooter,
CardHeader,
CardTitle,
} from "../ui/card";
import { Button } from "../ui/button";
import { useTranslation } from "react-i18next";
import { useLocation } from "react-router";
interface Props {
onClick: () => void;
appUrl: string;
currentUrl: string;
}
export const DomainWarning = (props: Props) => {
const { onClick, appUrl, currentUrl } = props;
const { t } = useTranslation();
const { search } = useLocation();
const searchParams = new URLSearchParams(search);
return (
<Card role="alert" aria-live="assertive">
<CardHeader>
<CardTitle className="text-xl">{t("domainWarningTitle")}</CardTitle>
</CardHeader>
<CardContent className="flex flex-col gap-3 text-sm mb-1.25">
<p className="text-muted-foreground">{t("domainWarningSubtitle")}</p>
<pre>
<span className="text-muted-foreground">
{t("domainWarningExpected")}
<span className="text-primary">{appUrl}</span>
</span>
</pre>
<pre>
<span className="text-muted-foreground">
{t("domainWarningCurrent")}
<span className="text-primary">{currentUrl}</span>
</span>
</pre>
</CardContent>
<CardFooter className="flex flex-col items-stretch gap-3">
<Button
onClick={() =>
window.location.assign(`${appUrl}/login?${searchParams.toString()}`)
}
variant="outline"
>
{t("goToCorrectDomainTitle")}
</Button>
<Button onClick={onClick} variant="warning">
{t("ignoreTitle")}
</Button>
</CardFooter>
</Card>
);
};
================================================
FILE: frontend/src/components/icons/github.tsx
================================================
import type { SVGProps } from "react";
export function GithubIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={24}
height={24}
viewBox="0 0 24 24"
{...props}
>
<path
fill="currentColor"
d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"
></path>
</svg>
);
}
================================================
FILE: frontend/src/components/icons/google.tsx
================================================
import type { SVGProps } from "react";
export function GoogleIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={256}
height={262}
viewBox="0 0 256 262"
{...props}
>
<path
fill="#4285f4"
d="M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622l38.755 30.023l2.685.268c24.659-22.774 38.875-56.282 38.875-96.027"
></path>
<path
fill="#34a853"
d="M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055c-34.523 0-63.824-22.773-74.269-54.25l-1.531.13l-40.298 31.187l-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1"
></path>
<path
fill="#fbbc05"
d="M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82c0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602z"
></path>
<path
fill="#eb4335"
d="M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251"
></path>
</svg>
);
}
================================================
FILE: frontend/src/components/icons/microsoft.tsx
================================================
import type { SVGProps } from "react";
export function MicrosoftIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="2em"
height="2em"
viewBox="0 0 256 256"
{...props}
>
<path fill="#f1511b" d="M121.666 121.666H0V0h121.666z"></path>
<path fill="#80cc28" d="M256 121.666H134.335V0H256z"></path>
<path fill="#00adef" d="M121.663 256.002H0V134.336h121.663z"></path>
<path fill="#fbbc09" d="M256 256.002H134.335V134.336H256z"></path>
</svg>
);
}
================================================
FILE: frontend/src/components/icons/oauth.tsx
================================================
import type { SVGProps } from "react";
export function OAuthIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={24}
height={24}
viewBox="0 0 24 24"
{...props}
>
<g
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
>
<path d="M2 12a10 10 0 1 0 20 0a10 10 0 1 0-20 0"></path>
<path d="M12.556 6c.65 0 1.235.373 1.508.947l2.839 7.848a1.646 1.646 0 0 1-1.01 2.108a1.673 1.673 0 0 1-2.068-.851L13.365 15h-2.73l-.398.905A1.67 1.67 0 0 1 8.26 16.95l-.153-.047a1.647 1.647 0 0 1-1.056-1.956l2.824-7.852a1.66 1.66 0 0 1 1.409-1.087z"></path>
</g>
</svg>
);
}
================================================
FILE: frontend/src/components/icons/pocket-id.tsx
================================================
import type { SVGProps } from "react";
export function PocketIDIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
xmlSpace="preserve"
width={512}
height={512}
viewBox="0 0 512 512"
{...props}
>
<circle cx="256" cy="256" r="256" />
<path
d="M268.6 102.4c64.4 0 116.8 52.4 116.8 116.7 0 25.3-8 49.4-23 69.6-14.8 19.9-35 34.3-58.4 41.7l-6.5 2-15.5-76.2 4.3-2c14-6.7 23-21.1 23-36.6 0-22.4-18.2-40.6-40.6-40.6S228 195.2 228 217.6c0 15.5 9 29.8 23 36.6l4.2 2-25 153.4h-69.5V102.4z"
className="fill-white"
/>
</svg>
);
}
================================================
FILE: frontend/src/components/icons/tailscale.tsx
================================================
import type { SVGProps } from "react";
export function TailscaleIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
xmlSpace="preserve"
width={512}
height={512}
viewBox="0 0 512 512"
{...props}
>
<path
className="opacity-80"
fill="currentColor"
d="M65.6 318.1c35.3 0 63.9-28.6 63.9-63.9s-28.6-63.9-63.9-63.9S1.8 219 1.8 254.2s28.6 63.9 63.8 63.9m191.6 0c35.3 0 63.9-28.6 63.9-63.9s-28.6-63.9-63.9-63.9-63.9 28.6-63.9 63.9 28.6 63.9 63.9 63.9m0 193.9c35.3 0 63.9-28.6 63.9-63.9s-28.6-63.9-63.9-63.9-63.9 28.6-63.9 63.9 28.6 63.9 63.9 63.9m189.2-193.9c35.3 0 63.9-28.6 63.9-63.9s-28.6-63.9-63.9-63.9-63.9 28.6-63.9 63.9 28.6 63.9 63.9 63.9"
/>
<path
d="M65.6 127.7c35.3 0 63.9-28.6 63.9-63.9S100.9 0 65.6 0 1.8 28.6 1.8 63.9s28.6 63.8 63.8 63.8m0 384.3c35.3 0 63.9-28.6 63.9-63.9s-28.6-63.9-63.9-63.9-63.8 28.7-63.8 63.9S30.4 512 65.6 512m191.6-384.3c35.3 0 63.9-28.6 63.9-63.9S292.5 0 257.2 0s-63.9 28.6-63.9 63.9 28.6 63.8 63.9 63.8m189.2 0c35.3 0 63.9-28.6 63.9-63.9S481.6 0 446.4 0c-35.3 0-63.9 28.6-63.9 63.9s28.6 63.8 63.9 63.8m0 384.3c35.3 0 63.9-28.6 63.9-63.9s-28.6-63.9-63.9-63.9-63.9 28.6-63.9 63.9 28.6 63.9 63.9 63.9"
className="opacity-20"
fill="currentColor"
/>
</svg>
);
}
================================================
FILE: frontend/src/components/language/language.tsx
================================================
import { languages, SupportedLanguage } from "@/lib/i18n/locales";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "../ui/select";
import { useState } from "react";
import i18n from "@/lib/i18n/i18n";
export const LanguageSelector = () => {
const [language, setLanguage] = useState<SupportedLanguage>(
i18n.language as SupportedLanguage,
);
const handleSelect = (option: string) => {
setLanguage(option as SupportedLanguage);
i18n.changeLanguage(option as SupportedLanguage);
};
return (
<Select onValueChange={handleSelect} value={language}>
<SelectTrigger>
<SelectValue placeholder="Select language" />
</SelectTrigger>
<SelectContent>
{Object.entries(languages).map(([key, value]) => (
<SelectItem key={key} value={key}>
{value}
</SelectItem>
))}
</SelectContent>
</Select>
);
};
================================================
FILE: frontend/src/components/layout/layout.tsx
================================================
import { useAppContext } from "@/context/app-context";
import { LanguageSelector } from "../language/language";
import { Outlet } from "react-router";
import { useCallback, useEffect, useState } from "react";
import { DomainWarning } from "../domain-warning/domain-warning";
import { ThemeToggle } from "../theme-toggle/theme-toggle";
const BaseLayout = ({ children }: { children: React.ReactNode }) => {
const { backgroundImage, title } = useAppContext();
useEffect(() => {
document.title = title;
}, [title]);
return (
<div
className="flex flex-col justify-center items-center min-h-svh px-4"
style={{
backgroundImage: `url(${backgroundImage})`,
backgroundSize: "cover",
backgroundPosition: "center",
}}
>
<div className="absolute top-4 right-4 flex flex-row gap-2">
<ThemeToggle />
<LanguageSelector />
</div>
<div className="max-w-sm md:min-w-sm min-w-xs">{children}</div>
</div>
);
};
export const Layout = () => {
const { appUrl, warningsEnabled } = useAppContext();
const [ignoreDomainWarning, setIgnoreDomainWarning] = useState(() => {
return window.sessionStorage.getItem("ignoreDomainWarning") === "true";
});
const currentUrl = window.location.origin;
const handleIgnore = useCallback(() => {
window.sessionStorage.setItem("ignoreDomainWarning", "true");
setIgnoreDomainWarning(true);
}, [setIgnoreDomainWarning]);
if (!ignoreDomainWarning && warningsEnabled && appUrl !== currentUrl) {
return (
<BaseLayout>
<DomainWarning
appUrl={appUrl}
currentUrl={currentUrl}
onClick={() => handleIgnore()}
/>
</BaseLayout>
);
}
return (
<BaseLayout>
<Outlet />
</BaseLayout>
);
};
================================================
FILE: frontend/src/components/providers/theme-provider.tsx
================================================
import { createContext, useContext, useEffect, useState } from "react";
type Theme = "dark" | "light" | "system";
type ThemeProviderProps = {
children: React.ReactNode;
defaultTheme?: Theme;
storageKey?: string;
};
type ThemeProviderState = {
theme: Theme;
setTheme: (theme: Theme) => void;
};
const initialState: ThemeProviderState = {
theme: "system",
setTheme: () => null,
};
const ThemeProviderContext = createContext<ThemeProviderState>(initialState);
export function ThemeProvider({
children,
defaultTheme = "system",
storageKey = "vite-ui-theme",
...props
}: ThemeProviderProps) {
const [theme, setTheme] = useState<Theme>(
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme,
);
useEffect(() => {
const root = window.document.documentElement;
root.classList.remove("light", "dark");
if (theme === "system") {
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)")
.matches
? "dark"
: "light";
root.classList.add(systemTheme);
return;
}
root.classList.add(theme);
}, [theme]);
const value = {
theme,
setTheme: (theme: Theme) => {
localStorage.setItem(storageKey, theme);
setTheme(theme);
},
};
return (
<ThemeProviderContext.Provider {...props} value={value}>
{children}
</ThemeProviderContext.Provider>
);
}
export const useTheme = () => {
const context = useContext(ThemeProviderContext);
if (context === undefined)
throw new Error("useTheme must be used within a ThemeProvider");
return context;
};
================================================
FILE: frontend/src/components/theme-toggle/theme-toggle.tsx
================================================
import { Moon, Sun } from "lucide-react";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { useTheme } from "@/components/providers/theme-provider";
export function ThemeToggle() {
const { setTheme } = useTheme();
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
className="bg-card text-card-foreground hover:bg-card/90"
size="icon"
>
<Sun className="h-[1.2rem] w-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" />
<Moon className="absolute h-[1.2rem] w-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" />
<span className="sr-only">Toggle theme</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => setTheme("light")}>
Light
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("dark")}>
Dark
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("system")}>
System
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
);
}
================================================
FILE: frontend/src/components/ui/button.tsx
================================================
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";
import { Loader2 } from "lucide-react";
const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:cursor-pointer",
{
variants: {
variant: {
default:
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
destructive:
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
outline:
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
secondary:
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
ghost:
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
link: "text-primary underline-offset-4 hover:underline",
warning:
"bg-amber-500 text-white shadow-xs hover:bg-amber-400 focus-visible:ring-amber-200/20 dark:focus-visible:ring-amber-400/40",
},
size: {
default: "h-9 px-4 py-2 has-[>svg]:px-3",
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
icon: "size-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
},
);
function Button({
className,
variant,
size,
asChild = false,
loading = false,
...props
}: React.ComponentProps<"button"> &
VariantProps<typeof buttonVariants> & {
asChild?: boolean;
loading?: boolean;
}) {
const Comp = asChild ? Slot : "button";
if (loading) {
return (
<Comp
data-slot="button"
className={cn(buttonVariants({ variant, size, className }))}
disabled
{...props}
>
<Loader2 className="animate-spin" />
</Comp>
);
}
return (
<Comp
data-slot="button"
className={cn(buttonVariants({ variant, size, className }))}
{...props}
/>
);
}
export { Button, buttonVariants };
================================================
FILE: frontend/src/components/ui/card.tsx
================================================
import * as React from "react";
import { cn } from "@/lib/utils";
function Card({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card"
className={cn(
"bg-card text-card-foreground flex flex-col gap-3 rounded-xl border py-6 shadow-sm",
className,
)}
{...props}
/>
);
}
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-header"
className={cn(
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
className,
)}
{...props}
/>
);
}
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-title"
className={cn("leading-none font-semibold", className)}
{...props}
/>
);
}
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-description"
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
);
}
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-action"
className={cn(
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
className,
)}
{...props}
/>
);
}
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-content"
className={cn("px-6", className)}
{...props}
/>
);
}
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="card-footer"
className={cn("flex items-center px-6 [.border-t]:pt-6 mt-2", className)}
{...props}
/>
);
}
export {
Card,
CardHeader,
CardFooter,
CardTitle,
CardAction,
CardDescription,
CardContent,
};
================================================
FILE: frontend/src/components/ui/dropdown-menu.tsx
================================================
import * as React from "react"
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
import { cn } from "@/lib/utils"
function DropdownMenu({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
}
function DropdownMenuPortal({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
return (
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
)
}
function DropdownMenuTrigger({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
return (
<DropdownMenuPrimitive.Trigger
data-slot="dropdown-menu-trigger"
{...props}
/>
)
}
function DropdownMenuContent({
className,
sideOffset = 4,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
return (
<DropdownMenuPrimitive.Portal>
<DropdownMenuPrimitive.Content
data-slot="dropdown-menu-content"
sideOffset={sideOffset}
className={cn(
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
className
)}
{...props}
/>
</DropdownMenuPrimitive.Portal>
)
}
function DropdownMenuGroup({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
return (
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
)
}
function DropdownMenuItem({
className,
inset,
variant = "default",
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
inset?: boolean
variant?: "default" | "destructive"
}) {
return (
<DropdownMenuPrimitive.Item
data-slot="dropdown-menu-item"
data-inset={inset}
data-variant={variant}
className={cn(
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
/>
)
}
function DropdownMenuCheckboxItem({
className,
children,
checked,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
return (
<DropdownMenuPrimitive.CheckboxItem
data-slot="dropdown-menu-checkbox-item"
className={cn(
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
checked={checked}
{...props}
>
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
<DropdownMenuPrimitive.ItemIndicator>
<CheckIcon className="size-4" />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
</DropdownMenuPrimitive.CheckboxItem>
)
}
function DropdownMenuRadioGroup({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
return (
<DropdownMenuPrimitive.RadioGroup
data-slot="dropdown-menu-radio-group"
{...props}
/>
)
}
function DropdownMenuRadioItem({
className,
children,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
return (
<DropdownMenuPrimitive.RadioItem
data-slot="dropdown-menu-radio-item"
className={cn(
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
>
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
<DropdownMenuPrimitive.ItemIndicator>
<CircleIcon className="size-2 fill-current" />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
</DropdownMenuPrimitive.RadioItem>
)
}
function DropdownMenuLabel({
className,
inset,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
inset?: boolean
}) {
return (
<DropdownMenuPrimitive.Label
data-slot="dropdown-menu-label"
data-inset={inset}
className={cn(
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
className
)}
{...props}
/>
)
}
function DropdownMenuSeparator({
className,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
return (
<DropdownMenuPrimitive.Separator
data-slot="dropdown-menu-separator"
className={cn("bg-border -mx-1 my-1 h-px", className)}
{...props}
/>
)
}
function DropdownMenuShortcut({
className,
...props
}: React.ComponentProps<"span">) {
return (
<span
data-slot="dropdown-menu-shortcut"
className={cn(
"text-muted-foreground ml-auto text-xs tracking-widest",
className
)}
{...props}
/>
)
}
function DropdownMenuSub({
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
}
function DropdownMenuSubTrigger({
className,
inset,
children,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
inset?: boolean
}) {
return (
<DropdownMenuPrimitive.SubTrigger
data-slot="dropdown-menu-sub-trigger"
data-inset={inset}
className={cn(
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className
)}
{...props}
>
{children}
<ChevronRightIcon className="ml-auto size-4" />
</DropdownMenuPrimitive.SubTrigger>
)
}
function DropdownMenuSubContent({
className,
...props
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
return (
<DropdownMenuPrimitive.SubContent
data-slot="dropdown-menu-sub-content"
className={cn(
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
className
)}
{...props}
/>
)
}
export {
DropdownMenu,
DropdownMenuPortal,
DropdownMenuTrigger,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuLabel,
DropdownMenuItem,
DropdownMenuCheckboxItem,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuSub,
DropdownMenuSubTrigger,
DropdownMenuSubContent,
}
================================================
FILE: frontend/src/components/ui/form.tsx
================================================
import * as React from "react";
import * as LabelPrimitive from "@radix-ui/react-label";
import { Slot } from "@radix-ui/react-slot";
import {
Controller,
FormProvider,
useFormContext,
useFormState,
type ControllerProps,
type FieldPath,
type FieldValues,
} from "react-hook-form";
import { cn } from "@/lib/utils";
import { Label } from "@/components/ui/label";
const Form = FormProvider;
type FormFieldContextValue<
TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
> = {
name: TName;
};
const FormFieldContext = React.createContext<FormFieldContextValue>(
{} as FormFieldContextValue,
);
const FormField = <
TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
>({
...props
}: ControllerProps<TFieldValues, TName>) => {
return (
<FormFieldContext.Provider value={{ name: props.name }}>
<Controller {...props} />
</FormFieldContext.Provider>
);
};
const useFormField = () => {
const fieldContext = React.useContext(FormFieldContext);
const itemContext = React.useContext(FormItemContext);
const { getFieldState } = useFormContext();
const formState = useFormState({ name: fieldContext.name });
const fieldState = getFieldState(fieldContext.name, formState);
if (!fieldContext) {
throw new Error("useFormField should be used within <FormField>");
}
const { id } = itemContext;
return {
id,
name: fieldContext.name,
formItemId: `${id}-form-item`,
formDescriptionId: `${id}-form-item-description`,
formMessageId: `${id}-form-item-message`,
...fieldState,
};
};
type FormItemContextValue = {
id: string;
};
const FormItemContext = React.createContext<FormItemContextValue>(
{} as FormItemContextValue,
);
function FormItem({ className, ...props }: React.ComponentProps<"div">) {
const id = React.useId();
return (
<FormItemContext.Provider value={{ id }}>
<div
data-slot="form-item"
className={cn("grid gap-2", className)}
{...props}
/>
</FormItemContext.Provider>
);
}
function FormLabel({
className,
...props
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
const { error, formItemId } = useFormField();
return (
<Label
data-slot="form-label"
data-error={!!error}
className={cn("data-[error=true]:text-destructive", className)}
htmlFor={formItemId}
{...props}
/>
);
}
function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
const { error, formItemId, formDescriptionId, formMessageId } =
useFormField();
return (
<Slot
data-slot="form-control"
id={formItemId}
aria-describedby={
!error
? `${formDescriptionId}`
: `${formDescriptionId} ${formMessageId}`
}
aria-invalid={!!error}
{...props}
/>
);
}
function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
const { formDescriptionId } = useFormField();
return (
<p
data-slot="form-description"
id={formDescriptionId}
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
);
}
function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
const { error, formMessageId } = useFormField();
const body = error ? String(error?.message ?? "") : props.children;
if (!body) {
return null;
}
return (
<p
data-slot="form-message"
id={formMessageId}
className={cn("text-destructive text-sm", className)}
{...props}
>
{body}
</p>
);
}
export {
useFormField,
Form,
FormItem,
FormLabel,
FormControl,
FormDescription,
FormMessage,
FormField,
};
================================================
FILE: frontend/src/components/ui/input-otp.tsx
================================================
import * as React from "react";
import { OTPInput, OTPInputContext } from "input-otp";
import { MinusIcon } from "lucide-react";
import { cn } from "@/lib/utils";
function InputOTP({
className,
containerClassName,
...props
}: React.ComponentProps<typeof OTPInput> & {
containerClassName?: string;
}) {
return (
<OTPInput
data-slot="input-otp"
containerClassName={cn(
"flex items-center gap-2 has-disabled:opacity-50",
containerClassName,
)}
className={cn("disabled:cursor-not-allowed", className)}
{...props}
/>
);
}
function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="input-otp-group"
className={cn("flex items-center", className)}
{...props}
/>
);
}
function InputOTPSlot({
index,
className,
...props
}: React.ComponentProps<"div"> & {
index: number;
}) {
const inputOTPContext = React.useContext(OTPInputContext);
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
return (
<div
data-slot="input-otp-slot"
data-active={isActive}
className={cn(
"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
className,
)}
{...props}
>
{char}
{hasFakeCaret && (
<div className="pointer-events-none absolute inset-0 flex items-center justify-center">
<div className="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
</div>
)}
</div>
);
}
function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
return (
<div data-slot="input-otp-separator" role="separator" {...props}>
<MinusIcon />
</div>
);
}
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
================================================
FILE: frontend/src/components/ui/input.tsx
================================================
import * as React from "react";
import { cn } from "@/lib/utils";
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
return (
<input
type={type}
data-slot="input"
className={cn(
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
className,
)}
{...props}
/>
);
}
export { Input };
================================================
FILE: frontend/src/components/ui/label.tsx
================================================
import * as React from "react";
import * as LabelPrimitive from "@radix-ui/react-label";
import { cn } from "@/lib/utils";
function Label({
className,
...props
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
return (
<LabelPrimitive.Root
data-slot="label"
className={cn(
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
className,
)}
{...props}
/>
);
}
export { Label };
================================================
FILE: frontend/src/components/ui/oauth-button.tsx
================================================
import { Loader2 } from "lucide-react";
import { Button } from "./button";
import React from "react";
import { twMerge } from "tailwind-merge";
interface Props extends React.ComponentProps<typeof Button> {
title: string;
icon: React.ReactNode;
onClick?: () => void;
loading?: boolean;
}
export const OAuthButton = (props: Props) => {
const { title, icon, onClick, loading, className, ...rest } = props;
return (
<Button
onClick={onClick}
className={twMerge("rounded-md", className)}
variant="outline"
{...rest}
>
{loading ? (
<Loader2 className="animate-spin" />
) : (
<>
{icon}
{title}
</>
)}
</Button>
);
};
================================================
FILE: frontend/src/components/ui/select.tsx
================================================
import * as React from "react";
import * as SelectPrimitive from "@radix-ui/react-select";
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
import { cn } from "@/lib/utils";
function Select({
...props
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
return <SelectPrimitive.Root data-slot="select" {...props} />;
}
function SelectGroup({
...props
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
return <SelectPrimitive.Group data-slot="select-group" {...props} />;
}
function SelectValue({
...props
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
return <SelectPrimitive.Value data-slot="select-value" {...props} />;
}
function SelectTrigger({
className,
size = "default",
children,
...props
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
size?: "sm" | "default";
}) {
return (
<SelectPrimitive.Trigger
data-slot="select-trigger"
data-size={size}
className={cn(
"hover:cursor-pointer border-input data-[placeholder]:text-card-foreground [&_svg:not([class*='text-'])]:text-card-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex w-fit items-center justify-between gap-2 rounded-md border bg-card hover:bg-card/90 px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
{...props}
>
{children}
<SelectPrimitive.Icon asChild>
<ChevronDownIcon className="size-4" />
</SelectPrimitive.Icon>
</SelectPrimitive.Trigger>
);
}
function SelectContent({
className,
children,
position = "popper",
...props
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
return (
<SelectPrimitive.Portal>
<SelectPrimitive.Content
data-slot="select-content"
className={cn(
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
position === "popper" &&
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
className,
)}
position={position}
{...props}
>
<SelectScrollUpButton />
<SelectPrimitive.Viewport
className={cn(
"p-1",
position === "popper" &&
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1",
)}
>
{children}
</SelectPrimitive.Viewport>
<SelectScrollDownButton />
</SelectPrimitive.Content>
</SelectPrimitive.Portal>
);
}
function SelectLabel({
className,
...props
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
return (
<SelectPrimitive.Label
data-slot="select-label"
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
{...props}
/>
);
}
function SelectItem({
className,
children,
...props
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
return (
<SelectPrimitive.Item
data-slot="select-item"
className={cn(
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
className,
)}
{...props}
>
<span className="absolute right-2 flex size-3.5 items-center justify-center">
<SelectPrimitive.ItemIndicator>
<CheckIcon className="size-4" />
</SelectPrimitive.ItemIndicator>
</span>
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
</SelectPrimitive.Item>
);
}
function SelectSeparator({
className,
...props
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
return (
<SelectPrimitive.Separator
data-slot="select-separator"
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
{...props}
/>
);
}
function SelectScrollUpButton({
className,
...props
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
return (
<SelectPrimitive.ScrollUpButton
data-slot="select-scroll-up-button"
className={cn(
"flex cursor-default items-center justify-center py-1",
className,
)}
{...props}
>
<ChevronUpIcon className="size-4" />
</SelectPrimitive.ScrollUpButton>
);
}
function SelectScrollDownButton({
className,
...props
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
return (
<SelectPrimitive.ScrollDownButton
data-slot="select-scroll-down-button"
className={cn(
"flex cursor-default items-center justify-center py-1",
className,
)}
{...props}
>
<ChevronDownIcon className="size-4" />
</SelectPrimitive.ScrollDownButton>
);
}
export {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectScrollDownButton,
SelectScrollUpButton,
SelectSeparator,
SelectTrigger,
SelectValue,
};
================================================
FILE: frontend/src/components/ui/separator.tsx
================================================
"use client";
import * as React from "react";
import * as SeparatorPrimitive from "@radix-ui/react-separator";
import { cn } from "@/lib/utils";
function Separator({
className,
orientation = "horizontal",
decorative = true,
...props
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
return (
<SeparatorPrimitive.Root
data-slot="separator-root"
decorative={decorative}
orientation={orientation}
className={cn(
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
className,
)}
{...props}
/>
);
}
function SeperatorWithChildren({ children }: { children: React.ReactNode }) {
return (
<div className="flex items-center gap-4">
<Separator className="flex-1" />
<span className="text-sm text-muted-foreground">{children}</span>
<Separator className="flex-1" />
</div>
);
}
export { Separator, SeperatorWithChildren };
================================================
FILE: frontend/src/components/ui/sonner.tsx
================================================
import { useTheme } from "../providers/theme-provider";
import { Toaster as Sonner, ToasterProps } from "sonner";
const Toaster = ({ ...props }: ToasterProps) => {
const { theme } = useTheme();
return (
<Sonner
theme={theme as ToasterProps["theme"]}
className="toaster group"
style={
{
"--normal-bg": "var(--popover)",
"--normal-text": "var(--popover-foreground)",
"--normal-border": "var(--border)",
} as React.CSSProperties
}
{...props}
/>
);
};
export { Toaster };
================================================
FILE: frontend/src/components/ui/tooltip.tsx
================================================
import * as React from "react"
import { Tooltip as TooltipPrimitive } from "radix-ui"
import { cn } from "@/lib/utils"
function TooltipProvider({
delayDuration = 0,
...props
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
return (
<TooltipPrimitive.Provider
data-slot="tooltip-provider"
delayDuration={delayDuration}
{...props}
/>
)
}
function Tooltip({
...props
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
}
function TooltipTrigger({
...props
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
}
function TooltipContent({
className,
sideOffset = 0,
children,
...props
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
return (
<TooltipPrimitive.Portal>
<TooltipPrimitive.Content
data-slot="tooltip-content"
sideOffset={sideOffset}
className={cn(
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
className
)}
{...props}
>
{children}
<TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
</TooltipPrimitive.Content>
</TooltipPrimitive.Portal>
)
}
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
================================================
FILE: frontend/src/context/app-context.tsx
================================================
import {
appContextSchema,
AppContextSchema,
} from "@/schemas/app-context-schema";
import { createContext, useContext } from "react";
import { useSuspenseQuery } from "@tanstack/react-query";
import axios from "axios";
const AppContext = createContext<AppContextSchema | null>(null);
export const AppContextProvider = ({
children,
}: {
children: React.ReactNode;
}) => {
const { isFetching, data, error } = useSuspenseQuery({
queryKey: ["app"],
queryFn: () => axios.get("/api/context/app").then((res) => res.data),
});
if (error && !isFetching) {
throw error;
}
const validated = appContextSchema.safeParse(data);
if (validated.success === false) {
throw validated.error;
}
return (
<AppContext.Provider value={validated.data}>{children}</AppContext.Provider>
);
};
export const useAppContext = () => {
const context = useContext(AppContext);
if (!context) {
throw new Error("useAppContext must be used within an AppContextProvider");
}
return context;
};
================================================
FILE: frontend/src/context/user-context.tsx
================================================
import {
userContextSchema,
UserContextSchema,
} from "@/schemas/user-context-schema";
import { createContext, useContext } from "react";
import { useSuspenseQuery } from "@tanstack/react-query";
import axios from "axios";
const UserContext = createContext<UserContextSchema | null>(null);
export const UserContextProvider = ({
children,
}: {
children: React.ReactNode;
}) => {
const { isFetching, data, error } = useSuspenseQuery({
queryKey: ["user"],
queryFn: () => axios.get("/api/context/user").then((res) => res.data),
});
if (error && !isFetching) {
throw error;
}
const validated = userContextSchema.safeParse(data);
if (validated.success === false) {
throw validated.error;
}
return (
<UserContext.Provider value={validated.data}>
{children}
</UserContext.Provider>
);
};
export const useUserContext = () => {
const context = useContext(UserContext);
if (!context) {
throw new Error(
"useUserContext must be used within an UserContextProvider",
);
}
return context;
};
================================================
FILE: frontend/src/index.css
================================================
@import "tailwindcss";
@import "tw-animate-css";
@custom-variant dark (&:is(.dark *));
@theme inline {
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
h1 {
@apply scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl;
}
h2 {
@apply scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0;
}
h3 {
@apply scroll-m-20 text-2xl font-semibold tracking-tight;
}
h4 {
@apply scroll-m-20 text-xl font-semibold tracking-tight;
}
p {
@apply leading-6;
}
blockquote {
@apply mt-6 border-l-2 pl-6 italic;
}
tr {
@apply m-0 border-t p-0 even:bg-muted;
}
th {
@apply border px-4 py-2 text-left font-bold [&[align=center]]:text-center [&[align=right]]:text-right;
}
ul {
@apply my-6 ml-6 list-disc [&>li]:mt-2;
}
code {
@apply relative rounded bg-muted px-[0.2rem] py-[0.1rem] font-mono text-sm font-semibold break-all;
}
pre {
@apply bg-accent border border-border rounded-md p-2 whitespace-break-spaces break-all;
}
.lead {
@apply text-xl text-muted-foreground;
}
.large {
@apply text-lg font-semibold;
}
small {
@apply text-sm font-medium leading-none;
}
.muted {
@apply text-sm text-muted-foreground;
}
================================================
FILE: frontend/src/lib/hooks/oidc.ts
================================================
export type OIDCValues = {
scope: string;
response_type: string;
client_id: string;
redirect_uri: string;
state: string;
nonce: string;
};
interface IuseOIDCParams {
values: OIDCValues;
compiled: string;
isOidc: boolean;
missingParams: string[];
}
const optionalParams: string[] = ["state", "nonce"];
export function useOIDCParams(params: URLSearchParams): IuseOIDCParams {
let compiled: string = "";
let isOidc = false;
const missingParams: string[] = [];
const values: OIDCValues = {
scope: params.get("scope") ?? "",
response_type: params.get("response_type") ?? "",
client_id: params.get("client_id") ?? "",
redirect_uri: params.get("redirect_uri") ?? "",
state: params.get("state") ?? "",
nonce: params.get("nonce") ?? "",
};
for (const key of Object.keys(values)) {
if (!values[key as keyof OIDCValues]) {
if (!optionalParams.includes(key)) {
missingParams.push(key);
}
}
}
if (missingParams.length === 0) {
isOidc = true;
}
if (isOidc) {
compiled = new URLSearchParams(values).toString();
}
return {
values,
compiled,
isOidc,
missingParams,
};
}
================================================
FILE: frontend/src/lib/hooks/redirect-uri.ts
================================================
type IuseRedirectUri = {
url?: URL;
valid: boolean;
trusted: boolean;
allowedProto: boolean;
httpsDowngrade: boolean;
};
export const useRedirectUri = (
redirect_uri: string | null,
cookieDomain: string,
): IuseRedirectUri => {
let isValid = false;
let isTrusted = false;
let isAllowedProto = false;
let isHttpsDowngrade = false;
if (!redirect_uri) {
return {
valid: isValid,
trusted: isTrusted,
allowedProto: isAllowedProto,
httpsDowngrade: isHttpsDowngrade,
};
}
let url: URL;
try {
url = new URL(redirect_uri);
} catch {
return {
valid: isValid,
trusted: isTrusted,
allowedProto: isAllowedProto,
httpsDowngrade: isHttpsDowngrade,
};
}
isValid = true;
if (
url.hostname == cookieDomain ||
url.hostname.endsWith(`.${cookieDomain}`)
) {
isTrusted = true;
}
if (url.protocol == "http:" || url.protocol == "https:") {
isAllowedProto = true;
}
if (window.location.protocol == "https:" && url.protocol == "http:") {
isHttpsDowngrade = true;
}
return {
url,
valid: isValid,
trusted: isTrusted,
allowedProto: isAllowedProto,
httpsDowngrade: isHttpsDowngrade,
};
};
================================================
FILE: frontend/src/lib/i18n/i18n.ts
================================================
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import resourcesToBackend from "i18next-resources-to-backend";
i18n
.use(LanguageDetector)
.use(initReactI18next)
.use(
resourcesToBackend(
(language: string) => import(`./locales/${language}.json`),
),
)
.init({
fallbackLng: "en",
debug: import.meta.env.MODE === "development",
nonExplicitSupportedLngs: true,
load: "currentOnly",
detection: {
lookupLocalStorage: "tinyauth-lang",
},
});
export default i18n;
================================================
FILE: frontend/src/lib/i18n/locales/af-ZA.json
================================================
{
"loginTitle": "Welcome back, login with",
"loginTitleSimple": "Welcome back, please login",
"loginDivider": "Or",
"loginUsername": "Username",
"loginPassword": "Password",
"loginSubmit": "Login",
"loginFailTitle": "Failed to log in",
"loginFailSubtitle": "Please check your username and password",
"loginFailRateLimit": "You failed to login too many times. Please try again later",
"loginSuccessTitle": "Logged in",
"loginSuccessSubtitle": "Welcome back!",
"loginOauthFailTitle": "An error occurred",
"loginOauthFailSubtitle": "Failed to get OAuth URL",
"loginOauthSuccessTitle": "Redirecting",
"loginOauthSuccessSubtitle": "Redirecting to your OAuth provider",
"loginOauthAutoRedirectTitle": "OAuth Auto Redirect",
"loginOauthAutoRedirectSubtitle": "You will be automatically redirected to your OAuth provider to authenticate.",
"loginOauthAutoRedirectButton": "Redirect now",
"continueTitle": "Continue",
"continueRedirectingTitle": "Redirecting...",
"continueRedirectingSubtitle": "You should be redirected to the app soon",
"continueRedirectManually": "Redirect me manually",
"continueInsecureRedirectTitle": "Insecure redirect",
"continueInsecureRedirectSubtitle": "You are trying to redirect from <code>https</code> to <code>http</code> which is not secure. Are you sure you want to continue?",
"continueUntrustedRedirectTitle": "Untrusted redirect",
"continueUntrustedRedirectSubtitle": "You are trying to redirect to a domain that does not match your configured domain (<code>{{cookieDomain}}</code>). Are you sure you want to continue?",
"logoutFailTitle": "Failed to log out",
"logoutFailSubtitle": "Please try again",
"logoutSuccessTitle": "Logged out",
"logoutSuccessSubtitle": "You have been logged out",
"logoutTitle": "Logout",
"logoutUsernameSubtitle": "You are currently logged in as <code>{{username}}</code>. Click the button below to logout.",
"logoutOauthSubtitle": "You are currently logged in as <code>{{username}}</code> using the {{provider}} OAuth provider. Click the button below to logout.",
"notFoundTitle": "Page not found",
"notFoundSubtitle": "The page you are looking for does not exist.",
"notFoundButton": "Go home",
"totpFailTitle": "Failed to verify code",
"totpFailSubtitle": "Please check your code and try again",
"totpSuccessTitle": "Verified",
"totpSuccessSubtitle": "Redirecting to your app",
"totpTitle": "Enter your TOTP code",
"totpSubtitle": "Please enter the code from your authenticator app.",
"unauthorizedTitle": "Unauthorized",
"unauthorizedResourceSubtitle": "The user with username <code>{{username}}</code> is not authorized to access the resource <code>{{resource}}</code>.",
"unauthorizedLoginSubtitle": "The user with username <code>{{username}}</code> is not authorized to login.",
"unauthorizedGroupsSubtitle": "The user with username <code>{{username}}</code> is not in the groups required by the resource <code>{{resource}}</code>.",
"unauthorizedIpSubtitle": "Your IP address <code>{{ip}}</code> is not authorized to access the resource <code>{{resource}}</code>.",
"unauthorizedButton": "Try again",
"cancelTitle": "Cancel",
"forgotPasswordTitle": "Forgot your password?",
"failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.",
"errorTitle": "An error occurred",
"errorSubtitleInfo": "The following error occurred while processing your request:",
"errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.",
"forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.",
"fieldRequired": "This field is required",
"invalidInput": "Invalid input",
"domainWarningTitle": "Invalid Domain",
"domainWarningSubtitle": "This instance is configured to be accessed from <code>{{appUrl}}</code>, but <code>{{currentUrl}}</code> is being used. If you proceed, you may encounter issues with authentication.",
"domainWarningCurrent": "Current:",
"domainWarningExpected": "Expected:",
"ignoreTitle": "Ignore",
"goToCorrectDomainTitle": "Go to correct domain",
"authorizeTitle": "Authorize",
"authorizeCardTitle": "Continue to {{app}}?",
"authorizeSubtitle": "Would you like to continue to this app? Please carefully review the permissions requested by the app.",
"authorizeSubtitleOAuth": "Would you like to continue to this app?",
"authorizeLoadingTitle": "Loading...",
"authorizeLoadingSubtitle": "Please wait while we load the client information.",
"authorizeSuccessTitle": "Authorized",
"authorizeSuccessSubtitle": "You will be redirected to the app in a few seconds.",
"authorizeErrorClientInfo": "An error occurred while loading the client information. Please try again later.",
"authorizeErrorMissingParams": "The following parameters are missing: {{missingParams}}",
"openidScopeName": "OpenID Connect",
"openidScopeDescription": "Allows the app to access your OpenID Connect information.",
"emailScopeName": "Email",
"emailScopeDescription": "Allows the app to access your email address.",
"profileScopeName": "Profile",
"profileScopeDescription": "Allows the app to access your profile information.",
"groupsScopeName": "Groups",
"groupsScopeDescription": "Allows the app to access your group information."
}
================================================
FILE: frontend/src/lib/i18n/locales/ar-SA.json
================================================
{
"loginTitle": "مرحبا بعودتك، ادخل باستخدام",
"loginTitleSimple": "مرحبا بعودتك، سجل دخولك",
"loginDivider": "أو",
"loginUsername": "اسم المستخدم",
"loginPassword": "كلمة المرور",
"loginSubmit": "تسجيل الدخول",
"loginFailTitle": "فشل تسجيل الدخول",
"loginFailSubtitle": "الرجاء التحقق من اسم المستخدم وكلمة المرور",
"loginFailRateLimit": "You failed to login too many times. Please try again later",
"loginSuccessTitle": "تم تسجيل الدخول",
"loginSuccessSubtitle": "مرحبا بعودتك!",
"loginOauthFailTitle": "حدث خطأ",
"loginOauthFailSubtitle": "أخفق الحصول على رابط OAuth",
"loginOauthSuccessTitle": "إعادة توجيه",
"loginOauthSuccessSubtitle": "إعادة توجيه إلى مزود OAuth الخاص بك",
"loginOauthAutoRedirectTitle": "OAuth Auto Redirect",
"loginOauthAutoRedirectSubtitle": "You will be automatically redirected to your OAuth provider to authenticate.",
"loginOauthAutoRedirectButton": "Redirect now",
"continueTitle": "متابعة",
"continueRedirectingTitle": "إعادة توجيه...",
"continueRedirectingSubtitle": "يجب إعادة توجيهك إلى التطبيق قريبا",
"continueRedirectManually": "Redirect me manually",
"continueInsecureRedirectTitle": "إعادة توجيه غير آمنة",
"continueInsecureRedirectSubtitle": "أنت تحاول إعادة التوجيه من <code>https</code> إلى <code>http</code>، هل أنت متأكد أنك تريد المتابعة؟",
"continueUntrustedRedirectTitle": "Untrusted redirect",
"continueUntrustedRedirectSubtitle": "You are trying to redirect to a domain that does not match your configured domain (<code>{{cookieDomain}}</code>). Are you sure you want to continue?",
"logoutFailTitle": "فشل تسجيل الخروج",
"logoutFailSubtitle": "يرجى إعادة المحاولة",
"logoutSuccessTitle": "تم تسجيل الخروج",
"logoutSuccessSubtitle": "تم تسجيل خروجك",
"logoutTitle": "تسجيل الخروج",
"logoutUsernameSubtitle": "You are currently logged in as <code>{{username}}</code>. Click the button below to logout.",
"logoutOauthSubtitle": "You are currently logged in as <code>{{username}}</code> using the {{provider}} OAuth provider. Click the button below to logout.",
"notFoundTitle": "الصفحة غير موجودة",
"notFoundSubtitle": "الصفحة التي تبحث عنها غير موجودة.",
"notFoundButton": "انتقل إلى الرئيسية",
"totpFailTitle": "أخفق التحقق من الرمز",
"totpFailSubtitle": "الرجاء التحقق من الرمز الخاص بك وحاول مرة أخرى",
"totpSuccessTitle": "تم التحقق",
"totpSuccessSubtitle": "إعادة توجيه إلى تطبيقك",
"totpTitle": "أدخل رمز TOTP الخاص بك",
"totpSubtitle": "Please enter the code from your authenticator app.",
"unauthorizedTitle": "غير مرخص",
"unauthorizedResourceSubtitle": "The user with username <code>{{username}}</code> is not authorized to access the resource <code>{{resource}}</code>.",
"unauthorizedLoginSubtitle": "The user with username <code>{{username}}</code> is not authorized to login.",
"unauthorizedGroupsSubtitle": "The user with username <code>{{username}}</code> is not in the groups required by the resource <code>{{resource}}</code>.",
"unauthorizedIpSubtitle": "Your IP address <code>{{ip}}</code> is not authorized to access the resource <code>{{resource}}</code>.",
"unauthorizedButton": "حاول مجددا",
"cancelTitle": "إلغاء",
"forgotPasswordTitle": "نسيت كلمة المرور؟",
"failedToFetchProvidersTitle": "Failed to load authentication providers. Please check your configuration.",
"errorTitle": "حدث خطأ",
"errorSubtitleInfo": "The following error occurred while processing your request:",
"errorSubtitle": "An error occurred while trying to perform this action. Please check the console for more information.",
"forgotPasswordMessage": "You can reset your password by changing the `USERS` environment variable.",
"fieldRequired": "This field is required",
"invalidInput": "Invalid input",
"domainWarningTitle": "Invalid Domain",
"domainWarningSubtitle": "This instance is configured to be accessed from <code>{{appUrl}}</code>, but <code>{{currentUrl}}</code> is being used. If you proceed, you may encounter issues with authentication.",
"domainWarningCurrent": "Current:",
"domainWarningExpected": "Expected:",
"ignoreTitle": "تجاهل",
"goToCorrectDomainTitle": "Go to correct domain",
"authorizeTitle": "Authorize",
"authorizeCardTitle": "Continue to {{app}}?",
"authorizeSubtitle": "Would you like to continue to this app? Please carefully review the permissions requested by the app.",
"authorizeSubtitleOAuth": "Would you like to continue to this app?",
"authorizeLoadingTitle": "Loading...",
"authorizeLoadingSubtitle": "Please wait while we load the client information.",
"authorizeSuccessTitle": "Authorized",
"authorizeSuccessSubtitle": "You will be redirected to the app in a few seconds.",
"authorizeErrorClientInfo": "An error occurred while loading the client information. Please try again later.",
"authorizeErrorMissingParams": "The following parameters are missing: {{missingParams}}",
"openidScopeName": "OpenID Connect",
"openidScopeDescription": "Allows the app to access your OpenID Connect information.",
"emailScopeName": "Email",
"emailScopeDescription": "Allows the app to access your email address.",
"profileScopeName": "Profile",
"profileScopeDescription": "Allows the app to access your profile information.",
"groupsScopeName": "Groups",
"groupsScopeDescription": "Allows the app to access your group information."
}
================================================
FILE: frontend/src/lib/i18n/locales/ca-ES.json
================================================
{
"loginTitle": "Welcome back, login with",
"loginTitleSimple": "Welcome back, please login",
"loginDivider": "Or",
"loginUsername": "Username",
"loginPassword": "Password",
"loginSubmit": "Login",
"loginFailTitle": "Failed to log in",
"loginFailSubtitle": "Please check your username and password",
"loginFailRateLimit": "You failed to login too many times. Please try again later",
"loginSuccessTitle": "Logged in",
"loginSuccessSubtitle": "Welcome back!",
"loginOauthFailTitle": "An error occurred",
"loginOauthFailSubtitle": "Failed to get OAuth URL",
"loginOauthSuccessTitle": "Redirecting",
"loginOauthSuccessSubtitle": "Redirecting to your OAuth provider",
"loginOauthAutoRedirectTitle": "OAuth Auto Redirect",
"loginOauthAutoRedirectSubtitle": "You will be automatically redirected to your OAuth provider to authenticate.",
"loginOauthAutoRedirectButton": "Redirect now",
"continueTitle": "Continue",
"continueRedirectingTitle": "Redirecting...",
"continueRedirectingSubtitle": "You should be redirected to the app soon",
"continueRedirectManually": "Redirect me manually",
"continueInsecureRedirectTitle": "Insecure redirect",
"continueInsecureRedirectSubtitle": "You are trying to redirect from <code>https</code> to <code>http</code> which is not secure. Are you sure you want to continue?",
"continueUntrustedRedirectTitle": "Untrusted redirect",
"continueUntrustedRedirectSubtitle": "You are trying to redirect to a domain that does not match your configured domain (<code>{{cookieDomain}}</code>). Are you sure you want to continue?",
"logoutFailTitle": "Failed to log out",
"logoutFailSubtitle": "Please try again",
"logoutSuccessTitle": "Logged out",
"logoutSuccessSubtitle": "You have been logged out",
"logoutTitle": "Logout",
"logoutUsernameSubtitle": "You are currently logged in as <code>{{username}}</code>. Click the button below to logout.",
"logoutOauthSubtitle": "You are currently logged in as <code>{{username}}</code> using the {{provider}} OAuth provider. Click the button below to logout.",
"notFoundTitle": "Page not found",
"notFoundSubtitle": "The page you are looking for does not exist.",
"notFoundButton": "Go home",
"totpFailTitle": "Failed to verify code",
"totpFailSubtitle": "Please check your code and try again",
"totpSuccessTitle": "Verified",
"totpSuccessSubtitle": "Redirecting to your app",
"totpTitle": "Enter your TOTP code",
"totpSubtitle": "Please enter the code from your authenticator app.",
"unauthorizedTitle": "Unauthorized",
"unauthorizedResourceSubtitle": "The user with username <code>{{username}}</code> is not authorized to access the resource <code>{{resource}}</code>.",
"unauthorizedLoginSubtitle": "The user with username <code>{{username}}</code> is not authorized to login.",
"unauthorizedGroupsSubtitle": "The user with username <code>{{username}}</code> is not in the groups required by the resource <code>{{resource}}</code>.",
"unauthorizedIpSubtitle": "Your IP address <code>{{ip}}</code>
gitextract_u5ucyfy8/ ├── .coderabbit.yaml ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── dependabot.yml │ └── workflows/ │ ├── ci.yml │ ├── nightly.yml │ ├── release.yml │ ├── sponsors.yml │ └── stale.yml ├── .gitignore ├── .gitmodules ├── .vscode/ │ └── launch.json ├── .zed/ │ └── debug.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── Dockerfile.dev ├── Dockerfile.distroless ├── FUNDING.yml ├── LICENSE ├── Makefile ├── README.md ├── SECURITY.md ├── air.toml ├── assets/ │ ├── discohook.json │ └── logo.xcf ├── cmd/ │ └── tinyauth/ │ ├── create_oidc_client.go │ ├── create_user.go │ ├── generate_totp.go │ ├── healthcheck.go │ ├── tinyauth.go │ ├── verify_user.go │ └── version.go ├── codecov.yml ├── crowdin.yml ├── docker-compose.dev.yml ├── docker-compose.example.yml ├── frontend/ │ ├── .gitignore │ ├── .prettierignore │ ├── .prettierrc │ ├── Dockerfile.dev │ ├── components.json │ ├── eslint.config.js │ ├── index.html │ ├── package.json │ ├── public/ │ │ └── site.webmanifest │ ├── src/ │ │ ├── App.tsx │ │ ├── components/ │ │ │ ├── auth/ │ │ │ │ ├── login-form.tsx │ │ │ │ └── totp-form.tsx │ │ │ ├── domain-warning/ │ │ │ │ └── domain-warning.tsx │ │ │ ├── icons/ │ │ │ │ ├── github.tsx │ │ │ │ ├── google.tsx │ │ │ │ ├── microsoft.tsx │ │ │ │ ├── oauth.tsx │ │ │ │ ├── pocket-id.tsx │ │ │ │ └── tailscale.tsx │ │ │ ├── language/ │ │ │ │ └── language.tsx │ │ │ ├── layout/ │ │ │ │ └── layout.tsx │ │ │ ├── providers/ │ │ │ │ └── theme-provider.tsx │ │ │ ├── theme-toggle/ │ │ │ │ └── theme-toggle.tsx │ │ │ └── ui/ │ │ │ ├── button.tsx │ │ │ ├── card.tsx │ │ │ ├── dropdown-menu.tsx │ │ │ ├── form.tsx │ │ │ ├── input-otp.tsx │ │ │ ├── input.tsx │ │ │ ├── label.tsx │ │ │ ├── oauth-button.tsx │ │ │ ├── select.tsx │ │ │ ├── separator.tsx │ │ │ ├── sonner.tsx │ │ │ └── tooltip.tsx │ │ ├── context/ │ │ │ ├── app-context.tsx │ │ │ └── user-context.tsx │ │ ├── index.css │ │ ├── lib/ │ │ │ ├── hooks/ │ │ │ │ ├── oidc.ts │ │ │ │ └── redirect-uri.ts │ │ │ ├── i18n/ │ │ │ │ ├── i18n.ts │ │ │ │ ├── locales/ │ │ │ │ │ ├── af-ZA.json │ │ │ │ │ ├── ar-SA.json │ │ │ │ │ ├── ca-ES.json │ │ │ │ │ ├── cs-CZ.json │ │ │ │ │ ├── da-DK.json │ │ │ │ │ ├── de-DE.json │ │ │ │ │ ├── el-GR.json │ │ │ │ │ ├── en-US.json │ │ │ │ │ ├── en.json │ │ │ │ │ ├── es-ES.json │ │ │ │ │ ├── fi-FI.json │ │ │ │ │ ├── fr-FR.json │ │ │ │ │ ├── he-IL.json │ │ │ │ │ ├── hu-HU.json │ │ │ │ │ ├── it-IT.json │ │ │ │ │ ├── ja-JP.json │ │ │ │ │ ├── ko-KR.json │ │ │ │ │ ├── nl-NL.json │ │ │ │ │ ├── no-NO.json │ │ │ │ │ ├── pl-PL.json │ │ │ │ │ ├── pt-BR.json │ │ │ │ │ ├── pt-PT.json │ │ │ │ │ ├── ro-RO.json │ │ │ │ │ ├── ru-RU.json │ │ │ │ │ ├── sr-SP.json │ │ │ │ │ ├── sv-SE.json │ │ │ │ │ ├── tr-TR.json │ │ │ │ │ ├── uk-UA.json │ │ │ │ │ ├── vi-VN.json │ │ │ │ │ ├── zh-CN.json │ │ │ │ │ └── zh-TW.json │ │ │ │ └── locales.ts │ │ │ └── utils.ts │ │ ├── main.tsx │ │ ├── pages/ │ │ │ ├── authorize-page.tsx │ │ │ ├── continue-page.tsx │ │ │ ├── error-page.tsx │ │ │ ├── forgot-password-page.tsx │ │ │ ├── login-page.tsx │ │ │ ├── logout-page.tsx │ │ │ ├── not-found-page.tsx │ │ │ ├── totp-page.tsx │ │ │ └── unauthorized-page.tsx │ │ ├── schemas/ │ │ │ ├── app-context-schema.ts │ │ │ ├── login-schema.ts │ │ │ ├── oidc-schemas.ts │ │ │ ├── totp-schema.ts │ │ │ └── user-context-schema.ts │ │ └── vite-env.d.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts ├── gen/ │ ├── gen.go │ ├── gen_env.go │ └── gen_md.go ├── go.mod ├── go.sum ├── internal/ │ ├── assets/ │ │ ├── assets.go │ │ └── migrations/ │ │ ├── 000001_init_sqlite.down.sql │ │ ├── 000001_init_sqlite.up.sql │ │ ├── 000002_oauth_name.down.sql │ │ ├── 000002_oauth_name.up.sql │ │ ├── 000003_oauth_sub.down.sql │ │ ├── 000003_oauth_sub.up.sql │ │ ├── 000004_created_at.down.sql │ │ ├── 000004_created_at.up.sql │ │ ├── 000005_oidc_session.down.sql │ │ ├── 000005_oidc_session.up.sql │ │ ├── 000006_oidc_nonce.down.sql │ │ └── 000006_oidc_nonce.up.sql │ ├── bootstrap/ │ │ ├── app_bootstrap.go │ │ ├── db_bootstrap.go │ │ ├── router_bootstrap.go │ │ └── service_bootstrap.go │ ├── config/ │ │ └── config.go │ ├── controller/ │ │ ├── context_controller.go │ │ ├── context_controller_test.go │ │ ├── health_controller.go │ │ ├── oauth_controller.go │ │ ├── oidc_controller.go │ │ ├── oidc_controller_test.go │ │ ├── proxy_controller.go │ │ ├── proxy_controller_test.go │ │ ├── resources_controller.go │ │ ├── resources_controller_test.go │ │ ├── user_controller.go │ │ ├── user_controller_test.go │ │ └── well_known_controller.go │ ├── middleware/ │ │ ├── context_middleware.go │ │ ├── ui_middleware.go │ │ └── zerolog_middleware.go │ ├── repository/ │ │ ├── db.go │ │ ├── models.go │ │ ├── oidc_queries.sql.go │ │ └── session_queries.sql.go │ ├── service/ │ │ ├── access_controls_service.go │ │ ├── auth_service.go │ │ ├── docker_service.go │ │ ├── generic_oauth_service.go │ │ ├── github_oauth_service.go │ │ ├── google_oauth_service.go │ │ ├── ldap_service.go │ │ ├── oauth_broker_service.go │ │ └── oidc_service.go │ └── utils/ │ ├── app_utils.go │ ├── app_utils_test.go │ ├── decoders/ │ │ ├── label_decoder.go │ │ └── label_decoder_test.go │ ├── fs_utils.go │ ├── fs_utils_test.go │ ├── label_utils.go │ ├── label_utils_test.go │ ├── loaders/ │ │ ├── loader_env.go │ │ ├── loader_file.go │ │ └── loader_flag.go │ ├── security_utils.go │ ├── security_utils_test.go │ ├── string_utils.go │ ├── string_utils_test.go │ ├── tlog/ │ │ ├── log_audit.go │ │ ├── log_wrapper.go │ │ └── log_wrapper_test.go │ ├── user_utils.go │ └── user_utils_test.go ├── patches/ │ └── nested_maps.diff ├── sql/ │ ├── oidc_queries.sql │ ├── oidc_schemas.sql │ ├── session_queries.sql │ └── session_schemas.sql └── sqlc.yml
SYMBOL INDEX (505 symbols across 99 files)
FILE: cmd/tinyauth/create_oidc_client.go
function createOidcClientCmd (line 14) | func createOidcClientCmd() *cli.Command {
FILE: cmd/tinyauth/create_user.go
type CreateUserConfig (line 14) | type CreateUserConfig struct
function NewCreateUserConfig (line 21) | func NewCreateUserConfig() *CreateUserConfig {
function createUserCmd (line 30) | func createUserCmd() *cli.Command {
FILE: cmd/tinyauth/generate_totp.go
type GenerateTotpConfig (line 18) | type GenerateTotpConfig struct
function NewGenerateTotpConfig (line 23) | func NewGenerateTotpConfig() *GenerateTotpConfig {
function generateTotpCmd (line 30) | func generateTotpCmd() *cli.Command {
FILE: cmd/tinyauth/healthcheck.go
type healthzResponse (line 16) | type healthzResponse struct
function healthcheckCmd (line 21) | func healthcheckCmd() *cli.Command {
FILE: cmd/tinyauth/tinyauth.go
function main (line 15) | func main() {
function runCmd (line 110) | func runCmd(cfg config.Config) error {
FILE: cmd/tinyauth/verify_user.go
type VerifyUserConfig (line 16) | type VerifyUserConfig struct
function NewVerifyUserConfig (line 24) | func NewVerifyUserConfig() *VerifyUserConfig {
function verifyUserCmd (line 34) | func verifyUserCmd() *cli.Command {
FILE: cmd/tinyauth/version.go
function versionCmd (line 11) | func versionCmd() *cli.Command {
FILE: frontend/src/components/auth/login-form.tsx
type Props (line 16) | interface Props {
FILE: frontend/src/components/auth/totp-form.tsx
type Props (line 14) | interface Props {
FILE: frontend/src/components/domain-warning/domain-warning.tsx
type Props (line 12) | interface Props {
FILE: frontend/src/components/icons/github.tsx
function GithubIcon (line 3) | function GithubIcon(props: SVGProps<SVGSVGElement>) {
FILE: frontend/src/components/icons/google.tsx
function GoogleIcon (line 3) | function GoogleIcon(props: SVGProps<SVGSVGElement>) {
FILE: frontend/src/components/icons/microsoft.tsx
function MicrosoftIcon (line 3) | function MicrosoftIcon(props: SVGProps<SVGSVGElement>) {
FILE: frontend/src/components/icons/oauth.tsx
function OAuthIcon (line 3) | function OAuthIcon(props: SVGProps<SVGSVGElement>) {
FILE: frontend/src/components/icons/pocket-id.tsx
function PocketIDIcon (line 3) | function PocketIDIcon(props: SVGProps<SVGSVGElement>) {
FILE: frontend/src/components/icons/tailscale.tsx
function TailscaleIcon (line 3) | function TailscaleIcon(props: SVGProps<SVGSVGElement>) {
FILE: frontend/src/components/providers/theme-provider.tsx
type Theme (line 3) | type Theme = "dark" | "light" | "system";
type ThemeProviderProps (line 5) | type ThemeProviderProps = {
type ThemeProviderState (line 11) | type ThemeProviderState = {
function ThemeProvider (line 23) | function ThemeProvider({
FILE: frontend/src/components/theme-toggle/theme-toggle.tsx
function ThemeToggle (line 12) | function ThemeToggle() {
FILE: frontend/src/components/ui/button.tsx
function Button (line 41) | function Button({
FILE: frontend/src/components/ui/card.tsx
function Card (line 5) | function Card({ className, ...props }: React.ComponentProps<"div">) {
function CardHeader (line 18) | function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
function CardTitle (line 31) | function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
function CardDescription (line 41) | function CardDescription({ className, ...props }: React.ComponentProps<"...
function CardAction (line 51) | function CardAction({ className, ...props }: React.ComponentProps<"div">) {
function CardContent (line 64) | function CardContent({ className, ...props }: React.ComponentProps<"div"...
function CardFooter (line 74) | function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
FILE: frontend/src/components/ui/dropdown-menu.tsx
function DropdownMenu (line 7) | function DropdownMenu({
function DropdownMenuPortal (line 13) | function DropdownMenuPortal({
function DropdownMenuTrigger (line 21) | function DropdownMenuTrigger({
function DropdownMenuContent (line 32) | function DropdownMenuContent({
function DropdownMenuGroup (line 52) | function DropdownMenuGroup({
function DropdownMenuItem (line 60) | function DropdownMenuItem({
function DropdownMenuCheckboxItem (line 83) | function DropdownMenuCheckboxItem({
function DropdownMenuRadioGroup (line 109) | function DropdownMenuRadioGroup({
function DropdownMenuRadioItem (line 120) | function DropdownMenuRadioItem({
function DropdownMenuLabel (line 144) | function DropdownMenuLabel({
function DropdownMenuSeparator (line 164) | function DropdownMenuSeparator({
function DropdownMenuShortcut (line 177) | function DropdownMenuShortcut({
function DropdownMenuSub (line 193) | function DropdownMenuSub({
function DropdownMenuSubTrigger (line 199) | function DropdownMenuSubTrigger({
function DropdownMenuSubContent (line 223) | function DropdownMenuSubContent({
FILE: frontend/src/components/ui/form.tsx
type FormFieldContextValue (line 19) | type FormFieldContextValue<
type FormItemContextValue (line 66) | type FormItemContextValue = {
function FormItem (line 74) | function FormItem({ className, ...props }: React.ComponentProps<"div">) {
function FormLabel (line 88) | function FormLabel({
function FormControl (line 105) | function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
function FormDescription (line 124) | function FormDescription({ className, ...props }: React.ComponentProps<"...
function FormMessage (line 137) | function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
FILE: frontend/src/components/ui/input-otp.tsx
function InputOTP (line 7) | function InputOTP({
function InputOTPGroup (line 27) | function InputOTPGroup({ className, ...props }: React.ComponentProps<"di...
function InputOTPSlot (line 37) | function InputOTPSlot({
function InputOTPSeparator (line 67) | function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
FILE: frontend/src/components/ui/input.tsx
function Input (line 5) | function Input({ className, type, ...props }: React.ComponentProps<"inpu...
FILE: frontend/src/components/ui/label.tsx
function Label (line 6) | function Label({
FILE: frontend/src/components/ui/oauth-button.tsx
type Props (line 6) | interface Props extends React.ComponentProps<typeof Button> {
FILE: frontend/src/components/ui/select.tsx
function Select (line 7) | function Select({
function SelectGroup (line 13) | function SelectGroup({
function SelectValue (line 19) | function SelectValue({
function SelectTrigger (line 25) | function SelectTrigger({
function SelectContent (line 51) | function SelectContent({
function SelectLabel (line 86) | function SelectLabel({
function SelectItem (line 99) | function SelectItem({
function SelectSeparator (line 123) | function SelectSeparator({
function SelectScrollUpButton (line 136) | function SelectScrollUpButton({
function SelectScrollDownButton (line 154) | function SelectScrollDownButton({
FILE: frontend/src/components/ui/separator.tsx
function Separator (line 8) | function Separator({
function SeperatorWithChildren (line 28) | function SeperatorWithChildren({ children }: { children: React.ReactNode...
FILE: frontend/src/components/ui/tooltip.tsx
function TooltipProvider (line 6) | function TooltipProvider({
function Tooltip (line 19) | function Tooltip({
function TooltipTrigger (line 25) | function TooltipTrigger({
function TooltipContent (line 31) | function TooltipContent({
FILE: frontend/src/lib/hooks/oidc.ts
type OIDCValues (line 1) | type OIDCValues = {
type IuseOIDCParams (line 10) | interface IuseOIDCParams {
function useOIDCParams (line 19) | function useOIDCParams(params: URLSearchParams): IuseOIDCParams {
FILE: frontend/src/lib/hooks/redirect-uri.ts
type IuseRedirectUri (line 1) | type IuseRedirectUri = {
FILE: frontend/src/lib/i18n/locales.ts
type SupportedLanguage (line 34) | type SupportedLanguage = keyof typeof languages;
FILE: frontend/src/lib/utils.ts
function cn (line 4) | function cn(...inputs: ClassValue[]) {
FILE: frontend/src/pages/authorize-page.tsx
type Scope (line 27) | type Scope = {
FILE: frontend/src/schemas/app-context-schema.ts
type AppContextSchema (line 20) | type AppContextSchema = z.infer<typeof appContextSchema>;
FILE: frontend/src/schemas/login-schema.ts
type LoginSchema (line 8) | type LoginSchema = z.infer<typeof loginSchema>;
FILE: frontend/src/schemas/totp-schema.ts
type TotpSchema (line 7) | type TotpSchema = z.infer<typeof totpSchema>;
FILE: frontend/src/schemas/user-context-schema.ts
type UserContextSchema (line 14) | type UserContextSchema = z.infer<typeof userContextSchema>;
FILE: gen/gen.go
function main (line 8) | func main() {
function walkAndBuild (line 15) | func walkAndBuild[T any](parent reflect.Type, parentValue reflect.Value,
FILE: gen/gen_env.go
type EnvEntry (line 16) | type EnvEntry struct
function generateExampleEnv (line 22) | func generateExampleEnv() {
function buildEnvEntry (line 46) | func buildEnvEntry(child reflect.StructField, childValue reflect.Value, ...
function buildEnvMapEntry (line 86) | func buildEnvMapEntry(child reflect.StructField, parentPath string, entr...
function buildEnvChildPath (line 103) | func buildEnvChildPath(parent string, child string) string {
function compileEnv (line 107) | func compileEnv(entries []EnvEntry) []byte {
FILE: gen/gen_md.go
type MarkdownEntry (line 16) | type MarkdownEntry struct
function generateMarkdown (line 23) | func generateMarkdown() {
function buildMdEntry (line 47) | func buildMdEntry(child reflect.StructField, childValue reflect.Value, p...
function buildMdMapEntry (line 77) | func buildMdMapEntry(child reflect.StructField, parentPath string, entri...
function buildMdChildPath (line 100) | func buildMdChildPath(parent string, child string) string {
function compileMd (line 104) | func compileMd(entries []MarkdownEntry) []byte {
FILE: internal/assets/migrations/000001_init_sqlite.up.sql
type "sessions" (line 1) | CREATE TABLE IF NOT EXISTS "sessions" (
FILE: internal/assets/migrations/000005_oidc_session.up.sql
type "oidc_codes" (line 1) | CREATE TABLE IF NOT EXISTS "oidc_codes" (
type "oidc_tokens" (line 10) | CREATE TABLE IF NOT EXISTS "oidc_tokens" (
type "oidc_userinfo" (line 20) | CREATE TABLE IF NOT EXISTS "oidc_userinfo" (
FILE: internal/bootstrap/app_bootstrap.go
type BootstrapApp (line 22) | type BootstrapApp struct
method Setup (line 45) | func (app *BootstrapApp) Setup() error {
method heartbeat (line 229) | func (app *BootstrapApp) heartbeat() {
method dbCleanup (line 283) | func (app *BootstrapApp) dbCleanup(queries *repository.Queries) {
function NewBootstrapApp (line 39) | func NewBootstrapApp(config config.Config) *BootstrapApp {
FILE: internal/bootstrap/db_bootstrap.go
method SetupDatabase (line 17) | func (app *BootstrapApp) SetupDatabase(databasePath string) (*sql.DB, er...
FILE: internal/bootstrap/router_bootstrap.go
method setupRouter (line 16) | func (app *BootstrapApp) setupRouter() (*gin.Engine, error) {
FILE: internal/bootstrap/service_bootstrap.go
type Services (line 9) | type Services struct
method initServices (line 18) | func (app *BootstrapApp) initServices(queries *repository.Queries) (Serv...
FILE: internal/config/config.go
function NewDefaultConfiguration (line 4) | func NewDefaultConfiguration() *Config {
type Config (line 79) | type Config struct
type DatabaseConfig (line 95) | type DatabaseConfig struct
type AnalyticsConfig (line 99) | type AnalyticsConfig struct
type ResourcesConfig (line 103) | type ResourcesConfig struct
type ServerConfig (line 108) | type ServerConfig struct
type AuthConfig (line 114) | type AuthConfig struct
type IPConfig (line 126) | type IPConfig struct
type OAuthConfig (line 131) | type OAuthConfig struct
type OIDCConfig (line 137) | type OIDCConfig struct
type UIConfig (line 143) | type UIConfig struct
type LdapConfig (line 150) | type LdapConfig struct
type LogConfig (line 162) | type LogConfig struct
type LogStreams (line 168) | type LogStreams struct
type LogStreamConfig (line 174) | type LogStreamConfig struct
type ExperimentalConfig (line 179) | type ExperimentalConfig struct
constant DefaultNamePrefix (line 185) | DefaultNamePrefix = "TINYAUTH_"
type Claims (line 189) | type Claims struct
type OAuthServiceConfig (line 197) | type OAuthServiceConfig struct
type OIDCClientConfig (line 210) | type OIDCClientConfig struct
type User (line 226) | type User struct
type LdapUser (line 232) | type LdapUser struct
type UserSearch (line 237) | type UserSearch struct
type UserContext (line 242) | type UserContext struct
type UnauthorizedQuery (line 260) | type UnauthorizedQuery struct
type RedirectQuery (line 267) | type RedirectQuery struct
type Apps (line 273) | type Apps struct
type App (line 277) | type App struct
type AppConfig (line 287) | type AppConfig struct
type AppUsers (line 291) | type AppUsers struct
type AppOAuth (line 296) | type AppOAuth struct
type AppLDAP (line 301) | type AppLDAP struct
type AppIP (line 305) | type AppIP struct
type AppResponse (line 311) | type AppResponse struct
type AppBasicAuth (line 316) | type AppBasicAuth struct
type AppPath (line 322) | type AppPath struct
FILE: internal/controller/context_controller.go
type UserContextResponse (line 13) | type UserContextResponse struct
type AppContextResponse (line 26) | type AppContextResponse struct
type Provider (line 39) | type Provider struct
type ContextControllerConfig (line 45) | type ContextControllerConfig struct
type ContextController (line 56) | type ContextController struct
method SetupRoutes (line 72) | func (controller *ContextController) SetupRoutes() {
method userContextHandler (line 78) | func (controller *ContextController) userContextHandler(c *gin.Context) {
method appContextHandler (line 106) | func (controller *ContextController) appContextHandler(c *gin.Context) {
function NewContextController (line 61) | func NewContextController(config ContextControllerConfig, router *gin.Ro...
FILE: internal/controller/context_controller_test.go
function setupContextController (line 52) | func setupContextController(middlewares *[]gin.HandlerFunc) (*gin.Engine...
function TestAppContextHandler (line 74) | func TestAppContextHandler(t *testing.T) {
function TestUserContextHandler (line 102) | func TestUserContextHandler(t *testing.T) {
FILE: internal/controller/health_controller.go
type HealthController (line 5) | type HealthController struct
method SetupRoutes (line 15) | func (controller *HealthController) SetupRoutes() {
method healthHandler (line 20) | func (controller *HealthController) healthHandler(c *gin.Context) {
function NewHealthController (line 9) | func NewHealthController(router *gin.RouterGroup) *HealthController {
FILE: internal/controller/oauth_controller.go
type OAuthRequest (line 19) | type OAuthRequest struct
type OAuthControllerConfig (line 23) | type OAuthControllerConfig struct
type OAuthController (line 31) | type OAuthController struct
method SetupRoutes (line 47) | func (controller *OAuthController) SetupRoutes() {
method oauthURLHandler (line 53) | func (controller *OAuthController) oauthURLHandler(c *gin.Context) {
method oauthCallbackHandler (line 102) | func (controller *OAuthController) oauthCallbackHandler(c *gin.Context) {
function NewOAuthController (line 38) | func NewOAuthController(config OAuthControllerConfig, router *gin.Router...
FILE: internal/controller/oidc_controller.go
type OIDCControllerConfig (line 17) | type OIDCControllerConfig struct
type OIDCController (line 19) | type OIDCController struct
method SetupRoutes (line 66) | func (controller *OIDCController) SetupRoutes() {
method GetClientInfo (line 74) | func (controller *OIDCController) GetClientInfo(c *gin.Context) {
method Authorize (line 105) | func (controller *OIDCController) Authorize(c *gin.Context) {
method Token (line 195) | func (controller *OIDCController) Token(c *gin.Context) {
method Userinfo (line 358) | func (controller *OIDCController) Userinfo(c *gin.Context) {
method authorizeError (line 427) | func (controller *OIDCController) authorizeError(c *gin.Context, err e...
type AuthorizeCallback (line 25) | type AuthorizeCallback struct
type TokenRequest (line 30) | type TokenRequest struct
type CallbackError (line 39) | type CallbackError struct
type ErrorScreen (line 45) | type ErrorScreen struct
type ClientRequest (line 49) | type ClientRequest struct
type ClientCredentials (line 53) | type ClientCredentials struct
function NewOIDCController (line 58) | func NewOIDCController(config OIDCControllerConfig, oidcService *service...
FILE: internal/controller/oidc_controller_test.go
function TestOIDCController (line 58) | func TestOIDCController(t *testing.T) {
FILE: internal/controller/proxy_controller.go
type AuthModuleType (line 20) | type AuthModuleType
constant AuthRequest (line 23) | AuthRequest AuthModuleType = iota
constant ExtAuthz (line 24) | ExtAuthz
constant ForwardAuth (line 25) | ForwardAuth
type Proxy (line 30) | type Proxy struct
type ProxyContext (line 34) | type ProxyContext struct
type ProxyControllerConfig (line 43) | type ProxyControllerConfig struct
type ProxyController (line 47) | type ProxyController struct
method SetupRoutes (line 63) | func (controller *ProxyController) SetupRoutes() {
method proxyHandler (line 68) | func (controller *ProxyController) proxyHandler(c *gin.Context) {
method setHeaders (line 280) | func (controller *ProxyController) setHeaders(c *gin.Context, acls con...
method handleError (line 298) | func (controller *ProxyController) handleError(c *gin.Context, proxyCt...
method getHeader (line 310) | func (controller *ProxyController) getHeader(c *gin.Context, header st...
method useFriendlyError (line 315) | func (controller *ProxyController) useFriendlyError(proxyCtx ProxyCont...
method getForwardAuthContext (line 321) | func (controller *ProxyController) getForwardAuthContext(c *gin.Contex...
method getAuthRequestContext (line 353) | func (controller *ProxyController) getAuthRequestContext(c *gin.Contex...
method getExtAuthzContext (line 390) | func (controller *ProxyController) getExtAuthzContext(c *gin.Context) ...
method determineAuthModules (line 420) | func (controller *ProxyController) determineAuthModules(proxy string) ...
method getContextFromAuthModule (line 433) | func (controller *ProxyController) getContextFromAuthModule(c *gin.Con...
method getProxyContext (line 457) | func (controller *ProxyController) getProxyContext(c *gin.Context) (Pr...
function NewProxyController (line 54) | func NewProxyController(config ProxyControllerConfig, router *gin.Router...
FILE: internal/controller/proxy_controller_test.go
function setupProxyController (line 26) | func setupProxyController(t *testing.T, middlewares []gin.HandlerFunc) (...
function TestProxyHandler (line 101) | func TestProxyHandler(t *testing.T) {
FILE: internal/controller/resources_controller.go
type ResourcesControllerConfig (line 9) | type ResourcesControllerConfig struct
type ResourcesController (line 14) | type ResourcesController struct
method SetupRoutes (line 30) | func (controller *ResourcesController) SetupRoutes() {
method resourcesHandler (line 34) | func (controller *ResourcesController) resourcesHandler(c *gin.Context) {
function NewResourcesController (line 20) | func NewResourcesController(config ResourcesControllerConfig, router *gi...
FILE: internal/controller/resources_controller_test.go
function TestResourcesHandler (line 14) | func TestResourcesHandler(t *testing.T) {
FILE: internal/controller/user_controller.go
type LoginRequest (line 16) | type LoginRequest struct
type TotpRequest (line 21) | type TotpRequest struct
type UserControllerConfig (line 25) | type UserControllerConfig struct
type UserController (line 29) | type UserController struct
method SetupRoutes (line 43) | func (controller *UserController) SetupRoutes() {
method loginHandler (line 50) | func (controller *UserController) loginHandler(c *gin.Context) {
method logoutHandler (line 170) | func (controller *UserController) logoutHandler(c *gin.Context) {
method totpHandler (line 186) | func (controller *UserController) totpHandler(c *gin.Context) {
function NewUserController (line 35) | func NewUserController(config UserControllerConfig, router *gin.RouterGr...
FILE: internal/controller/user_controller_test.go
function setupUserController (line 26) | func setupUserController(t *testing.T, middlewares *[]gin.HandlerFunc) (...
function TestLoginHandler (line 85) | func TestLoginHandler(t *testing.T) {
function TestLogoutHandler (line 174) | func TestLogoutHandler(t *testing.T) {
function TestTotpHandler (line 197) | func TestTotpHandler(t *testing.T) {
FILE: internal/controller/well_known_controller.go
type OpenIDConnectConfiguration (line 11) | type OpenIDConnectConfiguration struct
type WellKnownControllerConfig (line 27) | type WellKnownControllerConfig struct
type WellKnownController (line 29) | type WellKnownController struct
method SetupRoutes (line 43) | func (controller *WellKnownController) SetupRoutes() {
method OpenIDConnectConfiguration (line 48) | func (controller *WellKnownController) OpenIDConnectConfiguration(c *g...
method JWKS (line 67) | func (controller *WellKnownController) JWKS(c *gin.Context) {
function NewWellKnownController (line 35) | func NewWellKnownController(config WellKnownControllerConfig, oidc *serv...
FILE: internal/middleware/context_middleware.go
type ContextMiddlewareConfig (line 18) | type ContextMiddlewareConfig struct
type ContextMiddleware (line 22) | type ContextMiddleware struct
method Init (line 36) | func (m *ContextMiddleware) Init() error {
method Middleware (line 40) | func (m *ContextMiddleware) Middleware() gin.HandlerFunc {
function NewContextMiddleware (line 28) | func NewContextMiddleware(config ContextMiddlewareConfig, auth *service....
FILE: internal/middleware/ui_middleware.go
type UIMiddleware (line 17) | type UIMiddleware struct
method Init (line 26) | func (m *UIMiddleware) Init() error {
method Middleware (line 39) | func (m *UIMiddleware) Middleware() gin.HandlerFunc {
function NewUIMiddleware (line 22) | func NewUIMiddleware() *UIMiddleware {
FILE: internal/middleware/zerolog_middleware.go
type ZerologMiddleware (line 19) | type ZerologMiddleware struct
method Init (line 25) | func (m *ZerologMiddleware) Init() error {
method logPath (line 29) | func (m *ZerologMiddleware) logPath(path string) bool {
method Middleware (line 38) | func (m *ZerologMiddleware) Middleware() gin.HandlerFunc {
function NewZerologMiddleware (line 21) | func NewZerologMiddleware() *ZerologMiddleware {
FILE: internal/repository/db.go
type DBTX (line 12) | type DBTX interface
function New (line 19) | func New(db DBTX) *Queries {
type Queries (line 23) | type Queries struct
method WithTx (line 27) | func (q *Queries) WithTx(tx *sql.Tx) *Queries {
FILE: internal/repository/models.go
type OidcCode (line 7) | type OidcCode struct
type OidcToken (line 17) | type OidcToken struct
type OidcUserinfo (line 28) | type OidcUserinfo struct
type Session (line 37) | type Session struct
FILE: internal/repository/oidc_queries.sql.go
constant createOidcCode (line 12) | createOidcCode = `-- name: CreateOidcCode :one
type CreateOidcCodeParams (line 27) | type CreateOidcCodeParams struct
method CreateOidcCode (line 37) | func (q *Queries) CreateOidcCode(ctx context.Context, arg CreateOidcCode...
constant createOidcToken (line 60) | createOidcToken = `-- name: CreateOidcToken :one
type CreateOidcTokenParams (line 76) | type CreateOidcTokenParams struct
method CreateOidcToken (line 87) | func (q *Queries) CreateOidcToken(ctx context.Context, arg CreateOidcTok...
constant createOidcUserInfo (line 112) | createOidcUserInfo = `-- name: CreateOidcUserInfo :one
type CreateOidcUserInfoParams (line 126) | type CreateOidcUserInfoParams struct
method CreateOidcUserInfo (line 135) | func (q *Queries) CreateOidcUserInfo(ctx context.Context, arg CreateOidc...
constant deleteExpiredOidcCodes (line 156) | deleteExpiredOidcCodes = `-- name: DeleteExpiredOidcCodes :many
method DeleteExpiredOidcCodes (line 162) | func (q *Queries) DeleteExpiredOidcCodes(ctx context.Context, expiresAt ...
constant deleteExpiredOidcTokens (line 193) | deleteExpiredOidcTokens = `-- name: DeleteExpiredOidcTokens :many
type DeleteExpiredOidcTokensParams (line 199) | type DeleteExpiredOidcTokensParams struct
method DeleteExpiredOidcTokens (line 204) | func (q *Queries) DeleteExpiredOidcTokens(ctx context.Context, arg Delet...
constant deleteOidcCode (line 236) | deleteOidcCode = `-- name: DeleteOidcCode :exec
method DeleteOidcCode (line 241) | func (q *Queries) DeleteOidcCode(ctx context.Context, codeHash string) e...
constant deleteOidcCodeBySub (line 246) | deleteOidcCodeBySub = `-- name: DeleteOidcCodeBySub :exec
method DeleteOidcCodeBySub (line 251) | func (q *Queries) DeleteOidcCodeBySub(ctx context.Context, sub string) e...
constant deleteOidcToken (line 256) | deleteOidcToken = `-- name: DeleteOidcToken :exec
method DeleteOidcToken (line 261) | func (q *Queries) DeleteOidcToken(ctx context.Context, accessTokenHash s...
constant deleteOidcTokenBySub (line 266) | deleteOidcTokenBySub = `-- name: DeleteOidcTokenBySub :exec
method DeleteOidcTokenBySub (line 271) | func (q *Queries) DeleteOidcTokenBySub(ctx context.Context, sub string) ...
constant deleteOidcUserInfo (line 276) | deleteOidcUserInfo = `-- name: DeleteOidcUserInfo :exec
method DeleteOidcUserInfo (line 281) | func (q *Queries) DeleteOidcUserInfo(ctx context.Context, sub string) er...
constant getOidcCode (line 286) | getOidcCode = `-- name: GetOidcCode :one
method GetOidcCode (line 292) | func (q *Queries) GetOidcCode(ctx context.Context, codeHash string) (Oid...
constant getOidcCodeBySub (line 307) | getOidcCodeBySub = `-- name: GetOidcCodeBySub :one
method GetOidcCodeBySub (line 313) | func (q *Queries) GetOidcCodeBySub(ctx context.Context, sub string) (Oid...
constant getOidcCodeBySubUnsafe (line 328) | getOidcCodeBySubUnsafe = `-- name: GetOidcCodeBySubUnsafe :one
method GetOidcCodeBySubUnsafe (line 333) | func (q *Queries) GetOidcCodeBySubUnsafe(ctx context.Context, sub string...
constant getOidcCodeUnsafe (line 348) | getOidcCodeUnsafe = `-- name: GetOidcCodeUnsafe :one
method GetOidcCodeUnsafe (line 353) | func (q *Queries) GetOidcCodeUnsafe(ctx context.Context, codeHash string...
constant getOidcToken (line 368) | getOidcToken = `-- name: GetOidcToken :one
method GetOidcToken (line 373) | func (q *Queries) GetOidcToken(ctx context.Context, accessTokenHash stri...
constant getOidcTokenByRefreshToken (line 389) | getOidcTokenByRefreshToken = `-- name: GetOidcTokenByRefreshToken :one
method GetOidcTokenByRefreshToken (line 394) | func (q *Queries) GetOidcTokenByRefreshToken(ctx context.Context, refres...
constant getOidcTokenBySub (line 410) | getOidcTokenBySub = `-- name: GetOidcTokenBySub :one
method GetOidcTokenBySub (line 415) | func (q *Queries) GetOidcTokenBySub(ctx context.Context, sub string) (Oi...
constant getOidcUserInfo (line 431) | getOidcUserInfo = `-- name: GetOidcUserInfo :one
method GetOidcUserInfo (line 436) | func (q *Queries) GetOidcUserInfo(ctx context.Context, sub string) (Oidc...
constant updateOidcTokenByRefreshToken (line 450) | updateOidcTokenByRefreshToken = `-- name: UpdateOidcTokenByRefreshToken ...
type UpdateOidcTokenByRefreshTokenParams (line 460) | type UpdateOidcTokenByRefreshTokenParams struct
method UpdateOidcTokenByRefreshToken (line 468) | func (q *Queries) UpdateOidcTokenByRefreshToken(ctx context.Context, arg...
FILE: internal/repository/session_queries.sql.go
constant createSession (line 12) | createSession = `-- name: CreateSession :one
type CreateSessionParams (line 31) | type CreateSessionParams struct
method CreateSession (line 45) | func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionPa...
constant deleteExpiredSessions (line 76) | deleteExpiredSessions = `-- name: DeleteExpiredSessions :exec
method DeleteExpiredSessions (line 81) | func (q *Queries) DeleteExpiredSessions(ctx context.Context, expiry int6...
constant deleteSession (line 86) | deleteSession = `-- name: DeleteSession :exec
method DeleteSession (line 91) | func (q *Queries) DeleteSession(ctx context.Context, uuid string) error {
constant getSession (line 96) | getSession = `-- name: GetSession :one
method GetSession (line 101) | func (q *Queries) GetSession(ctx context.Context, uuid string) (Session,...
constant updateSession (line 120) | updateSession = `-- name: UpdateSession :one
type UpdateSessionParams (line 135) | type UpdateSessionParams struct
method UpdateSession (line 148) | func (q *Queries) UpdateSession(ctx context.Context, arg UpdateSessionPa...
FILE: internal/service/access_controls_service.go
type AccessControlsService (line 11) | type AccessControlsService struct
method Init (line 23) | func (acls *AccessControlsService) Init() error {
method lookupStaticACLs (line 27) | func (acls *AccessControlsService) lookupStaticACLs(domain string) (co...
method GetAccessControls (line 42) | func (acls *AccessControlsService) GetAccessControls(domain string) (c...
function NewAccessControlsService (line 16) | func NewAccessControlsService(docker *DockerService, static map[string]c...
FILE: internal/service/auth_service.go
type LdapGroupsCache (line 22) | type LdapGroupsCache struct
type LoginAttempt (line 27) | type LoginAttempt struct
type AuthServiceConfig (line 33) | type AuthServiceConfig struct
type AuthService (line 47) | type AuthService struct
method Init (line 69) | func (auth *AuthService) Init() error {
method SearchUser (line 73) | func (auth *AuthService) SearchUser(username string) config.UserSearch {
method VerifyUser (line 102) | func (auth *AuthService) VerifyUser(search config.UserSearch, password...
method GetLocalUser (line 132) | func (auth *AuthService) GetLocalUser(username string) config.User {
method GetLdapUser (line 143) | func (auth *AuthService) GetLdapUser(userDN string) (config.LdapUser, ...
method CheckPassword (line 178) | func (auth *AuthService) CheckPassword(user config.User, password stri...
method IsAccountLocked (line 182) | func (auth *AuthService) IsAccountLocked(identifier string) (bool, int) {
method RecordLoginAttempt (line 203) | func (auth *AuthService) RecordLoginAttempt(identifier string, success...
method IsEmailWhitelisted (line 233) | func (auth *AuthService) IsEmailWhitelisted(email string) bool {
method CreateSessionCookie (line 237) | func (auth *AuthService) CreateSessionCookie(c *gin.Context, data *rep...
method RefreshSessionCookie (line 277) | func (auth *AuthService) RefreshSessionCookie(c *gin.Context) error {
method DeleteSessionCookie (line 329) | func (auth *AuthService) DeleteSessionCookie(c *gin.Context) error {
method GetSessionCookie (line 347) | func (auth *AuthService) GetSessionCookie(c *gin.Context) (repository....
method LocalAuthConfigured (line 396) | func (auth *AuthService) LocalAuthConfigured() bool {
method LdapAuthConfigured (line 400) | func (auth *AuthService) LdapAuthConfigured() bool {
method IsUserAllowed (line 404) | func (auth *AuthService) IsUserAllowed(c *gin.Context, context config....
method IsInOAuthGroup (line 421) | func (auth *AuthService) IsInOAuthGroup(c *gin.Context, context config...
method IsInLdapGroup (line 444) | func (auth *AuthService) IsInLdapGroup(c *gin.Context, context config....
method IsAuthEnabled (line 460) | func (auth *AuthService) IsAuthEnabled(uri string, path config.AppPath...
method GetBasicAuth (line 490) | func (auth *AuthService) GetBasicAuth(c *gin.Context) *config.User {
method CheckIP (line 502) | func (auth *AuthService) CheckIP(acls config.AppIP, ip string) bool {
method IsBypassedIP (line 540) | func (auth *AuthService) IsBypassedIP(acls config.AppIP, ip string) bo...
function NewAuthService (line 58) | func NewAuthService(config AuthServiceConfig, docker *DockerService, lda...
FILE: internal/service/docker_service.go
type DockerService (line 15) | type DockerService struct
method Init (line 25) | func (docker *DockerService) Init() error {
method getContainers (line 53) | func (docker *DockerService) getContainers() ([]container.Summary, err...
method inspectContainer (line 61) | func (docker *DockerService) inspectContainer(containerId string) (con...
method GetLabels (line 69) | func (docker *DockerService) GetLabels(appDomain string) (config.App, ...
function NewDockerService (line 21) | func NewDockerService() *DockerService {
FILE: internal/service/generic_oauth_service.go
type GenericOAuthService (line 20) | type GenericOAuthService struct
method Init (line 48) | func (generic *GenericOAuthService) Init() error {
method GenerateState (line 69) | func (generic *GenericOAuthService) GenerateState() string {
method GenerateVerifier (line 79) | func (generic *GenericOAuthService) GenerateVerifier() string {
method GetAuthURL (line 85) | func (generic *GenericOAuthService) GetAuthURL(state string) string {
method VerifyCode (line 89) | func (generic *GenericOAuthService) VerifyCode(code string) error {
method Userinfo (line 100) | func (generic *GenericOAuthService) Userinfo() (config.Claims, error) {
method GetName (line 130) | func (generic *GenericOAuthService) GetName() string {
function NewGenericOAuthService (line 30) | func NewGenericOAuthService(config config.OAuthServiceConfig) *GenericOA...
FILE: internal/service/github_oauth_service.go
type GithubEmailResponse (line 23) | type GithubEmailResponse
type GithubUserInfoResponse (line 28) | type GithubUserInfoResponse struct
type GithubOAuthService (line 34) | type GithubOAuthService struct
method Init (line 55) | func (github *GithubOAuthService) Init() error {
method GenerateState (line 65) | func (github *GithubOAuthService) GenerateState() string {
method GenerateVerifier (line 75) | func (github *GithubOAuthService) GenerateVerifier() string {
method GetAuthURL (line 81) | func (github *GithubOAuthService) GetAuthURL(state string) string {
method VerifyCode (line 85) | func (github *GithubOAuthService) VerifyCode(code string) error {
method Userinfo (line 96) | func (github *GithubOAuthService) Userinfo() (config.Claims, error) {
method GetName (line 182) | func (github *GithubOAuthService) GetName() string {
function NewGithubOAuthService (line 42) | func NewGithubOAuthService(config config.OAuthServiceConfig) *GithubOAut...
FILE: internal/service/google_oauth_service.go
type GoogleOAuthService (line 22) | type GoogleOAuthService struct
method Init (line 43) | func (google *GoogleOAuthService) Init() error {
method GenerateState (line 53) | func (oauth *GoogleOAuthService) GenerateState() string {
method GenerateVerifier (line 63) | func (google *GoogleOAuthService) GenerateVerifier() string {
method GetAuthURL (line 69) | func (google *GoogleOAuthService) GetAuthURL(state string) string {
method VerifyCode (line 73) | func (google *GoogleOAuthService) VerifyCode(code string) error {
method Userinfo (line 84) | func (google *GoogleOAuthService) Userinfo() (config.Claims, error) {
method GetName (line 114) | func (google *GoogleOAuthService) GetName() string {
function NewGoogleOAuthService (line 30) | func NewGoogleOAuthService(config config.OAuthServiceConfig) *GoogleOAut...
FILE: internal/service/ldap_service.go
type LdapServiceConfig (line 15) | type LdapServiceConfig struct
type LdapService (line 26) | type LdapService struct
method IsConfigured (line 40) | func (ldap *LdapService) IsConfigured() bool {
method Unconfigure (line 44) | func (ldap *LdapService) Unconfigure() error {
method Init (line 59) | func (ldap *LdapService) Init() error {
method connect (line 109) | func (ldap *LdapService) connect() (*ldapgo.Conn, error) {
method GetUserDN (line 146) | func (ldap *LdapService) GetUserDN(username string) (string, error) {
method GetUserGroups (line 175) | func (ldap *LdapService) GetUserGroups(userDN string) ([]string, error) {
method BindService (line 217) | func (ldap *LdapService) BindService(rebind bool) error {
method Bind (line 230) | func (ldap *LdapService) Bind(userDN string, password string) error {
method heartbeat (line 240) | func (ldap *LdapService) heartbeat() error {
method reconnect (line 262) | func (ldap *LdapService) reconnect() error {
function NewLdapService (line 34) | func NewLdapService(config LdapServiceConfig) *LdapService {
FILE: internal/service/oauth_broker_service.go
type OAuthService (line 12) | type OAuthService interface
type OAuthBrokerService (line 22) | type OAuthBrokerService struct
method Init (line 34) | func (broker *OAuthBrokerService) Init() error {
method GetConfiguredServices (line 61) | func (broker *OAuthBrokerService) GetConfiguredServices() []string {
method GetService (line 70) | func (broker *OAuthBrokerService) GetService(name string) (OAuthServic...
method GetUser (line 75) | func (broker *OAuthBrokerService) GetUser(service string) (config.Clai...
function NewOAuthBrokerService (line 27) | func NewOAuthBrokerService(configs map[string]config.OAuthServiceConfig)...
FILE: internal/service/oidc_service.go
type ClaimSet (line 44) | type ClaimSet struct
type UserinfoResponse (line 58) | type UserinfoResponse struct
type TokenResponse (line 68) | type TokenResponse struct
type AuthorizeRequest (line 77) | type AuthorizeRequest struct
type OIDCServiceConfig (line 86) | type OIDCServiceConfig struct
type OIDCService (line 94) | type OIDCService struct
method IsConfigured (line 111) | func (service *OIDCService) IsConfigured() bool {
method Init (line 115) | func (service *OIDCService) Init() error {
method GetIssuer (line 254) | func (service *OIDCService) GetIssuer() string {
method GetClient (line 258) | func (service *OIDCService) GetClient(id string) (config.OIDCClientCon...
method ValidateAuthorizeParams (line 263) | func (service *OIDCService) ValidateAuthorizeParams(req AuthorizeReque...
method filterScopes (line 299) | func (service *OIDCService) filterScopes(scopes []string) []string {
method StoreCode (line 305) | func (service *OIDCService) StoreCode(c *gin.Context, sub string, code...
method StoreUserinfo (line 324) | func (service *OIDCService) StoreUserinfo(c *gin.Context, sub string, ...
method ValidateGrantType (line 347) | func (service *OIDCService) ValidateGrantType(grantType string) error {
method GetCodeEntry (line 355) | func (service *OIDCService) GetCodeEntry(c *gin.Context, codeHash stri...
method generateIDToken (line 384) | func (service *OIDCService) generateIDToken(client config.OIDCClientCo...
method GenerateAccessToken (line 450) | func (service *OIDCService) GenerateAccessToken(c *gin.Context, client...
method RefreshAccessToken (line 498) | func (service *OIDCService) RefreshAccessToken(c *gin.Context, refresh...
method DeleteCodeEntry (line 561) | func (service *OIDCService) DeleteCodeEntry(c *gin.Context, codeHash s...
method DeleteUserinfo (line 565) | func (service *OIDCService) DeleteUserinfo(c *gin.Context, sub string)...
method DeleteToken (line 569) | func (service *OIDCService) DeleteToken(c *gin.Context, tokenHash stri...
method GetAccessToken (line 573) | func (service *OIDCService) GetAccessToken(c *gin.Context, tokenHash s...
method GetUserinfo (line 601) | func (service *OIDCService) GetUserinfo(c *gin.Context, sub string) (r...
method CompileUserinfo (line 605) | func (service *OIDCService) CompileUserinfo(user repository.OidcUserin...
method Hash (line 634) | func (service *OIDCService) Hash(token string) string {
method DeleteOldSession (line 640) | func (service *OIDCService) DeleteOldSession(ctx context.Context, sub ...
method Cleanup (line 657) | func (service *OIDCService) Cleanup() {
method GetJWK (line 711) | func (service *OIDCService) GetJWK() ([]byte, error) {
function NewOIDCService (line 104) | func NewOIDCService(config OIDCServiceConfig, queries *repository.Querie...
FILE: internal/utils/app_utils.go
function GetCookieDomain (line 17) | func GetCookieDomain(u string) (string, error) {
function ParseFileToLine (line 46) | func ParseFileToLine(content string) string {
function Filter (line 60) | func Filter[T any](slice []T, test func(T) bool) (res []T) {
function GetContext (line 70) | func GetContext(c *gin.Context) (config.UserContext, error) {
function IsRedirectSafe (line 86) | func IsRedirectSafe(redirectURL string, domain string) bool {
FILE: internal/utils/app_utils_test.go
function TestGetRootDomain (line 13) | func TestGetRootDomain(t *testing.T) {
function TestParseFileToLine (line 69) | func TestParseFileToLine(t *testing.T) {
function TestFilter (line 101) | func TestFilter(t *testing.T) {
function TestGetContext (line 138) | func TestGetContext(t *testing.T) {
function TestIsRedirectSafe (line 160) | func TestIsRedirectSafe(t *testing.T) {
FILE: internal/utils/decoders/label_decoder.go
function DecodeLabels (line 7) | func DecodeLabels[T any](labels map[string]string, root string) (T, erro...
FILE: internal/utils/decoders/label_decoder_test.go
function TestDecodeLabels (line 12) | func TestDecodeLabels(t *testing.T) {
FILE: internal/utils/fs_utils.go
function ReadFile (line 5) | func ReadFile(file string) (string, error) {
FILE: internal/utils/fs_utils_test.go
function TestReadFile (line 10) | func TestReadFile(t *testing.T) {
FILE: internal/utils/label_utils.go
function ParseHeaders (line 8) | func ParseHeaders(headers []string) map[string]string {
function SanitizeHeader (line 26) | func SanitizeHeader(header string) string {
FILE: internal/utils/label_utils_test.go
function TestParseHeaders (line 11) | func TestParseHeaders(t *testing.T) {
function TestSanitizeHeader (line 68) | func TestSanitizeHeader(t *testing.T) {
FILE: internal/utils/loaders/loader_env.go
type EnvLoader (line 13) | type EnvLoader struct
method Load (line 15) | func (e *EnvLoader) Load(_ []string, cmd *cli.Command) (bool, error) {
FILE: internal/utils/loaders/loader_file.go
type FileLoader (line 12) | type FileLoader struct
method Load (line 14) | func (f *FileLoader) Load(args []string, cmd *cli.Command) (bool, erro...
FILE: internal/utils/loaders/loader_flag.go
type FlagLoader (line 10) | type FlagLoader struct
method Load (line 12) | func (*FlagLoader) Load(args []string, cmd *cli.Command) (bool, error) {
FILE: internal/utils/security_utils.go
function GetSecret (line 14) | func GetSecret(conf string, file string) string {
function ParseSecretFile (line 31) | func ParseSecretFile(contents string) string {
function GetBasicAuth (line 44) | func GetBasicAuth(username string, password string) string {
function FilterIP (line 49) | func FilterIP(filter string, ip string) (bool, error) {
function CheckFilter (line 78) | func CheckFilter(filter string, str string) bool {
function GenerateUUID (line 105) | func GenerateUUID(str string) string {
function GenerateString (line 110) | func GenerateString(length int) string {
FILE: internal/utils/security_utils_test.go
function TestGetSecret (line 12) | func TestGetSecret(t *testing.T) {
function TestParseSecretFile (line 40) | func TestParseSecretFile(t *testing.T) {
function TestGetBasicAuth (line 58) | func TestGetBasicAuth(t *testing.T) {
function TestFilterIP (line 78) | func TestFilterIP(t *testing.T) {
function TestCheckFilter (line 120) | func TestCheckFilter(t *testing.T) {
function TestGenerateUUID (line 140) | func TestGenerateUUID(t *testing.T) {
FILE: internal/utils/string_utils.go
function Capitalize (line 7) | func Capitalize(str string) string {
function CoalesceToString (line 14) | func CoalesceToString(value any) string {
FILE: internal/utils/string_utils_test.go
function TestCapitalize (line 11) | func TestCapitalize(t *testing.T) {
function TestCoalesceToString (line 33) | func TestCoalesceToString(t *testing.T) {
function TestCompileUserEmail (line 53) | func TestCompileUserEmail(t *testing.T) {
FILE: internal/utils/tlog/log_audit.go
function AuditLoginSuccess (line 7) | func AuditLoginSuccess(c *gin.Context, username, provider string) {
function AuditLoginFailure (line 18) | func AuditLoginFailure(c *gin.Context, username, provider string, reason...
function AuditLogout (line 30) | func AuditLogout(c *gin.Context, username, provider string) {
FILE: internal/utils/tlog/log_wrapper.go
type Logger (line 13) | type Logger struct
method Init (line 58) | func (l *Logger) Init() {
function NewLogger (line 25) | func NewLogger(cfg config.LogConfig) *Logger {
function NewSimpleLogger (line 46) | func NewSimpleLogger() *Logger {
function createLogger (line 64) | func createLogger(component string, streamCfg config.LogStreamConfig, ba...
function parseLogLevel (line 76) | func parseLogLevel(level string) zerolog.Level {
FILE: internal/utils/tlog/log_wrapper_test.go
function TestNewLogger (line 15) | func TestNewLogger(t *testing.T) {
function TestNewSimpleLogger (line 34) | func TestNewSimpleLogger(t *testing.T) {
function TestLoggerInit (line 42) | func TestLoggerInit(t *testing.T) {
function TestLoggerWithDisabledStreams (line 49) | func TestLoggerWithDisabledStreams(t *testing.T) {
function TestLogStreamField (line 67) | func TestLogStreamField(t *testing.T) {
FILE: internal/utils/user_utils.go
function ParseUsers (line 12) | func ParseUsers(usersStr []string) ([]config.User, error) {
function GetUsers (line 33) | func GetUsers(usersCfg []string, usersPath string) ([]config.User, error) {
function ParseUser (line 65) | func ParseUser(userStr string) (config.User, error) {
function CompileUserEmail (line 96) | func CompileUserEmail(username string, domain string) string {
FILE: internal/utils/user_utils_test.go
function TestGetUsers (line 12) | func TestGetUsers(t *testing.T) {
function TestParseUsers (line 77) | func TestParseUsers(t *testing.T) {
function TestParseUser (line 106) | func TestParseUser(t *testing.T) {
FILE: sql/oidc_schemas.sql
type "oidc_codes" (line 1) | CREATE TABLE IF NOT EXISTS "oidc_codes" (
type "oidc_tokens" (line 11) | CREATE TABLE IF NOT EXISTS "oidc_tokens" (
type "oidc_userinfo" (line 22) | CREATE TABLE IF NOT EXISTS "oidc_userinfo" (
FILE: sql/session_schemas.sql
type "sessions" (line 1) | CREATE TABLE IF NOT EXISTS "sessions" (
Condensed preview — 209 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (736K chars).
[
{
"path": ".coderabbit.yaml",
"chars": 52,
"preview": "issue_enrichment:\n auto_enrich:\n enabled: false\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 809,
"preview": "---\nname: Bug report\nabout: Create a report to help improve Tinyauth\ntitle: \"[BUG]\"\nlabels: bug\nassignees: steveiliop56\n"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 623,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: \"[FEATURE]\"\nlabels: enhancement\nassignees: stev"
},
{
"path": ".github/dependabot.yml",
"chars": 479,
"preview": "version: 2\nupdates:\n - package-ecosystem: \"bun\"\n directory: \"/frontend\"\n groups:\n minor-patch:\n updat"
},
{
"path": ".github/workflows/ci.yml",
"chars": 1292,
"preview": "name: Tinyauth CI\non:\n push:\n branches:\n - main\n pull_request:\n\njobs:\n ci:\n runs-on: ubuntu-latest\n ste"
},
{
"path": ".github/workflows/nightly.yml",
"chars": 15607,
"preview": "name: Nightly Release\non:\n workflow_dispatch:\n schedule:\n - cron: \"0 0 * * *\"\n\njobs:\n create-release:\n runs-on:"
},
{
"path": ".github/workflows/release.yml",
"chars": 14890,
"preview": "name: Release\non:\n workflow_dispatch:\n push:\n tags:\n - \"v*\"\n\njobs:\n generate-metadata:\n runs-on: ubuntu-la"
},
{
"path": ".github/workflows/sponsors.yml",
"chars": 996,
"preview": "name: Generate Sponsors List\non:\n workflow_dispatch:\n\njobs:\n generate-sponsors:\n runs-on: ubuntu-latest\n steps:\n"
},
{
"path": ".github/workflows/stale.yml",
"chars": 644,
"preview": "name: Close stale issues and PRs\non:\n schedule:\n - cron: 0 10 * * *\n\njobs:\n stale:\n runs-on: ubuntu-latest\n s"
},
{
"path": ".gitignore",
"chars": 496,
"preview": "# dist\n/internal/assets/dist\n\n# binaries\n/tinyauth\n/tinyauth-arm64\n/tinyauth-amd64\n\n# test docker compose\n/docker-compos"
},
{
"path": ".gitmodules",
"chars": 94,
"preview": "[submodule \"paerser\"]\n\tpath = paerser\n\turl = https://github.com/traefik/paerser\n\tignore = all\n"
},
{
"path": ".vscode/launch.json",
"chars": 281,
"preview": "{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"name\": \"Connect to server\",\n \"type\": \"go\",\n \"reques"
},
{
"path": ".zed/debug.json",
"chars": 232,
"preview": "[\n {\n \"label\": \"Attach to remote Delve\",\n \"adapter\": \"Delve\",\n \"mode\": \"remote\",\n \"remotePath\": \"/tinyauth\""
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 5202,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participa"
},
{
"path": "CONTRIBUTING.md",
"chars": 2232,
"preview": "# Contributing\n\nContributing to Tinyauth is straightforward. Follow the steps below to set up a development server.\n\n## "
},
{
"path": "Dockerfile",
"chars": 1480,
"preview": "# Site builder\nFROM oven/bun:1.3.10-alpine AS frontend-builder\n\nWORKDIR /frontend\n\nCOPY ./frontend/package.json ./\nCOPY "
},
{
"path": "Dockerfile.dev",
"chars": 436,
"preview": "FROM golang:1.25-alpine3.21\n\nWORKDIR /tinyauth\n\nCOPY ./paerser ./paerser\n\nCOPY go.mod ./\nCOPY go.sum ./\n\nRUN go mod down"
},
{
"path": "Dockerfile.distroless",
"chars": 1633,
"preview": "# Site builder\nFROM oven/bun:1.3.10-alpine AS frontend-builder\n\nWORKDIR /frontend\n\nCOPY ./frontend/package.json ./\nCOPY "
},
{
"path": "FUNDING.yml",
"chars": 51,
"preview": "github: steveiliop56\nbuy_me_a_coffee: steveiliop56\n"
},
{
"path": "LICENSE",
"chars": 35148,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "Makefile",
"chars": 2182,
"preview": "# Go specific stuff\nCGO_ENABLED := 0\nGOOS := $(shell go env GOOS)\nGOARCH := $(shell go env GOARCH)\n\n# Build out\nTAG_NAME"
},
{
"path": "README.md",
"chars": 5893,
"preview": "<div align=\"center\">\n <img alt=\"Tinyauth\" title=\"Tinyauth\" width=\"96\" src=\"assets/logo-rounded.png\">\n <h1>Tinyauth"
},
{
"path": "SECURITY.md",
"chars": 721,
"preview": "# Security Policy\n\n## Supported Versions\n\nIt is recommended to use the [latest](https://github.com/steveiliop56/tinyauth"
},
{
"path": "air.toml",
"chars": 696,
"preview": "root = \"/tinyauth\"\ntmp_dir = \"tmp\"\n\n[build]\npre_cmd = [\"mkdir -p internal/assets/dist\", \"mkdir -p /data\", \"echo 'backend"
},
{
"path": "assets/discohook.json",
"chars": 814,
"preview": "{\n \"content\": null,\n \"embeds\": [\n {\n \"title\": \"Welcome to Tinyauth Discord!\",\n \"description\": \"Tinyauth i"
},
{
"path": "cmd/tinyauth/create_oidc_client.go",
"chars": 2224,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/google/uuid\"\n\t\"github.com/steveiliop56/tinyau"
},
{
"path": "cmd/tinyauth/create_user.go",
"chars": 2447,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/charmbracelet/huh\"\n\t\"github.com/steveiliop56/tinyauth/i"
},
{
"path": "cmd/tinyauth/generate_totp.go",
"chars": 2729,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/utils\"\n\t\"github.co"
},
{
"path": "cmd/tinyauth/healthcheck.go",
"chars": 1883,
"preview": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/steveiliop56/tiny"
},
{
"path": "cmd/tinyauth/tinyauth.go",
"chars": 2589,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/bootstrap\"\n\t\"github.com/steveiliop56/tinyauth"
},
{
"path": "cmd/tinyauth/verify_user.go",
"chars": 2823,
"preview": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/utils\"\n\t\"github.com/steveiliop56/ti"
},
{
"path": "cmd/tinyauth/version.go",
"chars": 524,
"preview": "package main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n\n\t\"github.com/traefik/paerser/cli\"\n)\n"
},
{
"path": "codecov.yml",
"chars": 130,
"preview": "coverage:\n status:\n project:\n default:\n informational: true\n patch:\n default:\n informatio"
},
{
"path": "crowdin.yml",
"chars": 239,
"preview": "\"base_path\": \".\"\n\"base_url\": \"https://api.crowdin.com\"\n\n\"preserve_hierarchy\": true\n\nfiles:\n [\n {\n \"source\": \"/f"
},
{
"path": "docker-compose.dev.yml",
"chars": 1391,
"preview": "services:\n traefik:\n image: traefik:v3.6\n command: --api.insecure=true --providers.docker\n ports:\n - 80:8"
},
{
"path": "docker-compose.example.yml",
"chars": 874,
"preview": "services:\n traefik:\n image: traefik:v3.6\n command: --api.insecure=true --providers.docker\n ports:\n - 80:8"
},
{
"path": "frontend/.gitignore",
"chars": 277,
"preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\npnpm-debug.log*\nlerna-debug.log*\n\nnode_modules\ndist\ndis"
},
{
"path": "frontend/.prettierignore",
"chars": 80,
"preview": "# Ignore artifacts:\ndist\nnode_modules\nbun.lock\npackage.json\nsrc/lib/i18n/locales"
},
{
"path": "frontend/.prettierrc",
"chars": 3,
"preview": "{}\n"
},
{
"path": "frontend/Dockerfile.dev",
"chars": 439,
"preview": "FROM oven/bun:1.2.16-alpine\n\nWORKDIR /frontend\n\nCOPY ./frontend/package.json ./\nCOPY ./frontend/bun.lock ./\n\nRUN bun ins"
},
{
"path": "frontend/components.json",
"chars": 426,
"preview": "{\n \"$schema\": \"https://ui.shadcn.com/schema.json\",\n \"style\": \"new-york\",\n \"rsc\": false,\n \"tsx\": true,\n \"tailwind\": "
},
{
"path": "frontend/eslint.config.js",
"chars": 885,
"preview": "import js from \"@eslint/js\";\nimport globals from \"globals\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\nimport r"
},
{
"path": "frontend/index.html",
"chars": 749,
"preview": "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-w"
},
{
"path": "frontend/package.json",
"chars": 1758,
"preview": "{\n \"name\": \"tinyauth\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n "
},
{
"path": "frontend/public/site.webmanifest",
"chars": 438,
"preview": "{\n \"name\": \"Tinyauth\",\n \"short_name\": \"Tinyauth\",\n \"icons\": [\n {\n \"src\": \"/web-app-manifest-192x192.png\",\n "
},
{
"path": "frontend/src/App.tsx",
"chars": 287,
"preview": "import { Navigate } from \"react-router\";\nimport { useUserContext } from \"./context/user-context\";\n\nexport const App = ()"
},
{
"path": "frontend/src/components/auth/login-form.tsx",
"chars": 2553,
"preview": "import { useTranslation } from \"react-i18next\";\nimport { Input } from \"../ui/input\";\nimport { useForm } from \"react-hook"
},
{
"path": "frontend/src/components/auth/totp-form.tsx",
"chars": 2075,
"preview": "import { Form, FormControl, FormField, FormItem } from \"../ui/form\";\nimport {\n InputOTP,\n InputOTPGroup,\n InputOTPSep"
},
{
"path": "frontend/src/components/domain-warning/domain-warning.tsx",
"chars": 1718,
"preview": "import {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"../ui/card\";\nimport { Button } from \".."
},
{
"path": "frontend/src/components/icons/github.tsx",
"chars": 890,
"preview": "import type { SVGProps } from \"react\";\n\nexport function GithubIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg"
},
{
"path": "frontend/src/components/icons/google.tsx",
"chars": 1294,
"preview": "import type { SVGProps } from \"react\";\n\nexport function GoogleIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg"
},
{
"path": "frontend/src/components/icons/microsoft.tsx",
"chars": 555,
"preview": "import type { SVGProps } from \"react\";\n\nexport function MicrosoftIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <"
},
{
"path": "frontend/src/components/icons/oauth.tsx",
"chars": 759,
"preview": "import type { SVGProps } from \"react\";\n\nexport function OAuthIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg\n"
},
{
"path": "frontend/src/components/icons/pocket-id.tsx",
"chars": 639,
"preview": "import type { SVGProps } from \"react\";\n\nexport function PocketIDIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <s"
},
{
"path": "frontend/src/components/icons/tailscale.tsx",
"chars": 1349,
"preview": "import type { SVGProps } from \"react\";\n\nexport function TailscaleIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <"
},
{
"path": "frontend/src/components/language/language.tsx",
"chars": 939,
"preview": "import { languages, SupportedLanguage } from \"@/lib/i18n/locales\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n S"
},
{
"path": "frontend/src/components/layout/layout.tsx",
"chars": 1802,
"preview": "import { useAppContext } from \"@/context/app-context\";\nimport { LanguageSelector } from \"../language/language\";\nimport {"
},
{
"path": "frontend/src/components/providers/theme-provider.tsx",
"chars": 1606,
"preview": "import { createContext, useContext, useEffect, useState } from \"react\";\n\ntype Theme = \"dark\" | \"light\" | \"system\";\n\ntype"
},
{
"path": "frontend/src/components/theme-toggle/theme-toggle.tsx",
"chars": 1293,
"preview": "import { Moon, Sun } from \"lucide-react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n DropdownMenu,\n D"
},
{
"path": "frontend/src/components/ui/button.tsx",
"chars": 2641,
"preview": "import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"cla"
},
{
"path": "frontend/src/components/ui/card.tsx",
"chars": 1999,
"preview": "import * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Card({ className, ...props }: React.Compone"
},
{
"path": "frontend/src/components/ui/dropdown-menu.tsx",
"chars": 8410,
"preview": "import * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { CheckIcon"
},
{
"path": "frontend/src/components/ui/form.tsx",
"chars": 3788,
"preview": "import * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui"
},
{
"path": "frontend/src/components/ui/input-otp.tsx",
"chars": 2255,
"preview": "import * as React from \"react\";\nimport { OTPInput, OTPInputContext } from \"input-otp\";\nimport { MinusIcon } from \"lucide"
},
{
"path": "frontend/src/components/ui/input.tsx",
"chars": 972,
"preview": "import * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Input({ className, type, ...props }: React."
},
{
"path": "frontend/src/components/ui/label.tsx",
"chars": 603,
"preview": "import * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\n\nimport { cn } from \"@/lib/util"
},
{
"path": "frontend/src/components/ui/oauth-button.tsx",
"chars": 725,
"preview": "import { Loader2 } from \"lucide-react\";\nimport { Button } from \"./button\";\nimport React from \"react\";\nimport { twMerge }"
},
{
"path": "frontend/src/components/ui/select.tsx",
"chars": 6239,
"preview": "import * as React from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { CheckIcon, ChevronDo"
},
{
"path": "frontend/src/components/ui/separator.tsx",
"chars": 1038,
"preview": "\"use client\";\n\nimport * as React from \"react\";\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\n\nimport "
},
{
"path": "frontend/src/components/ui/sonner.tsx",
"chars": 561,
"preview": "import { useTheme } from \"../providers/theme-provider\";\nimport { Toaster as Sonner, ToasterProps } from \"sonner\";\n\nconst"
},
{
"path": "frontend/src/components/ui/tooltip.tsx",
"chars": 1816,
"preview": "import * as React from \"react\"\nimport { Tooltip as TooltipPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n"
},
{
"path": "frontend/src/context/app-context.tsx",
"chars": 1024,
"preview": "import {\n appContextSchema,\n AppContextSchema,\n} from \"@/schemas/app-context-schema\";\nimport { createContext, useConte"
},
{
"path": "frontend/src/context/user-context.tsx",
"chars": 1064,
"preview": "import {\n userContextSchema,\n UserContextSchema,\n} from \"@/schemas/user-context-schema\";\nimport { createContext, useCo"
},
{
"path": "frontend/src/index.css",
"chars": 5104,
"preview": "@import \"tailwindcss\";\n@import \"tw-animate-css\";\n\n@custom-variant dark (&:is(.dark *));\n\n@theme inline {\n --radius-sm: "
},
{
"path": "frontend/src/lib/hooks/oidc.ts",
"chars": 1183,
"preview": "export type OIDCValues = {\n scope: string;\n response_type: string;\n client_id: string;\n redirect_uri: string;\n stat"
},
{
"path": "frontend/src/lib/hooks/redirect-uri.ts",
"chars": 1230,
"preview": "type IuseRedirectUri = {\n url?: URL;\n valid: boolean;\n trusted: boolean;\n allowedProto: boolean;\n httpsDowngrade: b"
},
{
"path": "frontend/src/lib/i18n/i18n.ts",
"chars": 611,
"preview": "import i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport LanguageDetector from \"i18next-brow"
},
{
"path": "frontend/src/lib/i18n/locales/af-ZA.json",
"chars": 5548,
"preview": "{\n \"loginTitle\": \"Welcome back, login with\",\n \"loginTitleSimple\": \"Welcome back, please login\",\n \"loginDivider\""
},
{
"path": "frontend/src/lib/i18n/locales/ar-SA.json",
"chars": 5531,
"preview": "{\n \"loginTitle\": \"مرحبا بعودتك، ادخل باستخدام\",\n \"loginTitleSimple\": \"مرحبا بعودتك، سجل دخولك\",\n \"loginDivider\""
},
{
"path": "frontend/src/lib/i18n/locales/ca-ES.json",
"chars": 5548,
"preview": "{\n \"loginTitle\": \"Welcome back, login with\",\n \"loginTitleSimple\": \"Welcome back, please login\",\n \"loginDivider\""
},
{
"path": "frontend/src/lib/i18n/locales/cs-CZ.json",
"chars": 5581,
"preview": "{\n \"loginTitle\": \"Vítejte zpět, přihlaste se pomocí\",\n \"loginTitleSimple\": \"Vítejte zpět, přihlaste se prosím\",\n "
},
{
"path": "frontend/src/lib/i18n/locales/da-DK.json",
"chars": 5671,
"preview": "{\n \"loginTitle\": \"Velkommen tilbage, log ind med\",\n \"loginTitleSimple\": \"Velkommen tilbage, log venligst ind\",\n "
},
{
"path": "frontend/src/lib/i18n/locales/de-DE.json",
"chars": 6031,
"preview": "{\n \"loginTitle\": \"Willkommen zurück, logge dich ein mit\",\n \"loginTitleSimple\": \"Willkommen zurück, bitte anmelden\""
},
{
"path": "frontend/src/lib/i18n/locales/el-GR.json",
"chars": 6136,
"preview": "{\n \"loginTitle\": \"Καλώς ήρθατε, συνδεθείτε με\",\n \"loginTitleSimple\": \"Καλώς ήρθατε, παρακαλώ συνδεθείτε\",\n \"log"
},
{
"path": "frontend/src/lib/i18n/locales/en-US.json",
"chars": 5511,
"preview": "{\n \"loginTitle\": \"Welcome back, login with\",\n \"loginTitleSimple\": \"Welcome back, please login\",\n \"loginDivider\""
},
{
"path": "frontend/src/lib/i18n/locales/en.json",
"chars": 5511,
"preview": "{\n \"loginTitle\": \"Welcome back, login with\",\n \"loginTitleSimple\": \"Welcome back, please login\",\n \"loginDivider\""
},
{
"path": "frontend/src/lib/i18n/locales/es-ES.json",
"chars": 5861,
"preview": "{\n \"loginTitle\": \"Bienvenido de vuelta, inicie sesión con\",\n \"loginTitleSimple\": \"Bienvenido de vuelta, por favor "
},
{
"path": "frontend/src/lib/i18n/locales/fi-FI.json",
"chars": 5761,
"preview": "{\n \"loginTitle\": \"Tervetuloa takaisin, kirjaudu sisään käyttäen\",\n \"loginTitleSimple\": \"Tervetuloa takaisin, ole h"
},
{
"path": "frontend/src/lib/i18n/locales/fr-FR.json",
"chars": 6222,
"preview": "{\n \"loginTitle\": \"Bienvenue, connectez-vous avec\",\n \"loginTitleSimple\": \"De retour parmi nous, veuillez vous conne"
},
{
"path": "frontend/src/lib/i18n/locales/he-IL.json",
"chars": 5548,
"preview": "{\n \"loginTitle\": \"Welcome back, login with\",\n \"loginTitleSimple\": \"Welcome back, please login\",\n \"loginDivider\""
},
{
"path": "frontend/src/lib/i18n/locales/hu-HU.json",
"chars": 5606,
"preview": "{\n \"loginTitle\": \"Welcome back, login with\",\n \"loginTitleSimple\": \"Üdvözöljük, kérem jelentkezzen be\",\n \"loginD"
},
{
"path": "frontend/src/lib/i18n/locales/it-IT.json",
"chars": 5836,
"preview": "{\n \"loginTitle\": \"Bentornato, accedi con\",\n \"loginTitleSimple\": \"Bentornato, accedi al tuo account\",\n \"loginDiv"
},
{
"path": "frontend/src/lib/i18n/locales/ja-JP.json",
"chars": 5548,
"preview": "{\n \"loginTitle\": \"Welcome back, login with\",\n \"loginTitleSimple\": \"Welcome back, please login\",\n \"loginDivider\""
},
{
"path": "frontend/src/lib/i18n/locales/ko-KR.json",
"chars": 4285,
"preview": "{\n \"loginTitle\": \"다시 오신 것을 환영합니다. 아래 방법으로 로그인하세요\",\n \"loginTitleSimple\": \"다시 오신 것을 환영합니다. 로그인해 주세요\",\n \"loginDivi"
},
{
"path": "frontend/src/lib/i18n/locales/nl-NL.json",
"chars": 5799,
"preview": "{\n \"loginTitle\": \"Welkom terug, log in met\",\n \"loginTitleSimple\": \"Welkom terug, log in\",\n \"loginDivider\": \"Of\""
},
{
"path": "frontend/src/lib/i18n/locales/no-NO.json",
"chars": 5548,
"preview": "{\n \"loginTitle\": \"Welcome back, login with\",\n \"loginTitleSimple\": \"Welcome back, please login\",\n \"loginDivider\""
},
{
"path": "frontend/src/lib/i18n/locales/pl-PL.json",
"chars": 5792,
"preview": "{\n \"loginTitle\": \"Witaj ponownie, zaloguj się przez\",\n \"loginTitleSimple\": \"Witaj ponownie, zaloguj się\",\n \"log"
},
{
"path": "frontend/src/lib/i18n/locales/pt-BR.json",
"chars": 5803,
"preview": "{\n \"loginTitle\": \"Bem-vindo de volta, acesse com\",\n \"loginTitleSimple\": \"Bem-vindo de volta, faça o login\",\n \"l"
},
{
"path": "frontend/src/lib/i18n/locales/pt-PT.json",
"chars": 5877,
"preview": "{\n \"loginTitle\": \"Bem-vindo de volta, inicia sessão com\",\n \"loginTitleSimple\": \"Bem-vindo de volta, inicia sessão\""
},
{
"path": "frontend/src/lib/i18n/locales/ro-RO.json",
"chars": 5548,
"preview": "{\n \"loginTitle\": \"Welcome back, login with\",\n \"loginTitleSimple\": \"Welcome back, please login\",\n \"loginDivider\""
},
{
"path": "frontend/src/lib/i18n/locales/ru-RU.json",
"chars": 5542,
"preview": "{\n \"loginTitle\": \"С возвращением, войти с\",\n \"loginTitleSimple\": \"С возвращением, пожалуйста войдите\",\n \"loginD"
},
{
"path": "frontend/src/lib/i18n/locales/sr-SP.json",
"chars": 5792,
"preview": "{\n \"loginTitle\": \"Добродошли назад, пријавите се са\",\n \"loginTitleSimple\": \"Добродошли назад, молим вас пријавите "
},
{
"path": "frontend/src/lib/i18n/locales/sv-SE.json",
"chars": 5595,
"preview": "{\n \"loginTitle\": \"Välkommen tillbaka, logga in med\",\n \"loginTitleSimple\": \"Välkommen tillbaka, logga in\",\n \"log"
},
{
"path": "frontend/src/lib/i18n/locales/tr-TR.json",
"chars": 5827,
"preview": "{\n \"loginTitle\": \"Tekrar Hoş Geldiniz, giriş yapın\",\n \"loginTitleSimple\": \"Tekrar hoş geldiniz, lütfen giriş yapın"
},
{
"path": "frontend/src/lib/i18n/locales/uk-UA.json",
"chars": 5821,
"preview": "{\n \"loginTitle\": \"З поверненням, увійдіть через\",\n \"loginTitleSimple\": \"З поверненням, будь ласка, авторизуйтесь\","
},
{
"path": "frontend/src/lib/i18n/locales/vi-VN.json",
"chars": 5543,
"preview": "{\n \"loginTitle\": \"Welcome back, login with\",\n \"loginTitleSimple\": \"Welcome back, please login\",\n \"loginDivider\""
},
{
"path": "frontend/src/lib/i18n/locales/zh-CN.json",
"chars": 3638,
"preview": "{\n \"loginTitle\": \"欢迎回来,请使用以下方式登录\",\n \"loginTitleSimple\": \"欢迎回来,请登录\",\n \"loginDivider\": \"或\",\n \"loginUsername\": "
},
{
"path": "frontend/src/lib/i18n/locales/zh-TW.json",
"chars": 3873,
"preview": "{\n \"loginTitle\": \"歡迎回來,請使用以下方式登入\",\n \"loginTitleSimple\": \"歡迎回來,請登入\",\n \"loginDivider\": \"或\",\n \"loginUsername\": "
},
{
"path": "frontend/src/lib/i18n/locales.ts",
"chars": 853,
"preview": "export const languages = {\n \"af-ZA\": \"Afrikaans\",\n \"ar-SA\": \"العربية\",\n \"ca-ES\": \"Català\",\n \"cs-CZ\": \"Čeština\",\n \"d"
},
{
"path": "frontend/src/lib/utils.ts",
"chars": 271,
"preview": "import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: C"
},
{
"path": "frontend/src/main.tsx",
"chars": 2732,
"preview": "import { StrictMode } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport \"./index.css\";\nimport { Layout"
},
{
"path": "frontend/src/pages/authorize-page.tsx",
"chars": 6300,
"preview": "import { useUserContext } from \"@/context/user-context\";\nimport { useMutation, useQuery } from \"@tanstack/react-query\";\n"
},
{
"path": "frontend/src/pages/continue-page.tsx",
"chars": 5053,
"preview": "import { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardDescription,\n CardFooter,\n CardHeader,\n CardT"
},
{
"path": "frontend/src/pages/error-page.tsx",
"chars": 880,
"preview": "import {\n Card,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { useTranslation } "
},
{
"path": "frontend/src/pages/forgot-password-page.tsx",
"chars": 1187,
"preview": "import {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card"
},
{
"path": "frontend/src/pages/login-page.tsx",
"chars": 8550,
"preview": "import { LoginForm } from \"@/components/auth/login-form\";\nimport { GithubIcon } from \"@/components/icons/github\";\nimport"
},
{
"path": "frontend/src/pages/logout-page.tsx",
"chars": 2584,
"preview": "import { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardDescription,\n CardFooter,\n CardHeader,\n CardT"
},
{
"path": "frontend/src/pages/not-found-page.tsx",
"chars": 993,
"preview": "import { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardDescription,\n CardFooter,\n CardHeader,\n CardT"
},
{
"path": "frontend/src/pages/totp-page.tsx",
"chars": 2679,
"preview": "import { TotpForm } from \"@/components/auth/totp-form\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Card"
},
{
"path": "frontend/src/pages/unauthorized-page.tsx",
"chars": 1865,
"preview": "import { Button } from \"@/components/ui/button\";\nimport {\n Card,\n CardDescription,\n CardFooter,\n CardHeader,\n CardT"
},
{
"path": "frontend/src/schemas/app-context-schema.ts",
"chars": 487,
"preview": "import { z } from \"zod\";\n\nexport const providerSchema = z.object({\n id: z.string(),\n name: z.string(),\n oauth: z.bool"
},
{
"path": "frontend/src/schemas/login-schema.ts",
"chars": 172,
"preview": "import { z } from \"zod\";\n\nexport const loginSchema = z.object({\n username: z.string(),\n password: z.string(),\n});\n\nexp"
},
{
"path": "frontend/src/schemas/oidc-schemas.ts",
"chars": 100,
"preview": "import { z } from \"zod\";\n\nexport const getOidcClientInfoSchema = z.object({\n name: z.string(),\n});\n"
},
{
"path": "frontend/src/schemas/totp-schema.ts",
"chars": 141,
"preview": "import { z } from \"zod\";\n\nexport const totpSchema = z.object({\n code: z.string(),\n});\n\nexport type TotpSchema = z.infer"
},
{
"path": "frontend/src/schemas/user-context-schema.ts",
"chars": 333,
"preview": "import { z } from \"zod\";\n\nexport const userContextSchema = z.object({\n isLoggedIn: z.boolean(),\n username: z.string(),"
},
{
"path": "frontend/src/vite-env.d.ts",
"chars": 38,
"preview": "/// <reference types=\"vite/client\" />\n"
},
{
"path": "frontend/tsconfig.app.json",
"chars": 754,
"preview": "{\n \"compilerOptions\": {\n // Resolve paths\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./src/*\"]\n },\n\n \"t"
},
{
"path": "frontend/tsconfig.json",
"chars": 213,
"preview": "{\n \"files\": [],\n \"references\": [\n { \"path\": \"./tsconfig.app.json\" },\n { \"path\": \"./tsconfig.node.json\" }\n ],\n "
},
{
"path": "frontend/tsconfig.node.json",
"chars": 593,
"preview": "{\n \"compilerOptions\": {\n \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.node.tsbuildinfo\",\n \"target\": \"ES2022\","
},
{
"path": "frontend/vite.config.ts",
"chars": 1667,
"preview": "import { defineConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react\";\nimport path from \"path\";\nimport tailwindc"
},
{
"path": "gen/gen.go",
"chars": 1156,
"preview": "package main\n\nimport (\n\t\"log/slog\"\n\t\"reflect\"\n)\n\nfunc main() {\n\tslog.Info(\"generating example env file\")\n\tgenerateExampl"
},
{
"path": "gen/gen_env.go",
"chars": 3211,
"preview": "package main\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\n\t\"github.com/steveili"
},
{
"path": "gen/gen_md.go",
"chars": 3400,
"preview": "package main\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\n\t\"github.com/steveili"
},
{
"path": "go.mod",
"chars": 5939,
"preview": "module github.com/steveiliop56/tinyauth\n\ngo 1.25.0\n\nreplace github.com/traefik/paerser v0.2.2 => ./paerser\n\nrequire (\n\tg"
},
{
"path": "go.sum",
"chars": 37597,
"preview": "github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg=\ngithub.c"
},
{
"path": "internal/assets/assets.go",
"chars": 166,
"preview": "package assets\n\nimport (\n\t\"embed\"\n)\n\n// Frontend\n//\n//go:embed dist\nvar FrontendAssets embed.FS\n\n// Migrations\n//\n//go:e"
},
{
"path": "internal/assets/migrations/000001_init_sqlite.down.sql",
"chars": 32,
"preview": "DROP TABLE IF EXISTS \"sessions\";"
},
{
"path": "internal/assets/migrations/000001_init_sqlite.up.sql",
"chars": 297,
"preview": "CREATE TABLE IF NOT EXISTS \"sessions\" (\n \"uuid\" TEXT NOT NULL PRIMARY KEY UNIQUE,\n \"username\" TEXT NOT NULL,\n \""
},
{
"path": "internal/assets/migrations/000002_oauth_name.down.sql",
"chars": 48,
"preview": "ALTER TABLE \"sessions\" DROP COLUMN \"oauth_name\";"
},
{
"path": "internal/assets/migrations/000002_oauth_name.up.sql",
"chars": 320,
"preview": "ALTER TABLE \"sessions\" ADD COLUMN \"oauth_name\" TEXT;\n\nUPDATE \"sessions\"\nSET \"oauth_name\" = CASE\n WHEN LOWER(\"provider\")"
},
{
"path": "internal/assets/migrations/000003_oauth_sub.down.sql",
"chars": 47,
"preview": "ALTER TABLE \"sessions\" DROP COLUMN \"oauth_sub\";"
},
{
"path": "internal/assets/migrations/000003_oauth_sub.up.sql",
"chars": 52,
"preview": "ALTER TABLE \"sessions\" ADD COLUMN \"oauth_sub\" TEXT;\n"
},
{
"path": "internal/assets/migrations/000004_created_at.down.sql",
"chars": 49,
"preview": "ALTER TABLE \"sessions\" DROP COLUMN \"created_at\";\n"
},
{
"path": "internal/assets/migrations/000004_created_at.up.sql",
"chars": 75,
"preview": "ALTER TABLE \"sessions\" ADD COLUMN \"created_at\" INTEGER NOT NULL DEFAULT 0;\n"
},
{
"path": "internal/assets/migrations/000005_oidc_session.down.sql",
"chars": 109,
"preview": "DROP TABLE IF EXISTS \"oidc_tokens\";\nDROP TABLE IF EXISTS \"oidc_userinfo\";\nDROP TABLE IF EXISTS \"oidc_codes\";\n"
},
{
"path": "internal/assets/migrations/000005_oidc_session.up.sql",
"chars": 825,
"preview": "CREATE TABLE IF NOT EXISTS \"oidc_codes\" (\n \"sub\" TEXT NOT NULL UNIQUE,\n \"code_hash\" TEXT NOT NULL PRIMARY KEY UNIQ"
},
{
"path": "internal/assets/migrations/000006_oidc_nonce.down.sql",
"chars": 93,
"preview": "ALTER TABLE \"oidc_codes\" DROP COLUMN \"nonce\";\nALTER TABLE \"oidc_tokens\" DROP COLUMN \"nonce\";\n"
},
{
"path": "internal/assets/migrations/000006_oidc_nonce.up.sql",
"chars": 123,
"preview": "ALTER TABLE \"oidc_codes\" ADD COLUMN \"nonce\" TEXT DEFAULT \"\";\nALTER TABLE \"oidc_tokens\" ADD COLUMN \"nonce\" TEXT DEFAULT \""
},
{
"path": "internal/bootstrap/app_bootstrap.go",
"chars": 7988,
"preview": "package bootstrap\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n"
},
{
"path": "internal/bootstrap/db_bootstrap.go",
"chars": 1472,
"preview": "package bootstrap\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/a"
},
{
"path": "internal/bootstrap/router_bootstrap.go",
"chars": 3653,
"preview": "package bootstrap\n\nimport (\n\t\"fmt\"\n\t\"slices\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n\t\"github.com/steveilio"
},
{
"path": "internal/bootstrap/service_bootstrap.go",
"chars": 3050,
"preview": "package bootstrap\n\nimport (\n\t\"github.com/steveiliop56/tinyauth/internal/repository\"\n\t\"github.com/steveiliop56/tinyauth/i"
},
{
"path": "internal/config/config.go",
"chars": 12525,
"preview": "package config\n\n// Default configuration\nfunc NewDefaultConfiguration() *Config {\n\treturn &Config{\n\t\tDatabase: DatabaseC"
},
{
"path": "internal/controller/context_controller.go",
"chars": 3816,
"preview": "package controller\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/utils\"\n\t\"github.com/steveili"
},
{
"path": "internal/controller/context_controller_test.go",
"chars": 4053,
"preview": "package controller_test\n\nimport (\n\t\"encoding/json\"\n\t\"net/http/httptest\"\n\t\"testing\"\n\n\t\"github.com/steveiliop56/tinyauth/i"
},
{
"path": "internal/controller/health_controller.go",
"chars": 550,
"preview": "package controller\n\nimport \"github.com/gin-gonic/gin\"\n\ntype HealthController struct {\n\trouter *gin.RouterGroup\n}\n\nfunc N"
},
{
"path": "internal/controller/oauth_controller.go",
"chars": 7439,
"preview": "package controller\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n"
},
{
"path": "internal/controller/oidc_controller.go",
"chars": 11971,
"preview": "package controller\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/gin-gonic/gin\"\n\t\"github.com"
},
{
"path": "internal/controller/oidc_controller_test.go",
"chars": 7414,
"preview": "package controller_test\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testi"
},
{
"path": "internal/controller/proxy_controller.go",
"chars": 13315,
"preview": "package controller\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/steveiliop56/tin"
},
{
"path": "internal/controller/proxy_controller_test.go",
"chars": 8443,
"preview": "package controller_test\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n\n\t\"github.com/steveiliop56/tinyauth/intern"
},
{
"path": "internal/controller/resources_controller.go",
"chars": 1101,
"preview": "package controller\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/gin-gonic/gin\"\n)\n\ntype ResourcesControllerConfig struct {\n\tPath "
},
{
"path": "internal/controller/resources_controller_test.go",
"chars": 1438,
"preview": "package controller_test\n\nimport (\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/con"
},
{
"path": "internal/controller/user_controller.go",
"chars": 7462,
"preview": "package controller\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/repository\"\n\t\"github.com/stevei"
},
{
"path": "internal/controller/user_controller_test.go",
"chars": 7435,
"preview": "package controller_test\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"git"
},
{
"path": "internal/controller/well_known_controller.go",
"chars": 3273,
"preview": "package controller\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/gin-gonic/gin\"\n\t\"github.com/steveiliop56/tinyauth/internal"
},
{
"path": "internal/middleware/context_middleware.go",
"chars": 5616,
"preview": "package middleware\n\nimport (\n\t\"slices\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n\t\"github."
},
{
"path": "internal/middleware/ui_middleware.go",
"chars": 1370,
"preview": "package middleware\n\nimport (\n\t\"fmt\"\n\t\"io/fs\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/steveiliop56/tinyauth/in"
},
{
"path": "internal/middleware/zerolog_middleware.go",
"chars": 1413,
"preview": "package middleware\n\nimport (\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/gin-gonic/gin\"\n\t\"github.com/steveiliop56/tinyauth/internal"
},
{
"path": "internal/repository/db.go",
"chars": 603,
"preview": "// Code generated by sqlc. DO NOT EDIT.\n// versions:\n// sqlc v1.30.0\n\npackage repository\n\nimport (\n\t\"context\"\n\t\"databa"
},
{
"path": "internal/repository/models.go",
"chars": 947,
"preview": "// Code generated by sqlc. DO NOT EDIT.\n// versions:\n// sqlc v1.30.0\n\npackage repository\n\ntype OidcCode struct {\n\tSub "
},
{
"path": "internal/repository/oidc_queries.sql.go",
"chars": 11659,
"preview": "// Code generated by sqlc. DO NOT EDIT.\n// versions:\n// sqlc v1.30.0\n// source: oidc_queries.sql\n\npackage repository\n\n"
},
{
"path": "internal/repository/session_queries.sql.go",
"chars": 3556,
"preview": "// Code generated by sqlc. DO NOT EDIT.\n// versions:\n// sqlc v1.30.0\n// source: session_queries.sql\n\npackage repositor"
},
{
"path": "internal/service/access_controls_service.go",
"chars": 1414,
"preview": "package service\n\nimport (\n\t\"errors\"\n\t\"strings\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n\t\"github.com/steveil"
},
{
"path": "internal/service/auth_service.go",
"chars": 14123,
"preview": "package service\n\nimport (\n\t\"database/sql\"\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/steveiliop"
},
{
"path": "internal/service/docker_service.go",
"chars": 2641,
"preview": "package service\n\nimport (\n\t\"context\"\n\t\"strings\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n\t\"github.com/stevei"
},
{
"path": "internal/service/generic_oauth_service.go",
"chars": 3058,
"preview": "package service\n\nimport (\n\t\"context\"\n\t\"crypto/rand\"\n\t\"crypto/tls\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net"
},
{
"path": "internal/service/github_oauth_service.go",
"chars": 3945,
"preview": "package service\n\nimport (\n\t\"context\"\n\t\"crypto/rand\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/htt"
},
{
"path": "internal/service/google_oauth_service.go",
"chars": 2671,
"preview": "package service\n\nimport (\n\t\"context\"\n\t\"crypto/rand\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strin"
},
{
"path": "internal/service/ldap_service.go",
"chars": 6695,
"preview": "package service\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/cenkalti/backoff/v5\"\n\tldapgo \"gi"
},
{
"path": "internal/service/oauth_broker_service.go",
"chars": 2008,
"preview": "package service\n\nimport (\n\t\"errors\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n\t\"github.com/steveiliop56/tinya"
},
{
"path": "internal/service/oidc_service.go",
"chars": 20666,
"preview": "package service\n\nimport (\n\t\"context\"\n\t\"crypto\"\n\t\"crypto/rand\"\n\t\"crypto/rsa\"\n\t\"crypto/sha256\"\n\t\"crypto/x509\"\n\t\"database/s"
},
{
"path": "internal/utils/app_utils.go",
"chars": 2127,
"preview": "package utils\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/confi"
},
{
"path": "internal/utils/app_utils_test.go",
"chars": 6165,
"preview": "package utils_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n\t\"github.com/steveiliop56/t"
},
{
"path": "internal/utils/decoders/label_decoder.go",
"chars": 321,
"preview": "package decoders\n\nimport (\n\t\"github.com/traefik/paerser/parser\"\n)\n\nfunc DecodeLabels[T any](labels map[string]string, ro"
},
{
"path": "internal/utils/decoders/label_decoder_test.go",
"chars": 2239,
"preview": "package decoders_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n\t\"github.com/steveiliop5"
},
{
"path": "internal/utils/fs_utils.go",
"chars": 234,
"preview": "package utils\n\nimport \"os\"\n\nfunc ReadFile(file string) (string, error) {\n\t_, err := os.Stat(file)\n\tif err != nil {\n\t\tret"
},
{
"path": "internal/utils/fs_utils_test.go",
"chars": 656,
"preview": "package utils\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"gotest.tools/v3/assert\"\n)\n\nfunc TestReadFile(t *testing.T) {\n\t// Setup\n\tfile"
},
{
"path": "internal/utils/label_utils.go",
"chars": 847,
"preview": "package utils\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc ParseHeaders(headers []string) map[string]string {\n\theaderMap := "
},
{
"path": "internal/utils/label_utils_test.go",
"chars": 2261,
"preview": "package utils_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/utils\"\n\n\t\"gotest.tools/v3/assert\"\n)"
},
{
"path": "internal/utils/loaders/loader_env.go",
"chars": 605,
"preview": "package loaders\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n\n\t\"github.com/traefik/paerse"
},
{
"path": "internal/utils/loaders/loader_file.go",
"chars": 955,
"preview": "package loaders\n\nimport (\n\t\"os\"\n\n\t\"github.com/rs/zerolog/log\"\n\t\"github.com/traefik/paerser/cli\"\n\t\"github.com/traefik/pae"
},
{
"path": "internal/utils/loaders/loader_flag.go",
"chars": 417,
"preview": "package loaders\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/traefik/paerser/cli\"\n\t\"github.com/traefik/paerser/flag\"\n)\n\ntype FlagLoade"
},
{
"path": "internal/utils/security_utils.go",
"chars": 2082,
"preview": "package utils\n\nimport (\n\t\"crypto/rand\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"net\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/google/uui"
},
{
"path": "internal/utils/security_utils_test.go",
"chars": 4007,
"preview": "package utils_test\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/utils\"\n\n\t\"gotest.tools/v3/ass"
},
{
"path": "internal/utils/string_utils.go",
"chars": 506,
"preview": "package utils\n\nimport (\n\t\"strings\"\n)\n\nfunc Capitalize(str string) string {\n\tif len(str) == 0 {\n\t\treturn \"\"\n\t}\n\treturn st"
},
{
"path": "internal/utils/string_utils_test.go",
"chars": 1610,
"preview": "package utils_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/utils\"\n\n\t\"gotest.tools/v3/assert\"\n)"
},
{
"path": "internal/utils/tlog/log_audit.go",
"chars": 927,
"preview": "package tlog\n\nimport \"github.com/gin-gonic/gin\"\n\n// functions here use CallerSkipFrame to ensure correct caller info is "
},
{
"path": "internal/utils/tlog/log_wrapper.go",
"chars": 1910,
"preview": "package tlog\n\nimport (\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/rs/zerolog\"\n\t\"github.com/rs/zerolog/log\"\n\t\"github.com/stev"
},
{
"path": "internal/utils/tlog/log_wrapper_test.go",
"chars": 2461,
"preview": "package tlog_test\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"testing\"\n\n\t\"github.com/steveiliop56/tinyauth/internal/config\"\n\t\""
}
]
// ... and 9 more files (download for full content)
About this extraction
This page contains the full source code of the steveiliop56/tinyauth GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 209 files (657.9 KB), approximately 192.6k tokens, and a symbol index with 505 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.