Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions frontend/update-shadcn.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const fs = require("fs");
const path = require("path");
const { execSync } = require("child_process");
const { execFileSync } = require("child_process");

/**
* shadcn 컴포넌트를 자동으로 업데이트하는 스크립트
Expand Down Expand Up @@ -69,12 +69,19 @@ function main() {
try {
console.log(`🔄 업데이트 중: ${componentName}...`);

const command = `npx shadcn@latest add -o -y ${componentName}`;
execSync(command, {
if (!/^[a-z0-9_-]+$/i.test(componentName)) {
throw new Error(`invalid component name: ${componentName}`);
}

execFileSync(
"npx",
["shadcn@latest", "add", "-o", "-y", componentName],
{
stdio: "pipe",
encoding: "utf8",
env: { ...process.env, npm_config_legacy_peer_deps: "true" },
});
}
);

console.log(`✅ ${componentName} 업데이트 완료`);
successCount++;
Expand Down
6 changes: 5 additions & 1 deletion portal/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,11 @@ func (s *Server) runSNIListener(ctx context.Context) error {
func (s *Server) handleSNIConn(ctx context.Context, conn net.Conn) {
clientHello, wrappedConn, err := l4.InspectClientHello(conn, s.cfg.ClientHelloTimeout)
if err != nil {
_ = wrappedConn.Close()
if wrappedConn != nil {
_ = wrappedConn.Close()
} else {
_ = conn.Close()
}
return
}

Expand Down