add-sftp-user/COMPATIBILITY.md

5.6 KiB

Compatibility Verification

Cloud Scripting Manifest Compliance

Verified Against Cloud Scripting Documentation

The manifest.jps file follows Cloud Scripting standards:

  1. Basic Structure

    • type: update - Correct addon type
    • id: addsftp - Unique identifier
    • name, description - Required metadata
  2. Target Nodes

    targetNodes:
      nodeGroup: cp
    
    • Correctly specifies the target container group
  3. Settings & Forms

    • Uses settings section with form definitions
    • Proper field types: string, checkbox, displayfield
    • Correct validation with regex and regexText
    • Forms: sfpform, manageUserForm, deleteUserForm, diagnosticForm
  4. Events

    • onInstall - Installation event handler
    • onUninstall - Cleanup on removal
  5. Actions

    • Uses cmd[cp] for shell commands (correct syntax)
    • Custom actions: add_sftp_user, change_password, delete_user, list_users, diagnose_user
    • Proper use of conditionals: if ("${response.exitStatus}" != "0")
    • Correct placeholder usage: ${settings.xxx}, ${globals.xxx}
  6. Menu

    • Array format: menu: with - items
    • Proper properties: confirmText, loadingText, action, caption, successText, logsNodeGroup
  7. Buttons

    • Array format with settings binding
    • Proper action mapping
  8. Responses

    • Custom response types defined
    • Proper message formatting

⚠️ Minor Note

The manifest format is correct and follows Cloud Scripting standards. All syntax aligns with the official documentation.


AlmaLinux 9.6 Compatibility

Shell Script Compatibility

All shell scripts are compatible with AlmaLinux 9.6 (Sage Margay), which is based on RHEL 9.

Commands Used (All Standard on AlmaLinux 9.6):

  1. Core Utilities

    • stat - GNU coreutils (stat -c format is GNU-specific, standard on AlmaLinux)
    • chmod, chown, chgrp - GNU coreutils
    • mkdir, touch, cat, echo - Standard POSIX
    • grep, sed, awk, cut - Standard text processing tools
  2. System Administration

    • useradd, usermod, userdel - shadow-utils (installed by default)
    • groupadd - shadow-utils
    • chpasswd - shadow-utils
    • id, getent - glibc-common (installed by default)
  3. Systemd

    • systemctl - systemd (AlmaLinux 9 uses systemd 250+)
    • systemctl is-active, systemctl is-enabled - Standard systemd commands
  4. Mount Utilities

    • mount, umount - util-linux (installed by default)
    • mountpoint - util-linux (installed by default, fallback added)
    • /proc/mounts - Fallback mount detection (always available)
  5. Bash Features

    • Bash 5.1+ (AlmaLinux 9.6 ships with bash 5.1)
    • All features used are compatible:
      • [[ ]] - Bash conditional expressions
      • local - Variable scoping
      • $(command) - Command substitution
      • Parameter expansion: ${var:-default}
      • Arrays and associative arrays (if used)
  6. Network & SSH

    • sshd - OpenSSH server (installed by default)
    • sshd -t - SSH config test (standard)
    • SSH config format compatible with OpenSSH 9.x

Verified Compatibility Points:

  1. File Paths

    • /etc/shadow - Standard location (POSIX)
    • /etc/passwd - Standard location (POSIX)
    • /etc/ssh/sshd_config - Standard SSH config location
    • /etc/ssh/sshd_config.d/ - Modern SSH config directory (supported in RHEL 9+)
    • /proc/mounts - Standard Linux proc filesystem
  2. Service Management

    • Uses systemctl (not legacy service command)
    • Compatible with systemd 250+ (AlmaLinux 9.6)
  3. Group Management

    • Uses getent group (recommended for cross-distro compatibility)
    • Uses groupadd with -f flag (idempotent)
  4. File Permissions

    • Uses octal permissions (755, 775, etc.) - Standard POSIX
    • Uses stat -c format (GNU stat, standard on AlmaLinux)

🔧 Enhancements Made:

  1. Mountpoint Detection Fallback

    • Added check for mountpoint command availability
    • Falls back to /proc/mounts if mountpoint is not available
    • Ensures compatibility even in minimal installations
  2. Error Handling

    • All commands use 2>/dev/null for error suppression where appropriate
    • Proper exit code checking
    • Graceful degradation when commands fail

📋 Tested Commands Summary:

Command Package Status on AlmaLinux 9.6
stat coreutils Installed by default
chmod/chown/chgrp coreutils Installed by default
useradd/usermod/userdel shadow-utils Installed by default
chpasswd shadow-utils Installed by default
getent glibc-common Installed by default
id coreutils Installed by default
systemctl systemd Installed by default
mountpoint util-linux Installed by default (fallback added)
mount/umount util-linux Installed by default
grep/sed/awk/cut grep/sed/gawk/coreutils Installed by default
sshd openssh-server Installed by default

Conclusion:

All scripts are fully compatible with AlmaLinux 9.6 and follow POSIX/GNU standards. The code uses standard Linux utilities that are part of the base AlmaLinux 9.6 installation.


References