diff --git a/Dockerfile b/Dockerfile index 1b29680..187e2f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,28 @@ -FROM node:20 as builder +# syntax = docker/dockerfile:1 + +########## +FROM node:20 as base +LABEL fly_launch_runtime="Node.js" -RUN mkdir /app WORKDIR /app +ENV NODE_ENV="production" -COPY package.json package-lock.json ./ -RUN npm install +########## +FROM base as builder -COPY . . -RUN npm run build && rm -rf node_modules +COPY --link package.json package-lock.json ./ +RUN npm ci --include=dev -########## +COPY --link . . +RUN npm run build -FROM node:20 -LABEL fly_launch_runtime="nodejs" +RUN rm -rf node_modules -WORKDIR /app -ENV NODE_ENV production +########## +FROM base COPY --from=builder /app /app -RUN npm install +RUN npm ci +EXPOSE 8080 CMD [ "npm", "run", "start" ] diff --git a/README.md b/README.md index 03def4c..ba7764e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The main goals of this repo: 1. create a (simple, but capable) service/bot to monitor game servers 1. get gamedig & steam api server info (_eg.: server name, map, players, etc._) 1. relay real time server information to various channels via APIs (_eg.: discord, telegram, slack etc._) - 1. should be able to host on a free service (_target atm. is fly.io (node.js 18)_) + 1. should be able to host on a free service (_target atm. is fly.io (node.js 20)_) 1. graciously add more features based on community feedback via [discord ](https://discord.gg/4tsbftsGJz) and [github :octocat:](https://github.com/a-sync/game-server-watcher/discussions/new?category=ideas-requests) # Screenshots @@ -111,7 +111,8 @@ _The bot has no cleanup functionality, leftover messages must be removed manuall # Deployment Check the wiki page for detailed instructions on [how to setup a self deploying free cloud instance at fly.io](https://github.com/a-sync/game-server-watcher/wiki/Free-hosting-via-fly.io). -The latest Pterodactyl egg can always be found here: [🥚](https://raw.githubusercontent.com/a-sync/game-server-watcher/master/egg.json) +The latest Pterodactyl egg can always be found here: [🥚](https://raw.githubusercontent.com/a-sync/game-server-watcher/master/egg.json) +Pre-built container images can be downloaded from the github container registry: `docker pull ghcr.io/a-sync/game-server-watcher`
diff --git a/azuredeploy.json b/azuredeploy.json
index 1662b20..31ee543 100644
--- a/azuredeploy.json
+++ b/azuredeploy.json
@@ -84,7 +84,7 @@
"variables": {
"sku": "Basic",
"skuCode": "B1",
- "linuxFxVersion": "NODE|16-lts",
+ "linuxFxVersion": "NODE|18-lts",
"hostingPlanName": "[format('AppServicePlan-{0}', parameters('siteName'))]"
},
"resources": [
diff --git a/package-lock.json b/package-lock.json
index dc9744e..30bd3b3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "game-server-watcher",
- "version": "3.1.10",
+ "version": "3.1.11",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "game-server-watcher",
- "version": "3.1.10",
+ "version": "3.1.11",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@slack/bolt": "^3.17.1",
diff --git a/package.json b/package.json
index c8eebfc..4b56e3f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "game-server-watcher",
- "version": "3.1.10",
+ "version": "3.1.11",
"description": "A simple discord/telegram/slack bot that can be hosted on a free service to monitor your game servers and players in style. 😎",
"exports": "./dist/server.js",
"type": "module",
diff --git a/public/jsoneditor.js b/public/jsoneditor.js
index b43521b..f6a289c 100644
--- a/public/jsoneditor.js
+++ b/public/jsoneditor.js
@@ -1,2 +1,2 @@
/*! For license information please see jsoneditor.js.LICENSE.txt */
-!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(self,(()=>(()=>{var t={9662:(t,e,r)=>{var n=r(614),i=r(6330),o=TypeError;t.exports=function(t){if(n(t))return t;throw o(i(t)+" is not a function")}},9483:(t,e,r)=>{var n=r(4411),i=r(6330),o=TypeError;t.exports=function(t){if(n(t))return t;throw o(i(t)+" is not a constructor")}},6077:(t,e,r)=>{var n=r(614),i=String,o=TypeError;t.exports=function(t){if("object"==typeof t||n(t))return t;throw o("Can't set "+i(t)+" as a prototype")}},1223:(t,e,r)=>{var n=r(5112),i=r(30),o=r(3070).f,a=n("unscopables"),s=Array.prototype;null==s[a]&&o(s,a,{configurable:!0,value:i(null)}),t.exports=function(t){s[a][t]=!0}},1530:(t,e,r)=>{"use strict";var n=r(8710).charAt;t.exports=function(t,e,r){return e+(r?n(t,e).length:1)}},5787:(t,e,r)=>{var n=r(7976),i=TypeError;t.exports=function(t,e){if(n(e,t))return t;throw i("Incorrect invocation")}},9670:(t,e,r)=>{var n=r(111),i=String,o=TypeError;t.exports=function(t){if(n(t))return t;throw o(i(t)+" is not an object")}},8533:(t,e,r)=>{"use strict";var n=r(2092).forEach,i=r(9341)("forEach");t.exports=i?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},8457:(t,e,r)=>{"use strict";var n=r(9974),i=r(6916),o=r(7908),a=r(3411),s=r(7659),l=r(4411),c=r(6244),u=r(6135),h=r(4121),p=r(1246),d=Array;t.exports=function(t){var e=o(t),r=l(this),f=arguments.length,y=f>1?arguments[1]:void 0,m=void 0!==y;m&&(y=n(y,f>2?arguments[2]:void 0));var v,b,g,w,_,k,j=p(e),O=0;if(!j||this===d&&s(j))for(v=c(e),b=r?new this(v):d(v);v>O;O++)k=m?y(e[O],O):e[O],u(b,O,k);else for(_=(w=h(e,j)).next,b=r?new this:[];!(g=i(_,w)).done;O++)k=m?a(w,y,[g.value,O],!0):g.value,u(b,O,k);return b.length=O,b}},1318:(t,e,r)=>{var n=r(5656),i=r(1400),o=r(6244),a=function(t){return function(e,r,a){var s,l=n(e),c=o(l),u=i(a,c);if(t&&r!=r){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===r)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},2092:(t,e,r)=>{var n=r(9974),i=r(1702),o=r(8361),a=r(7908),s=r(6244),l=r(5417),c=i([].push),u=function(t){var e=1==t,r=2==t,i=3==t,u=4==t,h=6==t,p=7==t,d=5==t||h;return function(f,y,m,v){for(var b,g,w=a(f),_=o(w),k=n(y,m),j=s(_),O=0,x=v||l,C=e?x(f,j):r||p?x(f,0):void 0;j>O;O++)if((d||O in _)&&(g=k(b=_[O],O,w),t))if(e)C[O]=g;else if(g)switch(t){case 3:return!0;case 5:return b;case 6:return O;case 2:c(C,b)}else switch(t){case 4:return!1;case 7:c(C,b)}return h?-1:i||u?u:C}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},1194:(t,e,r)=>{var n=r(7293),i=r(5112),o=r(7392),a=i("species");t.exports=function(t){return o>=51||!n((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},9341:(t,e,r)=>{"use strict";var n=r(7293);t.exports=function(t,e){var r=[][t];return!!r&&n((function(){r.call(null,e||function(){return 1},1)}))}},3671:(t,e,r)=>{var n=r(9662),i=r(7908),o=r(8361),a=r(6244),s=TypeError,l=function(t){return function(e,r,l,c){n(r);var u=i(e),h=o(u),p=a(u),d=t?p-1:0,f=t?-1:1;if(l<2)for(;;){if(d in h){c=h[d],d+=f;break}if(d+=f,t?d<0:p<=d)throw s("Reduce of empty array with no initial value")}for(;t?d>=0:p>d;d+=f)d in h&&(c=r(c,h[d],d,u));return c}};t.exports={left:l(!1),right:l(!0)}},3658:(t,e,r)=>{"use strict";var n=r(9781),i=r(3157),o=TypeError,a=Object.getOwnPropertyDescriptor,s=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(i(t)&&!a(t,"length").writable)throw o("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},1589:(t,e,r)=>{var n=r(1400),i=r(6244),o=r(6135),a=Array,s=Math.max;t.exports=function(t,e,r){for(var l=i(t),c=n(e,l),u=n(void 0===r?l:r,l),h=a(s(u-c,0)),p=0;c{var n=r(1702);t.exports=n([].slice)},4362:(t,e,r)=>{var n=r(1589),i=Math.floor,o=function(t,e){var r=t.length,l=i(r/2);return r<8?a(t,e):s(t,o(n(t,0,l),e),o(n(t,l),e),e)},a=function(t,e){for(var r,n,i=t.length,o=1;o0;)t[n]=t[--n];n!==o++&&(t[n]=r)}return t},s=function(t,e,r,n){for(var i=e.length,o=r.length,a=0,s=0;a{var n=r(3157),i=r(4411),o=r(111),a=r(5112)("species"),s=Array;t.exports=function(t){var e;return n(t)&&(e=t.constructor,(i(e)&&(e===s||n(e.prototype))||o(e)&&null===(e=e[a]))&&(e=void 0)),void 0===e?s:e}},5417:(t,e,r)=>{var n=r(7475);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},3411:(t,e,r)=>{var n=r(9670),i=r(9212);t.exports=function(t,e,r,o){try{return o?e(n(r)[0],r[1]):e(r)}catch(e){i(t,"throw",e)}}},7072:(t,e,r)=>{var n=r(5112)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},t(o)}catch(t){}return r}},4326:(t,e,r)=>{var n=r(1702),i=n({}.toString),o=n("".slice);t.exports=function(t){return o(i(t),8,-1)}},648:(t,e,r)=>{var n=r(1694),i=r(614),o=r(4326),a=r(5112)("toStringTag"),s=Object,l="Arguments"==o(function(){return arguments}());t.exports=n?o:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=s(t),a))?r:l?o(e):"Object"==(n=o(e))&&i(e.callee)?"Arguments":n}},9920:(t,e,r)=>{var n=r(2597),i=r(3887),o=r(1236),a=r(3070);t.exports=function(t,e,r){for(var s=i(e),l=a.f,c=o.f,u=0;u {var n=r(4376),i=r(3517),o=r(34),a=r(8227)("species"),s=Array;t.exports=function(t){var e;return n(t)&&(e=t.constructor,(i(e)&&(e===s||n(e.prototype))||o(e)&&null===(e=e[a]))&&(e=void 0)),void 0===e?s:e}},1469:(t,e,r)=>{var n=r(7433);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},6319:(t,e,r)=>{var n=r(8551),i=r(9539);t.exports=function(t,e,r,o){try{return o?e(n(r)[0],r[1]):e(r)}catch(e){i(t,"throw",e)}}},4428:(t,e,r)=>{var n=r(8227)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){try{if(!e&&!i)return!1}catch(t){return!1}var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},t(o)}catch(t){}return r}},4576:(t,e,r)=>{var n=r(9504),i=n({}.toString),o=n("".slice);t.exports=function(t){return o(i(t),8,-1)}},6955:(t,e,r)=>{var n=r(2140),i=r(4901),o=r(4576),a=r(8227)("toStringTag"),s=Object,l="Arguments"===o(function(){return arguments}());t.exports=n?o:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=s(t),a))?r:l?o(e):"Object"===(n=o(e))&&i(e.callee)?"Arguments":n}},7740:(t,e,r)=>{var n=r(9297),i=r(5031),o=r(7347),a=r(4913);t.exports=function(t,e,r){for(var s=i(e),l=a.f,c=o.f,u=0;u
";var e=document.createElement("img");e.style.maxWidth="100%",e.style.maxHeight="100px",e.src=this.value,this.preview.appendChild(e)}}else this.preview.innerHTML="Invalid data URI"}}},{key:"enable",value:function(){this.always_disabled||(this.uploader&&(this.uploader.disabled=!1),vt(gt(a.prototype),"enable",this).call(this))}},{key:"disable",value:function(t){t&&(this.always_disabled=!0),this.uploader&&(this.uploader.disabled=!0),vt(gt(a.prototype),"disable",this).call(this)}},{key:"setValue",value:function(t){this.value!==t&&(this.schema.readOnly&&this.schema.enum&&!this.schema.enum.includes(t)?this.value=this.schema.enum[0]:this.value=t,this.input.value=this.value,this.refreshPreview(),this.onChange())}},{key:"destroy",value:function(){this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.uploader&&this.uploader.parentNode&&this.uploader.parentNode.removeChild(this.uploader),vt(gt(a.prototype),"destroy",this).call(this)}}])&&mt(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(w);function _t(t){return _t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(t)}function kt(t,e){for(var r=0;r".concat(i,"
"):"".concat(i,"
")}return"boolean"==typeof t?t?"true":"false":"string"==typeof t?t.replace(/&/g,"&").replace(/
Type: ").concat(t.type,"
Size: ").concat(t.formattedSize),n.appendChild(o),n.appendChild(e);var a=document.createElement("div");return a.style.clear="left",n.appendChild(a),n}},{key:"getProgressBar",value:function(){var t=document.createElement("progress");return t.setAttribute("max",100),t.setAttribute("value",0),t}},{key:"updateProgressBar",value:function(t,e){t&&t.setAttribute("value",e)}},{key:"updateProgressBarUnknown",value:function(t){t&&t.removeAttribute("value")}}],r&&no(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ao(t){return ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ao(t)}function so(t,e){for(var r=0;r'),r}},{key:"getTab",value:function(t,e){var r=document.createElement("a");return r.classList.add("btn","btn-secondary","btn-block"),r.setAttribute("href","#".concat(e)),r.appendChild(t),r}},{key:"getTopTab",value:function(t,e){var r=document.createElement("li");r.id=e,r.classList.add("tab-item");var n=document.createElement("a");return n.setAttribute("href","#".concat(e)),n.appendChild(t),r.appendChild(n),r}},{key:"markTabActive",value:function(t){t.tab.classList.add("active"),void 0!==t.rowPane?t.rowPane.style.display="":t.container.style.display=""}},{key:"markTabInactive",value:function(t){t.tab.classList.remove("active"),void 0!==t.rowPane?t.rowPane.style.display="none":t.container.style.display="none"}},{key:"afterInputReady",value:function(t){if("select"===t.localName)if(t.classList.contains("selectized")){var e=t.nextSibling;e&&(e.classList.remove("form-select"),Array.from(e.querySelectorAll(".form-select")).forEach((function(t){t.classList.remove("form-select")})))}else if(t.classList.contains("select2-hidden-accessible")){var r=t.nextSibling;r&&r.querySelector(".select2-selection--single")&&r.classList.add("form-select")}t.controlgroup||(t.controlgroup=this.closest(t,".form-group"),this.closest(t,".compact")&&(t.controlgroup.style.marginBottom=0))}},{key:"addInputError",value:function(t,e){t.controlgroup&&(t.controlgroup.classList.add("has-error"),t.errmsg||(t.errmsg=document.createElement("p"),t.errmsg.classList.add("form-input-hint"),t.controlgroup.appendChild(t.errmsg)),t.errmsg.classList.remove("d-hide"),t.errmsg.textContent=e,t.errmsg.setAttribute("role","alert"))}},{key:"removeInputError",value:function(t){t.errmsg&&(t.errmsg.classList.add("d-hide"),t.controlgroup.classList.remove("has-error"))}}])&&Go(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(oo);function Qo(t){return Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qo(t)}function Ko(t,e){for(var r=0;r
";var e=document.createElement("img");e.style.maxWidth="100%",e.style.maxHeight="100px",e.src=this.value,this.preview.appendChild(e)}}else this.preview.innerHTML="Invalid data URI"}}},{key:"enable",value:function(){this.always_disabled||(this.uploader&&(this.uploader.disabled=!1),Gt($t(e.prototype),"enable",this).call(this))}},{key:"disable",value:function(t){t&&(this.always_disabled=!0),this.uploader&&(this.uploader.disabled=!0),Gt($t(e.prototype),"disable",this).call(this)}},{key:"setValue",value:function(t){this.value!==t&&(this.schema.readOnly&&this.schema.enum&&!this.schema.enum.includes(t)?this.value=this.schema.enum[0]:this.value=t,this.input.value=this.value,this.refreshPreview(),this.onChange())}},{key:"destroy",value:function(){this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.uploader&&this.uploader.parentNode&&this.uploader.parentNode.removeChild(this.uploader),Gt($t(e.prototype),"destroy",this).call(this)}}])&&zt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(_);function Zt(t){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(t)}function Yt(t,e){for(var r=0;r".concat(i,"
"):"".concat(i,"
")}return"boolean"==typeof t?t?"true":"false":"string"==typeof t?t.replace(/&/g,"&").replace(/
Type: ").concat(t.type,"
Size: ").concat(t.formattedSize),n.appendChild(o),n.appendChild(e);var a=document.createElement("div");return a.style.clear="left",n.appendChild(a),n}},{key:"getProgressBar",value:function(){var t=document.createElement("progress");return t.setAttribute("max",100),t.setAttribute("value",0),t}},{key:"updateProgressBar",value:function(t,e){t&&t.setAttribute("value",e)}},{key:"updateProgressBarUnknown",value:function(t){t&&t.removeAttribute("value")}}],e&&fs(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function bs(t){return bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bs(t)}function gs(t,e){for(var r=0;r'),r}},{key:"getTab",value:function(t,e){var r=document.createElement("a");return r.classList.add("btn","btn-secondary","btn-block"),r.setAttribute("href","#".concat(e)),r.appendChild(t),r}},{key:"getTopTab",value:function(t,e){var r=document.createElement("li");r.id=e,r.classList.add("tab-item");var n=document.createElement("a");return n.setAttribute("href","#".concat(e)),n.appendChild(t),r.appendChild(n),r}},{key:"markTabActive",value:function(t){t.tab.classList.add("active"),void 0!==t.rowPane?t.rowPane.style.display="":t.container.style.display=""}},{key:"markTabInactive",value:function(t){t.tab.classList.remove("active"),void 0!==t.rowPane?t.rowPane.style.display="none":t.container.style.display="none"}},{key:"afterInputReady",value:function(t){if("select"===t.localName)if(t.classList.contains("selectized")){var e=t.nextSibling;e&&(e.classList.remove("form-select"),Array.from(e.querySelectorAll(".form-select")).forEach((function(t){t.classList.remove("form-select")})))}else if(t.classList.contains("select2-hidden-accessible")){var r=t.nextSibling;r&&r.querySelector(".select2-selection--single")&&r.classList.add("form-select")}t.controlgroup||(t.controlgroup=this.closest(t,".form-group"),this.closest(t,".compact")&&(t.controlgroup.style.marginBottom=0))}},{key:"addInputError",value:function(t,e){t.controlgroup&&(t.controlgroup.classList.add("has-error"),t.errmsg||(t.errmsg=document.createElement("p"),t.errmsg.classList.add("form-input-hint"),t.controlgroup.appendChild(t.errmsg)),t.errmsg.classList.remove("d-hide"),t.errmsg.textContent=e,t.errmsg.setAttribute("role","alert"))}},{key:"removeInputError",value:function(t){t.errmsg&&(t.errmsg.classList.add("d-hide"),t.controlgroup.classList.remove("has-error"))}}])&&wl(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(vs);function Pl(t){return Pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pl(t)}function Ll(t,e){for(var r=0;r