Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

2.2 KB
Raw Blame
import type { VersionInfo } from '@/api/updates';

export const SECURITY_AUTH_DISABLED_PANEL_TITLE = 'Authentication disabled';
export const SECURITY_AUTH_SETUP_LABEL = 'Setup';
export const SECURITY_AUTH_DISABLED_MESSAGE =
  'Authentication is currently disabled. Set up password authentication to protect your Pulse instance.';
export const SECURITY_AUTH_DISABLED_READ_ONLY_MESSAGE =
  'This account can view authentication status but cannot configure it.';
export const SECURITY_AUTH_SETTINGS_READ_ONLY_MESSAGE =
  'Authentication settings are read-only for this account.';
export const SECURITY_AUTH_RESTART_REQUIRED_TITLE = 'Security Configured - Restart Required';
export const SECURITY_AUTH_RESTART_REQUIRED_MESSAGE =
  'Security settings have been configured but the service needs to be restarted to activate them.';
export const SECURITY_AUTH_RESTART_FOOTER =
  "After restarting, you'll need to log in with your saved credentials.";
export const SECURITY_AUTH_RESTART_TIP =
  "Tip: Make sure you've saved your credentials before restarting!";

export interface SecurityAuthRestartInstruction {
  label: string;
  command?: string;
}

export function getSecurityAuthRestartInstruction(
  deploymentType?: VersionInfo['deploymentType'],
): SecurityAuthRestartInstruction {
  switch (deploymentType) {
    case 'proxmoxve':
      // Not `update`: the community-scripts helper exits without restarting
      // Pulse when no newer release exists. LXC consoles are root shells, and
      // older ProxmoxVE installs still run pulse-backend.service.
      return {
        label: 'Restart the service as root (older installs use pulse-backend):',
        command: 'systemctl restart pulse',
      };
    case 'docker':
      return {
        label: 'Restart your Docker container:',
        command: 'docker restart pulse',
      };
    case 'systemd':
    case 'manual':
      return {
        label: 'Restart the service:',
        command: 'sudo systemctl restart pulse',
      };
    case 'development':
      return {
        label: 'Restart the managed development runtime from the repo root:',
        command: 'npm run dev:restart',
      };
    default:
      return {
        label: 'Restart Pulse using your deployment method',
      };
  }
}