Commit graph

2620 commits

Author SHA1 Message Date
glab
1ab8bef29d Update towerops/gitlab-helm-repository.yaml via glab file sync 2026-01-02 14:23:14 -06:00
glab
3af184c3c3 Update .gitlab/agents/towerops/config.yaml via glab file sync 2026-01-02 14:23:10 -06:00
glab
8623e59707 Update towerops/gitlab-agent-helm-release.yaml via glab file sync 2026-01-02 14:22:44 -06:00
glab
aad5bb0ecc Update towerops/gitlab-helm-repository.yaml via glab file sync 2026-01-02 14:22:40 -06:00
glab
bfdc6360ee Update .gitlab/agents/towerops/config.yaml via glab file sync 2026-01-02 14:22:35 -06:00
glab
8b633cfbd8 Add towerops/gitlab-agent-helm-release.yaml via glab file sync 2026-01-02 14:22:22 -06:00
glab
92431696ad Add towerops/gitlab-helm-repository.yaml via glab file sync 2026-01-02 14:22:21 -06:00
glab
e86f995148 Add .gitlab/agents/towerops/config.yaml via glab file sync 2026-01-02 14:22:16 -06:00
glab
465ace1b54 Add gitlab-agent-helm-release.yaml via glab file sync 2026-01-02 14:19:12 -06:00
glab
003bcf5edb Add gitlab-helm-repository.yaml via glab file sync 2026-01-02 14:19:11 -06:00
glab
720fa902be Add .gitlab/agents/gitlab/config.yaml via glab file sync 2026-01-02 14:19:07 -06:00
93e0b869be
more features 2026-01-02 14:06:44 -06:00
fd5c6b3d72
more tests 2025-12-21 17:29:01 -06:00
d88cf9dddc
mix format 2025-12-21 17:17:35 -06:00
8f618291a0
timescaledb 2025-12-21 17:17:26 -06:00
d431db37bb
What Was Built
Monitoring Infrastructure:
  - lib/towerops/monitoring/ping.ex - OS-agnostic ping functionality that works on macOS, Linux, and Windows
  - lib/towerops/monitoring/equipment_monitor.ex - GenServer that monitors individual equipment at configurable intervals
  - lib/towerops/monitoring/supervisor.ex - DynamicSupervisor with Registry for managing monitor workers
  - lib/towerops/monitoring.ex - Context for creating and querying monitoring checks

  Database:
  - monitoring_checks table stores historical ping results with status, response time, and timestamps
  - Indexed on (equipment_id, checked_at) for efficient querying

  Real-Time Updates:
  - PubSub broadcasting on equipment:#{id} topic when status changes
  - Equipment show page subscribes to updates and refreshes automatically
  - Manual "Check Now" button to trigger immediate checks

  Application Integration:
  - Monitoring.Supervisor added to application supervision tree
  - All monitored equipment starts monitoring automatically on app startup
  - Recent checks displayed in Equipment show page

  How It Works

  1. On application start, a monitor GenServer is spawned for each equipment with monitoring_enabled: true
  2. Each monitor pings its equipment at the configured interval (default 5 minutes)
  3. Results are saved to monitoring_checks table
  4. Equipment status is updated if it changes (up ↔ down)
  5. Status changes are broadcast via PubSub to all connected LiveViews
  6. The Equipment show page updates in real-time when status changes
2025-12-21 16:52:23 -06:00
1bd72dac78
1. Sites Management
- Sites schema with hierarchical parent-child relationships
  - CRUD operations for sites
  - Sites context with helper functions
  - LiveView pages:
    - /orgs/:slug/sites - List all sites
    - /orgs/:slug/sites/new - Create new site
    - /orgs/:slug/sites/:id - View site details
    - /orgs/:slug/sites/:id/edit - Edit site
  - Support for site locations and descriptions
  - Site tree builder for hierarchy visualization

  2. Equipment Management
  - Equipment schema with monitoring fields
  - IP address validation (IPv4 & IPv6)
  - Equipment status tracking (up/down/unknown)
  - Customizable check intervals per equipment
  - Equipment context with CRUD operations
  - LiveView pages:
    - /orgs/:slug/equipment - List all equipment
    - /orgs/:slug/equipment/new - Add equipment
    - /orgs/:slug/equipment/:id - View equipment details
    - /orgs/:slug/equipment/:id/edit - Edit equipment
  - Equipment can be added from site pages
  - Status badges and last checked timestamps

  3. Database Schema
  - sites table with self-referencing parent_site_id
  - equipment table with status tracking
  - All migrations run successfully
  - Proper indexes on foreign keys and status

  4. Features Implemented
  -  IP address validation using :inet.parse_address
  -  Site hierarchy with parent-child relationships
  -  Equipment linked to sites
  -  Monitoring enabled/disabled per equipment
  -  Customizable check intervals (30s - 3600s)
  -  Status tracking (up/down/unknown)
  -  Timestamps for last check and last status change
  -  Organization-scoped data (users only see their org's data)
2025-12-21 13:39:19 -06:00
c52f313e2d
1. User Authentication
- Full auth system with email/password (using phx.gen.auth)
  - Login, registration, password reset
  - Session management with remember-me functionality
  - Magic link login support

  2. Organization Management
  - Multi-tenant organization system
  - Organizations schema with unique slugs
  - Automatic organization creation when users register
  - Organization switcher UI at /orgs

  3. Membership System
  - Users can belong to multiple organizations
  - 4 permission levels: Owner, Admin, Member, Viewer
  - Complete permission matrix implemented
  - Join/leave organizations

  4. Invitation System
  - Email-based invitations with secure tokens
  - 7-day expiration on invites
  - Track who invited and who accepted

  5. Authorization
  - Full policy system (Organizations.Policy)
  - can?(membership, :action, :resource) helper
  - Enforced via plugs in router

  6. LiveView Pages
  - /orgs - List all your organizations
  - /orgs/new - Create new organization
  - /orgs/:slug - Organization dashboard (placeholder)

  7. Database Schema
  - users table
  - organizations table
  - organization_memberships table
  - organization_invitations table
  - All migrations run successfully
2025-12-21 13:31:59 -06:00
20d2d8dbd8
format 2025-12-21 11:31:08 -06:00
ba463dc5a2
init 2025-12-21 11:10:43 -06:00