### Start and Enable firewalld Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Ensures the `firewalld` service is running and configured to start automatically on boot. This is a critical step for network security and proper installation. ```bash # Execute as root systemctl start firewalld systemctl enable firewalld ``` -------------------------------- ### Install Docker and Related Components Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Installs Docker Engine, CLI, containerd, buildx plugin, and Docker Compose plugin. It also includes steps to remove conflicting packages like Podman and optionally configure the Aliyun mirror for faster image pulls. Finally, it starts and enables the Docker service. ```bash yum -y erase podman buildah # Execute as root ### Configure Aliyun Mirror for Docker (Optional) yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y docker -v # Docker version 24.0.6, build ed223bc # Start the docker service and set it to start on boot. systemctl start docker systemctl enable docker ``` -------------------------------- ### Download and Execute OctoMation Installation Script Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Provides commands to download and run the OctoMation community Docker installation script. It includes a recommended command for users in China using `ghproxy.com` for acceleration, and a default command using the raw GitHub URL. The script is made executable before running. ```bash # ghproxy.com network acceleration version (recommended for CN users) curl -o octomation_install.sh https://ghproxy.com/https://raw.githubusercontent.com/flagify-com/OctoMation/main/octomation_community_docker_install_1.1.4.sh && \ chmod +x octomation_install.sh && \ ./octomation_install.sh # # Default installation (GitHub original address) curl -o octomation_install.sh https://raw.githubusercontent.com/flagify-com/OctoMation/main/octomation_community_docker_install_1.1.4.sh && \ chmod +x octomation_install.sh && \ ./octomation_install.sh ``` -------------------------------- ### Start and Enable Firewall Service Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Commands to start and enable the `firewalld` service, which is necessary for the OctoMation installation script to run successfully if the firewall is not already active. It also checks the firewall status before and after the operations. ```bash firewall-cmd --state systemctl start firewalld systemctl enable firewalld firewall-cmd --state ``` -------------------------------- ### Install Key Components Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Installs essential components like `yum-utils` and `screen`. `screen` is recommended for managing long-running terminal sessions during installation to prevent interruptions. ```bash # Execute as root yum install yum-utils screen -y ``` -------------------------------- ### OctoMation QuickBook Links Source: https://github.com/flagify-com/octomation/blob/main/README.md Provides links to quick start guides for creating the first OctoMation Playbook, event ingestion, and application development. ```Markdown - [🐙我的第一个OctoMation Playbook](https://github.com/flagify-com/OctoMation/wiki/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E4%B8%AAOctoMation-Playbook) - [🐙我的第一个OctoMation 事件接入](https://github.com/flagify-com/OctoMation/wiki/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E4%B8%AAOctoMation-%E4%BA%8B%E4%BB%B6%E6%8E%A5%E5%85%A5) - [🐙我的第一个OctoMation 应用APP开发](https://github.com/flagify-com/OctoMation/wiki/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E4%B8%AAOctoMation-%E5%BA%94%E7%94%A8APP%E5%BC%80%E5%8F%91) ``` -------------------------------- ### Install Docker Compose Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Installs Docker Compose version 1.29.2 on Linux systems. It downloads the binary, makes it executable, and verifies the installation. If 'docker-compose' is not found, it provides instructions to add '/usr/local/bin' to the system's PATH environment variable. ```bash # Original installation curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose && \ docker-compose -v ``` -------------------------------- ### Create Swap Partition for Cloud Hosts Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 This set of commands guides the creation of an 8GB swap file on a cloud host. It includes steps for creating the swap file, setting appropriate permissions, formatting it as swap space, activating it, and configuring it to persist across reboots by adding it to /etc/fstab. It also shows how to adjust swappiness for performance tuning. ```bash sudo dd if=/dev/zero of=/swapfile count=8192 bs=1MiB sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab free -h swapon --show # Adjust swappiness # Add or modify vm.swappiness = 1 in /etc/sysctl.conf # vm.swappiness = 1 # Then apply the changes with: sysctl -p ``` -------------------------------- ### SDK Installation Source: https://github.com/flagify-com/octomation/wiki/应用sdk使用手册 Instructions for installing the Octomation SDK using pip. It also clarifies that the SDK is pre-built into the platform, and local installation is for development purposes. ```text pip install action-sdk-for-cache-mock ``` -------------------------------- ### Check firewalld Status Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Verifies if the `firewalld` service is running. A running firewall is a prerequisite for OctoMation installation. If `firewalld` is not active, refer to the provided link for troubleshooting. ```bash [root@iZj6ce5tnbjr6kx5xz180xZ ~]# firewall-cmd --state running If fiewalld is not running properly, please refer to: [Firewall Service Not Enabled During Installation, Causing Installation Failure](#firewall-service-not-enabled-during-installation-causing-installation-failure). ``` -------------------------------- ### Execute Offline Installation Script Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Provides the command to execute the offline OctoMation installation script after downloading it. This script is recommended for users in China due to network considerations. Ensure the script is executed with root privileges. ```bash # Execute the offline installation script as root chmod +x octomation_community_docker_install_offline_.sh ./octomation_community_docker_install_offline_.sh ``` -------------------------------- ### Configure Docker Registry Mirrors Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Sets up domestic Docker registry mirrors to improve pull image speed for users in China. This involves creating or modifying the `/etc/docker/daemon.json` file with a list of recommended mirror URLs. ```json { "registry-mirrors": [ "https://docker.nju.edu.cn", "https://docker.mirrors.sjtug.sjtu.edu.cn", "https://dockerproxy.com", "https://docker.m.daocloud.io", "https://hub-mirror.c.163.com" ] } ``` -------------------------------- ### OctoMation API Documentation Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 This section provides API documentation for OctoMation. It includes details on authentication, endpoints, request/response formats, and common operations. Specific API details such as models, methods, and parameters are documented below. ```APIDOC OctoMation API Overview: Base URL: (Not specified in the provided text) Authentication: (Not specified in the provided text, but typically API keys or tokens are used for authentication.) Common Operations: - Installation and Deployment related APIs (details not provided) - Configuration Management APIs (details not provided) - Data Import/Export APIs (details not provided) Example API Endpoint (Hypothetical): GET /api/v1/status Description: Retrieves the current status of the OctoMation system. Parameters: None Responses: 200 OK: content: application/json: schema: type: object properties: status: { type: string, description: "Current system status (e.g., running, stopped, installing)" } version: { type: string, description: "OctoMation version" } 500 Internal Server Error: content: application/json: schema: type: object properties: error: { type: string, description: "Error message" } Note: The provided text does not contain specific API endpoint details, methods, schemas, or examples. This is a placeholder based on typical API documentation structure. ``` -------------------------------- ### Install Docker CE and Compose on CentOS 8 (without yum-config-manager) Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 A script to install Docker CE and Docker Compose on systems where `yum-config-manager` is not available, specifically targeting CentOS 8. It downloads the Docker CE repository configuration, installs necessary packages including `container-selinux`, starts and enables the Docker service, and installs Docker Compose. ```bash curl -o /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo sed -i s/\$releasever/8/g /etc/yum.repos.d/docker-ce.repo wget https://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/container-selinux-2.124.0-1.gitf958d0c.module_el8.3.0+569+1bada2e4.noarch.rpm rpm -ivh container-selinux-2.124.0-1.gitf958d0c.module_el8.3.0+569+1bada2e4.noarch.rpm dnf install docker-ce docker-ce-cli -y systemctl start docker systemctl enable docker curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64 -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose && docker-compose -v ``` -------------------------------- ### OctoMation Installation and Activation Source: https://github.com/flagify-com/octomation/blob/main/README.md Provides guidance on installing OctoMation, including system requirements and software dependencies, and explains the process of obtaining and importing a free community license for activation. ```Markdown ## 快速安装 关于系统要求,软件依赖和具体安装说明,**请参考WIKI文档**:[OctoMation安装部署手册](https://github.com/flagify-com/OctoMation/wiki/OctoMation%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2%E6%89%8B%E5%86%8C)。 ## 免费激活 OctoMation是HoneyGuide SOAR的社区免费版,为了规范产品使用,促进社区健康发展,让我们的后续支持更加有针对性,社区免费版需要导入一个免费的授权License。 您可以直接访问[OctoMation社区免费版License申请地址](https://flagify.com/e1598bd6f9a583),也可以手机端扫码申请。 申请OctoMation社区免费版License 成功获取免费激活的授权文件后,登录系统导入授权文件。 > 建议提前将License发送邮箱[octomation_support@wuzhi-ai.com](mailto://octomation_support@wuzhi-ai.com)加入邮件服务器白名单。 ## 导入社区剧本和应用(按需) OctoMation安装成功后,用户可以自己创建应用和剧本,也可以导入社区免费版提供的各类应用和剧本,详细请参考: - ⏬[应用能力APP包](./App%20Packages/AppPackages.md) - ⏬[场景剧本Playbook包](./Playbook%20Packages/PlaybookPackages.md) ``` -------------------------------- ### Change CentOS YUM Repository Mirror Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Instructions for changing the CentOS YUM repository mirror to a domestic source, recommended for users in China to improve download speeds. It utilizes the LinuxMirrors script. ```bash bash <(curl -sSL https://linuxmirrors.cn/main.sh) # During the configuration process: Do not choose to close the firewall ``` -------------------------------- ### 应用APP说明文档配置 Source: https://github.com/flagify-com/octomation/wiki/我的第一个OctoMation-应用APP开发 介绍了应用APP的说明文档编写的重要性,以及在应用APP顶级目录下配置`readme.md`和`readme.html`文件的作用。默认使用`readme.md`,可通过`config.json`修改。 ```zh 在应用APP顶级目录里,有`readme.md`和`readme.html`。默认为`readme.md`,您也可以通过`config.json`文件修订。 ``` -------------------------------- ### Troubleshoot Docker IP Table Errors Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 This snippet addresses an error where Docker fails to set up IP tables, specifically the SKIP DNAT rule. It suggests checking firewalld status and restarting the Docker service. The provided commands help diagnose and potentially resolve the issue by ensuring Docker's network configurations are correctly applied. ```bash Note: check firewalld for docker ✔ firewalld started Note: !!!!!防火墙已启动,后续不允许停止,否则可能导致docker服务异常!!!! Note: docker version: 24.0.6 ➜ check if docker started ✔ docker started already ➜ check honeyGuide docker network ➜ create HoneyGuide docker network Error response from daemon: Failed to Setup IP tables: Unable to enable SKIP DNAT rule: (iptables failed: iptables --wait -t nat -I DOCKER -i br-ce0256958c7e -j RETURN: iptables: No chain/target/match by that name. (exit status 1)) shakespeare install error,exit OcoMation 安装失败 systemctl restart docker ``` -------------------------------- ### Check Operating System Version Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Verifies the current operating system version. It's crucial to ensure the system meets the minimum version requirements for OctoMation. If the primary command fails, alternative methods are suggested. ```bash cat /etc/redhat-release # CentOS Linux release 7.9.2009 (Core) # If the command has no effect, please try [more CentOS version checking methods](https://blog.csdn.net/GGxiaobai/article/details/53505029) ``` -------------------------------- ### 应用APP单元测试代码创建 Source: https://github.com/flagify-com/octomation/wiki/我的第一个OctoMation-应用APP开发 指导开发者在应用APP顶级目录下创建单元测试代码,以便测试团队使用自动化测试工具进行回测。 ```zh 在应用APP顶级目录下创建单元测试代码,方便未来测试团队使用自动化测试工具进行回测。 ``` -------------------------------- ### IPinfo应用APP在剧本编排中的使用 Source: https://github.com/flagify-com/octomation/wiki/我的第一个OctoMation-应用APP开发 展示了如何在OctoMation的剧本编排过程中,将IPinfo应用APP集成到事件响应流程中,实现编排调度的灵活性。 ```zh 在剧本编排过程中,也可以选择IPinfo应用参与事件响应过程的编排调度。 ``` -------------------------------- ### Start All Services Source: https://github.com/flagify-com/octomation/wiki/OctoMation运维手册 Command to start all services defined in the docker-compose.yml file in detached mode. This brings up the entire OctoMation system. ```bash docker-compose -f /opt/shakespeare/docker-compose.yml up -d docker-compose -f /opt/honeyguide_docker_python/docker-compose.yml up -d ``` -------------------------------- ### Check Disk Space Usage Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Displays disk space usage for mounted filesystems, allowing verification of available space on critical partitions like '/' and '/opt'. This is important for ensuring sufficient storage for OctoMation data and logs. ```bash root@iZj6ce5tnbjr6kx5xz180xZ:~# df -h Filesystem Size Used Avail Use% Mounted on tmpfs 729M 988K 728M 1% /run /dev/vda3 197G 2.3G 187G 2% / tmpfs 3.6G 0 3.6G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock /dev/vda2 197M 6.1M 191M 4% /boot/efi tmpfs 729M 4.0K 729M 1% /run/user/1000 ``` -------------------------------- ### Octomation API Authentication and Request Example Source: https://github.com/flagify-com/octomation/wiki/Octomation开放接口 Demonstrates how to authenticate API requests using an 'hg-token' in the request header and provides a basic GET request structure. The token should be obtained from the system's 'System Configuration -> Authentication Authorization -> Token Management' section. ```commandline curl --location --request GET 'https://192.168.2.186/接口URI' \ --header 'hg-token: xxx' ``` ```APIDOC API Authentication: Header: 'hg-token: xxx' Token Source: System Configuration -> Authentication Authorization -> Token Management Request Example: GET https://192.168.2.186/接口URI Headers: hg-token: xxx ``` -------------------------------- ### Automatic Module Installation via Wheel File Source: https://github.com/flagify-com/octomation/wiki/OctoMation中使用第三方Python模块 This Python code demonstrates how to automatically install a module using a .whl file if it's not found. The code attempts to import 'onnxruntime' and, if a ModuleNotFoundError occurs, it constructs the path to the .whl file and installs it using os.system. It's important that the .whl file is accessible relative to the Python script. ```python import os def __init__(self, det: bool = False): try: import onnxruntime except ModuleNotFoundError: model_filename = os.path.join( os.path.dirname(os.path.abspath(__file__)), "onnxruntime-1.1.0-cp36-cp36m-manylinux1_x86_64.whl" ) os.system(f"source /etc/profile; pip install {model_filename}") ``` -------------------------------- ### File Operations with SDK Source: https://github.com/flagify-com/octomation/wiki/应用sdk使用手册 Illustrates various file operations using the SDK, including getting a permitted directory, saving a file, retrieving a file by UUID, getting a download URL, and checking for file existence. ```python # Get a permitted directory permissioned_dir = hg_client.fileCache.localFilePath() # Save a file (keepDays is optional, defaults to permanent) file_uuid = hg_client.fileCache.save("tmp/readme", keepDays=1) # Get file path by UUID file_path = hg_client.fileCache.get(fileUuid="5647a76e976e4c0ba52c9e0405197103") # Get download URL for a file download_link = hg_client.fileCache.downloadUrl(fileUuid="5647a76e976e4c0ba52c9e0405197103") # Check if a file exists exists = hg_client.fileCache.isExist(fileUuid="5647a76e976e4c0ba52c9e0405197103") ``` -------------------------------- ### IPinfo应用APP地理位置查询示例 Source: https://github.com/flagify-com/octomation/wiki/我的第一个OctoMation-应用APP开发 演示了如何在OctoMation的作战室中使用IPinfo应用APP查询IP地址的地理位置。用户通过点击闪电符号触发应用动作,输入IP参数后执行,并在作战室查看结果。 ```zh 在作战室输入框左下角,点击【闪电符号⚡️】,执行应用动作。搜索IPinfo即可找到。 点击应用动作【查询IP地址的地理位置】,输入IP参数,点击【执行】。 应用执行完成后,在作战室中可以查看执行的结果。 ``` -------------------------------- ### Initializing the SDK Source: https://github.com/flagify-com/octomation/wiki/应用sdk使用手册 Shows how to initialize the HoneyGuide client from the SDK within an action function. The context_info parameter is required for initialization. ```python from action_sdk_for_cache.action_cache_sdk import HoneyGuide def function_name(params, assets,context_info): hg_client = HoneyGuide(context_info=context_info) ``` -------------------------------- ### Diagnose Profile Errors During Installation Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 This code snippet is used to diagnose potential errors when sourcing the /etc/profile file during OctoMation installation. It checks the exit status of the source command to identify if there are any issues with the profile configuration that might lead to installation failures. ```bash echo -e " source /etc/profile echo $? set -e source /etc/profile echo $?" > test.sh bash test.sh ``` -------------------------------- ### Octomation SDK Development Example Source: https://github.com/flagify-com/octomation/wiki/应用sdk使用手册 Demonstrates how to use the Octomation SDK within a development action. It covers logging, caching key-value pairs, saving and retrieving files, and sending messages. ```python import os import time import shutil import unittest from unittest import TestCase from action_sdk_for_cache.action_cache_sdk import HoneyGuide,WarroomMessage def dev_action(params, assets, context_info): """ params/assets/context_info这三个参数都是上游传下来的, 不用自己手动传参 """ hg_client = HoneyGuide(context_info=context_info) # 上报日志, 这样在开启日志模式后就可以在事件处理处执行的动作中查看到日志信息 hg_client.actionLog.info(msg="测试") # 缓存key, value.缓存某个变量的结果,以便后面的action可以获取到该结果 # (比如我多次执行某个动作,将多次执行的某个变量值做相关计算).缓存的数据必须可以json.dump hg_client.keyCache.setString(key="cache_key", value="2") # 获取刚才缓存key对应的value hg_client.keyCache.getString(key="cache_key") # 获取有权限的存储目录 validate_save_dir = hg_client.fileCache.localFilePath() # 将文件保存至该目录下 filename = "readme.txt" # 注意validate_save_dir不是一直不变的,所以不能通过该路径获取到上次 # 存储的文件进行操作,要想让前端下载文件,这里的存储操作是必须进行的 validate_save_path = os.path.join(validate_save_dir, filename) with open(validate_save_path, "w", encoding="utf-8") as f: f.write("Hey there!\n") # 用sdk再保存一下文件,以便该文件能够在前端下载到. file_uuid = hg_client.fileCache.save(filePath=validate_save_path) # 获取sdk保存文件路径 file_path = hg_client.fileCache.get(fileUuid=file_uuid) # 获取文件前端下载链接 download_url = hg_client.fileCache.downloadUrl(fileUuid=file_uuid) print("first time download url: ", download_url) ##### 如果你想下次还用到这个文件,可以将刚才sdk保存文件的路径缓存起来 hg_client.keyCache.setString(key="last_save_file", value=file_path) # 下次在该文件中新增内容 last_save_file_path = hg_client.keyCache.getString(key="last_save_file") with open(last_save_file_path, "a+", encoding="utf-8") as f: f.write("I'm new content!\n") # 保存刚变更完的文件,用于前端下载 file_uuid = hg_client.fileCache.save(filePath=last_save_file_path) download_url = hg_client.fileCache.downloadUrl(file_uuid=file_uuid) print("second time download url: ", download_url) # 往作战室推送消息 message = WarroomMessage(content="Hello", messageId="11111111", pushTimestamp=1593572373) hg_client.warroomMessageSender.send(message) ``` -------------------------------- ### Complex Rule Example: IP Address Validation Source: https://github.com/flagify-com/octomation/wiki/如何创建一个A-and-(B-or-C)类型的规则 This example demonstrates the creation of a complex rule in OctoMation's expert mode. It checks if an IP address is not empty AND (not equal to 127.0.0.1 OR not equal to 192.168.1.1). The process involves switching to expert mode, adding individual conditions, using parentheses for grouping, and combining them with logical operators. ```OctoMation Rule Syntax ip地址不为空 并且 (ip地址不等于127.0.0.1或者ip地址不等于192.168.1.1) ``` -------------------------------- ### Python helloworld Function Source: https://github.com/flagify-com/octomation/wiki/OctoMation应用开发手册 A basic Python function named 'helloworld' that serves as a demonstration action in OctoMation. It takes params, assets, and context_info as input and returns a JSON object with a success code and a test message. ```Python # -*- coding: utf-8 -*- # 如果需要引入依赖,import xxxx 即可, 但在使用时,此依赖必须在python环境中存在 # helloworld 函数名称, 在config.json 中 actions - class_name 的值,必须一致 # params、assets、context_info 为函数必要的参数, # params 入参 在config.json 中 actions - parameters 的值,是个字典,同python的字典相同操作方式 # assets 资源 在config.json 中 configuration 的值,是个字典,同python的字典相同操作方式 # context_info 上下文 # context_info["activieId"] 执行链事件ID 字符串 # context_info["appName"] 执行链应用名称 字符串 # context_info["actionName"] 执行链动作名称 字符串 # context_info["eventId"] 执行链事件ID 字符串 # context_info["logMode"] 执行链 日志模型 布尔值 # context_info["executor"] 执行链 执行人 字符串 # context_info["executeTime"] 执行链 执行时间 整型 def helloworld(params, assets, context_info): """helloworld 演示动作""" # helloworld 演示资源 host = assets["host"] # 返回值 # 返回值中 code、msg是必须的, code 非 200的情况下, 应用运行会报错 json_ret = {"code": 200, "msg": "","data": ""} '''添加函数实现 ''' json_ret['data'] = "这是一个测试" return json_ret ``` -------------------------------- ### Logging with SDK Source: https://github.com/flagify-com/octomation/wiki/应用sdk使用手册 Provides an example of how to use the SDK's logging functionality to log messages. The log message is sent via the actionLog attribute of the initialized HoneyGuide client. ```python hg_client.actionLog.info("测试") ``` -------------------------------- ### Check Swap Space Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Checks the available Swap space on the system. OctoMation requires a minimum of 8GB of Swap space for optimal performance. This command helps verify if the current Swap configuration meets the requirement. ```bash [root@VM-16-7-centos ~]# free -h total used free shared buff/cache available Mem: 7.5G 4.9G 156M 2.5M 2.5G 2.4G Swap: 8.0G 0B 8.0G If your swap space has not been created or is insufficient, please refer to: [Create Swap Partition for Cloud Host](#create-swap-partition-for-cloud-host) ``` -------------------------------- ### Customize Docker Data Root Directory Source: https://github.com/flagify-com/octomation/wiki/OctoMation安装部署手册 Instructions for changing the Docker data root directory when the default `/opt` partition has insufficient space. It provides methods using `sed` to modify the Docker service file or by updating the `daemon.json` configuration. After modification, Docker service needs to be reloaded and restarted. ```bash mkdir -p /home/octomation/docker_data sed -i -e '\@ExecStart=@s@$@ --data-root='/home/octomation/docker_data'@g' /etc/systemd/system/docker.service systemctl daemon-reload systemctl restart docker ``` ```bash mkdir -p /home/octomation/docker_data sed -i -e '\@ExecStart=@s@$@ --data-root='/home/octomation/docker_data'@g' /usr/lib/systemd/system/docker.service systemctl daemon-reload systemctl restart docker ``` ```bash vi /etc/docker/daemon.json { "storage-driver": "overlay2", "data-root": "/home/octomation/docker_data", "default-ulimits": { "nofile": { "Name": "nofile", "Hard": 65536, "Soft": 65536 } } } systemctl daemon-reload systemctl restart docker ``` -------------------------------- ### Application and Resource Management Source: https://github.com/flagify-com/octomation/wiki/OctoMation专用术语 Defines 'App' as an abstraction of a specific technical capability or service, and 'Resource' (or Device) as a specific running instance of an App. Examples include firewall applications and specific firewall devices. Each App has associated actions, and each Resource has configuration parameters. ```APIDOC App: name: string (e.g., "Huawei USG Firewall", "DingTalk IM") description: string actions: array of action objects Resource: name: string (e.g., "Office Network Firewall", "Specific DingTalk Group") app: string (references an App) configurationParameters: - ip: string - url: string - username: string - password: string - apiKey: string - ... AppAction: name: string (e.g., "Block IP", "Query IP Intelligence") parameters: array of parameter objects ``` -------------------------------- ### OctoMation Application SDK Usage Manual Source: https://github.com/flagify-com/octomation/wiki/Home This document details how to use the OctoMation Application SDK for developing applications within the OctoMation ecosystem. ```APIDOC 应用sdk使用手册: - Link: https://github.com/flagify-com/OctoMation/wiki/%E5%BA%94%E7%94%A8sdk%E4%BD%BF%E7%94%A8%E6%89%8B%E5%92%9A ``` -------------------------------- ### Install Module in Container Source: https://github.com/flagify-com/octomation/wiki/OctoMation中使用第三方Python模块 This snippet shows how to install a Python module inside the OctoMation Python service container using pip. It involves executing a bash command to enter the container and then using pip to install the desired module. ```bash docker exec -it shakespeare-java-exe-python /bin/bash ``` ```bash pip install 模块名 ``` -------------------------------- ### API Response Example Source: https://github.com/flagify-com/octomation/wiki/Octomation开放接口 This snippet shows a typical successful API response structure for retrieving application or SDK information. It includes details about the application's status, metadata, and associated actions. ```json { "code": 200, "result": { "content": [ { "status": "ON", "deleted": false, "createdBy": "admin", "modifiedBy": "admin", "createdNickName": "管理员", "modifiedNickName": "管理员", "createTime": "2021-01-27 15:24:01", "updateTime": "2021-01-27 15:24:01", "id": 3923576105249034, "name": "sdktest", "description": "SDK测试-java", "displayName": null, "version": "1.0", "readMePath": "app/share/sdktest/1.0/readme.html", "iconfilePath": "app/share/sdktest/1.0/sdk.jpg", "os": null, "logicLanguage": "JAVA", "logicLanguageVersion": "", "category": "大屏数据统计", "assetVariableList": [ { "name": "input_string", "required": false, "type": "STRING", "description": "输入rigit,资产执行正确,否则失败", "lable": null, "defaultValue": null, "optionsList": null, "multiSelected": false, "concat": null, "order": 5, "array": false } ], "appActionList": [ { "status": "ON", "deleted": false, "createdBy": "admin", "modifiedBy": "admin", "createdNickName": "管理员", "modifiedNickName": "管理员", "createTime": "2021-01-27 15:24:01", "updateTime": "2021-01-27 15:24:01", "id": 3923576123860691, "appId": null, "name": "SDKSendMessage", "actionType": "ACTION", "readonly": true, "description": "SDK发送作战室消息", "displayName": null, "classify": "N", "os": null, "logicLanguage": "JAVA", "logic": "com.shakespeare.action.sdk.SendMessage", "retryTimes": 0, "sleepSeconds": 0, "quartzEtl": "", "parameterVariableList": [ { "name": "msg", "required": true, "type": "STRING", "description": "msg", "lable": null, "defaultValue": null, "optionsList": null, "multiSelected": false, "concat": null, "order": 1, "array": false } ], "resultVariableList": [ { "description": "msg", "valueType": "STRING", "dataPath": "action_result.msg", "exampleValues": null } ], "resultDisplayTmptType": "JS", "isTest": false } ] } ] } } ```