refactor: restructure project architecture
All checks were successful
renovate / renovate (push) Successful in 45s
Docker Build and Push / build-and-push-branches (push) Successful in 5m54s
Docker Build and Push / build-and-push-tags (push) Successful in 6m21s

This commit is contained in:
2025-12-31 15:49:37 +07:00
parent 878664e0ac
commit acd02aadd3
13 changed files with 89 additions and 77 deletions

View File

@@ -6,9 +6,10 @@ import (
"log"
"strings"
"time"
"tunnel_pls/internal/config"
"tunnel_pls/internal/random"
"tunnel_pls/session/slug"
"tunnel_pls/types"
"tunnel_pls/utils"
"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
@@ -722,9 +723,9 @@ func (m model) View() string {
func (i *Interaction) Start() {
lipgloss.SetColorProfile(termenv.TrueColor)
domain := utils.Getenv("DOMAIN", "localhost")
domain := config.Getenv("DOMAIN", "localhost")
protocol := "http"
if utils.Getenv("TLS_ENABLED", "false") == "true" {
if config.Getenv("TLS_ENABLED", "false") == "true" {
protocol = "https"
}
@@ -811,7 +812,7 @@ func buildURL(protocol, subdomain, domain string) string {
}
func generateRandomSubdomain() string {
return utils.GenerateRandomString(20)
return random.GenerateRandomString(20)
}
func isValidSlug(slug string) bool {