1 | <p align="center">
|
2 | <a href="https://github.com/geekdada/yasd">
|
3 | <img width="300" src="https://raw.githubusercontent.com/geekdada/yasd/master/public/github-banner.png" alt="logo">
|
4 | </a>
|
5 | </p>
|
6 |
|
7 | # yasd-helper
|
8 |
|
9 | [![NPM version][npm-image]][npm-url]
|
10 | [![TAONPM version][taonpm-image]][taonpm-url]
|
11 | ![Nodejs][nodejs-version]
|
12 | [![David deps][david-image]][david-url]
|
13 | [![Known Vulnerabilities][snyk-image]][snyk-url]
|
14 | [![npm download][download-image]][download-url]
|
15 | [![install size](https://packagephobia.now.sh/badge?p=yasd-helper)](https://packagephobia.now.sh/result?p=yasd-helper)
|
16 |
|
17 | [npm-image]: https://img.shields.io/npm/v/yasd-helper.svg?style=flat-square
|
18 | [npm-url]: https://npmjs.org/package/yasd-helper
|
19 | [david-image]: https://img.shields.io/david/geekdada/yasd-helper.svg?style=flat-square
|
20 | [david-url]: https://david-dm.org/geekdada/yasd-helper
|
21 | [snyk-image]: https://snyk.io/test/npm/yasd-helper/badge.svg?style=flat-square
|
22 | [snyk-url]: https://snyk.io/test/npm/yasd-helper
|
23 | [download-image]: https://img.shields.io/npm/dm/yasd-helper.svg?style=flat-square
|
24 | [download-url]: https://npmjs.org/package/yasd-helper
|
25 | [taonpm-image]: https://npm.taobao.org/badge/v/yasd-helper.svg
|
26 | [taonpm-url]: https://npm.taobao.org/package/yasd-helper
|
27 | [nodejs-version]: https://img.shields.io/node/v/yasd-helper
|
28 |
|
29 | [中文](/README_zh-CN.md) | [English](/README.md)
|
30 |
|
31 | Surge only provides HTTP API to its users at the moment, crippling the possibility of using the PWA version of YASD. yasd-helper's goal is to expose HTTPS endpoints to Surge.
|
32 |
|
33 | ## Installation
|
34 |
|
35 | Before installing yasd-helper, you need to make sure your environment already has Node.js installed (>=12.0.0).
|
36 |
|
37 | ```bash
|
38 | $ npm install yasd-helper -g
|
39 | ```
|
40 |
|
41 | ## Usage
|
42 |
|
43 | yasd-helper uses the existing CA certificate generated by Surge to issue new certificates, so please make sure your Surge config has a valid MITM certificate, and your operating system has trusted the certificate. As long as the CA certificate is trusted by the operating system, you won't be prompted to trust any new certificates issued by it.
|
44 |
|
45 | ![](assets/surge-mitm.png)
|
46 |
|
47 | ```bash
|
48 | $ yasd-helper start --surge /path/to/surge.conf --host 192.168.1.2.nip.io
|
49 | ```
|
50 |
|
51 | 1. [nip.io](nip.io) gives you a domain based on the IP address. `192.168.1.2.nip.io` will be resolved to `192.168.1.2` where yasd-helper is going to be running at.
|
52 | 2. yasd-helper only exposes HTTPS endpoints at `https://192.168.1.2.nip.io`.
|
53 | 3. You can make it accessible outside your intranet, just to use the DDNS domain as `host`. yasd-helper will make sure only the responses from Surge API get passed.
|
54 | 4. You can use only one yasd-helper to access as many Surge instances as possible, as long as they are on the same intranet.
|
55 |
|
56 | ## Daemonize
|
57 |
|
58 | ### macOS LaunchAgent
|
59 |
|
60 | TBD
|
61 |
|
62 | ### PM2
|
63 |
|
64 | TBD
|