metabase-standalone

Description

Install a Postgresql database service on the host and create a database. Then install Metabase, and configure it to use said database.

In case no 'metabase_db_password' is specified, freckles will generate a random one.

TODO: reverse proxy

NOTE: work in progess, will probably fail

Variables

Name Type Default Description

metabase_db_password

string metabase_password

The password for the db connection.

metabase_host

string localhost

The hostname to listen on.

metabase_port

integer 3000

The port for metabase to listen on.

Code

doc:
  short_help: Install a standalone metabase service.
  help: |
    Install a Postgresql database service on the host and create a database. Then install Metabase, and configure it to use said database.

    In case no 'metabase_db_password' is specified, freckles will generate a random one.

    TODO: reverse proxy

    NOTE: work in progess, will probably fail

args:
  _import: metabase-service
  metabase_db_password:
    doc:
      short_help: The password for the db connection.
    default: metabase_password
    type: string
    required: false

frecklets:
- postgresql-database-exists:
    db_name: metabase
    db_user: metabase
    db_user_password: "{{:: metabase_db_password | postgresql_password_hash('metabase')\
      \ ::}}"
    postgresql_listen_addresses:
#        - "{{:: metabase_host ::}}"
    - 127.0.0.1
    - 10.0.0.22
    postgresql_pg_hba:
    - method: md5
- metabase-service:
    metabase_db_type: postgres
    metabase_db_name: metabase
    metabase_db_user: metabase
    metabase_db_password: '{{:: metabase_db_password ::}}'
    metabase_db_host: localhost
    metabase_db_port: 5432
    metabase_host: '{{:: metabase_host ::}}'
    metabase_port: '{{:: metabase_port ::}}'
frecklecute --community metabase-standalone --help

Usage: frecklecute metabase-standalone [OPTIONS]

  Install a Postgresql database service on the host and create a database.
  Then install Metabase, and configure it to use said database.

  In case no 'metabase_db_password' is specified, freckles will generate a
  random one.

  TODO: reverse proxy

  NOTE: work in progess, will probably fail

Options:
  --metabase-db-password METABASE_DB_PASSWORD
                                  The password for the db connection.
  --metabase-host METABASE_HOST   The hostname to listen on.
  --metabase-port METABASE_PORT   The port for metabase to listen on.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.metabase_standalone.MetabaseStandalone
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class MetabaseStandalone(AutoPycklet):
    """Install a Postgresql database service on the host and create a database. Then install Metabase, and configure it to use said database.

     In case no 'metabase_db_password' is specified, freckles will generate a random one.

     TODO: reverse proxy

     NOTE: work in progess, will probably fail

       Args:
         metabase_db_password: The password for the db connection.
         metabase_host: The hostname to listen on.
         metabase_port: The port for metabase to listen on.

    """

    FRECKLET_ID = "metabase-standalone"

    metabase_db_password: str = None
    metabase_host: str = None
    metabase_port: int = None


    def __post_init__(self):
        super(MetabaseStandalone, self).__init__(var_names=["metabase_db_password", "metabase_host", "metabase_port"])


frecklet_class = MetabaseStandalone
# -*- coding: utf-8 -*-


#
# module path: pycklets.metabase_standalone.MetabaseStandalone
#


from pyckles import AutoPycklet

class MetabaseStandalone(AutoPycklet):
    """Install a Postgresql database service on the host and create a database. Then install Metabase, and configure it to use said database.

     In case no 'metabase_db_password' is specified, freckles will generate a random one.

     TODO: reverse proxy

     NOTE: work in progess, will probably fail

       Args:
         metabase_db_password: The password for the db connection.
         metabase_host: The hostname to listen on.
         metabase_port: The port for metabase to listen on.

    """

    FRECKLET_ID = "metabase-standalone"

    def __init__(self, metabase_db_password="metabase_password", metabase_host="localhost", metabase_port=3000):

        super(MetabaseStandalone, self).__init__(var_names=["metabase_db_password", "metabase_host", "metabase_port"])
        self._metabase_db_password = metabase_db_password
        self._metabase_host = metabase_host
        self._metabase_port = metabase_port

    @property
    def metabase_db_password(self):
        return self._metabase_db_password

    @metabase_db_password.setter
    def metabase_db_password(self, metabase_db_password):
        self._metabase_db_password = metabase_db_password

    @property
    def metabase_host(self):
        return self._metabase_host

    @metabase_host.setter
    def metabase_host(self, metabase_host):
        self._metabase_host = metabase_host

    @property
    def metabase_port(self):
        return self._metabase_port

    @metabase_port.setter
    def metabase_port(self, metabase_port):
        self._metabase_port = metabase_port



frecklet_class = MetabaseStandalone