From fc58a5db0affe17fb2324d75d8a45d4b608d6c5a Mon Sep 17 00:00:00 2001 From: Faye Date: Wed, 21 Jul 2021 00:58:36 +0200 Subject: [PATCH 1/3] Update egg-discord-js-generic.json This pr removes some useless code and removes the --production on npm install, as discord often uses -dev packages and removes confusion. Makes it generally more simple for people to run bots without having to figure out to remove the --production (not needed for bots) --- bots/discord/discord.js/egg-discord-js-generic.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bots/discord/discord.js/egg-discord-js-generic.json b/bots/discord/discord.js/egg-discord-js-generic.json index 4753aa92..59c89f33 100644 --- a/bots/discord/discord.js/egg-discord-js-generic.json +++ b/bots/discord/discord.js/egg-discord-js-generic.json @@ -17,7 +17,7 @@ "quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-10" ], "file_denylist": [], - "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${NODE_PACKAGES} ]]; then \/usr\/local\/bin\/npm install ${NODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then \/usr\/local\/bin\/npm install --production; fi; \/usr\/local\/bin\/node \/home\/container\/{{BOT_JS_FILE}}", + "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${NODE_PACKAGES} ]]; then npm install ${NODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then npm install; fi; node \/home\/container\/{{BOT_JS_FILE}}", "config": { "files": "{}", "startup": "{\r\n \"done\": \"change this part\"\r\n}", @@ -105,4 +105,4 @@ "rules": "nullable|string" } ] -} \ No newline at end of file +} From 92227201f52dc489418541a5c4fa6066777173dd Mon Sep 17 00:00:00 2001 From: Faye Date: Wed, 21 Jul 2021 01:29:09 +0200 Subject: [PATCH 2/3] Update egg-discord-js-generic.json --- bots/discord/discord.js/egg-discord-js-generic.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bots/discord/discord.js/egg-discord-js-generic.json b/bots/discord/discord.js/egg-discord-js-generic.json index 59c89f33..b2849414 100644 --- a/bots/discord/discord.js/egg-discord-js-generic.json +++ b/bots/discord/discord.js/egg-discord-js-generic.json @@ -17,7 +17,7 @@ "quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-10" ], "file_denylist": [], - "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${NODE_PACKAGES} ]]; then npm install ${NODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then npm install; fi; node \/home\/container\/{{BOT_JS_FILE}}", + "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${NODE_PACKAGES} ]]; then \/usr\/local\/bin\/npm install ${NODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then \/usr\/local\/bin\/npm install; fi; \/usr\/local\/bin\/node \/home\/container\/{{BOT_JS_FILE}}", "config": { "files": "{}", "startup": "{\r\n \"done\": \"change this part\"\r\n}", From 0bad8ec5f2b17e6768fd636fb807c76a6d827cde Mon Sep 17 00:00:00 2001 From: Faye Date: Wed, 21 Jul 2021 01:38:10 +0200 Subject: [PATCH 3/3] Update egg-discord-js-generic.json Added uninstall node packages + startup for it --- bots/discord/discord.js/egg-discord-js-generic.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bots/discord/discord.js/egg-discord-js-generic.json b/bots/discord/discord.js/egg-discord-js-generic.json index b2849414..8b3e9d7b 100644 --- a/bots/discord/discord.js/egg-discord-js-generic.json +++ b/bots/discord/discord.js/egg-discord-js-generic.json @@ -17,7 +17,7 @@ "quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-10" ], "file_denylist": [], - "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${NODE_PACKAGES} ]]; then \/usr\/local\/bin\/npm install ${NODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then \/usr\/local\/bin\/npm install; fi; \/usr\/local\/bin\/node \/home\/container\/{{BOT_JS_FILE}}", + "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${NODE_PACKAGES} ]]; then \/usr\/local\/bin\/npm install ${NODE_PACKAGES}; fi; if [[ ! -z ${UNNODE_PACKAGES} ]]; then \/usr\/local\/bin\/npm uninstall ${UNNODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then \/usr\/local\/bin\/npm install; fi; \/usr\/local\/bin\/node \/home\/container\/{{BOT_JS_FILE}}", "config": { "files": "{}", "startup": "{\r\n \"done\": \"change this part\"\r\n}", @@ -86,6 +86,15 @@ "user_editable": true, "rules": "nullable|string" }, + { + "name": "Uninstall Node packages", + "description": "Uninstall node packages.\r\n\r\nUse spaces to separate.", + "env_variable": "UNNODE_PACKAGES", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, { "name": "Git Username", "description": "Username to auth with git.",