Configuration file format? #1

Open
opened 2025-05-08 22:24:21 +02:00 by lars · 2 comments
Owner

The following configuration file should represent all possible actions of nixnutz:

global_account_source:
  type: ldap
  parameters:
    base_dn: "ou=People,dc=example,dc=org"
    filter: "(objectClass=posixAccount)"

local_accounts:
  - name: Foo
    account_source:
      type: sql
      paramters:
        uri: postgres://username:password@database
        query: "SELECT username FROM service_users WHERE source='ldap'"
    removal_actions:
      - type: directory-pattern
        parameters:
          pattern: "/home/{username}"

  - name: Bar
    account_source:
      type: shell
      parameters:
        command: "find /srv/maildirs -type d -mindepth 2 -maxdepth 2 -name Maildir | cut -d / -f 4"
    removal_actions:
      - type: sql
        paramters:
          uri: postgres://username:password@database
          query: "DELETE FROM service_profiles WHERE user='{username}'"
      - type: http-api
        parameters:
          url: "https://api.service.local/api/v2/users/{username}"
          method: DELETE
          headers:
            Authorization: "Token f2d84d433a7d6a255e27f325c1050df48e8c26ac"
      - type: shell
        parameters:
          command: "sogo-tool remove '{username}'"
      - type: shell
        parameters:
          arguments:
            - ejabberd
            - unregister
            - "{username}"
            - example.org

I am not very happy with the names of the following keys:

  • global_account_source
  • local_accounts
  • account_source

Maybe you can think of better alternatives?

Is there something missing? Is the structure suitable?

The following configuration file should represent all possible actions of nixnutz: ```yaml global_account_source: type: ldap parameters: base_dn: "ou=People,dc=example,dc=org" filter: "(objectClass=posixAccount)" local_accounts: - name: Foo account_source: type: sql paramters: uri: postgres://username:password@database query: "SELECT username FROM service_users WHERE source='ldap'" removal_actions: - type: directory-pattern parameters: pattern: "/home/{username}" - name: Bar account_source: type: shell parameters: command: "find /srv/maildirs -type d -mindepth 2 -maxdepth 2 -name Maildir | cut -d / -f 4" removal_actions: - type: sql paramters: uri: postgres://username:password@database query: "DELETE FROM service_profiles WHERE user='{username}'" - type: http-api parameters: url: "https://api.service.local/api/v2/users/{username}" method: DELETE headers: Authorization: "Token f2d84d433a7d6a255e27f325c1050df48e8c26ac" - type: shell parameters: command: "sogo-tool remove '{username}'" - type: shell parameters: arguments: - ejabberd - unregister - "{username}" - example.org ``` I am not very happy with the names of the following keys: * `global_account_source` * `local_accounts` * `account_source` Maybe you can think of better alternatives? Is there something missing? Is the structure suitable?
Author
Owner

@kmohrf @phil: keine Meinung?

@kmohrf @phil: keine Meinung?
Owner

I like services instead of local_accounts.

I like `services` instead of `local_accounts`.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: systemausfall.org/nixnutz#1
No description provided.