{"id":13536436,"url":"https://github.com/lexrus/ios-dev-playbook","last_synced_at":"2025-04-06T00:10:18.250Z","repository":{"id":18759516,"uuid":"21972011","full_name":"lexrus/ios-dev-playbook","owner":"lexrus","description":"不会运维的 iOS 开发不是好设计师。这个 Ansible Playbook 能快速配置 iOS 开发需要的服务，安装如 Gogs、GitLab、Jenkins、Ghost、Ajenti 等常用服务。","archived":false,"fork":false,"pushed_at":"2018-04-17T14:47:57.000Z","size":267,"stargazers_count":555,"open_issues_count":1,"forks_count":83,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-29T23:11:08.766Z","etag":null,"topics":["ansible","debian-wheezy","devops","yaml"],"latest_commit_sha":null,"homepage":"https://twitter.com/lexrus","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lexrus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-18T07:36:30.000Z","updated_at":"2024-10-25T16:25:30.000Z","dependencies_parsed_at":"2022-07-20T10:04:12.529Z","dependency_job_id":null,"html_url":"https://github.com/lexrus/ios-dev-playbook","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexrus%2Fios-dev-playbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexrus%2Fios-dev-playbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexrus%2Fios-dev-playbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexrus%2Fios-dev-playbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lexrus","download_url":"https://codeload.github.com/lexrus/ios-dev-playbook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415973,"owners_count":20935387,"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":["ansible","debian-wheezy","devops","yaml"],"created_at":"2024-08-01T09:00:39.326Z","updated_at":"2025-04-06T00:10:18.226Z","avatar_url":"https://github.com/lexrus.png","language":"Ruby","readme":"# iOS Dev Playbook\n\n[![Build Status](https://img.shields.io/travis/lexrus/ios-dev-playbook/master.svg?style=flat)](https://travis-ci.org/lexrus/ios-dev-playbook)\n[![GitHub tag](https://img.shields.io/github/tag/lexrus/ios-dev-playbook.svg?style=flat)](https://github.com/lexrus/ios-dev-playbook)\n![License](https://img.shields.io/github/license/lexrus/ios-dev-playbook.svg?style=flat)\n\n作为一个 iOS 开发人员，会一些基础的运维技术能使工作流更加顺，并为创业团队节省不少运维成本。\n这个 [Ansible](http://www.ansible.com) Playbook 的仓库，可以用来快速配置 iOS 开发需要的一些服务。\n当然，如果经费充裕，直接使用优质的收费服务更省时省力。\n\n因为精力有限，大部分配置只在 64bit __Debian Jessie__(Debian 8) 上跑通部署测试，\n理论上 Ubuntu 14.04 以上也能用。\n请先阅读 [Ansible 的入门文档](http://docs.ansible.com)，不然遇到问题可能会没有方向。\n如果你用 macOS，建议在 [Dash](http://kapeli.com/dash) 里安装 Ansible 的文档。\n\n## 服务列表\n\n#### [Docker](https://docker.com) `rake docker`\n目前大部分服务都没有运行在 Docker 里。\n理想的运行方式是每一个服务都以 Docker container 的形式运行，互不干扰。等有空了再改。\n\n#### [Gogs](http://gogs.io) :443 `rake gogs`\n用 Go 语言编写的 Git 服务，特点是功能精简和速度快，树莓派也能流畅运行。\n我自己就在用，用的人比较少的话内存占用稳定在 100M 左右。\n`rake gogs` 安装后默认开了注册功能，如果要禁用，运行 `rake gogsdr` 即可。\n新版本升级后，再运行 `rake gogs` 和 `rake gogsdr` 可以自动完成升级。\n这个 role 默认会用 [le.sh](https://github.com/Neilpang/le) 自动生成 [LetsEncrypt](https://letsencrypt.org) 的 SSL 证书，\n每隔 80 天自动更新证书。\n如果不想用 SSL 可以加上 `SSL=false` 这个参数。\n\n#### [GitLab](https://github.com/gitlabhq/gitlabhq) :80 `rake gitlab`\n知名的开源 Git 服务，特点是功能全面。\n安装完成后默认用户名是 `root`, 密码为 `5iveL!fe`。\nGitLab 对内存有一定要求，建议使用最少 1G 内存的主机。\n另外，如果已经成功安装，再次运行 `rake gitlab` 可进行数据备份和程序升级。\n手动操作可以看[官方的说明](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/update.md)。\n\n#### [Jenkins](http://jenkins-ci.org) :8080 `rake jenkins`\n开源的持续集成服务，很多人用它来做自动编译打包 IPA 的事。\n不过界面不好看，我个人更喜欢 Atlassian Bamboo。\n\n#### [Ghost](https://ghost.org/) :443 `rake ghost`\n如果你想同时建一个 Blog 记录开发中的心得或者创业的艰辛，Ghost 是个不错的工具。\n它比 Wordpress 更轻巧，皮肤也都非常简洁。\n这个 role 使用 [Caddy](https://caddyserver.com) 提供了 HTTP2 支持，并自动生成 LetsEncrypt 的免费 SSL 证书。\n默认会自动装上这些皮肤: [ghostium](https://github.com/oswaldoacauan/ghostium)、[ghostrayder](https://github.com/k9ordon/ghostrayder)、[ghostwriter](https://github.com/roryg/ghostwriter)、[GhostScroll](https://github.com/grmmph/GhostScroll)、[Readium](https://github.com/starburst1977/Readium)\n\n#### [Uptime](http://www.redotheweb.com/uptime/) :8082 `rake uptime`\n默认用户 `root`，密码 `admin`。\n非常轻巧的服务器可用率监控服务，监控小团队的服务可用率肯定是够了。\n如果不想自己搭的话推荐用完全免费的 [UptimeRobot](https://uptimerobot.com) 代替。\n更全面的监控应该用\n[Munin](http://munin-monitoring.org) /\n[Nagios](http://www.nagios.org) /\n[Sensu](http://sensuapp.org) 等工具实现。\n\n#### [Ajenti](http://ajenti.org) :8000 `rake ajenti`\n这是服务器管理工具，功能全，比较重。\n如果喜欢把所有服务都装在一起的话，装上这个也不错。默认用户 `root`，密码 `admin`。\nAjenti 强烈建议使用 SSL 连接，但是 Safari 访问非 443 端口使用自签证书的服务器会比较麻烦，所以我暂时禁用了，可以进管理界面打开。\n不使用 SSL 有安全隐患，请避免在生产环境使用这样的配置。\n另外，重签证书可以用 `ajenti-ssl-gen hostname.com -f; service ajenti restart`;\n\n#### [Huginn](https://github.com/cantino/huginn) :5000 `rake huginn`\n算是 IFTTT 的 geek 版本，可以用来定制各种触发条件，可以自动完成很多事。\n默认用户 `admin`，密码 `password`。\n\n#### [S🀫🀫🀫🀫🀫🀫🀫🀫🀫s](https://github.com/clowwindy/shadowsocks)\n此处打码一百字。\n\n#### [haproxy](http://www.haproxy.org) `rake haproxy`\n代理 Gmail，装完后设置本地的 `/etc/hosts`，加上:\n```\n__YOUR_SERVER_IP__   smtp.gmail.com\n__YOUR_SERVER_IP__   pop.gmail.com\n__YOUR_SERVER_IP__   imap.gmail.com\n```\n\n\n## 使用方法\n\n### 通过 SSH 远程配置，通常是用 Mac 操作远程服务器\n\n1. `sudo pip install ansible docker-py` - 安装 Ansible\n1. `git clone https://github.com/lexrus/ios-dev-playbook.git` - 下载项目\n1. `cd ios-dev-playbook` - 进入目录\n1. `cp ansible_hosts.ini{.example,}` - 复制 ansible_hosts.ini.example 到 ansible_hosts.ini，然后修改相应的服务器地址\n1. 如果要备份这些配置，可以用 `rake dropbox`，它会把重要的配置备份到 `~/Dropbox/.ios-dev-playbook` 目录下\n1. 确保你的服务器可以用 [SSH key 验证登录](http://www.debian-administration.org/article/530/SSH_with_authentication_key_instead_of_password)\n1. 安装相应的服务，如 GitLab: `rake gitlab`，更多命令用 `rake -T` 列出\n1. 如果遇到问题可以试着用 `rake deps` 更新第三方 roles，用 [Ansible Galaxy](https://galaxy.ansible.com) 更新依赖的 roles([.ansible_galaxy_dependencies](https://github.com/lexrus/ios-dev-playbook/blob/master/.ansible_galaxy_dependencies))\n\n### 在当前主机上做本地配置，适合 Debian 或 Ubuntu 单机手动操作\n\n1. `sudo apt-get install ansible docker-py git python python-setuptools python-pip`\n1. `sudo pip install ansible docker-py` - 安装 Ansible\n1. `git clone https://github.com/lexrus/ios-dev-playbook.git` - 下载项目\n1. `cd ios-dev-playbook` - 进入目录\n1. `ansible-playbook 059_uptime.yml -i ansible_localhost.ini` - 安装相应的服务\n\n## 注意事项\n\n1. 备份策略是: 等有空了再备份 @__@#\n2. 各个服务的使用方法这里就不赘述了，我在上面的列表里加了相应的链接;\n5. 端口都是 :80 的服务不能装在一起，再设置一个二级域名吧;\n\n## 测试\n\n测试需要 [Vagrant](https://www.vagrantup.com/)，在本项目目录中 `rake test_ubuntu` 就会拉一个 ubuntu/trusty64 的镜像试着跑大部分配置，测 Debian Jessie 请用 `rake test_debian`。\n如果你用的是 macOS，推荐先装 [Brew](http://brew.sh) 和 [Cask](http://caskroom.io)，然后运行 `brew cask install vagrant virtualbox`。\nVagrant 测试的 roles 都写在 [tests/vagrant_test.yml](https://github.com/lexrus/ios-dev-playbook/blob/master/tests/vagrant_test.yml) 里了。\n\n本地用 Vagrant 测试会消耗很多时间，尤其是在网速不理想的情况下。并且，请确保你的电脑有至少 2G 的空闲内存。\n\nTravis 设置了测试 playbook 的语法是否正确，以及 `001_common_utilities.yml` 是否能顺利跑通。\n\n## 捐赠\n\n非常感谢请我喝咖啡的朋友们，我的钱包地址是:\nBTC: `3MnMu3Q1UK63dRbwjhwqWSBVLWxy8SPk6b`\nETH: `0x2884F4bE2cBA05395EE0EF997a44aA9B90fD2E2A`\n\n## 上哪搞服务器?\n\n欢迎你使用我的推广链接注册自己的虚拟服务器：\n\n[我的 DigitalOcean 推广链接](https://www.digitalocean.com/?refcode=3eb5cf371fc9) 新加坡节点延时都很低，每月 5 刀起，通过推广链接注册就送 10 刀。\n\n[我的 Linode 推广链接](http://www.linode.com/?r=9f144941e797d495a10c2841c3137ce1acde5f15) Linode 服务非常稳定，性能也不错。\n\n[我的 Vultr 推广链接](http://www.vultr.com/?ref=6822054) 最低每月 5 刀，使用优惠码 SSDVPS 就送 20 刀。\n\n\n## 协议\n\n本项目的源码遵循 MIT 协议，详见 `LICENSE` 文件。\n","funding_links":[],"categories":["Ruby","devops","HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexrus%2Fios-dev-playbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flexrus%2Fios-dev-playbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexrus%2Fios-dev-playbook/lists"}