Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Acspanel Core Laravel Package

acs/acspanel-core

ACSPanel Core powers ACSPanel, a Symfony-based server administration panel. Manage multiple servers and services with role-based access, plans, audit logs, themes, and multilingual UI. Integrates DNS, web, database, and FTP backends.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Clone the repository and install via Composer:

    composer create-project altctrlsupr/acspanel-core acspanel
    cd acspanel
    composer install
    
  2. Database Configuration Configure .env or app/config/parameters.yml with your database credentials:

    # app/config/parameters.yml
    parameters:
        database_driver: pdo_mysql
        database_host: localhost
        database_port: null
        database_name: acspanel
        database_user: root
        database_password: null
    
  3. First Use Case: Basic User Setup Run migrations and load fixtures (if available):

    php bin/console doctrine:migrations:migrate
    

    Register a Superadmin via the CLI or manually in the database:

    INSERT INTO user (username, password, role) VALUES ('admin', '$2y$10$...', 'superadmin');
    

Implementation Patterns

Core Workflows

  1. Role-Based Access Control (RBAC)

    • Define permissions via Role entities (e.g., superadmin, admin, reseller).
    • Use dependency injection to restrict actions:
      // Example: Check if user has 'manage_servers' permission
      if (!$this->get('security.authorization_checker')->isGranted('ROLE_SUPERADMIN')) {
          throw $this->createAccessDeniedException();
      }
      
  2. Plan Management

    • Create custom plans (e.g., Basic, Premium) with resource limits (CPU, RAM, storage).
    • Assign plans to users/resellers via the Plan entity:
      $user->setPlan($this->getDoctrine()->getRepository(Plan::class)->find(1));
      $this->getDoctrine()->getManager()->flush();
      
  3. Service Integration (e.g., PowerDNS, Apache)

    • Use the Server entity to track decentralized services:
      $server = new Server();
      $server->setType('dns'); // 'web', 'dns', etc.
      $server->setHost('192.168.1.100');
      $server->setConfig($configArray); // Serialized config
      $this->getDoctrine()->getManager()->persist($server);
      
  4. Logging Actions

    • Leverage StofDoctrineExtensionsBundle for audit logs:
      // Example: Log a DNS record change
      $dnsRecord->setTtl(3600);
      $this->getDoctrine()->getManager()->flush();
      // Automatically logged via Doctrine lifecycle events.
      

Integration Tips

  • Symfony2 Services: Extend existing bundles (e.g., PanelWordpressBundle) by injecting ACSPanelCoreBundle services.
  • Theming: Customize the UI with LiipThemeBundle:
    # app/config/config.yml
    liip_theme:
        themes: [default, custom_theme]
    
  • API Access: Use Symfony’s FOSRestBundle to expose endpoints for headless clients.

Gotchas and Tips

Pitfalls

  1. Archived Status

    • The package is archived (no active maintenance). Validate compatibility with Symfony 2.x before adoption.
    • Fork or patch critical bugs locally if needed.
  2. Doctrine Extensions Dependency

    • StofDoctrineExtensionsBundle requires manual setup for audit logs. Ensure:
      # app/config/config.yml
      stof_doctrine_extensions:
          orm:
              default:
                  timestampable: true
                  loggable: true
      
  3. Multiserver Complexity

    • Decentralized servers require synchronized database access. Use a shared MySQL instance or replication.
  4. Missing Mobile Frontend

    • The "Mobile front-end (Coming soon...)" note suggests incomplete functionality. Test responsiveness manually.

Debugging

  • Permission Errors: Use Symfony’s profiler (/app_dev.php/_profiler) to debug RBAC issues.
  • Database Migrations: Rollback with:
    php bin/console doctrine:migrations:rollback
    

Extension Points

  1. Custom Roles/Plans Extend the Role and Plan entities to add domain-specific permissions:

    // src/Acspanel/CoreBundle/Entity/CustomRole.php
    class CustomRole extends Role {
        // Add fields like 'max_clients', 'whitelisted_ips'
    }
    
  2. Service Adapters Create adapters for unsupported services (e.g., Nginx, Postfix) by implementing the ServerInterface:

    class NginxServerAdapter implements ServerInterface {
        public function applyConfig(array $config) { ... }
    }
    
  3. Translation Add missing languages via translations/ directories or use Crowdin for community contributions.

Configuration Quirks

  • LiipThemeBundle: Ensure app/Resources/views/ has a base.html.twig for theming.
  • Security: Hardcode sensitive credentials in .env (never in parameters.yml).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware