Skip to content

Commit ff97ae7

Browse files
committed
initial commit
0 parents  commit ff97ae7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+15885
-0
lines changed

.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.output
2+
.data
3+
.nuxt
4+
.nitro
5+
.cache
6+
dist
7+
node_modules
8+
logs
9+
*.log
10+
.DS_Store
11+
.fleet
12+
.idea
13+
.env
14+
.env.*
15+
!.env.example
16+
prisma/dev.*

.env.example

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Redis URL
2+
REDIS_URL=redis://localhost:6379
3+
4+
# Session Configuration
5+
SESSION_TTL_DAYS=30
6+
REQUEST_TTL_DAYS=7
7+
8+
# Trust proxy for client IP detection
9+
TRUST_PROXY_CLIENT_IP=false
10+
11+
# Authentication (Optional - Leave empty to disable)
12+
# If set, users must login to access the site
13+
# payload endpoint remain public even when auth is enabled.
14+
AUTH_USERNAME=my_username
15+
AUTH_PASSWORD=my_super_secret_password
16+
17+
# Secret key for token generation (set in production), otherwise a random key is generated on each startup
18+
AUTH_SECRET=random_secret_key
19+
20+
# Enable session restore feature (enabled by default).
21+
# When enabled, users can use their friendly id to restore their session.
22+
SESSION_RESTORE_ENABLED=false
23+
24+
# Enable raw full URL feature (disabled by default).
25+
RAW_FULL_URL=false

.github/workflows/build.yml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: build-docker-containers
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
build:
7+
description: "Build and publish native multi-arch image"
8+
type: boolean
9+
default: true
10+
update_readme:
11+
description: "Also sync DockerHub README"
12+
type: boolean
13+
default: false
14+
push:
15+
branches:
16+
- dev
17+
- master
18+
tags:
19+
- "v*"
20+
paths-ignore:
21+
- "**.md"
22+
- ".github/ISSUE_TEMPLATE/**"
23+
24+
jobs:
25+
test:
26+
uses: ./.github/workflows/ci.yml
27+
28+
docker-build-arch:
29+
name: Build Container (${{ matrix.arch }})
30+
runs-on: ${{ matrix.os }}
31+
needs: [test]
32+
strategy:
33+
matrix:
34+
include:
35+
- os: ubuntu-latest
36+
arch: amd64
37+
- os: ubuntu-latest
38+
arch: arm64
39+
permissions:
40+
packages: write
41+
contents: write
42+
env:
43+
REGISTRY: ${{ vars.REGISTRY != '' && vars.REGISTRY || 'ghcr.io' }}
44+
SLUG: ${{ format('{0}/{1}', vars.REGISTRY != '' && vars.REGISTRY || 'ghcr.io', github.repository) }}
45+
ARCH: ${{ matrix.arch }}
46+
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
53+
- name: Docker meta
54+
id: meta
55+
uses: docker/metadata-action@v5
56+
with:
57+
images: ${{ env.SLUG }}
58+
flavor: |
59+
latest=false
60+
suffix=-${{ env.ARCH }}
61+
tags: |
62+
type=ref,event=branch
63+
type=ref,event=tag
64+
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
65+
66+
- name: Login to Container Registry
67+
uses: docker/login-action@v3
68+
with:
69+
registry: ${{ env.REGISTRY }}
70+
username: ${{ github.actor }}
71+
password: ${{ secrets.GIT_TOKEN && secrets.GIT_TOKEN || secrets.GITHUB_TOKEN }}
72+
73+
- name: Set up Docker Buildx
74+
uses: docker/setup-buildx-action@v3
75+
76+
- name: Build Container and push
77+
uses: docker/build-push-action@v5
78+
with:
79+
context: .
80+
platforms: linux/${{ env.ARCH }}
81+
push: true
82+
tags: ${{ steps.meta.outputs.tags }}
83+
labels: ${{ steps.meta.outputs.labels }}
84+
cache-from: |
85+
type=gha,scope=${{ github.workflow }}
86+
cache-to: |
87+
type=gha,mode=max,scope=${{ github.workflow }}
88+
provenance: true
89+
90+
docker-publish-manifest:
91+
name: Publish multi-arch manifest
92+
needs: [docker-build-arch]
93+
runs-on: ubuntu-latest
94+
permissions:
95+
packages: write
96+
contents: write
97+
env:
98+
REGISTRY: ${{ vars.REGISTRY != '' && vars.REGISTRY || 'ghcr.io' }}
99+
SLUG: ${{ format('{0}/{1}', vars.REGISTRY != '' && vars.REGISTRY || 'ghcr.io', github.repository) }}
100+
steps:
101+
- name: Docker meta
102+
id: meta
103+
uses: docker/metadata-action@v5
104+
with:
105+
images: ${{ env.SLUG }}
106+
flavor: |
107+
latest=false
108+
tags: |
109+
type=ref,event=branch
110+
type=ref,event=tag
111+
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
112+
113+
- name: Login to Container Registry
114+
uses: docker/login-action@v3
115+
with:
116+
registry: ${{ env.REGISTRY }}
117+
username: ${{ github.actor }}
118+
password: ${{ secrets.GIT_TOKEN && secrets.GIT_TOKEN || secrets.GITHUB_TOKEN }}
119+
120+
- name: Create and push manifest list
121+
shell: bash
122+
run: |
123+
IFS=$'\n'
124+
for tag in $(echo "${{ steps.meta.outputs.tags }}"); do
125+
echo "Creating manifest for ${tag}"
126+
docker buildx imagetools create \
127+
--tag "$tag" \
128+
"${tag}-amd64" \
129+
"${tag}-arm64"
130+
done
131+
132+
- name: Overwrite GitHub release notes
133+
if: startsWith(github.ref, 'refs/tags/v') && startsWith(env.REGISTRY, 'ghcr.io/')
134+
uses: actions/github-script@v6
135+
with:
136+
github-token: ${{ secrets.GITHUB_TOKEN }}
137+
script: |
138+
const tag = context.ref.replace('refs/tags/', '');
139+
140+
const latestRelease = await github.rest.repos.listReleases({
141+
owner: context.repo.owner,
142+
repo: context.repo.repo,
143+
});
144+
145+
const release = latestRelease.data.find(r => r.tag_name === tag);
146+
if (!release) {
147+
core.setFailed(`Release with tag ${tag} not found`);
148+
return;
149+
}
150+
151+
const { data: comparison } = await github.rest.repos.compareCommits({
152+
owner: context.repo.owner,
153+
repo: context.repo.repo,
154+
base: latestRelease.data[1]?.tag_name || '',
155+
head: tag,
156+
});
157+
158+
const commits = comparison.commits.filter(c => 1 === c.parents.length);
159+
160+
const changelog = commits.map(
161+
c => `- ${c.sha.substring(0, 7)} ${c.commit.message.split('\n')[0]} by @${c.commit.author.name}`
162+
).join('\n');
163+
164+
if (!changelog) {
165+
core.setFailed('No commits found for the changelog');
166+
return;
167+
}
168+
169+
console.log(`Changelog for ${tag}:\n${changelog}`);
170+
171+
await github.rest.repos.updateRelease({
172+
owner: context.repo.owner,
173+
repo: context.repo.repo,
174+
release_id: release.id,
175+
body: changelog
176+
});

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
pull_request:
7+
branches:
8+
- master
9+
paths-ignore:
10+
- "**.md"
11+
- ".github/ISSUE_TEMPLATE/**"
12+
13+
env:
14+
PNPM_VERSION: 10
15+
NODE_VERSION: 20
16+
17+
jobs:
18+
build-and-test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v4
25+
with:
26+
version: ${{ env.PNPM_VERSION }}
27+
28+
- name: Install Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: ${{ env.NODE_VERSION }}
32+
cache: pnpm
33+
cache-dependency-path: "pnpm-lock.yaml"
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Run Lint
39+
run: pnpm lint
40+
41+
- name: Run tests
42+
run: pnpm test
43+
44+
- name: Run type-check
45+
run: pnpm tsc
46+
47+
- name: Build
48+
run: pnpm build

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
8+
var/
9+
# Node dependencies
10+
node_modules
11+
12+
# Logs
13+
logs
14+
*.log
15+
16+
# Misc
17+
.DS_Store
18+
.fleet
19+
.idea
20+
21+
# Local env files
22+
.env
23+
.env.*
24+
!.env.example
25+
prisma/dev.*
26+
nextjs-based/*
27+
llm*.txt
28+
nextjs-based/

.vscode/launch.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Node: Dev",
6+
"request": "launch",
7+
"runtimeArgs": [
8+
"dev"
9+
],
10+
"runtimeExecutable": "pnpm",
11+
"type": "node",
12+
"cwd": "${workspaceFolder}",
13+
"console": "internalConsole",
14+
"outputCapture": "std"
15+
},
16+
]
17+
}

.vscode/settings.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"editor.rulers": [
3+
120
4+
],
5+
"css.styleSheets": [
6+
"app/assets/css/*.css"
7+
],
8+
"search.exclude": {
9+
".nuxt": true,
10+
".output": true,
11+
"node_modules": true,
12+
},
13+
"eslint.format.enable": true,
14+
"eslint.ignoreUntitled": true,
15+
"css.customData": [
16+
".vscode/tailwind.json"
17+
],
18+
"cSpell.words": [
19+
"autoresize",
20+
"fastly",
21+
"heroicons",
22+
"hgetall",
23+
"hset",
24+
"iconify",
25+
"lucide",
26+
"sadd",
27+
"scard",
28+
"setex",
29+
"shiki",
30+
"smembers",
31+
"sqlmap",
32+
"srem",
33+
"Whois"
34+
]
35+
}

0 commit comments

Comments
 (0)