Rename project from imc-vibe to imc
- Binary name: imc-vibe -> imc - Go module: github.com/imc-vibe/backend -> github.com/imc/backend - JWT issuer: imc-vibe -> imc - UI labels: IMC Vibe -> IMC - Update all imports and comments
This commit is contained in:
parent
a4c6b04b37
commit
ff52be8adf
19 changed files with 52 additions and 40 deletions
|
|
@ -2,8 +2,8 @@
|
|||
# Install air: go install github.com/air-verse/air@latest
|
||||
|
||||
[build]
|
||||
bin = "./tmp/imc-vibe"
|
||||
cmd = "go build -o ./tmp/imc-vibe ./cmd/server"
|
||||
bin = "./tmp/imc"
|
||||
cmd = "go build -o ./tmp/imc ./cmd/server"
|
||||
stop_on_error = true
|
||||
|
||||
[log]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Package main is the entry point for the imc-vibe mail server admin application.
|
||||
// Package main is the entry point for the IMC mail server admin application.
|
||||
// This single binary contains both the Go backend API and the embedded SvelteKit frontend.
|
||||
package main
|
||||
|
||||
|
|
@ -11,11 +11,11 @@ import (
|
|||
"os" // OS-level operations like reading command-line args
|
||||
"strings" // string manipulation utilities
|
||||
|
||||
"github.com/gin-gonic/gin" // web framework
|
||||
"github.com/imc-vibe/backend/internal/api" // HTTP API routing and handlers
|
||||
"github.com/imc-vibe/backend/internal/auth" // password hashing
|
||||
"github.com/imc-vibe/backend/internal/config" // configuration loading
|
||||
"github.com/imc-vibe/backend/internal/db" // database connection and operations
|
||||
"github.com/gin-gonic/gin" // web framework
|
||||
"github.com/imc/backend/internal/api" // HTTP API routing and handlers
|
||||
"github.com/imc/backend/internal/auth" // password hashing
|
||||
"github.com/imc/backend/internal/config" // configuration loading
|
||||
"github.com/imc/backend/internal/db" // database connection and operations
|
||||
)
|
||||
|
||||
// main is the entry point of the application.
|
||||
|
|
@ -24,7 +24,7 @@ import (
|
|||
func main() {
|
||||
// Parse command-line flags.
|
||||
// Flags are optional arguments passed after the program name.
|
||||
// Example: ./imc-vibe --bind=0.0.0.0 --port=8080
|
||||
// Example: ./imc --bind=0.0.0.0 --port=8080
|
||||
|
||||
// --bind: The IP address the server should listen on.
|
||||
// 0.0.0.0 means listen on all network interfaces (accessible from other machines).
|
||||
|
|
@ -69,14 +69,14 @@ func main() {
|
|||
|
||||
// Connect to the database (MariaDB/MySQL).
|
||||
// The database stores both ISPmail data (virtual_users, virtual_domains, etc.)
|
||||
// and imc-vibe's own data (imc_users, imc_users2domains, etc.).
|
||||
// and IMC's own data (imc_users, imc_users2domains, etc.).
|
||||
database, err := db.Connect(cfg)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to database: %v", err) // Fatal = print and exit
|
||||
}
|
||||
|
||||
// Create database tables if they don't exist.
|
||||
// This only creates imc-vibe's own tables, not the ISPmail tables.
|
||||
// This only creates IMC's own tables, not the ISPmail tables.
|
||||
if err := database.InitSchema(); err != nil {
|
||||
log.Printf("Warning: Could not initialize schema: %v", err) // Non-fatal = continue
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
module github.com/imc-vibe/backend
|
||||
module github.com/imc/backend
|
||||
|
||||
go 1.25.0
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/imc-vibe/backend/internal/db"
|
||||
"github.com/imc/backend/internal/db"
|
||||
)
|
||||
|
||||
type AliasHandler struct {
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/imc-vibe/backend/internal/auth"
|
||||
"github.com/imc-vibe/backend/internal/db"
|
||||
"github.com/imc/backend/internal/auth"
|
||||
"github.com/imc/backend/internal/db"
|
||||
)
|
||||
|
||||
const MaxLoginAttempts = 5
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/imc-vibe/backend/internal/db"
|
||||
"github.com/imc/backend/internal/db"
|
||||
)
|
||||
|
||||
type DomainHandler struct {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"strconv"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/imc-vibe/backend/internal/mail"
|
||||
"github.com/imc/backend/internal/mail"
|
||||
)
|
||||
|
||||
type LogsHandler struct{}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/imc-vibe/backend/internal/auth"
|
||||
"github.com/imc/backend/internal/auth"
|
||||
)
|
||||
|
||||
// AuthContextKey is the key used to store auth context in gin.Context.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/imc-vibe/backend/internal/mail"
|
||||
"github.com/imc/backend/internal/mail"
|
||||
)
|
||||
|
||||
type QueueHandler struct{}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package handlers
|
|||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/imc-vibe/backend/internal/db"
|
||||
"github.com/imc/backend/internal/db"
|
||||
)
|
||||
|
||||
type StatsHandler struct {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/imc-vibe/backend/internal/db"
|
||||
"github.com/imc-vibe/backend/internal/mail"
|
||||
"github.com/imc/backend/internal/db"
|
||||
"github.com/imc/backend/internal/mail"
|
||||
)
|
||||
|
||||
type UserHandler struct {
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ import (
|
|||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/imc-vibe/backend/internal/api/handlers"
|
||||
"github.com/imc-vibe/backend/internal/auth"
|
||||
"github.com/imc-vibe/backend/internal/config"
|
||||
"github.com/imc-vibe/backend/internal/db"
|
||||
"github.com/imc/backend/internal/api/handlers"
|
||||
"github.com/imc/backend/internal/auth"
|
||||
"github.com/imc/backend/internal/config"
|
||||
"github.com/imc/backend/internal/db"
|
||||
)
|
||||
|
||||
type Router struct {
|
||||
|
|
@ -22,7 +22,7 @@ type Router struct {
|
|||
}
|
||||
|
||||
func New(database *db.DB, cfg *config.Config) *Router {
|
||||
jwtManager := auth.NewJWTManager(cfg.JWTSecret, "imc-vibe")
|
||||
jwtManager := auth.NewJWTManager(cfg.JWTSecret, "imc")
|
||||
|
||||
r := &Router{
|
||||
authHandler: handlers.NewAuthHandler(database, jwtManager, cfg.TrustedProxies),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Package db provides database access for the imc-vibe application.
|
||||
// Package db provides database access for the IMC application.
|
||||
// It uses GORM (Go ORM) for database operations.
|
||||
//
|
||||
// The database contains two sets of tables:
|
||||
|
|
@ -14,7 +14,7 @@ import (
|
|||
"gorm.io/gorm" // GORM ORM library
|
||||
"gorm.io/gorm/logger" // GORM logger configuration
|
||||
|
||||
"github.com/imc-vibe/backend/internal/config" // configuration
|
||||
"github.com/imc/backend/internal/config" // configuration
|
||||
)
|
||||
|
||||
// DB wraps GORM's database connection with helper methods.
|
||||
|
|
@ -70,7 +70,7 @@ type Alias struct {
|
|||
func (Alias) TableName() string { return "virtual_aliases" }
|
||||
|
||||
// =============================================================================
|
||||
// imc-vibe Application Models (tables created by this app)
|
||||
// IMC Application Models (tables created by this app)
|
||||
// =============================================================================
|
||||
|
||||
// ImcUser represents an admin user who can log into this application.
|
||||
|
|
@ -190,7 +190,7 @@ func Connect(cfg *config.Config) (*DB, error) {
|
|||
return &DB{db}, nil
|
||||
}
|
||||
|
||||
// InitSchema creates imc-vibe's database tables if they don't exist.
|
||||
// InitSchema creates IMC's database tables if they don't exist.
|
||||
// This only creates the imc_* tables, not the ISPmail virtual_* tables.
|
||||
// Called during application startup.
|
||||
func (d *DB) InitSchema() error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue