README.md 6.08 KB
Newer Older
René Jochum's avatar
René Jochum committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
# minAdmin

## The components of minAdmin

| Component | Description |
|-----------|-------------|
| [minadmin_main](https://git.webmeisterei.com/minadmin/minadmin_main) | The "main" entrypoint for clients - its the Webserver and hosts .well-known/minadmin-configuration. |
| [minadmin_auth](https://git.webmeisterei.com/minadmin/minadmin_auth) | The IDP for Hydra |
| [minadmin_auth_srv_xorm](https://git.webmeisterei.com/minadmin/minadmin_auth_srv_xorm) | Currently the only available backend for "minadmin_auth" above |
| [minadmin_init](https://git.webmeisterei.com/minadmin/minadmin_init) | Creates the "root" user and the minAdmin hydra client |
| [minadmin](https://git.webmeisterei.com/minadmin/minadmin) | Contains the shared golang Package for all other components |
| [agent_zimbra](https://git.webmeisterei.com/minadmin/agent_zimbra) | The first minAdmin agent, for Zimbra |


## External Components used here

| Component | Description |
|-----------|-------------|
| [consul](https://www.consul.io/)  | Connects everything together |
| [vault](https://www.vault.io) | Secret Storage - not in use yet |
| [traefik](https://traefik.io/) | The HTTP Router in use |
| [hydra](https://www.ory.sh/docs/guides/master/hydra/) | Hydra is used as OpenID Connect Provider |
| [micro](https://micro.mu/) | Our microframework to connected each piece together |
| [postgresql](https://www.postgresql.org/) | The World's Most Advanced Open Source Relational Database |

## Installation

### Clone this repo

```
git clone --recurse-submodules -j8 https://git.webmeisterei.com/minadmin/dev.git
```

### Setup

- Install go 1.11

I use [gvm](https://github.com/moovweb/gvm) for that.

- Install reqs for the template generator

```
sudo apt install bzr rsync python3-yaml python3-jinja2 apache2-utils
```

- Install docker from the offical [repo](https://docs.docker.com/install/)

- Install docker-compose

```
sudo apt install python-pip
sudo pip install docker-compose
```

- Run it

```
make
```


## Important URLs

- [minAdmin](https://local.minadmin.io)
- [Traefik dashboard](https://local.minadmin.io/traefik)
- [Consul UI](http://consul.local.minadmin.io)
- [Vault UI](http://vault.local.minadmin.io)


## Development URLs

- [micro-web](http://micro.local.minadmin.io)
- [pgAdmin4](http://pgadmin.local.minadmin.io)


### Folder structure

```
src/minadmin                        Shared between minAdmin and its Agents
src/minadmin/agent                  Shared Agent base package

src/agent_ispconfig                 ISPConfig Agent
src/agent_zimbra                    Zimbra Agent


ui                                  Our Angular Nx Workspace                        @minadmin/js-dev
                                    Read more about it here: https://nrwl.io/nx/guide-nx-workspace
                                                             https://izifortune.com/multiple-packages-repository-with-angular/

ui/apps/minadmin                    minAdmin main app
ui/libs/oidc                        OpenID Connect Library for minadmin             @minadmin/js-oidc
```

### URLs

```
https://local.minadmin.io/#          Login
                        /status           Status of all customer services
                        /admin            Admin overview page
                            /agents       Administrate Agents
                            /ui           Administrate Frontends
                        /dns              Aggregates all agents that provide "dns"
                        /mail             Aggregates all agents that provide "mail"
                        /php              Aggregates all agents that provide "php"
```

```
https://local.minadmin.io/api/
        /auth
            /health                                 GET             Execute health check
            /login                                  POST            Login func
            /logout                                 POST            Logout func
            /refresh                                POST            Refresh a Token

            /user                                   GET             List users
                                                    POST            Create a new User
                /me                                 GET             Get information about the current logged in user

                /<email>                            GET             Get informations about the user with the given "email"
                                                    PUT             Update user with the given "email"
                                                    DELETE          Delete user with the given "email"

        /api/v1
            /health                                 GET             Execute health check
            /agent                                  GET             List Agents
                    /refresh                        POST            Refresh Agents

            /ws                                     GET             List workspaces for the current user
                                                    POST            Create a workspace for the current user

                /health                             GET             Execute health check

                /<UUID>                             GET             Get informations about the workspace "UUID"
                                                    PUT             Update the workspace "UUID"
                                                    DELETE          Delete the workspace "UUID"

                        /resource                   GET             List resources in the current workspace

            /provider                               GET             List providers
                /io.minadmin.type.mail.domain       GET             Get provider Info
                                                    POST            Create a Resource on that Provider
                    /<UUID>                         GET             Get the data for the Resource "UUID"
                                                    PUT             Update Resource "UUID"
                                                    DELETE          Delete Resource "UUID"
```

### Agent API

gRPC