diff --git a/fpk/README.md b/fpk/README.md new file mode 100644 index 0000000..335897c --- /dev/null +++ b/fpk/README.md @@ -0,0 +1,17 @@ +# 飞牛应用商店打包(fpk) + +打包工具:`fnpack`(官方,https://developer.fnnas.com/ 下载,本机已装) + +```bash +cd fpk/moyu-qile +fnpack build . # 生成 moyu-qile.fpk +appcenter-cli install-fpk moyu-qile.fpk # NAS 本机测试安装 +appcenter-cli status moyu-qile # running / stopped +appcenter-cli uninstall moyu-qile # 测试完卸载 +``` + +结构:`manifest`(商店元数据)· `app/docker/docker-compose.yaml`(镜像/端口/数据卷)· +`app/ui/config`(桌面入口)· `cmd/`(生命周期脚本)· `ICON.PNG`/`ICON_256.PNG`(64/256 图标)。 + +已真机验证(fnOS):安装 → running + HTTP 200 → 停/起 → 卸载,全流程通过。 +提交上架:注册 https://developer.fnnas.com/ 开发者 → 「我的的应用」上传 .fpk + 图标 + 截图 + 更新说明。 diff --git a/fpk/moyu-qile/ICON.PNG b/fpk/moyu-qile/ICON.PNG new file mode 100644 index 0000000..80ab71a Binary files /dev/null and b/fpk/moyu-qile/ICON.PNG differ diff --git a/fpk/moyu-qile/ICON_256.PNG b/fpk/moyu-qile/ICON_256.PNG new file mode 100644 index 0000000..095ee0d Binary files /dev/null and b/fpk/moyu-qile/ICON_256.PNG differ diff --git a/fpk/moyu-qile/app/docker/docker-compose.yaml b/fpk/moyu-qile/app/docker/docker-compose.yaml new file mode 100644 index 0000000..1e488df --- /dev/null +++ b/fpk/moyu-qile/app/docker/docker-compose.yaml @@ -0,0 +1,10 @@ +version: "3.8" + +services: + webapp: + image: ghcr.io/personal82555/moyu-qile:latest + container_name: docker-moyu-qile + ports: + - "7025:7025" + volumes: + - "/var/apps/moyu-qile/shares/moyu-qile/data:/app/data" diff --git a/fpk/moyu-qile/app/ui/config b/fpk/moyu-qile/app/ui/config new file mode 100644 index 0000000..cbbb415 --- /dev/null +++ b/fpk/moyu-qile/app/ui/config @@ -0,0 +1,13 @@ +{ + ".url": { + "moyu-qile.Application": { + "title": "摸鱼棋乐", + "icon": "images/icon_{0}.png", + "type": "url", + "protocol": "http", + "port": "7025", + "url": "/", + "allUsers": false + } + } +} \ No newline at end of file diff --git a/fpk/moyu-qile/app/ui/images/icon_256.png b/fpk/moyu-qile/app/ui/images/icon_256.png new file mode 100644 index 0000000..095ee0d Binary files /dev/null and b/fpk/moyu-qile/app/ui/images/icon_256.png differ diff --git a/fpk/moyu-qile/app/ui/images/icon_64.png b/fpk/moyu-qile/app/ui/images/icon_64.png new file mode 100644 index 0000000..80ab71a Binary files /dev/null and b/fpk/moyu-qile/app/ui/images/icon_64.png differ diff --git a/fpk/moyu-qile/cmd/config_callback b/fpk/moyu-qile/cmd/config_callback new file mode 100644 index 0000000..f96cbfb --- /dev/null +++ b/fpk/moyu-qile/cmd/config_callback @@ -0,0 +1,5 @@ +#!/bin/bash + +### This script is called after the user change environment variables in application setting page. + +exit 0 \ No newline at end of file diff --git a/fpk/moyu-qile/cmd/config_init b/fpk/moyu-qile/cmd/config_init new file mode 100644 index 0000000..cacd475 --- /dev/null +++ b/fpk/moyu-qile/cmd/config_init @@ -0,0 +1,5 @@ +#!/bin/bash + +### This script is called before the user change environment variables in application setting page. + +exit 0 \ No newline at end of file diff --git a/fpk/moyu-qile/cmd/install_callback b/fpk/moyu-qile/cmd/install_callback new file mode 100644 index 0000000..c7f9afa --- /dev/null +++ b/fpk/moyu-qile/cmd/install_callback @@ -0,0 +1,5 @@ +#!/bin/bash + +### This script is called after the user installs the application. + +exit 0 \ No newline at end of file diff --git a/fpk/moyu-qile/cmd/install_init b/fpk/moyu-qile/cmd/install_init new file mode 100644 index 0000000..9ee0f11 --- /dev/null +++ b/fpk/moyu-qile/cmd/install_init @@ -0,0 +1,5 @@ +#!/bin/bash + +### This script is called before the user installs the application. + +exit 0 \ No newline at end of file diff --git a/fpk/moyu-qile/cmd/main b/fpk/moyu-qile/cmd/main new file mode 100644 index 0000000..c6786a8 --- /dev/null +++ b/fpk/moyu-qile/cmd/main @@ -0,0 +1,42 @@ +#!/bin/bash + +FILE_PATH="${TRIM_APPDEST}/docker/docker-compose.yaml" + +is_docker_running () { + DOCKER_NAME="" + + if [ -f "$FILE_PATH" ]; then + DOCKER_NAME=$(cat $FILE_PATH | grep "container_name" | awk -F ':' '{print $2}' | xargs) + echo "DOCKER_NAME is set to: $DOCKER_NAME" + fi + + if [ -n "$DOCKER_NAME" ]; then + docker inspect $DOCKER_NAME | grep -q "\"Status\": \"running\"," || exit 1 + return + fi +} + +case $1 in +start) + # run start command. exit 0 if success, exit 1 if failed + # do nothing, docker application will be started by appcenter + exit 0 + ;; +stop) + # run stop command. exit 0 if success, exit 1 if failed + # do nothing, docker application will be stopped by appcenter + exit 0 + ;; +status) + # check application status command. exit 0 if running, exit 3 if not running + # check first container by default, you cound modify it by yourself + if is_docker_running; then + exit 0 + else + exit 3 + fi + ;; +*) + exit 1 + ;; +esac \ No newline at end of file diff --git a/fpk/moyu-qile/cmd/uninstall_callback b/fpk/moyu-qile/cmd/uninstall_callback new file mode 100644 index 0000000..52f5bf0 --- /dev/null +++ b/fpk/moyu-qile/cmd/uninstall_callback @@ -0,0 +1,5 @@ +#!/bin/bash + +### This script is called after the user uninstalls the application. + +exit 0 \ No newline at end of file diff --git a/fpk/moyu-qile/cmd/uninstall_init b/fpk/moyu-qile/cmd/uninstall_init new file mode 100644 index 0000000..52f5bf0 --- /dev/null +++ b/fpk/moyu-qile/cmd/uninstall_init @@ -0,0 +1,5 @@ +#!/bin/bash + +### This script is called after the user uninstalls the application. + +exit 0 \ No newline at end of file diff --git a/fpk/moyu-qile/cmd/upgrade_callback b/fpk/moyu-qile/cmd/upgrade_callback new file mode 100644 index 0000000..80ae554 --- /dev/null +++ b/fpk/moyu-qile/cmd/upgrade_callback @@ -0,0 +1,5 @@ +#!/bin/bash + +### This script is called after the user upgrades the application. + +exit 0 \ No newline at end of file diff --git a/fpk/moyu-qile/cmd/upgrade_init b/fpk/moyu-qile/cmd/upgrade_init new file mode 100644 index 0000000..997e45d --- /dev/null +++ b/fpk/moyu-qile/cmd/upgrade_init @@ -0,0 +1,5 @@ +#!/bin/bash + +### This script is called before the user upgrades the application. + +exit 0 \ No newline at end of file diff --git a/fpk/moyu-qile/config/privilege b/fpk/moyu-qile/config/privilege new file mode 100644 index 0000000..82d059c --- /dev/null +++ b/fpk/moyu-qile/config/privilege @@ -0,0 +1,8 @@ +{ + "defaults": + { + "run-as": "package" + }, + "username": "docker-moyu-qile", + "groupname": "docker-moyu-qile" +} \ No newline at end of file diff --git a/fpk/moyu-qile/config/resource b/fpk/moyu-qile/config/resource new file mode 100644 index 0000000..0fb385c --- /dev/null +++ b/fpk/moyu-qile/config/resource @@ -0,0 +1,20 @@ +{ + "docker-project": { + "projects": [ + { + "name": "moyu-qile", + "path": "docker" + } + ] + }, + "data-share": { + "shares": [ + { + "name": "moyu-qile" + }, + { + "name": "moyu-qile/data" + } + ] + } +} diff --git a/fpk/moyu-qile/manifest b/fpk/moyu-qile/manifest new file mode 100644 index 0000000..16ba552 --- /dev/null +++ b/fpk/moyu-qile/manifest @@ -0,0 +1,15 @@ +appname = moyu-qile +version = 1.0.0 +display_name = 摸鱼棋乐 +desc = 三合一网页棋类:中国象棋 · 五子棋 · 军棋
纯 Node.js 自研、MIT 开源,装完即玩:
✅ AI 对战(3 档难度 / 5 种教练人格 / 走法点评 / 赛后复盘)
✅ 自动存档 + 战绩排行,刷新不丢局(每 5 分钟保存)
✅ 残局挑战 · 每日一题 · 战绩海报 · 棋风统计
✅ 手机竖屏适配,不填模型 AI 功能也有本地兜底
源码与反馈: github.com/personal82555/moyu-qile +platform = x86 +source = thirdparty +maintainer = personal82555 +maintainer_url = https://github.com/personal82555/moyu-qile +distributor = personal82555 +distributor_url = https://github.com/personal82555/moyu-qile +os_min_version = 1.1.8 +desktop_uidir = ui +desktop_applaunchname = moyu-qile.Application +service_port = 7025 +ctl_stop = true diff --git a/fpk/moyu-qile/moyu-qile.fpk b/fpk/moyu-qile/moyu-qile.fpk new file mode 100644 index 0000000..9de0f36 Binary files /dev/null and b/fpk/moyu-qile/moyu-qile.fpk differ