Giter VIP home page Giter VIP logo

tryzealot / zealot Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 130.0 17.04 MB

开源自部署移动应用、 macOS、Linux 和 Windows 应用分发平台,提供 iOS、Android SDK、fastlane 等丰富组件库 | Self-hosted Beta App Distribution for Android, iOS, macOS, Linux and Windows apps

Home Page: https://zealot.ews.im

License: MIT License

Ruby 63.90% Dockerfile 0.68% JavaScript 3.23% HTML 9.79% SCSS 1.47% Slim 20.90% Procfile 0.01% Shell 0.02%
adhoc android appstoreconnect deployment distribution docker fastlane fir gitlab ios jenkins macos-app ota-server over-the-air pgyer ruby ruby-on-rails self-hosted testflight zealot

zealot's People

Contributors

answer-huang avatar dependabot-preview[bot] avatar dependabot[bot] avatar icyleaf avatar ilyachizhanov avatar imgbotapp avatar yiukamsum avatar zanechua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zealot's Issues

新功能:网页上传调试文件

之前一直都是支持 API 上传,自己在使用第三方都因为没有提供 web 上传而苦恼没想到自己的系统也没有这个功能,后知后觉的我啊

RFC: iOS 设备名称自注册和同步顺带支持团队管理

描述 | Description

现状

托管的 AdHoc 的 iOS 应用会显示包含测试设备 UDID 列表,之前可通过 zealot-sync-device fastlane 插件利用 Apple 开发者账户和密码手动同步,问题是同步不及时就会影响查看测试包的开发或测试同学无法确认上传的包是否包含自己的设备,尤其是新入职或者采购新 iOS 设备的时候。

服务本身提供获取 iOS UDID 设备的功能同时在获取之后会告知是否有可以按照的应用这本身是一个非常有用的功能,假如没有注册能够提供一个注册设备的功能,同步 CICD 在构建 AdHoc 包的时候自动更新一次证书会非常有帮助。

另外一点 iOS 已经提供使用 AuthKey + AppStoreConnectAPI 官方 API 来管理应用和证书等,不再涉及密码和二次认证的麻烦事情。

原理

  • AppStoreConnectAPI 的 Key 对应一个公司主体
    • 通过 Key 可以拿到 Certficate 信息间接获取唯一的公司主体
  • 现有 Devices 表新增设备类型并关联上传 Key 的公司主体
  • 利用 Key 的功能可以注册、更新 Devices 列表

功能实现

  • 抽离之前的 iOS App 机器人审核使用的 AppStoreConnectAPI 类 https://github.com/icyleaf/tiny_appstore_connect
  • 测试设备表扩容设备类型,网页可通过 UDID 识别设备类型(如果 API 可以拿到的话)
  • 新增团队管理 Team ID,应用可能会是多个 Team ID 组成的,允许注册设备选择自己要注册的 Team
  • 获取 UDID 设备若没有发现可安装的应用提示是否进行注册操作
  • 后台可以管理 AppStoreConnect API 配置的 AuthKey、团队和测试设备相关界面

功能截图

苹果开发者管理界面
Apple Developer Manage UI

获取未注册 UDID 设备可进行注册操作
Register Deivce to Apple Develoer

测试上传 ipa 包出现问题

已经用 docker 的方式成功运行了,但在使用过程中出现了问题
在示例应用中,上传 ipa 包,会出现错误
image

日志在响应时间显示:

zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25] Started GET "/channels/4aqlW/releases/upload" for 172.20.0.1 at 2020-01-09 22:55:26 +0800
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25] Processing by ReleasesController#new as HTML
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Parameters: {"channel_id"=>"4aqlW"}
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Rendering releases/new.html.slim within layouts/application
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Rendered releases/_form.html.slim (Duration: 35.7ms | Allocations: 15479)
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Rendered releases/new.html.slim within layouts/application (Duration: 66.8ms | Allocations: 33696)
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Rendered layouts/_tips.html.slim (Duration: 3.1ms | Allocations: 2710)
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Rendered layouts/_main_sidebar.html.slim (Duration: 12.3ms | Allocations: 25940)
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Rendered layouts/_navigation.html.slim (Duration: 20.8ms | Allocations: 36124)
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Rendered layouts/_content_header.html.slim (Duration: 5.8ms | Allocations: 4822)
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Rendered layouts/_messages.html.slim (Duration: 7.5ms | Allocations: 3786)
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Rendered layouts/_content.html.slim (Duration: 23.6ms | Allocations: 11336)
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25]   Rendered layouts/_footer.html.slim (Duration: 8.5ms | Allocations: 4019)
zealot_1    | [f52bb5cd-ab3d-4fcf-83e9-859eb4dd6d25] Completed 200 OK in 246ms (Views: 130.3ms | ActiveRecord: 35.1ms | Allocations: 137610)
zealot_1    | [0356689e-1b53-41d4-9a14-03ecc2d510ff] Started POST "/channels/4aqlW/releases" for 172.20.0.1 at 2020-01-09 22:55:35 +0800
zealot_1    | [0356689e-1b53-41d4-9a14-03ecc2d510ff] Processing by ReleasesController#create as HTML
zealot_1    | [0356689e-1b53-41d4-9a14-03ecc2d510ff]   Parameters: {"authenticity_token"=>"zixiosZN+WDuK9lBJgYzVEqfRve3K5LD6IsDHgnAnB8IInK+lazhgr5ZsxhjlUJKiDaM2GaEVbeKngYSLNQH7w==", "release"=>{"file"=>#<ActionDispatch::Http::UploadedFile:0x0000558cd0eb54f8 @tempfile=#<Tempfile:/tmp/RackMultipart20200109-46-1lalhiy.ipa>, @original_filename="cb.ipa", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"release[file]\"; filename=\"cb.ipa\"\r\nContent-Type: application/octet-stream\r\n">, "changelog"=>"", "release_type"=>"", "branch"=>"", "git_commit"=>"", "ci_url"=>""}, "commit"=>"上传应用", "channel_id"=>"4aqlW"}
zealot_1    | [0356689e-1b53-41d4-9a14-03ecc2d510ff] Completed 500 Internal Server Error in 2916ms (ActiveRecord: 1.4ms | Allocations: 162993)
zealot_1    | [0356689e-1b53-41d4-9a14-03ecc2d510ff]   
zealot_1    | [0356689e-1b53-41d4-9a14-03ecc2d510ff] NameError (undefined local variable or method `device' for #<Class:0x0000558ccce36698>
zealot_1    | Did you mean?  devise):
zealot_1    | [0356689e-1b53-41d4-9a14-03ecc2d510ff]   
zealot_1    | [0356689e-1b53-41d4-9a14-03ecc2d510ff] app/models/release.rb:53:in `block in upload_file'
zealot_1    | [0356689e-1b53-41d4-9a14-03ecc2d510ff] app/models/release.rb:37:in `upload_file'
zealot_1    | [0356689e-1b53-41d4-9a14-03ecc2d510ff] app/controllers/releases_controller.rb:26:in `create'

麻烦帮助一下,谢谢。

生成的下载链接 https://app.winnwemedical.com/download/releases/5 打不开,直接ip是可以下载的

大佬 再次打扰你了。服务已经部署在服务器上面,
证书是我们公司自己正式证书

通过域名解析绑定的IP:port

通过域名上传的apk 点击下载链接无法下载 https://app.winnwemedical.com/download/releases/5 显示连接不存在
但是将域名直接替换为IP是可以下载的
没有用到Nginx转发

求大佬帮忙。还有一个测试条件 在本机搭建的ip的https ,点击下载可以直接下载的。

元宵节快乐

调整 app device_type 和 platform

现有逻辑 device_type 从 app 元数据获取,对于 iOS App 可能是 iPhone,iPad 或 Univeral,Android 就只有他自己,platform 是从前者判断返回 iOS 或 Android。

鉴于 app 在上传的时候可能原有是 iPhone 后来改 Universal 但这块的数据就变化了,前端 UI 逻辑做了一些处理但数据结构层比较麻烦。

新的逻辑:

app 表新增 platform 字段,移除 device_type 字段并添加到 release 表中。 platform 逻辑沿用之前的判断但数据会写入 db。

DRAFT: 版本保留功能修改草案

服务一直使用老版本清理机制在对外开放使用之后有些不太适应,主要因为:

从以上原因也不能看出市面现有的系统都会有一个是否设置保留最大上传版本的功能特性,但我一直认为这个是太不智能的一刀切的粗暴的解决方案,因此本服务一直用的是自己研发的一套清理机制。

从全局出发现有的清理机制需要改进或变更,可以考虑从如下角度调整:

  1. 磁盘空间大小,超出的按照最早的删除
  2. 应用证书失效情况(只适用于 iOS 太有局限性),过期的就最早的删除
  3. 设置过期时间,超出的按照最早的删除

目的主要是避免最粗暴的方式来减少不必要的麻烦。若大家认为设置最大上传数量是非常有必要的请拿出足够的理由来说服我 :D

problems about ldap

我使用docker部署,开了ldap,现在ldap登陆,会返回错误:

Not found. Authentication passthru.

我应该如何排查?

错误日志不能收集

docker部署后ipa上传失败,报错信息如下:

[2021-10-14T23:32:38.862736 #339]  INFO -- : [zealot] [921dabe7-1380-4064-bd18-2e6572544c8a] Completed 500 Internal Server Error in 4583ms (ActiveRecord: 10.1ms | Allocations: 477727)
[2021-10-14T23:32:38.863451 #339] FATAL -- : [zealot] [921dabe7-1380-4064-bd18-2e6572544c8a]
[zealot] [921dabe7-1380-4064-bd18-2e6572544c8a] NameError (undefined local variable or method `exception' for #<Api::Apps::UploadController:0x0000000001aea0>):
[zealot] [921dabe7-1380-4064-bd18-2e6572544c8a]
[zealot] [921dabe7-1380-4064-bd18-2e6572544c8a] app/controllers/api/base_controller.rb:34:in `record_invalid'
{"level":"error","ts":1634225558.8662913,"logger":"http.handlers.reverse_proxy","msg":"reading from backend","error":"http: read on closed response body"}

看了眼似乎这个文件app/controllers/api/base_controller.rb第34行有老版本的变量没有改掉。

  def record_invalid(e)
    respond_with_error(
      :unprocessable_entity, e,
      error: t('api.unprocessable_entity'),
      # exception 未定义,看起来是4.1.0遗留的形参
      entry: exception.record.errors
    )
  end

我先用 4.1.0 的 Image 尝试下。

脚本部署,caddy无法启动,容器端口无法映射到宿主机。

部署方式 | How to Deploy

使用一键部署脚本 | Using zealot-docker on-click install (Default)

部署版本 | Version

nightly (Default)

反代服务 | Reverse Proxy

caddy

已阅读文档 | Read the document

  • 已阅读 | Yes

描述 | Description

按照部署文档进行的,环境没有问题,拿其他项目测试过,具体故障为caddy容器一直起不来,手动起有报错。然后其他服务端口无法正确映射到外面,检查了yml文件没有问题。是否是Let's Encrypt SSL 证书那里配置有问题呢?
image
image

问题日志 | Relevant log output

No response

ios上传报错

web界面上传ipa会出现错误

I, [2021-04-30T10:38:43.046464 #325] INFO -- : [ota] [e9dcff1a-a06b-487a-b2c9-638731c5f368] Started POST "/channels/YRI5l/releases" for 172.20.0.1 at 2021-04-30 10:38:43 +0800
I, [2021-04-30T10:38:43.048098 #325] INFO -- : [ota] [e9dcff1a-a06b-487a-b2c9-638731c5f368] Processing by ReleasesController#create as HTML
I, [2021-04-30T10:38:43.048232 #325] INFO -- : [ota] [e9dcff1a-a06b-487a-b2c9-638731c5f368] Parameters: {"authenticity_token"=>"LhXue8CNBys8GMZiHsAbt9EEZRcbRjj6l+Qy7mPxwQd7XR3/S5Phx/6qn3mHlO+rzoMaYVjb39P+ZMdAI7AJ+g==", "release"=>{"file"=>#<ActionDispatch::Http::UploadedFile:0x00007f501686a700 @tempfile=#Tempfile:/tmp/RackMultipart20210430-325-1jrrbo.ipa, @original_filename="TFHuiLianMS.ipa", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name="release[file]"; filename="TFHuiLianMS.ipa"\r\nContent-Type: application/octet-stream\r\n">, "changelog"=>"", "release_type"=>"", "branch"=>"", "git_commit"=>"", "ci_url"=>""}, "commit"=>"上传应用", "channel_id"=>"YRI5l"}
I, [2021-04-30T10:38:44.227643 #325] INFO -- : [ota] [e9dcff1a-a06b-487a-b2c9-638731c5f368] Completed 500 Internal Server Error in 1179ms (ActiveRecord: 0.3ms | Allocations: 191411)
F, [2021-04-30T10:38:44.228230 #325] FATAL -- : [ota] [e9dcff1a-a06b-487a-b2c9-638731c5f368]
[ota] [e9dcff1a-a06b-487a-b2c9-638731c5f368] Zlib::DataError (invalid stored block lengths):
[ota] [e9dcff1a-a06b-487a-b2c9-638731c5f368]
[ota] [e9dcff1a-a06b-487a-b2c9-638731c5f368] app/models/release.rb:53:in block in upload_file' [ota] [e9dcff1a-a06b-487a-b2c9-638731c5f368] app/models/release.rb:39:in upload_file'
[ota] [e9dcff1a-a06b-487a-b2c9-638731c5f368] app/controllers/releases_controller.rb:27:in `create'

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler could not find compatible versions for gem "actionmailbox":
  In Gemfile:
    rails (~> 6.0.0) was resolved to 6.0.0, which depends on
      actionmailbox (= 6.0.0)

Could not find gem 'actionmailbox (= 6.0.0)', which is required by gem 'rails (~> 6.0.0)', in any of the sources.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

You can mention @dependabot in the comments below to contact the Dependabot team.

获取设备 UDID 功能

类似蒲公英通过安装一个 mobileconfig 证书可以获取设备的 UDID ,但需要 MDM 企业账号基本上没法实现。

Apple Mobile Device Management concepts to provide you information about your device. Profile you install tells your iPhone, iPad or iPod to send encrypted data (UDID) to your browser. This profile is temporary and exists on your device only for a few moments to send encrypted data. After this profile removed from your iOS device. We do not store or reuse any of your device information.

新功能:在线解包支持查看历史

基于现有在线解包看信息的基础上做如下扩展:

  • 按照用户 id 入库解包信息
  • 解包信息拥有唯一 id 可供分享使用
  • 通过 web 和 API 上传的文件也会进入解包+入库并在版本详情展示一部分重要信息,详情会跳转
  • 解包的信息提供用户和管理员删除权限
  • 开启自动移除老版本功能的连带也会删除解包信息

在线查看 App 包信息

功能:提供一个页面可以上传 apk 或 ipa 文件,经过解析后可以显示 app 包的信息,iOS 参考内容如下:

image

使用 app-info 会非常容易处理,同时可以再处理下对于创建的应用上传的版本 app 也可以显示

docker部署报错

initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

chmod: /var/lib/postgresql/data: Operation not permitted

希望能加入更多平台类型 App 的支持

现在 Zealot 只支持 APK 和 IPA 的解析,希望能加入更多应用类型的支持,例如

  1. macOS 应用程序,使用 Zip 打包,解析根目录中的 .app,可以解析出图标及 Info.plist
  2. Windows 应用程序,使用 Zip 打包,可以解析 exe 文件的图标,名称可以采用 exe 的文件名

这样 Zealot 就可以作为一个全平台的 dailybuild 平台来使用了。

不支持 nginx 同一个域名通过不同 path 反向代理到不同服务

我有一个域名,后端多个服务,通过 path 来走不同的服务,如gitlab, zealot。目前重定向到登录页时没有带 nginx 配置的 对应
location。比如如下的配置,我可以通过 https://dev.example.com/gitlab 正常访问 gitlab,我也应该可以通过 https://dev.example.com/zealot 正常访问 zealot。

server_name dev.example.com;

	location /gitlab {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		# try_files $uri $uri/ =404;
		proxy_pass  http://127.0.0.1:8929;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header REMOTE-HOST $remote_addr;
	}

	location /zealot {
		proxy_pass http://127.0.0.1:8093/;
		proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header REMOTE-HOST $remote_addr;
       }

新功能:增加 doctor 监测功能

此功能类似于 homebrew doctor 功能在管理面板增加一个监测功能,涵盖:

  • 文件系统读写检查 #575
  • Gemfile 依赖
  • 版本信息
  • 环境变量
  • 查看日志文件
  • 依赖服务状态(postgres、redis 和 sidekiq)

没错会把原有的 "环境信息" 聚合后改为监测功能。

疑似问题:docker-compose down 操作有一定记录 zealot 服务无法正常移除

$ docker-compose down
Stopping zealot-zealot ... done
Stopping zealot-worker ... done
Stopping zealot-redis  ... done
Removing zealot-zealot   ...
Removing zealot-worker   ... done
Removing zealot-postgres ... done
Removing zealot-redis    ... done

ERROR: for zealot-zealot  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).

$ docker-compose down
Removing zealot-zealot ... error

ERROR: for zealot-zealot  removal of container 1fa104f306063e17a813ea1a58af3e1d43af7383694211faf82119033616be5a is already in progress
Removing network zealot_default

目前的解决方案:

$ sudo systemctl stop docker
$ sudo rm -rf /var/lib/docker/containers/<CONTAINER_ID>
$ sudo systemctl start docker

Channel 页面交互需要调整才好用

IMG_3586

打包应该 iOS, Android 居多,用户场景应该在手机的布局下更多一些。

上图的场景,最新上传动态较多,原本在右侧的「应用类型」「渠道」被排到后面去了,往往安装完了才发现,类型 / 渠道没选择正确。

可以反过来排

减少 docker image 的体积

当前 Docker 体积大小为 1.18G,image 本身基于只有 51MB 的 ruby:2.6-alpine 在构建和编译。通过使用 dive 分析结果最大体积消耗为:

  • yarn install 安装的 node_modules 依赖 541 MB
  • apk 安装依赖库(必备和编译必备) 386 MB
  • bundle install 安装的 rails 依赖 138 MB

第一个即使在使用完进行删除还是会保持体积的大小,第二个可以减少的是在所有依赖库安装成功后再做删除但会不会也存在第一个的问题,第三个是必备的如果能够把前面两个或者第一个减少掉提交也会骤降一倍我就很欣喜。搜索了一番找到一个解决方案也就是使用两个镜像其中第一个作为 builder 现在不太确定 yarn 和 bundle 依赖的库在编译后 COPY 到新 images 会不会抱错,这个不像是 go 可以静态编译或者动态编译然后在通过 ldd 把关联的动态库直接 COPY 过去那么简单。

按照官方教程配置,生成的链接域名异常,求助!

激活链接异常

创建用户之后,点击用户对应的激活,显示的激活链接不正常(不应该是http且不应该出现443端口):
image

用户邮箱收到的激活链接是正常的(即上面链接去掉443端口)

产品二维码链接异常

问题和激活链接一样,扫二维码得到的链接依然是http且带有443端口号,导致无法正常访问:

二维码链接也是可以通过去掉443端口正常访问。

上面链接仅描述问题,故隐藏了真实域名。

nginx的反向代理配置,按照官网文档,配置详情如下:

server {
    listen 80;
    server_name zealot.xx.xx;
    # return 301 https://$host$request_uri;
    location / {
        if ($request_method = GET) {
            rewrite ^ https://$host$request_uri? permanent;
        }
        return 405;
    }
}

server {
  listen 443 ssl;
  server_name zealot.xx.xx;

  access_log  /data/logs/nginx/access_zealot_xx_xx.log;
  error_log  /data/logs/nginx/error_zealot_tt_xx_xx.log;

  # ssl证书配置我已经在nginx.conf里面配置过了,这里注释掉了
  # ssl                 on;
  # ssl_certificate     /etc/certs/zealot-cert.key;
  # ssl_certificate_key /etc/certs/zealot.key;
  # ssl_session_timeout 5m;
  # ssl_session_cache   shared:SSL:1m;

  root /data/zealot/public;

  location ~* ^(/assets|/favicon.ico) {
    access_log        off;
    expires           max;
  }

  location / {
    proxy_redirect     off;
    proxy_set_header   Host               $host:$server_port;
    proxy_set_header   X-Forwarded-Host   $host:$server_port;
    proxy_set_header   X-Forwarded-Port   $server_port;
    proxy_set_header   X-Forwarded-Server $host;
    proxy_set_header   X-Real-IP          $remote_addr;
    proxy_set_header   X-Forwarded-For    $proxy_add_x_forwarded_for;
    proxy_buffering    on;
    proxy_pass         http://127.0.0.1:9008; # 这里我改了docker映射端口
  }

  location /cable {
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_pass http://127.0.0.1:9008;
  }

  error_page 500 502 503 504 /500.html;
  location = /500.html {
    root /data/zealot/public;
  }
}

我的环境

  • 系统:CentOS Linux release 7.9.2009 (Core)
  • docker镜像(下面两个都试了):
    • tryzealot/zealot:nightly 36a80f2302d5
    • tryzealot/zealot:atest 3d9ef54041a0

在 iPad 和 M1 Mac 上增加安装按钮

我看了代码在平台判断里,把对 Mac 平台的判断去掉了,只保留了 iPhone 相关的,但是实际使用过程中在 iPad 以及 M1 Mac 上又需要 OTA 安装,我们是通过自行修改代码实现的,希望考虑一下这块功能。

app/application_helper.rb
(source =~ /iPhone|iPad|Unversal|ios|iOS/i).present?
改成
(source =~ /iPhone|iPad|Unversal|ios|iOS|Mac OS X/i).present?

关于自签名证书问题

因为本身内网环境局域网使用,所以准备使用自签名证书,我是在win10部署的
== Configuring Deploy ==
How do you deploy?
Use [L]et's Encryt SSL (default)
Use [S]elf-signed SSL
Do [n]ot use SSL?
S

== Configuring self signed SSL/TLS cert ==
Generating self-signed cert for zealot.test

打印到这就结束了,最终证书没有生成成功,rootfs\etc\certs里面是空的,env里面也没有写入,docker-compose.yml 没有创建

上传的iOS应用无法安装

如图:上传后无法安装、ipa文件在本地是可以安装的。

image

zealot log:
域名替换为: {localhost}
访问IP替换为: {111.1.11.111}

[313] Puma starting in cluster mode...
[313] * Puma version: 5.5.2 (ruby 2.7.4-p191) ("Zawgyi")
[313] *  Min threads: 5
[313] *  Max threads: 5
[313] *  Environment: production
[313] *   Master PID: 313
[313] *      Workers: 2
[313] *     Restarts: (✔) hot (✖) phased
[313] * Preloading application
[313] * Listening on http://0.0.0.0:3000
[313] Use Ctrl-C to stop
[313] - Worker 0 (PID: 333) booted in 0.01s, phase: 0
[313] - Worker 1 (PID: 334) booted in 0.0s, phase: 0
I, [2021-11-10T16:31:47.102022 #334]  INFO -- : [2145ebc5-2b68-47e6-929b-7fc4aa6d0e63] Started GET "/health" for 127.0.0.1 at 2021-11-10 16:31:47 +0800
I, [2021-11-10T16:31:47.107050 #334]  INFO -- : [2145ebc5-2b68-47e6-929b-7fc4aa6d0e63] Processing by HealthCheck::HealthCheckController#index as TEXT
I, [2021-11-10T16:31:47.147548 #334]  INFO -- : [2145ebc5-2b68-47e6-929b-7fc4aa6d0e63]   Rendered text template (Duration: 0.0ms | Allocations: 3)
I, [2021-11-10T16:31:47.147913 #334]  INFO -- : [2145ebc5-2b68-47e6-929b-7fc4aa6d0e63] Completed 200 OK in 41ms (Views: 1.0ms | ActiveRecord: 12.6ms | Allocations: 5513)
I, [2021-11-10T16:32:17.225789 #334]  INFO -- : [c2d62c66-16fc-4451-8a1f-3da805f117be] Started GET "/health" for 127.0.0.1 at 2021-11-10 16:32:17 +0800
I, [2021-11-10T16:32:17.227271 #334]  INFO -- : [c2d62c66-16fc-4451-8a1f-3da805f117be] Processing by HealthCheck::HealthCheckController#index as TEXT
I, [2021-11-10T16:32:17.232087 #334]  INFO -- : [c2d62c66-16fc-4451-8a1f-3da805f117be]   Rendered text template (Duration: 0.0ms | Allocations: 2)
I, [2021-11-10T16:32:17.232291 #334]  INFO -- : [c2d62c66-16fc-4451-8a1f-3da805f117be] Completed 200 OK in 5ms (Views: 0.3ms | ActiveRecord: 0.5ms | Allocations: 1802)
I, [2021-11-10T16:32:47.303901 #334]  INFO -- : [eb85440c-86b2-43c5-9f51-ce8c46ed2cf8] Started GET "/health" for 127.0.0.1 at 2021-11-10 16:32:47 +0800
I, [2021-11-10T16:32:47.305243 #334]  INFO -- : [eb85440c-86b2-43c5-9f51-ce8c46ed2cf8] Processing by HealthCheck::HealthCheckController#index as TEXT
I, [2021-11-10T16:32:47.312827 #334]  INFO -- : [eb85440c-86b2-43c5-9f51-ce8c46ed2cf8]   Rendered text template (Duration: 0.0ms | Allocations: 2)
I, [2021-11-10T16:32:47.313044 #334]  INFO -- : [eb85440c-86b2-43c5-9f51-ce8c46ed2cf8] Completed 200 OK in 8ms (Views: 0.4ms | ActiveRecord: 0.4ms | Allocations: 1802)
I, [2021-11-10T16:33:01.194841 #334]  INFO -- : [7f714276-94af-483f-8e24-5d083e700aea] Started GET "/" for 183.6.43.209 at 2021-11-10 16:33:01 +0800
I, [2021-11-10T16:33:01.196285 #334]  INFO -- : [7f714276-94af-483f-8e24-5d083e700aea] Processing by DashboardsController#index as HTML

......

zealot-zealot | I, [2021-11-10T18:22:57.964553 #334]  INFO -- : [fbfb27c9-ad47-488b-9f57-999ddefcad5b] Started GET "/channels/tZh8V/releases/7/install" for {111.1.11.111} at 2021-11-10 18:22:57 +0800
zealot-zealot | I, [2021-11-10T18:22:57.966026 #334]  INFO -- : [fbfb27c9-ad47-488b-9f57-999ddefcad5b] Processing by Releases::InstallController#show as */*
zealot-zealot | I, [2021-11-10T18:22:57.966074 #334]  INFO -- : [fbfb27c9-ad47-488b-9f57-999ddefcad5b]   Parameters: {"channel_id"=>"tZh8V", "release_id"=>"7"}
zealot-zealot | I, [2021-11-10T18:22:57.978747 #334]  INFO -- : [fbfb27c9-ad47-488b-9f57-999ddefcad5b]   Rendered releases/install/show.html.erb (Duration: 3.0ms | Allocations: 718)
zealot-zealot | I, [2021-11-10T18:22:57.979019 #334]  INFO -- : [fbfb27c9-ad47-488b-9f57-999ddefcad5b] Completed 200 OK in 13ms (Views: 3.9ms | ActiveRecord: 4.3ms | Allocations: 2020)
zealot-zealot | I, [2021-11-10T18:23:00.674241 #334]  INFO -- : [6f7a2bfe-675a-4c0a-b853-fb588532985b] Started GET "/download/releases/7" for {111.1.11.111} at 2021-11-10 18:23:00 +0800
zealot-zealot | I, [2021-11-10T18:23:00.675700 #334]  INFO -- : [6f7a2bfe-675a-4c0a-b853-fb588532985b] Processing by Download::ReleasesController#show as */*
zealot-zealot | I, [2021-11-10T18:23:00.675756 #334]  INFO -- : [6f7a2bfe-675a-4c0a-b853-fb588532985b]   Parameters: {"id"=>"7"}
zealot-zealot | I, [2021-11-10T18:23:00.686432 #334]  INFO -- : [6f7a2bfe-675a-4c0a-b853-fb588532985b] Redirected to http://{localhost}:443/download/releases/7/tZh8V_1.0.0_12_202111101749.ipa
zealot-zealot | I, [2021-11-10T18:23:00.686580 #334]  INFO -- : [6f7a2bfe-675a-4c0a-b853-fb588532985b] Completed 302 Found in 11ms (ActiveRecord: 5.0ms | Allocations: 1240)
zealot-zealot | I, [2021-11-10T18:23:00.796234 #334]  INFO -- : [eccb697e-dc46-48c8-8894-311a9d1941b0] Started GET "/download/releases/7/tZh8V_1.0.0_12_202111101749.ipa" for {111.1.11.111} at 2021-11-10 18:23:00 +0800
zealot-zealot | I, [2021-11-10T18:23:00.797687 #334]  INFO -- : [eccb697e-dc46-48c8-8894-311a9d1941b0] Processing by Download::ReleasesController#download as */*
zealot-zealot | I, [2021-11-10T18:23:00.797748 #334]  INFO -- : [eccb697e-dc46-48c8-8894-311a9d1941b0]   Parameters: {"id"=>"7", "filename"=>"tZh8V_1.0.0_12_202111101749.ipa"}
zealot-zealot | I, [2021-11-10T18:23:00.809761 #334]  INFO -- : [eccb697e-dc46-48c8-8894-311a9d1941b0] Sent file /app/public/uploads/apps/a2/r7/binary/AutoCI_Test_1.0.0_2021-11-10-17-48.ipa (0.5ms)
zealot-zealot | I, [2021-11-10T18:23:00.809928 #334]  INFO -- : [eccb697e-dc46-48c8-8894-311a9d1941b0] Completed 200 OK in 12ms (ActiveRecord: 4.4ms | Allocations: 1871)
zealot-zealot | I, [2021-11-10T18:23:01.326993 #333]  INFO -- : [1414e7ed-5179-4c38-9947-57f9a0dca66f] Started GET "/download/releases/7" for {111.1.11.111} at 2021-11-10 18:23:01 +0800
zealot-zealot | I, [2021-11-10T18:23:01.328300 #333]  INFO -- : [1414e7ed-5179-4c38-9947-57f9a0dca66f] Processing by Download::ReleasesController#show as */*
zealot-zealot | I, [2021-11-10T18:23:01.328345 #333]  INFO -- : [1414e7ed-5179-4c38-9947-57f9a0dca66f]   Parameters: {"id"=>"7"}
zealot-zealot | I, [2021-11-10T18:23:01.354498 #333]  INFO -- : [1414e7ed-5179-4c38-9947-57f9a0dca66f] Redirected to http://{localhost}:443/download/releases/7/tZh8V_1.0.0_12_202111101749.ipa
zealot-zealot | I, [2021-11-10T18:23:01.354672 #333]  INFO -- : [1414e7ed-5179-4c38-9947-57f9a0dca66f] Completed 302 Found in 26ms (ActiveRecord: 13.2ms | Allocations: 3475)
zealot-zealot | I, [2021-11-10T18:23:07.471371 #333]  INFO -- : [c149a17c-d56e-4b03-a725-7510b248cbd5] Started GET "/health" for 127.0.0.1 at 2021-11-10 18:23:07 +0800
zealot-zealot | I, [2021-11-10T18:23:07.472624 #333]  INFO -- : [c149a17c-d56e-4b03-a725-7510b248cbd5] Processing by HealthCheck::HealthCheckController#index as TEXT
zealot-zealot | I, [2021-11-10T18:23:07.477413 #333]  INFO -- : [c149a17c-d56e-4b03-a725-7510b248cbd5]   Rendered text template (Duration: 0.0ms | Allocations: 1)
zealot-zealot | I, [2021-11-10T18:23:07.477623 #333]  INFO -- : [c149a17c-d56e-4b03-a725-7510b248cbd5] Completed 200 OK in 5ms (Views: 0.4ms | ActiveRecord: 0.9ms | Allocations: 1775)

Nginx 配置:

server
{
  #  listen 80;
	listen 443 ssl http2;
    server_name {localhost} www.{localhost};
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/{localhost};
    
    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    ssl_certificate    /www/server/panel/vhost/cert/{localhost}/fullchain.pem;
    ssl_certificate_key    /www/server/panel/vhost/cert/{localhost}/privkey.pem;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    add_header Strict-Transport-Security "max-age=31536000";
    error_page 497  https://$host$request_uri;

    #SSL-END
    
    #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    #ERROR-PAGE-END
    
    #PHP-INFO-START  PHP引用配置,可以注释或修改
    include enable-php-56.conf;
    #PHP-INFO-END
    
    #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
    include /www/server/panel/vhost/rewrite/{localhost}.conf;
    #REWRITE-END
    
    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }
    
    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
        allow all;
    }
    
    # location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    # {
        # expires      30d;
        # error_log /dev/null;
        # access_log /dev/null;
    # }
    
    # location ~ .*\.(js|css)?$
    # {
    #     expires      12h;
    #     error_log /dev/null;
    #     access_log /dev/null; 
    # }
    location / {
      proxy_redirect     off;
      proxy_set_header   Host               $host:$server_port;
      proxy_set_header   X-Forwarded-Host   $host:$server_port;
      proxy_set_header   X-Forwarded-Port   $server_port;
      proxy_set_header   X-Forwarded-Server $host;
      proxy_set_header   X-Real-IP          $remote_addr;
      proxy_set_header   X-Forwarded-For    $proxy_add_x_forwarded_for;
      proxy_buffering    on;
      proxy_pass         http://172.20.0.4:3000;
    }
    access_log  /www/wwwlogs/{localhost}.log;
    error_log  /www/wwwlogs/{localhost}.error.log;
}

server {
    listen 80;
    server_name {localhost} www.{localhost};
    rewrite ^(.*)$ https://$host$1 permanent;
}

zealot-zealot 容器起不来

你好,我 ./deploy 使用 no ssl 模式,zealot-zealot 容器报错,请问下是什么原因呢

ERROR: for zealot-zealot Cannot create container for service zealot: json: cannot unmarshal number into Go value of type string

ERROR: for zealot Cannot create container for service zealot: json: cannot unmarshal number into Go value of type string
ERROR: Encountered errors while bringing up the project.

image

fastlane zealot 上传失败

+-------------+-----------------------------------------------------------+
|                        �[32mSummary for zealot 0.8.0�[0m                         |
+-------------+-----------------------------------------------------------+
| channel_key | win_test                                                  |
| file        | /Users/king/Library/Caches/apk/app-profile-1644561694.apk |
| changelog   | 体验版本                                                  |
|             | - - 修复 endpoint 路径错误                                |
| branch      | origin/develop-支持zealot部署                             |
| git_commit  | ab6248ada4efb596d81c1d9ea01ff617c768ec78                  |
| source      | jenkins                                                   |
| ci_url      | http://127.0.0.1:8080/job/win+_android/189/               |
+-------------+-----------------------------------------------------------+
[14:42:29]: �[32mUploading to [http://127.0.0.1:80](http://127.0.0.1/) ...�[0m
[14:42:33]: �[31mError uploading to Zealot [422]: �[0m

新功能:通过 API 上传 App 支持显示自定义字段

起因

Zealot 在上传 App 的版本详情页提供默认一系列的字段参数值,包括:

  • 上传版本号:从 1 开始自增
  • 平台:支持 iOS 和 Android
  • 版本信息:1.0.0 (1.0)
  • 打包类型:debug/adhoc/inhouse/release
  • App 体积: 20MB
  • 上传渠道: Web/Fastlane/API/Jenkins 等
  • Git 分支名
  • Git Commit SHA
  • 上传时间: 时间戳

为了方便广大开发者不同的需求,现开放自定义字段用于展示你希望显示的字段信息,比如 API 环境:development/staging/production 等。

定义

App 上传接口新增一个 custom_fields 字段接收一个 json 的数组字符串,每个数组是一个字典,字典结构如下:

  • icon: 支持 fontawesome v4 的 icon 名,比如 building-o,不需要 fa- 开头
  • value: 显示的文字
  • title: 提示文案,可要可不要

举个例子:

[
  {
    "icon": "building-o",
    "value": "development",
    "title": "API 环境"
  }
]

Web 就会显示如下:

WX20200417-160051@2x

辛苦看一下:Docker启动的时候日志提示连接Redis错误,怎么解决?

2021-05-28T14:50:33.322Z pid=355 tid=nmn ERROR: Error connecting to Redis on redis:6379 (SocketError)
2021-05-28T14:50:33.322Z pid=355 tid=nmn ERROR: /app/vendor/bundle/ruby/2.7.0/gems/redis-4.2.5/lib/redis/client.rb:367:in `rescue in establish_connection'
2021-05-28T14:50:33.322Z pid=355 tid=nmn WARN: Redis::CannotConnectError: Error connecting to Redis on redis:6379 (SocketError)

bundle install 的一些告警

HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.

Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.

For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0

Post-install message from exception_handler:
ExceptionHandler 0.8.0.0 → New "config" (config.exception_handler = {exceptions: {layout: 'x', notification: true, action: {redirect_to root_path} }} ). https://www.github.com/richpeck/exception_handler#config for more info. Post-install message from sass:

Ruby Sass has reached end-of-life and should no longer be used.

[DEPRECATED] As noted on devise_helper.rb, overriding devise_error_messages! is no longer recommended.

解决 docker 容器不会清理 /tmp 临时文件

Zealot 在解析 ipa 或 apk 文件实际上会在 /tmp 目录生成缓存文件来更快获取元数据。但不知道为什么 docker container 的 /tmp 不会自动清理,需要解决。

目前初步想法是写一个 crontab 清理超过 x 小时的临时文件:

#!/bin/bash
find /tmp -type f -mmin +300 -exec rm -f {} \;
0 */5 * * * /bin/sh -l -c 'find /tmp -type f -mmin +300 -exec rm -f {} \;' >> /var/log/clean_tmp_cron.log 2>&1

使用密码访问时出错

I, [2021-08-26T11:43:31.739464 #339]  INFO -- : [26370625-36c7-43aa-a225-7a82cbbadfce] Completed 500 Internal Server Error in 31ms (ActiveRecord: 9.7ms | Allocations: 4256)
F, [2021-08-26T11:43:31.739888 #339] FATAL -- : [26370625-36c7-43aa-a225-7a82cbbadfce]
[26370625-36c7-43aa-a225-7a82cbbadfce] NoMethodError (undefined method `app_release_auth_key' for #<ReleasesController:0x000000000157c0>
Did you mean?  app_scheme_url):
[26370625-36c7-43aa-a225-7a82cbbadfce]
[26370625-36c7-43aa-a225-7a82cbbadfce] app/controllers/releases_controller.rb:46:in `auth'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.