Skip to content

Commit b7e9756

Browse files
committed
feat: initial
0 parents  commit b7e9756

File tree

10 files changed

+538
-0
lines changed

10 files changed

+538
-0
lines changed

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
commit-message:
8+
prefix: "fix"
9+
include: "scope"
10+
11+
- package-ecosystem: "docker"
12+
directory: "/"
13+
schedule:
14+
interval: "daily"
15+
commit-message:
16+
prefix: "fix"
17+
include: "scope"
18+
19+
- package-ecosystem: "github-actions"
20+
directory: "/"
21+
schedule:
22+
interval: "daily"
23+
commit-message:
24+
prefix: "fix"
25+
include: "scope"

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
binaries:
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
token: ${{ secrets.API_GITHUB_TOKEN }}
17+
18+
- name: Setup Go environment
19+
uses: actions/[email protected]
20+
with:
21+
go-version: "1.16"
22+
23+
- name: Binaries Release
24+
uses: goreleaser/goreleaser-action@v2
25+
with:
26+
version: ~> 0.159
27+
args: release --rm-dist
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [master, develop]
6+
pull_request:
7+
branches: [master, develop]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-20.04
12+
13+
steps:
14+
- name: Checkout with token
15+
if: github.event_name != 'pull_request'
16+
uses: actions/checkout@v2
17+
with:
18+
token: ${{ secrets.API_GITHUB_TOKEN }}
19+
20+
- name: Checkout without token
21+
if: github.event_name == 'pull_request'
22+
uses: actions/checkout@v2
23+
24+
- name: Setup Go environment
25+
uses: actions/[email protected]
26+
with:
27+
go-version: "1.16"
28+
29+
- name: Program Test
30+
run: go test ./...
31+
32+
- name: Version
33+
if: github.event_name != 'pull_request'
34+
uses: cycjimmy/[email protected]
35+
with:
36+
semantic_version: 17.4
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}

.gitignore

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/go,intellij+all,vscode
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=go,intellij+all,vscode
4+
5+
### Go ###
6+
# Binaries for programs and plugins
7+
*.exe
8+
*.exe~
9+
*.dll
10+
*.so
11+
*.dylib
12+
13+
# Test binary, built with `go test -c`
14+
*.test
15+
16+
# Output of the go coverage tool, specifically when used with LiteIDE
17+
*.out
18+
19+
# Dependency directories (remove the comment below to include it)
20+
# vendor/
21+
22+
### Go Patch ###
23+
/vendor/
24+
/Godeps/
25+
26+
### Intellij+all ###
27+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
28+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
29+
30+
# User-specific stuff
31+
.idea/**/workspace.xml
32+
.idea/**/tasks.xml
33+
.idea/**/usage.statistics.xml
34+
.idea/**/dictionaries
35+
.idea/**/shelf
36+
37+
# Generated files
38+
.idea/**/contentModel.xml
39+
40+
# Sensitive or high-churn files
41+
.idea/**/dataSources/
42+
.idea/**/dataSources.ids
43+
.idea/**/dataSources.local.xml
44+
.idea/**/sqlDataSources.xml
45+
.idea/**/dynamic.xml
46+
.idea/**/uiDesigner.xml
47+
.idea/**/dbnavigator.xml
48+
49+
# Gradle
50+
.idea/**/gradle.xml
51+
.idea/**/libraries
52+
53+
# Gradle and Maven with auto-import
54+
# When using Gradle or Maven with auto-import, you should exclude module files,
55+
# since they will be recreated, and may cause churn. Uncomment if using
56+
# auto-import.
57+
# .idea/artifacts
58+
# .idea/compiler.xml
59+
# .idea/jarRepositories.xml
60+
# .idea/modules.xml
61+
# .idea/*.iml
62+
# .idea/modules
63+
# *.iml
64+
# *.ipr
65+
66+
# CMake
67+
cmake-build-*/
68+
69+
# Mongo Explorer plugin
70+
.idea/**/mongoSettings.xml
71+
72+
# File-based project format
73+
*.iws
74+
75+
# IntelliJ
76+
out/
77+
78+
# mpeltonen/sbt-idea plugin
79+
.idea_modules/
80+
81+
# JIRA plugin
82+
atlassian-ide-plugin.xml
83+
84+
# Cursive Clojure plugin
85+
.idea/replstate.xml
86+
87+
# Crashlytics plugin (for Android Studio and IntelliJ)
88+
com_crashlytics_export_strings.xml
89+
crashlytics.properties
90+
crashlytics-build.properties
91+
fabric.properties
92+
93+
# Editor-based Rest Client
94+
.idea/httpRequests
95+
96+
# Android studio 3.1+ serialized cache file
97+
.idea/caches/build_file_checksums.ser
98+
99+
### Intellij+all Patch ###
100+
# Ignores the whole .idea folder and all .iml files
101+
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
102+
103+
.idea/
104+
105+
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
106+
107+
*.iml
108+
modules.xml
109+
.idea/misc.xml
110+
*.ipr
111+
112+
# Sonarlint plugin
113+
.idea/sonarlint
114+
115+
### vscode ###
116+
.vscode/*
117+
!.vscode/settings.json
118+
!.vscode/tasks.json
119+
!.vscode/launch.json
120+
!.vscode/extensions.json
121+
*.code-workspace
122+
123+
# End of https://www.toptal.com/developers/gitignore/api/go,intellij+all,vscode

.goreleaser.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
before:
2+
builds:
3+
- env:
4+
- CGO_ENABLED=0
5+
ldflags:
6+
- -s -w
7+
goos:
8+
- linux
9+
- windows
10+
- darwin
11+
goarch:
12+
- 386
13+
- amd64
14+
- arm
15+
- arm64
16+
goarm:
17+
- 6
18+
- 7
19+
archives:
20+
- format: binary
21+
checksum:
22+
name_template: "checksums.txt"

.releaserc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"branches": [
3+
{
4+
"name": "master"
5+
},
6+
{
7+
"name": "develop",
8+
"prerelease": true
9+
}
10+
],
11+
"plugins": [
12+
"@semantic-release/commit-analyzer",
13+
"@semantic-release/release-notes-generator",
14+
[
15+
"@semantic-release/github",
16+
{
17+
"successComment": false,
18+
"failComment": false
19+
}
20+
]
21+
]
22+
}

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# iOS Signer Builder
2+
3+
This is a free and simple builder server for [ios-signer-service](https://github.com/SignTools/ios-signer-service). This project is the self-hosted alternative of [ios-signer-ci](https://github.com/SignTools/ios-signer-ci) - instead of using a Continuous Integration (CI) provider, this server turns one of your very own Macs into a builder used to pull, sign, and upload any iOS apps to your `ios-signer-service`.
4+
5+
You only need to configure one builder. If you already configured a CI provider as your builder, you don't need to do anything here. This project is aimed at people who want to have a self-hosted builder.
6+
7+
## Setup
8+
9+
All the steps should be performed on your builder Mac.
10+
11+
1. Install the following dependencies:
12+
- [Xcode](https://developer.apple.com/xcode/)
13+
- curl
14+
- p7zip (optional, but recommended)
15+
2. Download the correct [binary release](https://github.com/SignTools/ios-signer-builder/releases)
16+
3. Make the binary executable by running: `chmod +x ios-signer-builder`. Replace the name with the file that you just downloaded
17+
4. Download the archive of `ios-signer-ci` and extract it in the same folder as the binary from the previous step. These will be your **signing files**. The whole step can be accomplished with the following commands:
18+
```bash
19+
curl -sL https://github.com/SignTools/ios-signer-ci/archive/master.zip -o master.zip
20+
unzip master.zip
21+
rm master.zip
22+
```
23+
24+
Important:
25+
26+
> :warning: **Remember to update the signing files from above every time that you update the signing service. Otherwise you may experience random issues.**
27+
28+
This server requires the use of an authentication key so that only the web service can control your builder. However, there is no built-in support for HTTPS or any other form of encryption. Therefore:
29+
30+
> :warning: **Anybody with access to the builder's network can potentially manipulate the builder to execute any code that they want on your machine.**
31+
32+
To prevent this, only deploy this server in a trusted environment, or even better, wrap the server in HTTPS yourself using a reverse proxy like nginx.
33+
34+
The authentication key has to be at least 8 characters long. Note it down - you will need to put it in your `ios-signer-service`'s configuration file later on.
35+
36+
## Running
37+
38+
When starting the server, you will want to use the same auth key and signing files from above and pass them as arguments:
39+
40+
```bash
41+
./ios-signer-builder -key "SOME_SECRET_KEY" -files "ios-signer-ci-master"
42+
```
43+
44+
The first time you run the server, you will have to [allow](https://www.macworld.co.uk/how-to/mac-app-unidentified-developer-3669596/) the unrecognized binary to run on your machine. After that it will run with no interruptions.
45+
46+
Additionally, the first time you attempt to sign an app using a developer account, macOS will ask you to grant permission for UI automation. You need to grant this permission or signing can't work. The prompt may break the current signing process, so just re-upload the app on the web service once more - it will work the next time.
47+
48+
For reference, these all of the arguments that will be used:
49+
50+
```bash
51+
-files string
52+
Path to directory whose files will be included in each sign job. Should at least contain a signer script 'sign.sh'
53+
-host string
54+
Listen host, empty for all
55+
-key string
56+
Auth key the web service must use to talk to this server
57+
-port uint
58+
Listen port (default 8090)
59+
-timeout uint
60+
Job timeout in minutes (default 15)
61+
```
62+
63+
You can always print them by running with `-help`.

go.mod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module ios-signer-builder
2+
3+
go 1.16
4+
5+
require (
6+
github.com/davecgh/go-spew v1.1.1 // indirect
7+
github.com/google/uuid v1.2.0
8+
github.com/labstack/echo/v4 v4.2.1
9+
github.com/otiai10/copy v1.5.0 // indirect
10+
github.com/pkg/errors v0.9.1
11+
)

0 commit comments

Comments
 (0)