Skip to content

Basic Operations of Script Market

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

Always use the latest version of DataFlux Func for operations

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, users can achieve various functional requirements by writing their own scripts in DataFlux Func.

For some highly generic program solutions, DataFlux Func provides the "Script Market" feature, which allows script collections to be published to the script market for other DataFlux Func installations to directly install, facilitating the distribution of function codes and timely updates.

In addition to the official script market maintained by DataFlux Func, users can also set up their own script markets through DataFlux Func to distribute code within their organization (i.e., a private market).

Starting from DataFlux Func 2.x, the script market is provided as an official feature and does not need to be enabled from the "experimental features".

You can directly access the script market list page by clicking on "Script Market" in the top navigation.

script-market-entry.png

2. Official Script Market

By default, DataFlux Func does not include any script markets.

To facilitate user access to the official script market, simply click "Add Official Script Market" in the script market list to directly create the official script market without any additional configuration.

add-official-script-market.png

3. Self-built Script Market

In addition to the official script market, DataFlux Func can simultaneously set up and connect to multiple different script markets to meet more complex scenarios.

The script market is based on external systems, and currently supported script market types are as follows:

Type Description Supported External Systems
git A script market based on git repositories.
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
Gitlab (SaaS or self-hosted)
Github
BitBucket
Self-hosted gitea
Self-hosted gogs
Alibaba Cloud OSS A 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 A script market based on HTTP services.
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

For script markets based on git and Alibaba Cloud OSS, authentication information (such as username and password) must be configured when creating the script market, and corresponding read/write permissions must be ensured when publishing, viewing, and installing scripts.

3.1 Adding a Self-built Script Market

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

After filling out the required fields and saving, the addition of the script market is completed.

If the current DataFlux Func acts as the script manager, enable the "Manage this script market" option.

add-script-market.png

Completing User Information for Git Commits

Since specifying user name and email is necessary during git commits, when creating a git-based script market as the script manager, the system will automatically prompt you to complete the user information (name and email) for the current user.

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

complete-git-commitor.png

3.2 Publishing Scripts

When adding a script market, if "Manage this script market" is specified, the current DataFlux Func will act as the manager to connect to the script market.

As the manager, local existing script collections can be published to the script market, and already published script collections in the script market can also be deleted.

manage-script-market.png

publish-delete-script-set.png

3.3 Installing Scripts

When adding a script market, if "Manage this script market" is not specified, the current DataFlux Func will act as the subscriber to connect to the script market.

As the subscriber, script collections can be installed from the script market.

install-from-script-market.png

script-set-from-script-market.png

X. Points to Note

When installing and using script collections installed from the "Script Market", please pay attention to 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), the script market would generate directory structures locally according to the target source.

For example, for a script market based on Alibaba Cloud OSS:

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 had several issues:

  1. Directory names and paths were too long.
  2. Creating two script markets with the same address caused conflicts in local directories.

Therefore, starting from version 2.2.0, we 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 version 2.2.0, there may be issues accessing the script collection list for git-based script markets that have already been created.

To fix the above problem, you can delete the script market and re-add it.

For script market managers, please also delete the TOKEN file in the root directory of remote storage before re-adding with the "Manage this script market" method.

Script Markets Based on Git Hosting Platforms

For script collections hosted on platforms like Gitlab, Github, Gitee, etc., refer to the table below:

Git Repository Type DataFlux Func Role Need to Fill in Git Hosting Platform Username and Password? Need Management Rights for This Git Repository on Git Hosting Platform?
Public Manager Yes Yes
Public Subscriber No No
Private Manager, Subscriber Yes Yes

Installed Script Collections Can Be Modified

There is no essential difference between installed script collections and script collections created manually by users.

Users can modify and customize them according to their needs, and the system imposes no restrictions.

After modifying the script collection, if the script collection has updates in the script market, upgrades will be prohibited by default to prevent loss of user modifications (upgrades can be forced through the force mode).

Existence of Script Collections with the Same ID

If the script collection ID in the script market matches the local script collection ID, then by default, installation of this script collection will be prohibited (it can be forcibly installed through the force mode).

Furthermore, if multiple different script markets are connected and there are script collections with the same ID, once one script collection from one script market is installed, another script collection with the same ID from another script market will be unable to install by default (it can be forcibly installed through the force mode).

If you encounter issues related to script collections with the same ID, you can use the 'Clone' function of the script collection to clone the script collection with duplicate IDs to another ID.