Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b00e4ef
BREAKING CHANGE(appcd-default-plugins): Switched to installing defaul…
cb1kenobi Jun 27, 2019
8e6dc98
fix(appcd-default-plugins): Fixed spawning lerna on Windows.
cb1kenobi Jun 27, 2019
f72734b
fix(appcd-default-plugins): Fixed spawning lerna on Windows again.
cb1kenobi Jun 27, 2019
f9c2edb
feat: Attempt to install plugins postinstall and optionally at runtime.
cb1kenobi Jul 2, 2019
f7b0363
chore: Async cleanup.
cb1kenobi Jul 2, 2019
bd4228a
fix: Switched from appcd-logger to snooplogg to fix chicken and egg p…
cb1kenobi Jul 2, 2019
7e377ce
fix: Wrapped the entire postinstall script in a try/catch since it co…
cb1kenobi Jul 2, 2019
777069c
fix(appcd-default-plugins): Fixed yarn link dir for Windows.
cb1kenobi Jul 2, 2019
b4de7df
feat(appcd-default-plugins): Only install plugins compatible with cur…
cb1kenobi Jul 4, 2019
991e204
Merge branch 'DAEMON-280' of github.com:cb1kenobi/appc-daemon into DA…
cb1kenobi Jul 4, 2019
f9eae95
fix(appcd-default-plugins): Fixed plugin platform check.
cb1kenobi Jul 4, 2019
59306b0
chore: Updated npm deps.
cb1kenobi Jul 10, 2019
acea60a
feat: Added initial work of the registry watcher.
cb1kenobi Jul 11, 2019
0fbe06c
More work on the RegistryWatcher.
cb1kenobi Jul 11, 2019
f9103ca
feat(appcd-detect): Added ability to recursively watch registry keys …
cb1kenobi Aug 6, 2019
695d24e
chore: Updated deps.
cb1kenobi Aug 6, 2019
6c00a5e
Merge branch 'master' into DAEMON-280
cb1kenobi Aug 7, 2019
6abf3b1
chore(core): Updated changelog.
cb1kenobi Aug 7, 2019
7822b08
BREAKING CHANGE(util): Bumped minimum supported Node.js version from …
cb1kenobi Aug 7, 2019
64bc8ca
fix(telemetry): Fixed shutdown bug and failed send handling.
cb1kenobi Aug 7, 2019
61fa709
chore: chore: Bumped Node.js version from 10.15.3 to 10.16.2.
cb1kenobi Aug 7, 2019
501bf1c
docs: Updated config related docs.
cb1kenobi Aug 7, 2019
5e65c93
fix(detect): Fixed bug referencing subkeys state if not initialized.
cb1kenobi Aug 7, 2019
436637b
chore(docs): Updated config docs and added config settings doc.
cb1kenobi Aug 8, 2019
b0e16d3
chore(docs): Fixed type.
cb1kenobi Aug 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions docs/Clients/WebSocket.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,18 @@ the WebSocket client disconnects.

### Web Browser Call Example

> Note: The following example requires msgpack. Either download it or reference it via the CDN:
> ## `msgpack` required
>
> The following example requires msgpack. Either download it via `npm install msgpack-lite` or
> reference it via the CDN:
>
> `<script src="https://cdnjs.cloudflare.com/ajax/libs/msgpack-lite/0.1.26/msgpack.min.js"></script>`
>
> For development, you may reference it directly from GitHub:
>
> `<script src="https://rawgit.com/kawanet/msgpack-lite/master/dist/msgpack.min.js"></script>`

```javascript
```js
const ws = new WebSocket('ws://127.0.0.1:1732');
ws.binaryType = 'arraybuffer';

Expand All @@ -125,7 +132,7 @@ ws.onmessage = evt => {
This example uses the [ws](https://www.npmjs.com/package/ws) and
[msgpack-lite](https://www.npmjs.com/package/msgpack-lite) packages.

```javascript
```js
const msgpack = require('msgpack-lite');
const util = require('util');
const WebSocket = require('ws');
Expand All @@ -145,7 +152,7 @@ const ws = new WebSocket('ws://127.0.0.1:1732', {

### Node.js Subscribe Example

```javascript
```js
const msgpack = require('msgpack-lite');
const util = require('util');
const WebSocket = require('ws');
Expand Down
86 changes: 86 additions & 0 deletions docs/Components/Configuration-System.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,92 @@

## Configuration System

The Appc Daemon contains a default configuration file located inside the `appcd-core` package.
User-defined config settings are stored in `~/.appcelerator/appcd/config.json`.

## Usage

The daemon configuration can be accessed via the CLI, WebSocket (external), appcd client
(external), or programmatically (internal).

### Actions

* `ls`, `list` - Display all config settings.
* `get` - Display a specific setting.
* `set` - Sets a config setting and saves it in the user-defined config file.
* `rm`, `delete` - Remove a config setting.
* `push` - Add a value to the end of a list.
* `pop` - Remove the last value in a list.

### `appcd config` CLI command

```sh
# show the help screen
$ appcd config
$ appcd config -h
$ appcd config --help

$ appcd config [options] <action> [<key>] [<value>]
```

Refer to the [config command](Commands/config.md) page for more information.

### Config Service via `appcd` CLI

```sh
$ appcd exec /appcd/config

$ appcd exec /appcd/config/{action}
```

### `appcd-client` for Node.js

```js
import Client from 'appcd-client';

new Client()
.request({
path: '/appcd/config'
})
.on('response', (message, response) => {
console.log(message);
process.exit(0);
})
.once('close', () => process.exit(0))
.once('error', err => {
console.error(err.message);
process.exit(1);
});
```

### WebSocket Client

HTML:

```html
<script src="https://rawgit.com/kawanet/msgpack-lite/master/dist/msgpack.min.js"></script>
```

JavaScript:

```js
const ws = new WebSocket('ws://127.0.0.1:1732');
ws.binaryType = 'arraybuffer';

ws.onopen = () => ws.send(JSON.stringify({
version: '1.0',
path: '/appcd/config',
id: Date.now()
}));

ws.onmessage = evt => {
const status = msgpack.decode(new Uint8Array(evt.data)).message;
console.info(status);
};
```

## Implementation

The Appc Daemon config system is implemented in the `appcd-config` package. It supports both `.js`
`.json` config files.

Expand Down
72 changes: 72 additions & 0 deletions docs/Configuration-Settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# ![Appc Daemon logo](images/appc-daemon.png) Daemon Project

## Configuration Settings

> For information about the implementation details of the config system, please refer to the
> [configuration system](Components/Configuration-System.md) page.

### Appc Daemon Settings

| Name | Type | Default | Scope | Requires Restart | Description |
| ---------------------------------- | -------------- | ------------------------------------ | ------------------------------------------ | ---------------- | ----------- |
| `core.enforceNodeVersion` | Boolean | `true` | appcd-nodejs (via appcd) | Yes | When `true`, enforces the Node.js version required by the core. If the required Node.js version is not installed, then the required version is downloaded. When `false`, it will use the current Node.js version which may be incompatible with the core. |
| `core.v8.memory` | String, Number | `"auto"` | appcd-nodejs (via appcd) | Yes | The maximum amount of memory the spawned appcd core process should allocate. The value must either be the number of megabytes or the string `"auto"`, which will automatically select a sensible size based on the system architecture and installed memory. |
| `environment.name` | String | `"prod"` | appcd-core | Yes | Shorthand environment name used for loading the environment-specific config file. This value is sent in the `ti.start` telemetry data payload. This value is not the same as the `telemetry.environment`. |
| `environment.title` | String | `"production"` | appcd-core | Yes | Title for the environment used in debug logging when the daemon starts. |
| `home` | String | `"~/.appcelerator/appcd"` | appcd, appcd-core, appcd-config-service, appcd-subprocess | | Yes | The path to the `appcd` home directory containing user-defined config files and plugins. |
| `network.agentOptions` | Object | `null` | appcd-request | No | Additional agent options to pass directly into `request`. |
| `network.caFile` | String | `null` | appcd-request | No | Path to a pem file containing one or more certificate authorities. Note that the `APPCD_NETWORK_CA_FILE` environment variable overrides this value. |
| `network.certFile` | String | `null` | appcd-request | No | Path to a cert file. |
| `network.httpProxy` | String | `null` | appcd-request | No | The proxy URL to use for outgoing HTTP network requests. Note that the `APPCD_NETWORK_PROXY` environment variable overrides this value. |
| `network.httpsProxy` | String | `null` | appcd-request | No | The secure proxy URL to use for outgoing HTTPS network requests. Note that the `APPCD_NETWORK_PROXY` environment variable overrides this value. |
| `network.keyFile` | String | `null` | appcd-request | No | Path to a private key file. |
| `network.passphrase` | String | `null` | appcd-request | No | The private key's passphrase. |
| `network.strictSSL` | Boolean | `true` | appcd-request | No | Enforces SSL certificates to be valid. Note that the `APPCD_NETWORK_STRICT_SSL` environment variable overrides this value. |
| `plugins.autoReload` | Boolean | `true` | appcd-plugin | No | Stops `external` plugins when one of its files is changed. |
| `plugins.defaultInactivityTimeout` | Number | `60 * 60 * 1000` (1 hour) | appcd-plugin | No | The default number of milliseconds of inactivity before an `external` plugin is deactivated. |
| `server.agentPollInterval` | Number | `1000` | appcd-agent (via appcd-core, appcd-plugin) | No | The number of milliseconds to have the agents poll for system health. |
| `server.daemonize` | Boolean | `true` | appcd | Yes | Launches the server as a background process. |
| `server.group` | String, Number | `null` | appcd-core | Yes | The group to switch to when the daemon is started as root on a POSIX system. |
| `server.hostname` | String | `"127.0.0.1"` | appcd-core | Yes | The hostname or IP address to listen on. |
| `server.nodejsMaxUnusedAge` | Number | `90 * 24 * 60 * 60 * 1000` (90 days) | appcd-core | Yes | The max age in milliseconds an unused Node.js executable should be kept before it's purged. |
| `server.pidFile` | String | `"~/.appcelerator/appcd/appcd.pid"` | appcd-core | Yes | Path to the daemon's pid (process id) file. |
| `server.port` | Number | `1732` | appcd-core | Yes | The port to listen for incoming requests. |
| `server.user` | String | `null` | appcd-core | Yes | The user to switch to when the daemon is started as root on a POSIX system. |
| `telemetry.app` | String | `"<guid>"` | appcd-telemetry | No | The Appc Daemon app GUID to send with each event. |
| `telemetry.enabled` | Boolean | `true` | appcd-telemetry | No | Turns on telemetry recording and submitting. |
| `telemetry.environment` | String | `"production"` | appcd-telemetry | No | Deploy type for the analytics events. |
| `telemetry.eventsDir` | String | `"~/.appcelerator/appcd/telemetry"` | appcd-telemetry | No | The path store unsent telemetry events. |
| `telemetry.sendBatchSize` | Number | `10` | appcd-telemetry | No | The maximum number of events to send at a time. |
| `telemetry.sendInterval` | Number | `60000` | appcd-telemetry | No | The number of milliseconds to wait before checking if there are enough telemetry events to batch send. |
| `telemetry.sendTimeout` | Number | `60000` | appcd-telemetry | No | The number of milliseconds to wait before timing out sending telementry events. |
| `telemetry.url` | String | `"<url>"` | appcd-telemetry | No | The URL to send the telemetry events to. |

### Titanium Settings

| Name | Type | Default | Scope | Requires Restart | Description |
| ---------------------------------- | ------------- | ------------------------------------------------ | -------------------------------------- | ---------------- | ----------- |
| `android.adb.install.timeout` | Number | `null` | androidlib (via @appcd/plugin-android) | No | The number of milliseconds to wait before installing an app times out. |
| `android.adb.port` | Number | `null` | androidlib (via @appcd/plugin-android) | No | The port to connect to ADB. |
| `android.adb.start.retryInterval` | Number | `null` | androidlib (via @appcd/plugin-android) | No | The number of milliseconds to wait before retrying to start ADB. |
| `android.adb.start.timeout` | Number | `null` | androidlib (via @appcd/plugin-android) | No | The number of milliseconds to wait before starting ADB times out. |
| `android.avd.path` | String | `null` | androidlib (via @appcd/plugin-android) | No | The path to where AVDs are stored. |
| `android.emulator.start.timeout` | Number | `null` | androidlib (via @appcd/plugin-android) | No | The number of milliseconds to wait before starting the Android emulator times out. |
| `android.env.path` | String | `null` | androidlib (via @appcd/plugin-android) | No | An override for the `PATH` environment variable for androidlib's ADB detection. |
| `android.executables.adb` | String | `null` | androidlib (via @appcd/plugin-android) | No | The path to the ADB executable. |
| `android.genymotion.searchPaths` | Array[String] | `null` | androidlib (via @appcd/plugin-android) | No | A list of paths to search for Genymotion. |
| `android.ndk.searchPaths` | Array[String] | `null` | @appcd/plugin-android, androidlib | No | A list of paths to search for Android NDKs. |
| `android.sdk.searchPaths` | Array[String] | `null` | @appcd/plugin-android, androidlib | No | A list of paths to search for Android SDKs. |
| `android.virtualbox.configFile` | String | `null` | @appcd/plugin-android, androidlib | No | The path to VirtualBox's XML config file. |
| `android.virtualbox.searchPaths` | Array[String] | `null` | @appcd/plugin-android, androidlib | No | A list of paths to search for VirtualBox. |
| `ios.env.path` | String | `null` | ioslib (via @appcd/plugin-ios) | No | An override for the `PATH` environment variable for ioslib's `xcode-select` detection. |
| `ios.executables.security` | String | `null` | ioslib (via @appcd/plugin-ios) | No | Path to the `security` executable. |
| `ios.executables.xcodeSelect` | String | `null` | ioslib (via @appcd/plugin-ios) | No | Path to the `xcode-select` executable. |
| `ios.provisioning.path` | String | `"~/Library/MobileDevice/Provisioning Profiles"` | ioslib (via @appcd/plugin-ios) | No | The path to the provisioning profiles directory. |
| `ios.simulator.devicesDir` | String | `"~/Library/Developer/CoreSimulator/Devices"` | ioslib (via @appcd/plugin-ios) | No | The path to the directory containing the simulator device directories. |
| `ios.xcode.searchPaths` | String | `null` | ioslib (via @appcd/plugin-ios) | No | A list of paths to search for Xcode installations. |
| `java.searchPaths` | Array[String] | `null` | @appcd/plugin-jdk | No | A list of paths to search for JDKs. |
| `titanium.configImported` | Boolean | `undefined` | appcd | Yes | Indicates the legacy Titanium CLI config file has been imported. This includes Android, Genymotion, iOS, and Java settings. |
| `titanium.searchPaths` | Array[String] | `null` | @appcd/plugin-titanium | No | A list of paths to search for Titanium SDKs. |
| `windows.sdk.searchPaths` | Array[String] | `null` | @appcd/plugin-windows | No | A list of paths to search for Windows SDKs. |
| `windows.visualstudio.searchPaths` | Array[String] | `null` | @appcd/plugin-windows | No | A list of paths to search for Visual Studio installations. |
| `windows.vswhere.searchPaths` | Array[String] | `null` | @appcd/plugin-windows | No | A list of paths to search for the `vswhere.exe` utility. |
5 changes: 0 additions & 5 deletions docs/Configuration.md

This file was deleted.

6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ![Appc Daemon logo](images/appc-daemon.png) Daemon Project

appcd is the name of the npm package that contains the Appc Daemon bootstrap, command line interface
(CLI), core, and supporting packages.
_appcd_ is the name of the npm package that contains the Appc Daemon bootstrap, command line
interface (CLI), core, and supporting packages.

## Table of Contents

Expand All @@ -22,7 +22,7 @@ appcd is the name of the npm package that contains the Appc Daemon bootstrap, co
8. [Subprocess Manager](Components/Subprocess-Manager.md)
9. [Telemetry](Components/Telemetry.md)
10. [Web Server](Components/Web-Server.md)
8. [Configuration](Configuration.md)
8. [Configuration Settings](Configuration-Settings.md)
9. [Commands](Commands/README.md)
1. [config](Commands/config.md)
2. [dump](Commands/dump.md)
Expand Down
4 changes: 1 addition & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,7 @@ exports.ls = exports.list = async function listPackages() {
*/
exports.lint = series(cyclic, function lint() {
return gulp
.src([
path.join(__dirname, 'packages/*/gulpfile.js')
])
.src(path.join(__dirname, 'packages/*/gulpfile.js'))
.pipe(debug({ title: 'Linting project:' }))
.pipe(plumber())
.pipe(chug({ tasks: [ 'lint' ] }));
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"ansi-colors": "^4.0.1",
"ansi-colors": "^4.1.1",
"cli-table2": "^0.2.0",
"fs-extra": "^8.0.1",
"fs-extra": "^8.1.0",
"globule": "^1.2.1",
"gulp": "^4.0.2",
"gulp-chug": "^0.5.1",
Expand All @@ -15,13 +15,14 @@
"istanbul-lib-coverage": "^2.0.5",
"istanbul-lib-report": "^2.0.8",
"istanbul-reports": "^2.2.6",
"lerna": "^3.15.0",
"libnpm": "^2.0.1",
"lerna": "^3.16.4",
"libnpm": "^3.0.1",
"node-gyp": "^5.0.3",
"pretty-log": "^0.1.0",
"progress": "^2.0.3",
"promise-limit": "^2.7.0",
"retire": "^2.0.2",
"semver": "^6.1.2",
"retire": "^2.0.3",
"semver": "^6.3.0",
"sloc": "^0.2.1",
"toposort": "^2.0.2",
"tree-printer": "^1.1.1"
Expand Down
5 changes: 5 additions & 0 deletions packages/appcd-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v1.1.7

* chore: Fixed eslint `hasOwnProperty` warnings.
* chore: Updated dependencies.

# v1.1.6 (Jun 4, 2019)

* chore: Updated dependencies.
Expand Down
4 changes: 2 additions & 2 deletions packages/appcd-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"test": "gulp test"
},
"dependencies": {
"nanobuffer": "^1.1.4",
"source-map-support": "^0.5.12"
"nanobuffer": "^1.1.5",
"source-map-support": "^0.5.13"
},
"devDependencies": {
"appcd-gulp": "^2.1.1"
Expand Down
Loading