定制 zpm-packages/server-access-filament 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zpm-packages/server-access-filament

Composer 安装命令:

composer require zpm-packages/server-access-filament

包简介

Filament plugin that exposes server access management resources, pages, and actions for zpm-packages/server-access-laravel.

README 文档

README

server access

ZPMPackages Server Access Filament

Filament admin resources and page actions for the Laravel server-access stack. This package plugs into a Filament panel and exposes server, user, and SSH key management on top of zpm-packages/server-access-laravel.

What This Package Adds

  • SshServerResource for server records and current-system manager verification.
  • Nested SshUserResource for server-scoped SSH users.
  • SshEntryResource and user-level key relation management.
  • Header actions for acting as a user, updating OS passwords, editing authorized_keys, editing ~/.ssh/config, and confirming root-user deletion.
  • Current-system scan actions for pulling OS users into the panel workflow.

Installation

composer require zpm-packages/server-access-filament

This package expects zpm-packages/server-access-laravel to be installed and configured first.

Register The Plugin

use Filament\Panel;
use ZPMPackages\FilamentSshManagement\FilamentSshManagementPlugin;

public function panel(Panel $panel): Panel
{
	return $panel
		->plugin(FilamentSshManagementPlugin::make());
}

Host App Requirements

The current resources are intentionally thin and reuse the host application's SSH wrappers. Your app must provide these classes:

  • App\Models\SshServer
  • App\Models\SshUser
  • App\Models\SshEntry
  • App\Support\Ssh\SshManagerResolver
  • App\Support\Ssh\SshDirectDataService
  • App\Support\Ssh\SshSystemUserService
  • App\Support\Ssh\SshUserManagerService
  • App\Support\Ssh\SshActorAuthorizer
  • App\Support\Ssh\DatabaseSshRepository

If your app uses different namespaces or model names, adapt the package resources or provide compatible wrappers before enabling the plugin.

Registered Resources

The plugin registers three resources on the active panel:

SshServerResource::class,
SshUserResource::class,
SshEntryResource::class,

Server Resource Usage

SshServerResource is the entrypoint for server records.

What You Can Do

  • List configured server records.
  • Create and edit servers when database sync is enabled.
  • Open nested user management from the server table.
  • Change the verified manager user for the current system.
  • Delete server records.

Current-System Manager Verification

The edit page exposes a Change Manager User action for current-system servers. It verifies the selected OS user password before switching the configured manager.

User Resource Usage

SshUserResource is nested under a server.

Users List Page

The list page supports:

  • Scanning system users.
  • Creating a new user.
  • Auto-importing current-system users into the database-backed repository on mount.
  • Direct-mode record actions when database sync is disabled.

Create User Flow

The create page supports:

  • username, name, home directory, groups, comment, and root flag
  • can_read_entries, can_write_entries, and can_manage_entries
  • managed directories
  • optional create-time password
  • create-time SSH key passphrase forwarding when a managed key is generated

Edit User Header Actions

The edit page currently provides:

  • Act As
  • Authorized Keys
  • SSH Config
  • Update Password
  • Delete

The delete action requires password confirmation when the target user is root-equivalent.

Key Management Usage

Keys are managed from the user relation manager and the standalone key resource.

Supported Flows

  • Create a manual key row.
  • Generate a managed key pair.
  • Set custom private and public key paths under the target .ssh directory.
  • Edit an existing key.
  • Delete a key.

Related UI Behaviors

  • Private/public path inputs stay constrained to the user .ssh directory.
  • Public path can auto-fill from the chosen private path.
  • Managed key generation failures show notifications instead of raw exceptions.

Example Panel Registration

use App\Providers\Filament\AdminPanelProvider;
use Filament\Panel;
use ZPMPackages\FilamentSshManagement\FilamentSshManagementPlugin;

class AdminPanelProvider extends PanelProvider
{
	public function panel(Panel $panel): Panel
	{
		return $panel
			->default()
			->id('admin')
			->path('admin')
			->plugin(FilamentSshManagementPlugin::make());
	}
}

Example App Service Wrappers

The plugin expects the host app wrappers to adapt package services to app models. A typical wrapper extends the Laravel package service:

namespace App\Support\Ssh;

class SshManagerResolver extends \ZPMPackages\LaravelSshManagement\Services\SshManagerResolver
{
}

Testing

The package includes a lightweight standalone plugin test that verifies:

  • the plugin id
  • resource registration on a panel
  • plugin resolution through the container

Run it from the package directory:

vendor/bin/phpunit tests/FilamentSshManagementPluginTest.php

Notes

  • This package is currently app-coupled by design; it is a reusable plugin package, but not a zero-configuration drop-in for arbitrary Laravel apps.
  • The panel resources rely on the host app for authorization messaging and OS/file management wrappers.
  • If you want a fully standalone Filament package, the next step is extracting the remaining App\... dependencies behind interfaces or plugin configuration.

zpm-packages/server-access-filament 适用场景与选型建议

zpm-packages/server-access-filament 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 433 次下载、GitHub Stars 达 5, 最近一次更新时间为 2026 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 zpm-packages/server-access-filament 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 zpm-packages/server-access-filament 我们能提供哪些服务?
定制开发 / 二次开发

基于 zpm-packages/server-access-filament 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 433
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 38
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-06