Skip to content

Commit c874be5

Browse files
Features/nginx custom (#46)
* feat: update DomainDialog to DomainDialogV2 with advanced configuration options - Replaced DomainDialog with DomainDialogV2 in Domains component. - Added new fields for advanced domain settings including real IP configuration, HSTS, HTTP/2, gRPC support, and custom location blocks. - Updated Domain type to include new properties for advanced settings. - Created migration script to add new columns for advanced settings in the database. * feat: Implement Access Lists management UI and functionality - Added AccessListFormDialog component for creating and editing access lists. - Introduced AccessListsContent component to display and manage access lists. - Created PaginationControls component for navigating through access lists. - Developed access-lists.service.ts for API interactions related to access lists. - Implemented query options for fetching access lists and handling mutations. - Added routes for access lists management under the authenticated section. - Integrated search and filter functionalities for access lists. - Enhanced user experience with loading skeletons during data fetching. * feat: Enhance security by validating usernames and escaping passwords in Nginx config service * feat: Add WebSocket support headers in Nginx configuration * feat: Implement Backup Service with backup scheduling and nginx configuration management
1 parent 4df2194 commit c874be5

Some content is hidden

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

41 files changed

+5359
-69
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ landing/*
4646
.pnpm-store/
4747
.seeded
4848
*.md
49-
/docs/*
49+
/docs/*
50+
test-*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ curl -X POST http://localhost:3001/api/auth/login \
601601

602602
## 📄 License
603603

604-
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
604+
This project is licensed under the **License** - see the [LICENSE](LICENSE) file for details.
605605

606606
## 👥 Support & Community
607607

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- AlterTable
2+
ALTER TABLE "domains" ADD COLUMN "customLocations" JSONB,
3+
ADD COLUMN "grpcEnabled" BOOLEAN NOT NULL DEFAULT false,
4+
ADD COLUMN "hstsEnabled" BOOLEAN NOT NULL DEFAULT false,
5+
ADD COLUMN "http2Enabled" BOOLEAN NOT NULL DEFAULT true;
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
-- CreateEnum
2+
CREATE TYPE "AccessListType" AS ENUM ('ip_whitelist', 'http_basic_auth', 'combined');
3+
4+
-- CreateTable
5+
CREATE TABLE "access_lists" (
6+
"id" TEXT NOT NULL,
7+
"name" TEXT NOT NULL,
8+
"description" TEXT,
9+
"type" "AccessListType" NOT NULL,
10+
"enabled" BOOLEAN NOT NULL DEFAULT true,
11+
"allowedIps" TEXT[] DEFAULT ARRAY[]::TEXT[],
12+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
13+
"updatedAt" TIMESTAMP(3) NOT NULL,
14+
15+
CONSTRAINT "access_lists_pkey" PRIMARY KEY ("id")
16+
);
17+
18+
-- CreateTable
19+
CREATE TABLE "access_list_auth_users" (
20+
"id" TEXT NOT NULL,
21+
"accessListId" TEXT NOT NULL,
22+
"username" TEXT NOT NULL,
23+
"passwordHash" TEXT NOT NULL,
24+
"description" TEXT,
25+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
26+
"updatedAt" TIMESTAMP(3) NOT NULL,
27+
28+
CONSTRAINT "access_list_auth_users_pkey" PRIMARY KEY ("id")
29+
);
30+
31+
-- CreateTable
32+
CREATE TABLE "access_list_domains" (
33+
"id" TEXT NOT NULL,
34+
"accessListId" TEXT NOT NULL,
35+
"domainId" TEXT NOT NULL,
36+
"enabled" BOOLEAN NOT NULL DEFAULT true,
37+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
38+
"updatedAt" TIMESTAMP(3) NOT NULL,
39+
40+
CONSTRAINT "access_list_domains_pkey" PRIMARY KEY ("id")
41+
);
42+
43+
-- CreateIndex
44+
CREATE UNIQUE INDEX "access_lists_name_key" ON "access_lists"("name");
45+
46+
-- CreateIndex
47+
CREATE INDEX "access_lists_type_idx" ON "access_lists"("type");
48+
49+
-- CreateIndex
50+
CREATE INDEX "access_lists_enabled_idx" ON "access_lists"("enabled");
51+
52+
-- CreateIndex
53+
CREATE INDEX "access_list_auth_users_accessListId_idx" ON "access_list_auth_users"("accessListId");
54+
55+
-- CreateIndex
56+
CREATE UNIQUE INDEX "access_list_auth_users_accessListId_username_key" ON "access_list_auth_users"("accessListId", "username");
57+
58+
-- CreateIndex
59+
CREATE INDEX "access_list_domains_accessListId_idx" ON "access_list_domains"("accessListId");
60+
61+
-- CreateIndex
62+
CREATE INDEX "access_list_domains_domainId_idx" ON "access_list_domains"("domainId");
63+
64+
-- CreateIndex
65+
CREATE UNIQUE INDEX "access_list_domains_accessListId_domainId_key" ON "access_list_domains"("accessListId", "domainId");
66+
67+
-- AddForeignKey
68+
ALTER TABLE "access_list_auth_users" ADD CONSTRAINT "access_list_auth_users_accessListId_fkey" FOREIGN KEY ("accessListId") REFERENCES "access_lists"("id") ON DELETE CASCADE ON UPDATE CASCADE;
69+
70+
-- AddForeignKey
71+
ALTER TABLE "access_list_domains" ADD CONSTRAINT "access_list_domains_accessListId_fkey" FOREIGN KEY ("accessListId") REFERENCES "access_lists"("id") ON DELETE CASCADE ON UPDATE CASCADE;
72+
73+
-- AddForeignKey
74+
ALTER TABLE "access_list_domains" ADD CONSTRAINT "access_list_domains_domainId_fkey" FOREIGN KEY ("domainId") REFERENCES "domains"("id") ON DELETE CASCADE ON UPDATE CASCADE;

apps/api/prisma/schema.prisma

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,19 @@ model Domain {
183183
realIpCloudflare Boolean @default(false) // Use Cloudflare IP ranges
184184
realIpCustomCidrs String[] @default([]) // Custom CIDR ranges for set_real_ip_from
185185
186+
// Advanced Configuration
187+
hstsEnabled Boolean @default(false) // HTTP Strict Transport Security
188+
http2Enabled Boolean @default(true) // Enable HTTP/2
189+
grpcEnabled Boolean @default(false) // Enable gRPC/gRPCs support
190+
customLocations Json? // Custom location blocks configuration
191+
186192
// Relations
187193
upstreams Upstream[]
188194
loadBalancer LoadBalancerConfig?
189195
sslCertificate SSLCertificate?
190196
modsecCRSRules ModSecCRSRule[]
191197
modsecRules ModSecRule[]
198+
accessLists AccessListDomain[]
192199
193200
createdAt DateTime @default(now())
194201
updatedAt DateTime @updatedAt
@@ -454,6 +461,73 @@ model AclRule {
454461
@@map("acl_rules")
455462
}
456463

464+
// Access Lists Management Models
465+
466+
enum AccessListType {
467+
ip_whitelist
468+
http_basic_auth
469+
combined // Both IP and Basic Auth
470+
}
471+
472+
model AccessList {
473+
id String @id @default(cuid())
474+
name String @unique
475+
description String? @db.Text
476+
type AccessListType
477+
enabled Boolean @default(true)
478+
479+
// IP Whitelist configuration
480+
allowedIps String[] @default([]) // List of allowed IP addresses/CIDR
481+
482+
// HTTP Basic Auth configuration
483+
authUsers AccessListAuthUser[]
484+
485+
// Relations to domains
486+
domains AccessListDomain[]
487+
488+
createdAt DateTime @default(now())
489+
updatedAt DateTime @updatedAt
490+
491+
@@index([type])
492+
@@index([enabled])
493+
@@map("access_lists")
494+
}
495+
496+
model AccessListAuthUser {
497+
id String @id @default(cuid())
498+
accessListId String
499+
accessList AccessList @relation(fields: [accessListId], references: [id], onDelete: Cascade)
500+
501+
username String
502+
passwordHash String // Plain text password - will be hashed by htpasswd tool with apr1/MD5 format
503+
description String?
504+
505+
createdAt DateTime @default(now())
506+
updatedAt DateTime @updatedAt
507+
508+
@@unique([accessListId, username])
509+
@@index([accessListId])
510+
@@map("access_list_auth_users")
511+
}
512+
513+
model AccessListDomain {
514+
id String @id @default(cuid())
515+
accessListId String
516+
accessList AccessList @relation(fields: [accessListId], references: [id], onDelete: Cascade)
517+
domainId String
518+
domain Domain @relation(fields: [domainId], references: [id], onDelete: Cascade)
519+
520+
enabled Boolean @default(true)
521+
522+
createdAt DateTime @default(now())
523+
updatedAt DateTime @updatedAt
524+
525+
@@unique([accessListId, domainId])
526+
@@index([accessListId])
527+
@@index([domainId])
528+
@@map("access_list_domains")
529+
}
530+
457531
model PerformanceMetric {
458532
id String @id @default(cuid())
459533
domain String

0 commit comments

Comments
 (0)