基于Sanic搭建的简单App在线下载、安装服务器。可在线下载安装包, 或者iPhone在线安装ipa。
-
RESTful的API - 上传apk、ipa文件
- 下载apk、下载ipa
- 短链接进入下载页
- App、版本管理
- 搜索App
- HTML更好兼容移动端
更多...
- Python > 3.5
- macOS 10.12+
- centos 6+
- ubuntu 14.04+
- 还有其它更多尚未测试...
# linux系统请注意, 需要安装libpng12(centos已测试, 其它系统还没测试), MacOSX系统不需要
`yum install libpng12` # centos
git clone https://github.com/skytoup/AppServercd AppServergcc vendors/pngdefry/pngdefry.c -o pngdefry # 编译pngdfrypip install -r requirements.txt # 安装依赖python main.py # 运行服务器
open https://your_bing_host:8000# or 打开浏览器, 输入https://{Config的host}:8000, 回车
git clone https://github.com/skytoup/AppServercd AppServer- 修改
app/config/config.py:BaseConfig.host为需要绑定的ip地址, 设置错误会导致iOS无法在线下载安装ipa docker build -t app_server ./docker run -d -p 8000:8000 -v /path/to/data:/www/AppServer/data -v /path/to/log:/www/AppServer/log --name AppServer app_server# ordocker run -d -p 8000:8000 --name AppServer app_serveropen https://your_bing_host:8000# or 打开浏览器, 输入https://{Config的host}:8000, 回车
pip install -r requirements_test.txtpytest -q tests
不是专业前端, 只是简单做了一个非常简陋的, 请勿介意😅
详情请看 👉 传送门: AppServerHTML
证书使用的是自签证书, 每次修改Config的host后, 会自动重新生成
- 开启服务器后, 需要在地址栏输入的是Config的host, 不能填写127.0.0.1、localhost、0.0.0.0; 还有协议是
https, 不是http iPhone安装ipa需要在App详情的界面里面点击安装证书, 因为证书是自己生成的, 不能免证书安装(iOS9以上系统安装完证书后, 还需要在设置那里信任一下证书, 请参考: 苹果iOS9系统安装应用证书信任操作指导)centos和ubuntu安装可能出现的问题 👉 传送门linux运行aapt需要安装libpng12, centos:yum install libpng12
更详细请看 👉 FAQ
{
code: int, # 请参考👇的表
ok: bool, # 是否请求成功
msg: str, # 请求返回的信息
datas: dict/array, # 请求返回的数据
}
| code | 描述 |
|---|---|
| 0 | 成功 |
| -1 | 失败 |
POST /upload/app
Form
| 参数 | 必填 | 描述 |
|---|---|---|
| pcakage | y | 上传的安装包 |
| msg | n | 更新说明 |
返回datas: object or not(上传不存在的App时, 才有返回)
| 参数 | 描述 |
|---|---|
| id | App的id |
| type | 安装包类型, 0: iOS, 1: Android |
| name | 名称 |
| icon | 图标 |
| detail | 介绍 |
| short_chain | 短链接 |
| package_name | 包名 |
| create_at | 创建时间 |
GET /apps/<app_type>/page/<page>?t=<time>
| 参数 | 必填 | 描述 |
|---|---|---|
| app_type | y | 安装包的类型: iOS、android、all |
| page | y | 页码, 从1开始 |
| time | y | 当获取第一页时, 为当前时间戳; 获取其它页时, 为获取第一页的时间戳 |
| kw | n | 按照App名称过滤 |
返回datas: array
| 参数 | 描述 |
|---|---|
| id | App的id |
| type | 安装包类型, 0: iOS, 1: Android |
| name | 名称 |
| icon | 图标 |
| detail | 介绍 |
| short_chain | 短链接 |
| package_name | 包名 |
| version_name | 最后上传安装包的版本名称 |
| version_code | 最后上传安装包的版本号 |
| create_at | 创建时间 |
GET /apps/<app_id>
| 参数 | 必填 | 描述 |
|---|---|---|
| app_id | y | App的id |
返回datas: dict
| 参数 | 描述 |
|---|---|
| id | App的id |
| type | 安装包类型, 0: iOS, 1: Android |
| name | 名称 |
| icon | 图标 |
| detail | 介绍 |
| short_chain | 短链接 |
| package_name | 包名 |
| create_at | 创建时间 |
DELETE /apps/<app_id>
| 参数 | 必填 | 描述 |
|---|---|---|
| app_id | y | App的id |
返回datas: 无
| 参数 | 描述 |
|---|---|
PUT /apps/<app_id>
Json
| 参数 | 必填 | 描述 |
|---|---|---|
| app_id | y | App的id |
| - | - | - |
| name | n | 名称 |
| short_chain | n | 短链 |
| detail | n | 简介 |
返回datas: 无
| 参数 | 描述 |
|---|---|
GET /apps/<app_id>/versions/page/<page>?t=<time>
| 参数 | 必填 | 描述 |
|---|---|---|
| app_id | y | App的id |
| page | y | 页码, 从1开始 |
| time | y | 当获取第一页时, 为当前时间戳; 获取其它页时, 为获取第一页的时间戳 |
返回的datas: array
| 参数 | 描述 |
|---|---|
| id | App Version的id |
| app_id | App的id |
| version_name | 版本名 |
| version_code | 版本号 |
| package | 安装包下载地址 |
| size | 安装包大小 |
| update_msg | 更新信息 |
| create_at | 创建时间 |
| plist | plist下载地址, App类型为iOS时, 才有此字段 |
DELETE /apps/<app_id>/versions/<app_version_id>
| 参数 | 必填 | 描述 |
|---|---|---|
| app_id | y | App的id |
| app_version_id | y | App Version的id |
返回datas: 无
| 参数 | 描述 |
|---|---|
版本更新 👉 传送门
- Sanic: Async Python 3.5+ web server that's written to go fast
- shortuuid: A generator library for concise, unambiguous and URL-safe UUIDs. http://www.stavros.io/
- sqlalchemy: See the development link for contribution guidelines http://sqlalchemy.org/develop.html
- aiofiles: File support for asyncio
- pngdefry: Repairing -iPhone fried PNGs
- QQ:875766917,请备注
- Mail:875766917@qq.com







