Git Product home page Git Product logo

app-host's Introduction

AppHost

MacDown logo

Build Status License Gems

介绍

一个轻量级的包托管网站,app-host 主要用于 iOS 和 Android 的包管理,作用类似于fir.im,不同之处是可以自由部署在内网,方便了公司项目保密。并且代码开源也可以方便根据各自需求进行定制化开发。

目前能实现

1.新建包
2.包底下新建渠道( iOS,安卓,各种环境都归为渠道,例如 iOS 生产,iOS 沙盒,iOS 越狱版,Android 生产等)
3.渠道下面上传包
4.帐号和权限管理
5.api 和页面表单上传包
6.解析包信息,包括 iOS 的包类型 ADHOC 还是 release,udid,安卓的签名证书等
7.我编不下去了···哈哈~~

推荐用法 Docker 公有镜像

1. 把~/shared目录添加到Docker -> Preferences... -> Resources中(授权访问)
2. docker run --name app_host -v ~/shared:/app/shared -p 3000:8686 -d tinyc/app-host:lastest

用法 2 Docker 自己编译

1. > git clone https://github.com/pluosi/app-host.git /opt/app-host
2. > cd /opt/app-host
5. > ./docker/launcher bootstrap -v #该步骤依赖网络,所以如果网络不稳定报错了,可以重试几次
6. > ./docker/launcher start
7. 尝试访问 http://localhost:3000 ,如果不希望用3000端口,可以手动修改 docker/launcher 里的`local_port`值
ps:数据库和上传的文件会保存在 ./shared 文件夹中

用法 3 源码运行

1. > git clone https://github.com/pluosi/app-host.git /opt/app-host
2. > cd /opt/app-host
4. 修改 config/secrets.yml 中 `production下的secret_key_base` ,可以运行`rake secret`得到
5. bundle install
6. rails s 运行测试环境
7. 关于部署到生成环境的话请参照一下 rails puma 部署等教程,需要修改一下 config/deply.rb 的部署地址
8. 尝试访问 http://localhost:3000

关于 https

如果需要用到ipa下载,必须配置 https,举例 ng 的配置参考

//https_app.conf
server {
    listen 443 ssl;
    server_name  ota.xxx.com;
    
    # access_log /var/log/nginx/ota.xxx.com_access.log;

    ssl_certificate      /home/xxx.com/nginx/public.pem;
    ssl_certificate_key  /home/xxx.com/nginx/private.key;
    ssl on;

    location / {
        proxy_set_header  Host $http_host;
        proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  X-Forwarded-Proto https;
        proxy_set_header  X-Forwarded-Port $server_port;
        proxy_pass http://172.21.35.62:3000; #此处改为 docker 服务的地址
    }
}

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

已知问题

  1. apk 包如果是非图片 logo,会无法显示 logo,因为目前还没实现 xml logo 的解析
  2. 如果不配置 https,ipa 将无法安装(苹果的限制)

License

AppHost is released under the MIT license. See LICENSE for details.

联系作者

MacDown logo

预览

MacDown logo

MacDown logo

MacDown logo

app-host's People

Contributors

tinyc-z avatar yaming116 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

app-host's Issues

请问:Docker跑不起来,报错

docker logs显示报错如下:
[ ok ] Starting nginx: nginx.
Puma starting in single mode...

  • Version 3.9.1 (ruby 2.5.0-p0), codename: Private Caller
  • Min threads: 1, max threads: 1
  • Environment: production
    /app/config/initializers/rack.rb:3: warning: already initialized constant Rack::Multipart::Parser::BUFSIZE
    /usr/local/bundle/gems/rack-2.0.3/lib/rack/multipart/parser.rb:8: warning: previous definition of BUFSIZE was here
  • Listening on tcp://0.0.0.0:3000
    Traceback (most recent call last):
    9: from /usr/local/bundle/bin/puma:29:in <main>' 8: from /usr/local/bundle/bin/puma:29:in load'
    7: from /usr/local/bundle/gems/puma-3.9.1/bin/puma:10:in <top (required)>' 6: from /usr/local/bundle/gems/puma-3.9.1/lib/puma/cli.rb:77:in run'
    5: from /usr/local/bundle/gems/puma-3.9.1/lib/puma/launcher.rb:174:in run' 4: from /usr/local/bundle/gems/puma-3.9.1/lib/puma/single.rb:92:in run'
    3: from /usr/local/bundle/gems/puma-3.9.1/lib/puma/launcher.rb:103:in write_state' 2: from /usr/local/bundle/gems/puma-3.9.1/lib/puma/launcher.rb:130:in write_pid'
    1: from /usr/local/bundle/gems/puma-3.9.1/lib/puma/launcher.rb:130:in open' /usr/local/bundle/gems/puma-3.9.1/lib/puma/launcher.rb:130:in initialize': No such file or directory @ rb_sysopen - tmp/pids/puma.pid (Errno::ENOENT)

curl 上传提示 no implicit conversion of nil into String

使用如下命令上传:
curl --form plat_id=3 --form token=0e0c6e491c42ca7127b1ea04175218ab6144b58a --form file=uat.ipa http://xxx/api/pkgs

提示错误信息:
{"error":"no implicit conversion of nil into String"}

换用如下命令上传:
curl --form plat_id=3 --form token=0e0c6e491c42ca7127b1ea04175218ab6144b58a --form file=uat.ipa --form file_nick_name="uat_140" http://xxx/api/pkgs

提示错误信息:
{"error":"Bundle Id not match xxx"}

网页提交正常。

配https

你好,请问如何在你的项目上挂https服务?我用的mac系统,项目已经搭建好了,本地也装了apache和nginx,但是不知道如何挂

The change you wanted was rejected.

The change you wanted was rejected.
Maybe you tried to change something you didn't have access to.

If you are the application owner check the logs for more information.

配置https后登录报错

https证书是自签名的,域名不是通过DNS解析的,是本地配的hosts

输入用户名和密码后,点击登录,报错:

screen shot 2018-01-15 at 10 37 03 am

win 10 按照报错

系统:win 10 x64
ruby:ruby 2.5.0p0 (2017-12-25 revision 61468) [x64-mingw32]
gem:2.7.5

执行bundle install的时候报错了,下面是报错信息


D:\app-host>gem sources -u
source cache successfully updated

D:\app-host>bundle install
Your Gemfile lists the gem paranoia (~> 2.2) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of one of them later.
Fetching gem metadata from https://gems.ruby-china.org/.........
Fetching gem metadata from https://gems.ruby-china.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "ruby ":
  In Gemfile:
    ruby  (~> 2.5.0.0)

    capybara (~> 2.13) was resolved to 2.14.4, which depends on
      nokogiri (>= 1.3.3) was resolved to 1.8.0, which depends on
        ruby  (< 2.5) x64-mingw32

Could not find gem 'ruby  (< 2.5)', which is required by gem 'nokogiri (>=
1.3.3)', in any of the relevant sources:
  the local ruby installation

『不允许重复包』如何理解?

image

如图:3个包分属于2个平台,uniq_key都是build,搞不清楚了。

上传ipa包经常触发这个错误。
if pkg_uniq? && !pkg.uniq? raise "Pkg Uniq Validation Fail" end

自签证书一直没有配好

自签证书是在docker文件夹里的nginx.conf文件里配置吗?配了快一天了,也没有配好,能不能帮发一个生产环境的nginx.conf文件里的配置

这是我的配置:
upstream app {
server 52.35.117.51;
}

server {
listen 443 ssl;
listen 8686;
server_name 52.35.117.51:3000;
root /app/public;
access_log test.access_log;
ssl on;
ssl_certificate www.infoljj.com.crt;
ssl_certificate_key www.infoljj.com.key;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDH:AES:HIGH:!aNULL:!MD5:!ADH:!DH;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
index index.html index.htm;
error_page 404 /404.html;
error_page 500 502 503 504 /500.html;
keepalive_timeout 60;

client_max_body_size 1000m;

location ~ ^/(assets|uploads)/  {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
    break;
}
location / {
    proxy_redirect    off;
    proxy_set_header  Host             $http_host;
    proxy_set_header  X-Real-IP        $remote_addr;
    proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;

    if (!-f $request_filename) {
        proxy_pass http://app;
    }
}

}

安装依赖,报错

执行 ./docker/launcher bootstrap -v 后,一直在 Step 14 : RUN rake assets:precompile 里报错。

image

重新 clone编译 了很多遍,开了 VPN 也一样报错。

启动后,出现找不到 cssjs 文件。

image

查看目录,没有发现public文件夹。

image
image

shared 文件夹里的也没有cssjs文件

image

已经部署一周了,能力有限,一直没有部署成功,希望能得到您的帮助,感谢!

部署后,找不到asset文件夹

部署后,找不到asset文件夹
image
点击,登陆 或者 新建

会跳到报错页面
image

整个app-host项目里的配置都没有动,包括PROTOCOLHOST也没有改

我的外部nginx配置:
image
是不是需要我改 app-host 项目里的 docker/nginx.conf文件的配置,或者更改 config/settings.local.yml文件里的HOST

mina deploy 失败

本地机器调试起来没问题的,用mina部署到服务器(一台iMac)的时候在这一步报错。

不知是什么原因。

image

IOS 下载

目前有两个问题:

  1. APP下载地址默认是localhost开头,如何修改
    image
    2.IOS的IPA文件如何安装,点击下载 如下图
    image

InvalidAuthenticityToken错误

在报错的前一天,做了浏览器清空cookie缓存之类的操作,然后今天使用就报错了。具体报错如下图:
1121544837458_ pic_hd

The change you wanted was rejected.

ip+端口号访问会被强制指向https
然后自行改回http可出现注册页面,然后注册会报这个错误
是什么问题呢?
求指导 谢谢啦

建议增加一个内网渠道

其实iOS 的https要求,只是针对plist文件,ipa的URL不强制https

把app-host的服务部署到公网,并加上https,在上传IPA的时候,选择是否添加ipa内网http地址,如果添加,则多生成一个ipa地址为内网http的plist文件,自动生成一个内网的渠道,这样内网测试时就不用信任自签的https证书了。
安卓也可以增加一个类似的功能,内网就不用再部署一份服务

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.