{"id":15835070,"url":"https://github.com/kaelzhang/docker-image-futuopend","last_synced_at":"2025-04-15T12:30:30.917Z","repository":{"id":65997665,"uuid":"231503808","full_name":"kaelzhang/docker-image-futuopend","owner":"kaelzhang","description":"Docker image for FutuOpenD, the one that really works and could handle SMS verification requests.","archived":false,"fork":false,"pushed_at":"2025-01-09T17:13:09.000Z","size":30756,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T03:16:10.175Z","etag":null,"topics":["docker-image","futu","futuopend"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaelzhang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-03T03:18:50.000Z","updated_at":"2025-01-09T17:13:12.000Z","dependencies_parsed_at":"2023-03-30T05:49:39.613Z","dependency_job_id":"b672a34a-91a0-4f20-9d7b-17c307965f63","html_url":"https://github.com/kaelzhang/docker-image-futuopend","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"26a1474964e043ed0f61612dad51210ed2dc16ce"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fdocker-image-futuopend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fdocker-image-futuopend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fdocker-image-futuopend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fdocker-image-futuopend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaelzhang","download_url":"https://codeload.github.com/kaelzhang/docker-image-futuopend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248352965,"owners_count":21089529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-image","futu","futuopend"],"created_at":"2024-10-05T14:20:25.095Z","updated_at":"2025-04-15T12:30:30.894Z","avatar_url":"https://github.com/kaelzhang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Image: ostai/ FutuOpenD\n\nDocker image for FutuOpenD on Ubuntu, the one that really works and could handle SMS verification requests.\n\nThe container will start\n- A FutuOpenD agent\n- A websocket server which could help to check the ready status of the FutuOpenD agent and make it possible for you to provide SMS verfication code.\n\nThe image is always built with `DOCKER_DEFAULT_PLATFORM=linux/amd64` ([why?](https://stackoverflow.com/questions/71040681/qemu-x86-64-could-not-open-lib64-ld-linux-x86-64-so-2-no-such-file-or-direc)) and could be `docker-run` on both Ubuntu and MacOS.\n\n\n## Install\n\n```sh\ndocker pull ostai/futuopend:latest\n```\n\nOr\n\n```sh\ndocker pull ostai/futuopend:8.8.4818\n```\n\n## Current FutuOpenD Image Version\n\n8.8.4818_Ubuntu16.04\n\n## Usage\n\n### Environment Variables\n\n- **FUTU_LOGIN_ACCOUNT** `string` required\n- **FUTU_LOGIN_PWD_MD5** `string` required\n- **FUTU_LOGIN_REGION** `string` defaults to `sh`\n- **FUTU_LANG** `string` defaults to `chs`\n- **FUTU_LOG_LEVEL** `string` defaults to `no`\n- **FUTU_PORT** `integer` the port of the FutuOpenD, defaults to `11111`\n- **SERVER_PORT** `integer` the port of the websocket server, defaults to `8000`\n- **FUTU_INIT_ON_START** `string=\"yes\"` whether it will initialize the Futu OpenD agent on the start, defaults to `\"yes\"`\n\n### Docker Run: How to start the container\n\n```sh\ndocker run \\\n--name FutuOpenD \\\n-e \"SERVER_PORT=8081\" \\\n-p 8081:8081 \\\n-p 11111:11111 \\\n-e \"FUTU_LOGIN_ACCOUNT=$your_futu_id\" \\\n-e \"FUTU_LOGIN_PWD_MD5=$your_password_md5\" \\\nostai/futuopend:latest\n```\n\n### WebSocket Server\n\n```js\nconst {WebSocket} = require('ws')\n\nconst ws = new WebSocket('ws://localhost:8081')\n\nws.on('message', msg =\u003e {\n  const data = JSON.parse(msg)\n\n  if (data.type === 'REQUEST_CODE') {\n    ws.send(JSON.stringify({\n      type: 'VERIFY_CODE',\n      code: '12345'\n    }))\n    return\n  }\n\n  if (data.type === 'STATUS') {\n    console.log('status:', data.status)\n    return\n  }\n})\n\nws.on('open', () =\u003e {\n  ws.send(JSON.stringify({\n    type: 'STATUS'\n  }))\n\n  // If env FUTU_INIT_ON_START=no, we need to manually init futu\n  ws.send(JSON.stringify({\n    type: 'INIT'\n  }))\n})\n```\n\nBoth downstream and upstream messages are in JSON type.\n\n#### Downstream Messages: From Server to Client\n\n```json\n{\n  \"type\": \"REQUEST_CODE\"\n}\n```\n\nwhich means the FutuOpenD agent requires you to provide an SMS verification code\n\n```json\n{\n  \"type\": \"CONNECTED\"\n}\n```\n\nwhich means the FutuOpenD agent is connected\n\n```json\n{\n  \"type\": \"STATUS\",\n  \"status\": -1\n}\n```\n\nThe server returns the current status to you.\n\n#### Upstream Messages: From Client to Server\n\n```json\n{\n  \"type\": \"INIT\"\n}\n```\n\nTells the server to initialize the Futu OpenD agent, which only works when `FUTU_INIT_ON_START` is set to `'no'`\n\n```json\n{\n  \"type\": \"STATUS\"\n}\n```\n\nAsks the server to response the current status of the server\n\n```json\n{\n  \"type\": \"VERIFY_CODE\",\n  \"code\": \"123456\"\n}\n```\n\nSubmits the SMS verification code to Futu OpenD agent.\n\n# For contributors\n\n## How to build your own image\n\n```sh\nTAG=ostai/futuopend\nVERSION=8.8.4818\nFUTU_VERSION=\"$VERSION\"_Ubuntu16.04\n\ndocker build -t $TAG:$VERSION \\\n  --build-arg FUTU_VERSION=$FUTU_VERSION \\\n  .\n```\n\nFor example:\n\n```sh\ndocker build -t ostai/futuopend:8.8.4818 \\\n  --build-arg FUTU_VERSION=8.8.4818_Ubuntu16.04 \\\n  .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Fdocker-image-futuopend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaelzhang%2Fdocker-image-futuopend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Fdocker-image-futuopend/lists"}