Skip to content

Basic Operations of Script Market

This document mainly introduces the basic operations of the "Script Market".

Tip

Always use the latest version of DataFlux Func for operations.

Danger

Starting from DataFlux Func 2.x, the new version of the Script Market has been fully enabled, and the old version of the Script Market is no longer maintained.

1. Background

Due to its programmable nature, DataFlux Func allows users to implement various functional requirements by writing their own scripts.

For some program solutions with strong universality, DataFlux Func provides the "Script Market" function, which allows script sets to be published to the Script Market for other DataFlux Func users to install directly, facilitating the distribution of functional code and timely updates.

In addition to the Script Market officially maintained by TrueWatch, users can also build their own Script Market through DataFlux Func to distribute code within their organization (i.e., private market).

Starting from DataFlux Func 2.x, the Script Market is provided as an official function and no longer needs to be enabled from "Experimental Features".

You can directly click "Script Market" in the top navigation to enter the Script Market list page.

2. Self-built Script Market

DataFlux Func can build and access multiple different Script Markets to meet more complex scenarios.

The Script Market is implemented based on external systems. The currently supported types of Script Markets are as follows:

Type Description Supported External Systems
git Script Market based on git repository.
Publishing scripts is achieved by submitting code to the git repository.
Viewing and installing scripts is achieved by pulling and reading data from the git repository.Gitee
Gitlab (SaaS or self-built)
Github
BitBucket
Self-built gitea
Self-built gogs
Alibaba Cloud OSS Script Market based on Alibaba Cloud OSS.
Publishing scripts is achieved by uploading files to Alibaba Cloud OSS.
Viewing and installing scripts is achieved by downloading files from Alibaba Cloud OSS.
Alibaba Cloud OSS
HTTP Service Script Market based on HTTP service.
Viewing and installing scripts is achieved by downloading files from the HTTP service.
This type of Script Market does not support publishing scripts
Various HTTP static services
Alibaba Cloud OSS public read
Note

For Script Markets based on git and Alibaba Cloud OSS, authentication information (such as username and password) needs to be configured when creating the Script Market, and the corresponding read and write permissions must be ensured for publishing, viewing, and installing scripts.

2.1 Adding a Self-built Script Market

On the "Script Market" list page, click "Add" to enter the Script Market addition page.

After filling in the required fields and saving, the Script Market addition is completed.

If the current DataFlux Func is the script management party, please enable the "Manage this Script Market" option.

Completing User Information for Git Commits

Since git commits require specifying a user name and email, when creating a git-based Script Market as the script management party, the system will automatically prompt the current user to complete the user information (name and email).

Note

Since git itself does not have a user system, the information completed here will be directly used as the information in the git commit. It can theoretically be filled in arbitrarily, but it is generally recommended to fill in the email registered on the corresponding platform to avoid unnecessary misunderstandings.

2.2 Publishing Scripts

When adding a Script Market, if "Manage this Script Market" is specified, the current DataFlux Func will access the Script Market as the management party.

As the management party, you can publish locally existing script sets to the Script Market, or delete script sets that have been published in the Script Market.

2.3 Installing Scripts

When adding a Script Market, if "Manage this Script Market" is not specified, the current DataFlux Func will access the Script Market as a subscriber.

As a subscriber, you can install script sets from the Script Market.

X. Notes

When installing and using script sets from the "Script Market", please note the following points:

Upgrading from 2.x to 2.2.x and later versions

Added in version 2.2.0

In previous versions (2.0.0 ~ 2.1.1), when the Script Market stored data locally, it would generate a directory structure based on the target source.

Take a Script Market based on Alibaba Cloud OSS as an example:

Item Address
OSS Address oss://my_bucket/folder_1/folder_2/folder_3/
Local Storage Location script-market/aliyun-oss/my_bucket/folder_1/folder_2/folder_3/

However, the above approach has several issues:

  1. The directory name and path are too long.
  2. Creating two Script Markets with the same address causes local directory conflicts.

Therefore, starting from version 2.2.0, we have modified the local storage directory as follows:

Item Address
OSS Address oss://my_bucket/folder_1/folder_2/folder_3/
Local Storage Location script-market/aliyun-oss/{script-market-id}/

Due to the above changes, after upgrading to 2.2.0, Script Markets based on git that have been created may have issues accessing the script set list.

To fix this issue, you can delete the Script Market and add it again.

For Script Market management parties, please also delete the TOKEN file in the root directory of the remote storage, and then re-add it as "Manage this Script Market".

Script Markets Based on Git Hosting Platforms

For script sets built on git hosting platforms like Gitlab, Github, Gitee, etc., please refer to the following table to determine:

Git Repository Type DataFlux Func Role Whether to Fill in Git Hosting Platform Username and Password Whether to Have Management Rights of This Git Repository on the Git Hosting Platform
Public Management Party Yes Yes
Public Subscriber No No
Private Management Party, Subscriber Yes Yes

Installed Script Sets Can Be Modified

The installed script sets are essentially no different from script sets created by users themselves.

Users can modify and customize them according to their own needs, and the system does not impose any restrictions on this.

Tip

After modifying the script set, if this script set has updates in the Script Market, upgrading will be prohibited by default to prevent the loss of user modifications (can be forced to upgrade through forced mode).

Script Sets with the Same ID Exist

If the script set ID in the Script Market is the same as the local script set ID, this script set will be prohibited from being installed by default (can be forced to install through forced mode).

In addition, if multiple different Script Markets are accessed and there are script sets with the same ID, once one of the Script Market script sets is installed, the script set with the same ID in another Script Market will be unable to be installed by default (can be forced to install through forced mode).

Tip

If you encounter such issues with script sets with the same ID, you can use the "Clone" function of the script set to clone the script set with the duplicate ID to another ID.