Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic artisan command for provisioning #1636

Open
pizkaz opened this issue Nov 27, 2024 · 1 comment · May be fixed by #1678
Open

Generic artisan command for provisioning #1636

pizkaz opened this issue Nov 27, 2024 · 1 comment · May be fixed by #1678

Comments

@pizkaz
Copy link
Contributor

pizkaz commented Nov 27, 2024

Is your feature request related to a problem? Please describe.
Kind of. We would like to (or rather: must) be able to pre-configure servers, server pools, user roles, etc. for new PILOS instances in an automated provisioning step.

Describe the solution you'd like
Ideally, we would be able to provide a JSON / YAML / TOML / ... file containing all the things we want to customize and feed it to an artisan command parsing it and executing required steps. The file might look something like this:

{
  "servers": {
    "keep_existing": false,
    "add": [
      {
        "name": "Default server",
        "description": "Our default BBB backend",
        "endpoint": "https://default.bbb.example.biz",
        "secret": "Xuper5ecr37",
        "strength": 5,
        "status": "enabled"
      },
      {
        "name": "BFS",
        "description": "Our powerful BBB backend",
        "endpoint": "https://9001.bbb.example.biz",
        "secret": "Xuper5ecr37",
        "strength": 10,
        "status": "enabled"
      }
    ]
  },

  "server_pools": {
    "keep_existing": false,
    "add": [
      {
        "name": "default",
        "description": "Default pool",
        "servers": [
          "Default server"
        ]
      },
      {
        "name": "performance",
        "description": "Performance pool",
        "servers": [
          "Default server"
        ]
      }
    ]
  },

  "room_types": {
    "keep_existing": false,
    "add": [
      {
        "name": "Meeting",
        "description": "A room type for small meetings",
        "color": "#2c3e50",
        "server_pool": "default"
      },
      {
        "name": "Lecture",
        "description": "A room type for big lectures",
        "color": "#ef4444",
        "server_pool": "performance"
      }
    ]
  },

  "roles": {
    "keep_existing": true,
    "add": [
      {
        "name": "Admin",
        "permissions": {
          "rooms": [
            "show_all",
            "manage"
          ],
          "meetings": [
            "show_all"
          ],
          "settings": [
            "show_all",
            "edit"
          ],
          "users": [
            "show_all",
            "show",
            "edit",
            "create",
            "delete"
          ],
          "roles": [
            "show_all",
            "show"
          ],
          "room_types": [
            "show",
            "edit",
            "create",
            "delete"
          ],
          "servers": [
            "show_all",
            "show"
          ],
          "server_pools": [
            "show_all",
            "show"
          ]
        }
      }
    ]
  },

  "users": {
    "keep_existing": true,
    "add": [
      {
        "firstname": "Maurice",
        "lastname": "Moss",
        "authenticator": "local",
        "language": "en",
        "timezone": "Europe/London"
      }
    ]
  },

  "settings": {
    "application": {
      "name": "Example company - PILOS",
      "help_url": "https://help.bbb.example.biz",
      "legal_url": "https://legal.bbb.example.biz",
      "privacy_url": "https://privacy.bbb.example.biz",
      "timezone": "Europe/Germany"
    },
    "recording": {
      "server_utilization": false,
      "meeting_utilization": false,
      "storage_duration": "2y"
    }
  }
}

The artisan command could have the following usage:

❯ ./sail artisan provision --help
Description:
  Provision a running PILOS instance according to a provides JSON file.

Usage:
  provision [options] <file>

Options:
      --force
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --env[=ENV]       The environment the command should run under
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Describe alternatives you've considered
A simpler solution could be a dummy implementation of the provision command printing a notice on how to implement it. Downsides:

  • would require admins to write PHP code
  • custom implementations could break with PILOS updates

Additional context
-none-

@SamuelWei
Copy link
Collaborator

Alternativ

  • stable management rest api

@pizkaz pizkaz linked a pull request Dec 10, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants