Jpom Documentation

repository·master·Indexed 23 days ago

https://github.com/dromara/jpom

A lightweight, low-intrusion DevOps/Ops tool for online building, automatic deployment, daily operations, and project monitoring. Jpom provides a centralized web interface for SSH, Docker, Nginx, and project lifecycle management, featuring user management with workspace isolation, real-time console log monitoring, and built-in SSH terminal capabilities.

Tokens
17.6K
Snippets
33
Records
90
Agent score
82%

What's inside Jpom

  1. Overview of Jpom

    master

    Jpom is a lightweight, low-intrusion online build, automatic deployment, daily operations, and project monitoring software. It acts as a native Ops tool designed to solve common development pain points such as manual builds, complex multi-environment deployments, and the need for specialized SSH/FTP tools.

    Key capabilities include:

    • User Management: Multi-user management with workspace isolation, operation monitoring (email notifications), and MFA (Multi-Factor Authentication).
    • Project Monitoring: Real-time status viewing, console log monitoring, and automatic alerts (Email, DingTalk, WeChat) with auto-restart capabilities.
    • Online SSH Terminal: A built-in terminal that eliminates the need for external tools like PuTTY or Xshell. It includes 'bastion host' features like command restriction, command logging, and scheduled script execution.
    • Online Build & Deployment: Supports GIT/SVN repository pulling, Docker container builds, SSH-based publishing, scheduled builds, and WebHook triggers.
    • Infrastructure Management: Docker UI (container and Swarm management) and Nginx management (config editing, auto-reload, and SSL certificate management).
    • File Management: Online text file editing and directory management.
  2. Overview of Jpom features and capabilities

    master

    Jpom is a simple, lightweight, and low-invasive software designed for online builds, automated deployment, daily operations, and project monitoring. It acts as a native ops tool to solve common developer pain points such as manual deployment, environment-specific packaging, and the need for multiple external tools (SSH, FTP, etc.).

    Key Capabilities:

    • User Management: Multi-user management with independent project permissions, workspace isolation, operation logs, and MFA (Multi-Factor Authentication).
    • Project Monitoring: Real-time interface for viewing project status, console logs, and managing project files (including online text editing).
    • Docker Management: Docker UI for managing containers and Docker Swarm clusters.
    • Online SSH Terminal: Lightweight 'bastion host' functionality. Allows server management without external tools, command execution logging, forbidden command restriction, and SSH command templates.
    • Automated Builds: Supports pulling from GIT/SVN, container builds (Docker), SSH-based deployment, scheduled builds, and WebHook-triggered builds.
    • Nginx Management: Online editing of nginx configuration files with automatic reload, status management, and SSL certificate management.
    • Alerting: Automatic alerts and restart attempts for abnormal project status via email, DingTalk, or WeChat.
  3. Reference global script libraries in scripts

    master
    You can reference scripts from the global script library within Server-side scripts, SSH scripts, and Agent node scripts by using the G@("xx") syntax, where xx is the script marker. This allows for centralized script management and reuse across different execution contexts.
    G@("xx")
  4. Important Usage Reminders for Jpom

    master

    Before using Jpom, please note the following technical constraints and best practices:

    • OS Compatibility: Linux is highly compatible. Windows servers may experience compatibility issues with certain features; thorough testing is recommended.
    • Installation Path: Always install the Server side and the Plugin side in different directories. Do not install them in the same directory.
    • Uninstallation: To uninstall either the plugin or server side, stop the service first, then delete the program files, log folders, and data directory folders.
    • Build Environment: Local builds depend on the system environment. If your build commands require maven or node, these must be installed on the server. If you install these environments after the Jpom server has already started, you must restart the server for the changes to take effect.
    • Ubuntu/Debian Plugin Installation: If plugin installation fails on Ubuntu/Debian, create a .bash_profile file in the current user's home directory.
    • Version Upgrades: Do not attempt to downgrade from version 2.7.x, as it will cause data incompatibility.
    • Network Requirements: Since version 2.x.x uses HTTP for communication between the plugin side and the server side, ensure that the plugin and server can communicate over the network.
  5. Understand the web-vue directory structure

    master

    The project follows a standard Vue 3 structure. Key directories include:

    • src/components: Common/shared components.
    • src/assets: Static assets.
    • src/interface: TypeScript type definitions.
    • src/router: Routing configuration.
    • src/stores: State management (using Pinia).
    • src/pages: Page components (e.g., login, user).
    • src/utils: Utility functions.
    • src/api: API interface files.
    • vite.config.ts: Vite configuration.
    • .env: Environment variables.
  6. Important considerations when using Jpom

    master

    Before deploying or upgrading Jpom, keep the following technical constraints and best practices in mind:

    • OS Compatibility: Linux is highly recommended. Some features may have compatibility issues on Windows servers.
    • Installation Directory: Install the Jpom server and plugin components in different directories. Do not install them in the same directory.
    • Uninstallation: To uninstall, stop the corresponding service first, then delete the program files, log folders, and data directories.
    • Build Environments: Local builds depend on the system environment. If your build requires Maven or Node.js, ensure they are installed on the build server. If installed after the server starts, you must restart the server via the command line for the changes to take effect.
    • Ubuntu/Debian Setup: If the plugin component fails to add, create a .bash_profile file in the root directory of the current user.
    • Version Compatibility:
      • Do not downgrade to versions prior to 2.7.x due to potential data incompatibility.
      • Version 2.x.x uses HTTP for communication between plugin and server components; ensure network connectivity is available.
    • Future Roadmap: Jpom version 3.0 is currently in planning.
  7. Configure multi-threading for local build commands

    master
    Starting from version 2.11.1.2-beta, local build command execution supports a multi-threaded mode. This mode uses multiple threads to receive output streams, which helps prevent the build process from hanging in extreme scenarios.
  8. Manage 'Lonely Data' (孤独数据)

    master
    Introduced in version 2.11.0.9-beta, Jpom includes a management interface for 'Lonely Data' (孤独数据). This allows users to view and correct data entries that have become orphaned or disconnected from their intended nodes/projects.
  9. Run Jpom in Development Mode

    master

    To run Jpom locally for development purposes:

    1. Agent: Run the org.dromara.jpom.JpomAgentApplication class. Note the default username/password printed in the console. Default port: 2123.
    2. Server: Run the org.dromara.jpom.JpomServerApplication class. Default port: 2122.
    3. Frontend:
      • Navigate to the web-vue directory.
      • Run npm install.
      • Run npm run dev.
      • Access the frontend at the address output in the console (typically http://127.0.0.1:3000/).
  10. Install Jpom Server using Docker

    master

    Jpom Server can be deployed as a container. Note that containerized installation is only provided for the Server version; the Agent is not recommended for containerization due to isolation issues with the host environment.

    Quick Start: Run the following command to start a container named jpom-server mapping port 2122.

    Troubleshooting: If you encounter ls: cannot access '/usr/local/jpom-server/lib/': Operation not permitted on older Docker versions, add the --privileged flag to the command.

  11. Install Jpom Agent on Linux via One-Click Script

    master

    To manage a server that is also running the Jpom Server, you must install the Agent on that same machine.

    Important Notes:

    • Crucial: The Agent must be installed in a different directory than the Server.
    • To change the data and log storage paths, modify the jpom.path property in the application.yml file.
    • The Agent runs on port 2123 to provide data to the Server.
    # One-click default installation
    curl -fsSL https://jpom.top/docs/install.sh | bash -s Agent jdk+default
    
    # One-click default installation + automatic boot service configuration
    curl -fsSL https://jpom.top/docs/install.sh | bash -s Agent jdk+default+service
    
    # Install Agent and JDK environment (CentOS/Yum)
    yum install -y wget && \
    wget -O install.sh https://jpom.top/docs/install.sh && \
    bash install.sh Agent jdk
    
    # Install Agent and JDK (Ubuntu/Apt)
    apt-get install -y wget && \
    wget -O install.sh https://jpom.top/docs/install.sh && \
    bash install.sh Agent jdk