Skip to content

Agent for the Portabase Server. Portabase is designed from the ground up for easy installation and seamless management of database backups and restores.

License

Notifications You must be signed in to change notification settings

Portabase/agent-portabase


Logo

Portabase Agent

Free, open-source, and self-hosted solution for automated backup and restoration of your database instances.

License: MIT Docker Pulls Platform

PostgreSQL PostgreSQL MySQL MariaDB Self Hosted

Documentation β€’ Demo β€’ Installation β€’ Contributing β€’ Report Bug β€’ Request Feature


πŸ“š Table of Contents


✨ About The Project

Portabase Agent is the agent service use with Portabase Server. This service is for backup/restore db instances. Portabase Server

Built With

  • Python
  • Celery
  • Docker

πŸš€ Getting Started

Installation

Ensure Docker is installed on your machine before getting started.

Option 1: Docker Compose Setup

Create a docker-compose.yml file with the following configuration:

name: agent-portabase

services:
  app:
    container_name: agent-portabase
    restart: always
    image: solucetechnologies/agent-portabase:latest
    volumes:
      - ./databases.json:/app/src/data/config/config.json
      # - ./databases.toml:/app/src/data/config/config.toml
    environment:
      TZ: "Europe/Paris"
      # DATABASES_CONFIG_FILE: "config.toml" if you use .toml config file. By default, it's "config.json"
      EDGE_KEY: "<Get your edge key from your dashboard>"
    networks:
      - portabase

  db:
    image: postgres:17-alpine
    networks:
      - portabase
      - default
    ports:
      - "5430:5432"
    volumes:
      - postgres-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=<your_database>
      - POSTGRES_USER=<database_user>
      - POSTGRES_PASSWORD=<database_password>

volumes:
  postgres-data:

networks:
  portabase:
    name: portabase_network
    external: true

Then run:

docker compose up -d

Option 2: Locally (Development)

  1. Clone the repository
    git clone https://github.com/Soluce-Technologies/agent-portabase
  2. Start the project
    docker compose up 

πŸ”‘ Config File

You can configure your database connections by adding a config file. The software supports both JSON and TOML formats, so you can choose the format that best fits your workflow.

Multiple databases can be connected through the same agent, which is useful for managing development, staging, and production environments.

JSON Example

Create a database.json file with your database information:

{
  "databases": [
    {
      "name": "devdb",
      "type": "postgresql",
      "username": "devuser",
      "password": "changeme",
      "port": 5432,
      "host": "localhost",
      "generatedId": "16678159-ff7e-4c97-8c83-0adeff214681"
    },
    {
      "name": "mariadb",
      "type": "mysql",
      "username": "mariadb",
      "password": "changeme",
      "port": 3306,
      "host": "localhost",
      "generatedId": "16678124-ff7e-4c97-8c83-0adeff214681"
    }
  ]
}

For generatedId, you will need to generate it yourself using the UUID V4 format

TOML Example

Create a database.json file with your database information:

[[databases]]
name = "devdb"
type = "postgresql"
username = "devuser"
password = "changeme"
port = 5432
host = "localhost"
generatedId = "16678159-ff7e-4c97-8c83-0adeff214681"

[[databases]]
name = "mariadb"
type = "mysql"
username = "mariadb"
password = "changeme"
port = 3306
host = "localhost"
generatedId = "16678124-ff7e-4c97-8c83-0adeff214681"

βœ… Both JSON and TOML formats are fully supported.


πŸ—ΊοΈ Roadmap

  • Add Changelog
  • Add tests procedure
  • Add Release File
  • Security improvements
  • Multi db support
    • PostgreSQL
    • MySQL
    • MariaDB
    • MongoDB

See the open issues for a full list of proposed features (and known issues).


πŸ“¦ Database Seed (development)

Using Docker

For postgres

docker exec -i -e PGPASSWORD=<password> <container_name> psql -U <USER> -d <DATABASE> < ./scripts/seed.sql

For mysql

Install the client cli before

mysql -h 127.0.0.1 -P <port> -u <username> -p<password> <database_name> < ./scripts/seed-mysql.sql

🀝 Contributing

Contributions are welcome and appreciated! Here's how to get started:

  1. Fork the repository
  2. Create a new branch:
    git checkout -b feature/YourFeature
  3. Commit your changes:
    git commit -m "Add YourFeature"
  4. Push to the branch:
    git push origin feature/YourFeature
  5. Open a pull request

Give the project a ⭐ if you like it!

Top contributors:

contrib.rocks image

Semantic Versioning

Use the following format for Docker image versioning:

major.minor.patch-rc.release
# Example: 1.0.0-rc.1

major.minor.patch-rc.release-tag
# Example: 1.0.0-rc.1-dev

πŸ“„ License

Distributed under the Apache License. See LICENSE.txt for more information.


πŸ“¬ Contact


πŸ™ Acknowledgments

Thanks to all contributors and the open-source community!

About

Agent for the Portabase Server. Portabase is designed from the ground up for easy installation and seamless management of database backups and restores.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published