feature/read-env-vars #1
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,3 @@
|
||||
node_modules/
|
||||
web-ext-artifacts/
|
||||
*.swp
|
||||
package.json
|
||||
package-lock.json
|
||||
|
||||
@@ -2,7 +2,7 @@ const fplay = require("./lib/fplay.js");
|
||||
|
||||
var port = 3030;
|
||||
var timeout = 30000;
|
||||
var password = "cnc";
|
||||
var password = process.env.FOURPLAY_PASSWORD || "cnc";
|
||||
|
||||
fplay.event.on("server_ready", function(){
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
const http = require("http");
|
||||
const { WebSocketServer } = require("ws");
|
||||
|
||||
const {FOURPLAY_PORT = 3000, FOURPLAY_COMMAND_TIMEOUT = 5000, FOURPLAY_PASSWORD = "cnc"} = process.env;
|
||||
|
||||
var fplay = {};
|
||||
|
||||
fplay.PORT = 3030;
|
||||
fplay.COMMAND_TIMEOUT = 5000;
|
||||
fplay.PASSWORD = "cnc";
|
||||
fplay.PORT = FOURPLAY_PORT;
|
||||
fplay.COMMAND_TIMEOUT = FOURPLAY_COMMAND_TIMEOUT;
|
||||
fplay.PASSWORD = FOURPLAY_PASSWORD;
|
||||
|
||||
const { EventEmitter } = require("events");
|
||||
fplay.event = new EventEmitter();
|
||||
@@ -558,4 +560,8 @@ fplay.init = function(port = 3030, password = "cnc", command_timeout = 5000){
|
||||
});
|
||||
}
|
||||
|
||||
process.on('SIGINT', function() {
|
||||
process.exit();
|
||||
});
|
||||
|
||||
module.exports = fplay;
|
||||
|
||||
37
server/package-lock.json
generated
Normal file
37
server/package-lock.json
generated
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@lawlers/4play",
|
||||
"version": "1.2.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@lawlers/4play",
|
||||
"version": "1.2.5",
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"ws": "^8.21.1"
|
||||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.21.2",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.21.2.tgz",
|
||||
"integrity": "sha512-54dMVAo4WIe6SKy3vBgN+9bJZqqQ8IMRevAkOLQALhi49qkkQDQfWdAZ8KQlXiEabw88ARXXdUrlvtbKQX+aKw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"utf-8-validate": ">=5.0.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bufferutil": {
|
||||
"optional": true
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
29
server/package.json
Normal file
29
server/package.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "@lawlers/4play",
|
||||
"version": "1.2.5",
|
||||
"description": "4play and dominate",
|
||||
"keywords": [
|
||||
"4play",
|
||||
"fplay",
|
||||
"foreplay",
|
||||
"browser-automation",
|
||||
"puppeteer",
|
||||
"selenium",
|
||||
"playwright",
|
||||
"firefox"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.lolcat.ca/lolcat/4play"
|
||||
},
|
||||
"license": "AGPL-3.0-only",
|
||||
"author": "lolcat",
|
||||
"type": "commonjs",
|
||||
"main": "fplay.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"ws": "^8.21.1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user