first commit

This commit is contained in:
HiepLM
2026-05-20 17:37:36 +07:00
commit d1986f261c
2086 changed files with 11013 additions and 0 deletions

29
README.md Normal file
View File

@@ -0,0 +1,29 @@
# Thiệp cưới — chạy trên Windows
Website tĩnh (Ladipage). Cần chạy qua **web server cục bộ** — không mở trực tiếp file `index.html` bằng double-click (ảnh/JS sẽ lỗi).
## Cách nhanh nhất
1. Double-click file **`start.bat`** trong thư mục dự án.
2. Trình duyệt sẽ mở: `http://localhost:8080/www.mewedding.vn/index.html`
3. Dừng server: nhấn `Ctrl+C` trong cửa sổ đen (hoặc đóng cửa sổ).
## Chạy bằng PowerShell
```powershell
cd "D:\Thiệp Cứoi\Wed-dt"
powershell -ExecutionPolicy Bypass -File .\serve.ps1
```
Nếu Windows chặn script lần đầu, chạy một lần:
```powershell
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
```
## Deploy lên server (Kubernetes)
```bash
kubectl -n wedding rollout restart deploy/wedding-web
kubectl -n wedding rollout status deploy/wedding-web
```

107
serve.ps1 Normal file
View File

@@ -0,0 +1,107 @@
# Simple static file server for the wedding site (Windows, no Node/Python required)
$ErrorActionPreference = "Stop"
$root = $PSScriptRoot
$port = 8080
$mime = @{
".html" = "text/html; charset=utf-8"
".htm" = "text/html; charset=utf-8"
".css" = "text/css; charset=utf-8"
".js" = "application/javascript; charset=utf-8"
".json" = "application/json; charset=utf-8"
".png" = "image/png"
".jpg" = "image/jpeg"
".jpeg" = "image/jpeg"
".gif" = "image/gif"
".svg" = "image/svg+xml"
".webp" = "image/webp"
".woff" = "font/woff"
".woff2" = "font/woff2"
".ttf" = "font/ttf"
".otf" = "font/otf"
".mp3" = "audio/mpeg"
".mp4" = "video/mp4"
".ico" = "image/x-icon"
}
function Get-ContentType([string]$path) {
$ext = [System.IO.Path]::GetExtension($path).ToLowerInvariant()
if ($mime.ContainsKey($ext)) { return $mime[$ext] }
return "application/octet-stream"
}
function Send-File([System.Net.HttpListenerContext]$ctx, [string]$filePath) {
$bytes = [System.IO.File]::ReadAllBytes($filePath)
$ctx.Response.ContentType = Get-ContentType $filePath
$ctx.Response.ContentLength64 = $bytes.Length
$ctx.Response.OutputStream.Write($bytes, 0, $bytes.Length)
}
$listener = New-Object System.Net.HttpListener
$listener.Prefixes.Add("http://localhost:$port/")
$listener.Start()
$url = "http://localhost:$port/www.mewedding.vn/index.html"
Write-Host ""
Write-Host " Thiep cuoi dang chay tai:" -ForegroundColor Green
Write-Host " $url" -ForegroundColor Cyan
Write-Host ""
Write-Host " Nhan Ctrl+C de dung server." -ForegroundColor DarkGray
Write-Host ""
try {
Start-Process $url | Out-Null
} catch {
Write-Host " Mo trinh duyet thu cong: $url" -ForegroundColor Yellow
}
while ($listener.IsListening) {
$context = $listener.GetContext()
$request = $context.Request
$response = $context.Response
try {
$rawPath = $request.Url.LocalPath
if ([string]::IsNullOrWhiteSpace($rawPath) -or $rawPath -eq "/") {
$rawPath = "/www.mewedding.vn/index.html"
}
$relative = [System.Uri]::UnescapeDataString($rawPath).TrimStart("/").Replace("/", [IO.Path]::DirectorySeparatorChar)
$filePath = Join-Path $root $relative
$filePath = [IO.Path]::GetFullPath($filePath)
if (-not $filePath.StartsWith([IO.Path]::GetFullPath($root), [StringComparison]::OrdinalIgnoreCase)) {
$response.StatusCode = 403
$buf = [Text.Encoding]::UTF8.GetBytes("403 Forbidden")
$response.OutputStream.Write($buf, 0, $buf.Length)
continue
}
if (Test-Path $filePath -PathType Container) {
$index = Join-Path $filePath "index.html"
if (Test-Path $index) { $filePath = $index } else {
$response.StatusCode = 404
$buf = [Text.Encoding]::UTF8.GetBytes("404 Not Found")
$response.OutputStream.Write($buf, 0, $buf.Length)
continue
}
}
if (-not (Test-Path $filePath -PathType Leaf)) {
$response.StatusCode = 404
$buf = [Text.Encoding]::UTF8.GetBytes("404 Not Found: $rawPath")
$response.OutputStream.Write($buf, 0, $buf.Length)
continue
}
Send-File $context $filePath
}
catch {
$response.StatusCode = 500
$msg = [Text.Encoding]::UTF8.GetBytes($_.Exception.Message)
$response.OutputStream.Write($msg, 0, $msg.Length)
}
finally {
$response.Close()
}
}

8
start.bat Normal file
View File

@@ -0,0 +1,8 @@
@echo off
chcp 65001 >nul
cd /d "%~dp0"
echo.
echo Dang khoi dong server thiep cuoi...
echo.
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0serve.ps1"
pause

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Some files were not shown because too many files have changed in this diff Show More