Skip to content

pararang/letgofur

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

letgofur

letgofur (Lieutenant Gofurr) is a CapRover (Captain Rover) subordinate.

Simple CLI for CapRover API, built with Go. Help you to define your infrastructure hosted with CapRover in a declarative way. It is designed to be a simple and efficient command-line interface for managing your CapRover applications and resources. It allows you to easily interact with your CapRover server, manage applications, and automate tasks without the need for a web interface.

CapRover is an open-source platform that simplifies the deployment and management of applications on cloud servers. It provides a user-friendly interface for managing Docker containers, making it easy to deploy, scale, and monitor applications. Read more about CapRover here.

About

letgofur provides a simple and efficient way to interact with your CapRover server from the command line. It allows you to:

  • List all applications deployed on your CapRover instance
  • Connect to your CapRover server using authentication credentials
  • Manage your CapRover applications without using the web interface

Built with Go and the forked GoCaproverAPI as its base, letgofur makes it easy to automate and streamline your CapRover management tasks on your terminal.

Installation

Download pre-built binary

You can download the pre-built binary for Linux from the GitHub Releases page:

# Download the latest release (replace X.Y.Z with the latest version)
curl -L https://github.com/pararang/letgofur/releases/download/vX.Y.Z/letgofur-linux-amd64 -o letgofur

# Make it executable
chmod +x letgofur

# Move to a directory in your PATH (optional)
sudo mv letgofur /usr/local/bin/

Prerequisites for building from source

  • Go 1.23 or higher

Building from source

# Clone the repository
git clone https://github.com/pararang/letgofur.git
cd letgofur

# Build the application
go build -o letgofur

# Make it executable (optional)
chmod +x letgofur

# Move to a directory in your PATH (optional)
mv letgofur /usr/local/bin/

Configuration

Command-line Flags

You have provide credentials directly via command-line flags:

letgofur --host https://captain.your.domain --passwd yourpassword

Usage

List all applications

letgofur --host https://captain.your.domain --passwd yourpassword ls

Create a workspace

Initialize a workspace for infrastructure as code configuration:

letgofur --host https://captain.your.domain --passwd yourpassword init

You can also initialize a git repository in the workspace directory by adding the --git flag:

letgofur --host https://captain.your.domain --passwd yourpassword init --git

This command will create a directory named based on the hostname of your CapRover instance. Inside this directory, you will find all the current apps config. Currently this only supports the instance and app resource configurations. If the --git flag is provided, it will also initialize a git repository in the workspace directory.

# Example of the generated YAML file
# captain.your.domain/app-name.yml
AppName: app-name
Instances: 3
Resources:
    Limits:
        MemoryBytes: 16777216
        NanoCPUs: 1000000
    Reservations:
        MemoryBytes: 1122323
        NanoCPUs: 1000000

Update app configuration

Apply configuration changes to an existing app using a YAML file. Lets say you are inside the generated workspace directory:

letgofur --host https://captain.your.domain --passwd yourpassword apply app-name.yml

This command updates app resources and instance count based on the configuration file.

For a detailed guide on implementing infrastructure-as-code workflows with letgofur, please see WORKFLOW.md.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Attribution

The crapi directory contains code from the GoCaproverAPI project, which is licensed under the Apache License 2.0. The original code has been incorporated into this project with minimal modifications to support the letgofur CLI functionality.

Changes made to the original code include:

  • Minor adaptations for integration with the letgofur command structure
  • Remove some printed messages for cleaner CLI output

All copyright notices and license terms from the original project have been preserved in the source files.

To Do

The following features are planned for future releases, based on the capabilities of the GoCaproverAPI:

  • App Management

    • List all applications
    • Generate workspace for infra as code configuration
    • Update application details and configurations
    • Create new applications
    • Remove/delete applications
    • Force build applications
  • Domain Management

    • Add custom domains to applications
    • Enable SSL for base domains
    • Enable SSL for custom domains
    • Enable force redirect to the custom domain
  • Resource Management

    • Update resource constraints (memory, CPU) for applications
    • Scale application instances
  • Deployment Options

    • Configure environment variables
    • Set up port mappings
  • User Interface Improvements

    • Interactive mode for commands
    • Progress indicators for long-running operations
    • Colorized output for better readability
    • Interective mode with session

License

This project is licensed under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LICENSE file for the specific terms and conditions of the license.

About

Lieutenant Gofurr, CapRover subordinate

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.7%
  • Makefile 2.3%