mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 23:41:42 +00:00
29 lines
875 B
JavaScript
29 lines
875 B
JavaScript
////////////////////////////////////////////////////////////////////////
|
|
// Cloudflare API
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
var SHELL = require("lib/shell");
|
|
var SYS = require("lib/system");
|
|
|
|
exports.VERSIONINFO = "Cloudflare Lib (cloudflare.js) version 0.1";
|
|
exports.global = global;
|
|
exports.require = global.require;
|
|
|
|
var arch = SYS.getArch();
|
|
if(arch.indexOf("64") > -1) {
|
|
exports.binPath = "bin/cloudflared-stable-windows-amd64/cloudflared";
|
|
} else {
|
|
exports.binPath = "bin/cloudflared-stable-windows-386/cloudflared";
|
|
}
|
|
|
|
// TODO: https://developers.cloudflare.com/access/rdp/rdp-guide/
|
|
|
|
exports.installService = function() {
|
|
var commandOptions = [];
|
|
commandOptions.push(exports.binPath);
|
|
commandOptions.push("service");
|
|
commandOptions.push("install");
|
|
|
|
return SHELL.exec(commandOptions.join(' '));
|
|
};
|