Github: namanvashistha/limedb
This commit introduces a significant refactor to the LimeDB installation process, primarily by creating a new, dedicated installation script (proxmox/install.sh) and adapting the existing Proxmox LXC setup script (proxmox/limedb_lxc.sh) to leverage this new unified installer.
What Changed
-
New
install.shScript: A standalone bash script (proxmox/install.sh) has been added. This script encapsulates the entire process of installing LimeDB on a Debian-based system.- It manages dependency installation (
curl,ca-certificates,wget). - It fetches the latest LimeDB binary for
linux-amd64directly from the official GitHub releases. It uses the GitHub API to dynamically retrieve the newesttag_nameand includes a fallback version (v0.0.2) for robustness. - It creates and enables a
systemdservice (/etc/systemd/system/limedb.service) to run LimeDB as a background service, configured for automatic restart on failure. - It sets up a descriptive Message of the Day (MOTD) banner for users accessing the server.
- Includes helper functions for colored informational, success, and error messages.
- It manages dependency installation (
limedb_lxc.shRefactor: The Proxmox LXC helper script (proxmox/limedb_lxc.sh) has been updated to remove the previously embedded LimeDB installation logic. Instead, it now uses a newoverride_installfunction that points to the URL of the newly createdinstall.shscript hosted on GitHub. This means the LXC script no longer contains the installation steps directly but rather fetches and executes the externalinstall.sh.
Why the Change Was Needed
The primary motivation behind these changes is to enhance modularity, reusability, and maintainability of the LimeDB installation process.
- Modularity: By extracting the installation logic into a dedicated script, the process is now self-contained and can be executed independently of the Proxmox LXC setup. This allows for easier installation of LimeDB on any compatible Linux system, not just within a Proxmox container.
- Reusability: The
install.shscript can now be directly used or referenced by other automation tools, scripts, or manual installations, promoting a consistent deployment experience across different environments. - Maintainability: Centralizing the installation logic means that any updates or fixes to how LimeDB is installed (e.g., new dependencies, changes in binary release names, service configuration adjustments) only need to be made in one place (
install.sh). This reduces the chance of inconsistencies and simplifies future development. - Simplification of LXC Script: The
limedb_lxc.shscript becomes leaner and more focused on its core task of setting up the LXC container, delegating application-specific installation to a specialized script.
Design Choices
- Dynamic Latest Release Fetching: Utilizing the GitHub API for
latestreleasetag_nameensures that users always install the most current stable version of LimeDB. This reduces manual intervention for version updates. - Systemd Integration: Standard
systemdservice creation provides robust process management, automatic startup on boot, and failure recovery, which is essential for a reliable key-value store. - Binary Installation to
/usr/local/bin: This is a standard location for locally installed executable programs, making the LimeDB binary easily accessible from the system's PATH. - Direct Script Fetching in LXC: The LXC script directly fetches
install.shfrom themainbranch of the GitHub repository. This ensures the LXC creation process always uses the very latest version of the installer script without needing to updatelimedb_lxc.shitself for installer changes.
Trade-offs and Constraints
- Running as
root: Thesystemdservice is configured to run LimeDB as therootuser. While simplifying initial setup and avoiding permission issues, running services with elevated privileges can be a security concern in production environments where a dedicated, unprivileged user is often preferred for application processes. - External Dependency for LXC Script: The
limedb_lxc.shscript now has an external dependency on theinstall.shscript hosted on GitHub. While convenient for dynamic updates, it means the installation process requires internet connectivity and is susceptible to GitHub's availability. - Fallback Version Limitation: In case of GitHub API issues, the fallback
v0.0.2is used. This ensures some installation can proceed but might not provide the desired up-to-date version. - Limited Configuration Options: The
install.shscript provides a default installation without explicit options for custom configurations (e.g., custom data directories, different listening ports, user accounts) during the installation process. These would need to be manually configured post-installation. - Linux AMD64 Specific: The installer targets
limedb-linux-amd64exclusively, limiting its direct use to this architecture.
Future Implications
- This modular approach paves the way for easier support for multiple installation methods (e.g., different operating systems, containerization solutions) by simply creating or adapting new installation scripts.
- The
install.shscript could be extended in the future to accept parameters for custom configurations, enhancing its flexibility for various deployment scenarios. - It simplifies automated testing and continuous integration workflows, as the installation steps are now standardized and repeatable.
Top comments (0)