feat: CI/CD pipeline + Learning/Medicine/Travel services
Some checks failed
Build and Deploy GooSeek / build-backend (push) Failing after 1m4s
Build and Deploy GooSeek / build-webui (push) Failing after 1m2s
Build and Deploy GooSeek / deploy (push) Has been skipped

- Add Gitea Actions workflow for automated build & deploy
- Add K8s manifests: webui, travel-svc, medicine-svc, sandbox-svc
- Update kustomization for localhost:5000 registry
- Add ingress for gooseek.ru and api.gooseek.ru
- Learning cabinet with onboarding, courses, sandbox integration
- Medicine service with symptom analysis and doctor matching
- Travel service with itinerary planning
- Server setup scripts (NVIDIA/CUDA, K3s, Gitea runner)

Made-with: Cursor
This commit is contained in:
home
2026-03-02 20:25:44 +03:00
parent 08bd41e75c
commit ab48a0632b
92 changed files with 15562 additions and 2198 deletions

View File

@@ -46,6 +46,8 @@ type Config struct {
FinanceHeatmapURL string
LearningSvcURL string
TravelSvcURL string
SandboxSvcURL string
MedicineSvcURL string
// TravelPayouts
TravelPayoutsToken string
@@ -57,6 +59,7 @@ type Config struct {
MinioSecretKey string
MinioBucket string
MinioUseSSL bool
MinioPublicURL string
// Auth
JWTSecret string
@@ -130,15 +133,18 @@ func Load() (*Config, error) {
FinanceHeatmapURL: getEnv("FINANCE_HEATMAP_SVC_URL", "http://localhost:3033"),
LearningSvcURL: getEnv("LEARNING_SVC_URL", "http://localhost:3034"),
TravelSvcURL: getEnv("TRAVEL_SVC_URL", "http://localhost:3035"),
SandboxSvcURL: getEnv("SANDBOX_SVC_URL", "http://localhost:3036"),
MedicineSvcURL: getEnv("MEDICINE_SVC_URL", "http://localhost:3037"),
TravelPayoutsToken: getEnv("TRAVELPAYOUTS_TOKEN", ""),
TravelPayoutsMarker: getEnv("TRAVELPAYOUTS_MARKER", ""),
MinioEndpoint: getEnv("MINIO_ENDPOINT", "minio:9000"),
MinioAccessKey: getEnv("MINIO_ACCESS_KEY", "minioadmin"),
MinioSecretKey: getEnv("MINIO_SECRET_KEY", "minioadmin"),
MinioBucket: getEnv("MINIO_BUCKET", "gooseek"),
MinioUseSSL: getEnv("MINIO_USE_SSL", "false") == "true",
MinioEndpoint: getEnv("MINIO_ENDPOINT", getEnv("S3_ENDPOINT", "minio:9000")),
MinioAccessKey: getEnv("MINIO_ACCESS_KEY", getEnv("S3_ACCESS_KEY", "minioadmin")),
MinioSecretKey: getEnv("MINIO_SECRET_KEY", getEnv("S3_SECRET_KEY", "minioadmin")),
MinioBucket: getEnv("MINIO_BUCKET", getEnv("S3_BUCKET", "gooseek")),
MinioUseSSL: getEnv("MINIO_USE_SSL", getEnv("S3_USE_SSL", "false")) == "true",
MinioPublicURL: getEnv("MINIO_PUBLIC_URL", getEnv("S3_PUBLIC_URL", "")),
JWTSecret: getEnv("JWT_SECRET", ""),
AuthSvcURL: getEnv("AUTH_SVC_URL", ""),

View File

@@ -20,11 +20,13 @@ type MinioConfig struct {
SecretKey string
Bucket string
UseSSL bool
PublicURL string
}
type MinioStorage struct {
client *minio.Client
bucket string
client *minio.Client
bucket string
publicURL string
}
type UploadResult struct {
@@ -57,11 +59,23 @@ func NewMinioStorage(cfg MinioConfig) (*MinioStorage, error) {
}
return &MinioStorage{
client: client,
bucket: cfg.Bucket,
client: client,
bucket: cfg.Bucket,
publicURL: strings.TrimRight(cfg.PublicURL, "/"),
}, nil
}
func (s *MinioStorage) GetPublicURL(key string) string {
if s.publicURL != "" {
return s.publicURL + "/" + s.bucket + "/" + key
}
return ""
}
func (s *MinioStorage) Bucket() string {
return s.bucket
}
func (s *MinioStorage) Upload(ctx context.Context, reader io.Reader, size int64, filename, contentType string) (*UploadResult, error) {
ext := filepath.Ext(filename)
key := generateStorageKey(ext)
@@ -83,6 +97,25 @@ func (s *MinioStorage) Upload(ctx context.Context, reader io.Reader, size int64,
}, nil
}
func (s *MinioStorage) UploadWithKey(ctx context.Context, key string, reader io.Reader, size int64, contentType string) (*UploadResult, error) {
opts := minio.PutObjectOptions{
ContentType: contentType,
CacheControl: "public, max-age=2592000",
}
info, err := s.client.PutObject(ctx, s.bucket, key, reader, size, opts)
if err != nil {
return nil, fmt.Errorf("failed to upload file: %w", err)
}
return &UploadResult{
Key: key,
Bucket: s.bucket,
Size: info.Size,
ETag: info.ETag,
}, nil
}
func (s *MinioStorage) UploadUserFile(ctx context.Context, userID string, reader io.Reader, size int64, filename, contentType string) (*UploadResult, error) {
ext := filepath.Ext(filename)
key := fmt.Sprintf("users/%s/%s%s", userID, uuid.New().String(), ext)