2020-07-25 08:49:30 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Cloudflare API
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
var SHELL = require("lib/shell");
|
2020-07-25 09:24:10 +00:00
|
|
|
var SYS = require("lib/system");
|
2020-07-25 08:49:30 +00:00
|
|
|
|
|
|
|
exports.VERSIONINFO = "Cloudflare Lib (cloudflare.js) version 0.1";
|
|
|
|
exports.global = global;
|
|
|
|
exports.require = global.require;
|
|
|
|
|
2020-07-25 09:24:10 +00:00
|
|
|
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";
|
|
|
|
}
|
2020-07-25 08:49:30 +00:00
|
|
|
|
|
|
|
// TODO: https://developers.cloudflare.com/access/rdp/rdp-guide/
|
|
|
|
|
|
|
|
exports.installService = function() {
|
2020-07-26 11:40:25 +00:00
|
|
|
return SHELL.exec([
|
|
|
|
exports.binPath,
|
|
|
|
"service",
|
|
|
|
"install"
|
|
|
|
]);
|
2020-07-25 08:49:30 +00:00
|
|
|
};
|