Commit Graph

28 Commits

Author SHA1 Message Date
dalbodeule
9bb0d0d009 [fix](errorpages): refine error page handling and resolve template issues
- Replaced unused `logo.svg` reference with `hop-gate.png` in embedded assets.
- Fixed redundant code for reading files from the error page directory.
- Updated 400 error template to properly reference external Tailwind CSS.
- Corrected invalid DOCTYPE declaration in 525 error template.
2025-12-02 22:07:22 +09:00
dalbodeule
0c4e02f832 [feat](errorpages): add custom templates for HTTP errors and assets
- Implemented custom HTML templates for `400`, `404`, `500`, and `525` error pages with multilingual support.
- Added embedded file system for error page templates and assets.
- Introduced fallback mechanism to serve minimal plain text for missing error templates.
- Integrated TailwindCSS for styling error pages, with a build script in `package.json`.
2025-12-02 21:57:30 +09:00
dalbodeule
300db525ff [fix](server): update domain status response types for consistency
- Changed `CreatedAt` and `UpdatedAt` fields in `domainStatusResponse` to `time.Time` for type consistency and improved parsing.
2025-12-02 20:49:50 +09:00
dalbodeule
98aed77342 [feat](server): add ACME standalone-only mode for certificate management
- Introduced `HOP_ACME_STANDALONE_ONLY` env variable to run the ACME client without starting HTTP/DTLS servers.
- Allows certificate issuance/renewal solely and exits upon completion.
- Includes initialization of the ACME manager with domain verification, certificate management, and caching mechanisms. DomainService and expand Admin API

- Added `DomainServiceImpl` with support for registering, unregistering, and querying domains.
- Expanded Admin API with new endpoints:
  - `GET /api/v1/admin/domains/exists` to check domain registration status.
  - `GET /api/v1/admin/domains/status` to retrieve detailed domain information.
- Updated server initialization to wire `DomainService` and Admin API routes.
- Documented new Admin API endpoints in `API.md`.
2025-12-02 20:35:45 +09:00
dalbodeule
61466a5397 [feat](server): add ACME standalone-only mode for certificate management
- Introduced `HOP_ACME_STANDALONE_ONLY` env variable to run the ACME client without starting HTTP/DTLS servers.
- Allows certificate issuance/renewal solely and exits upon completion.
- Includes initialization of the ACME manager with domain verification, certificate management, and caching mechanisms.
2025-11-27 23:52:33 +09:00
dalbodeule
9e4689c799 [chore](build): update port mappings in Docker Compose configuration
- Adjusted Docker Compose port mappings to directly map host ports to container ports for HTTP, HTTPS, and DTLS.
2025-11-27 19:56:26 +09:00
dalbodeule
1c72626884 [chore](build): add Docker Compose configuration for local development
- Introduced `docker-compose.yml` to simplify local development and service orchestration.
- Defined services for Hop Gate server and Postgres with environment, ports, and volume configurations.
- Added persistent volume settings for Postgres and ACME cache management.
2025-11-27 19:47:22 +09:00
dalbodeule
0b985b6b65 [chore](build): update Go version in server Dockerfile
- Upgraded base image to `golang:1.25-alpine` for compatibility with newer features and improvements.
2025-11-27 19:35:02 +09:00
dalbodeule
cdab10ea01 [chore](build): remove unused GOPROXY configuration from server Dockerfile
- Eliminated redundant `GOPROXY` environment configuration step to streamline the Docker build process.
2025-11-27 18:56:08 +09:00
dalbodeule
9bbfbf035c [chore](build): support multi-architecture builds in server Dockerfile
- Added `TARGETOS` and `TARGETARCH` arguments for multi-architecture build support.
- Updated build commands to utilize the provided OS/ARCH arguments.
- Simplified Dockerfile by removing redundant conditional logic for `go.sum`.
2025-11-27 18:53:45 +09:00
dalbodeule
88ebbd1ce7 [chore](build): remove redundant GOARCH flag from server Dockerfile
- Simplified the build stage by eliminating the unused `GOARCH` flag, ensuring compatibility with the default architecture.
2025-11-27 18:51:04 +09:00
dalbodeule
1c9f287cd7 [feat](proxy,build): enhance HTTP tunneling protocol and add Docker publishing
- Refactored HTTP tunneling protocol to use `protocol.Envelope` for better extensibility.
- Implemented support for message types including HTTP requests, stream handling, and responses.
- Added common security headers like HSTS and X-Forwarded-For processing for improved security and identity handling.
- Introduced GitHub Actions workflow to build and publish Docker images to GHCR.
- Added new protocol structures for stream-based communication in anticipation of future WebSocket/TCP tunneling.
- Updated `go.sum` to remove unused dependencies and reflect new changes.
2025-11-27 18:49:34 +09:00
dalbodeule
c1ba29079c [docs] update and simplify GitHub Discussions template
- Refactored `DISCUSSION_TEMPLATE.md` to enhance clarity and structure.
- Simplified sections and eliminated redundancy for better usability.
- Improved bilingual (Korean/English) guidance for consistency.
2025-11-27 15:51:44 +09:00
dalbodeule
5388517767 [docs] add GitHub Discussions templates for announcements and project introduction
- Added `DISCUSSION_TEMPLATE.md` for GitHub Discussions announcements.
- Introduced `DISCUSSION_001_PROJECT_INTRODUCTION.md` as a draft for the project introduction, architecture, and roadmap.
- Templates provide bilingual (Korean/English) guidance for consistency and accessibility.
2025-11-27 15:48:03 +09:00
dalbodeule
f110c33d4d [chore](templates): add GitHub issue and pull request templates
- Added pull request template to standardize PR descriptions and improve review process.
- Introduced bug report and feature request templates for structured issue reporting.
- Configured a default issue template with contact links and disabled blank issues.
2025-11-27 15:37:25 +09:00
dalbodeule
5ea992a0df [feat](observability): add Prometheus metrics and /metrics endpoint
- Introduced Prometheus metrics tracking for DTLS handshakes, HTTP requests, and proxy errors.
- Defined counters and histograms with labels for detailed observability.
- Registered metrics via `MustRegister` during server initialization.
- Added `/metrics` endpoint protected by host domain filtering.
- Updated HTTP handler to capture request metadata and record metrics.
- Integrated metrics tracking for DTLS handshake processes and various error conditions.
- Updated `go.mod` and `go.sum` with Prometheus client dependencies.
2025-11-27 14:06:23 +09:00
dalbodeule
33d86d522d [chore](docs): update progress tracker with completed tasks
- Marked proxy implementation, ACME integration, and wiring tasks as complete.
- Updated details for ACME HTTP-01 challenge handling and certificate management.
- Added notes on remaining milestones, including TLS-ALPN-01 support and strategy refinement.
2025-11-27 13:49:37 +09:00
dalbodeule
0f32593ea5 [feat] add ACME-based certificate management using go-acme/lego
- Introduced a new `legoManager` for managing per-domain TLS certificates.
- Implemented ACME HTTP-01 challenge handling with a configurable webroot directory.
- Created `NewLegoManagerFromEnv` to initialize ACME settings from environment variables.
- Added `verifyDomainsResolve` to validate domain DNS resolutions.
- Updated `.gitignore` to include ACME cache and webroot directories.
- Updated `go.mod` and `go.sum` with new dependencies, including `go-acme/lego`.
2025-11-27 01:23:12 +09:00
dalbodeule
694b0feaae docs(progress): add milestone tracking document 2025-11-26 20:08:38 +09:00
dalbodeule
d14a8eec63 [chore](docs): update commit message guidelines and remove old file 2025-11-26 19:24:52 +09:00
dalbodeule
df1b4758da feat(store): integrate postgres with ent for domain management 2025-11-26 18:59:18 +09:00
dalbodeule
1d6888a45b docs(architecture): update request flow summary formatting 2025-11-26 17:38:25 +09:00
dalbodeule
e657c5e723 [chore] move commit message guidelines to .github directory 2025-11-26 17:37:32 +09:00
dalbodeule
1425bb5bfc docs: add commit message template file 2025-11-26 17:31:15 +09:00
dalbodeule
596c8c2ac2 chore(config): initialize docker ignore rules 2025-11-26 17:17:17 +09:00
dalbodeule
2121b56511 feat(dtls): add dtls client-server handshake flow
Implement initial DTLS handshake flow for server and client using
pion/dtls. Load server and client configuration from .env/environment,
including new debug flags and logging config.

On the server:
- load ServerConfig from env, including DTLS listen addr and debug flag
- create DTLS listener with optional self-signed localhost cert in debug
- accept DTLS sessions and run PerformServerHandshake with a dummy
  domain validator

On the client:
- load ClientConfig from env, then override with CLI flags where given
- validate required fields: server_addr, domain, api_key, local_target
- create DTLS client and run PerformClientHandshake
- support debug mode to skip server certificate verification

Also:
- update go.mod/go.sum with pion/dtls and related dependencies
- extend .env.example with new ports, client config, and debug flags
- ignore built binaries via bin/ in .gitignore

BREAKING CHANGE: client environment variables have changed. The former
HOP_CLIENT_ID, HOP_CLIENT_AUTH_TOKEN and HOP_CLIENT_SERVICE_PORTS are
replaced by HOP_CLIENT_DOMAIN, HOP_CLIENT_API_KEY,
HOP_CLIENT_LOCAL_TARGET and HOP_CLIENT_DEBUG. Client startup now
requires server_addr, domain, api_key and local_target to be provided
(via env or CLI).
2025-11-26 17:04:45 +09:00
dalbodeule
4d5b7f15f3 build(deps): add ent and x libs dependencies 2025-11-26 16:32:54 +09:00
dalbodeule
98bc949db1 chore(init): add .gitignore and license files for project setup 2025-11-26 15:58:00 +09:00