Skip to content

Ribbon2 Directory

Stanislav Nepochatov edited this page Oct 21, 2024 · 6 revisions

General

Directory module serves as holder of directories and related data. It also autorize any operation on directories by permissions. Module hasn't any REST API method it only relies on message bus.

Directory keeps it's own copy of user/group structure for validating access control lists and for checking permissions.

Configuration

Example:

{
    "directory": {
        "createDirs": [
            "System.Test",
            "System.Error",
            "Inbox.Agencies",
            "Inbox.Reporters",
            "Inbox.Drop",
            "Edit.Translation.En2Ua",
            "Edit.Translation.Ua2En",
            "Edit.Release.En",
            "Edit.Release.Ua"
        ],
        "permissions": [
            {
                "key": "canCreateDir",
                "description": "Allows user to create child directory",
                "defaultValue": false
            },
            {
                "key": "canUpdateDir",
                "description": "Allows user to update current or child directory",
                "defaultValue": false
            },
            {
                "key": "canDeleteDir",
                "description": "Allows user to delete current or child directory",
                "defaultValue": false
            },
            {
                "key": "canEditDirAccess",
                "description": "Allows user to change access control list on directory",
                "defaultValue": false
            }
        ],
        "errorDir": "System.Error"
    },
    "db": {
        "jdbcUrl": "jdbc:postgresql://localhost:5432/ribbon2-directory",
        "driver": "org.postgresql.ds.PGSimpleDataSource",
        "username": "ribbon2",
        "password": "ribbon2"
    }
}

List of params:

  • directory.createDirs - array of the dirs which should be created on first startup (can be overridden by DIRECTORY_CREATE_DIRS env variable);
  • directory.permissions - list of the permissions which should be created for proper work of the module. Other modules can create on directory module it's own permissions by calling Ribbon.Global.InitPermissions;
  • directory.errorDir - directory assigned to accept reports of system errors on other units (can be overridden by DIRECTORY_ERROR_DIR env variable). Specified directory must be preseint in db or defined in directory.createDirs config;
  • db.* - self-explainatory database settings. Settings can be overridden by following variables: DB_JDBC_URL, DB_USERNAME and DB_PASSWORD;

Startup

Directory module can be started like normal Java application or in Docker image. Project contains ready-to-use Dockerfile.

During startup directory module will create listed in config directories and permissions. For each created directiory notification will be released in bus.

Clone this wiki locally