From b1647a310eede09952bba9cb4fb7adb4558711df Mon Sep 17 00:00:00 2001 From: LouisLam Date: Thu, 2 Sep 2021 22:37:51 +0800 Subject: [PATCH] add demo db --- db/demo_kuma.db | Bin 0 -> 65536 bytes package.json | 2 -- server/server.js | 8 ++++++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 db/demo_kuma.db diff --git a/db/demo_kuma.db b/db/demo_kuma.db new file mode 100644 index 0000000000000000000000000000000000000000..2042fcf2fefebb30173033c355b54244dfdb373f GIT binary patch literal 65536 zcmeI*&u`n-0S9o>v?Wui&0?u1blw(LNoQ-dY>JL-i^G7)GM%`wWyhAgB!(c+B5gB~ zD4C?}xJ3sz={jK8fZd1w0XywB6#Waf+fKtyyKaY_)&jj0=-#79n)HulDV84#zKm>B z?0l3YquU#oI6$$oa`2~oXNs}o-j zd_SGdvcIgm+IG`uwJprm-cZ*? ztL=(bx7idsw%O9`Bk_T8Bx+r^ZCVZ6Xc?9}k>V|_Wr**U*2_0b>*M)?lqJiwhHD-e z;{59BvRbN$y0N2mo35A-Vr zH=2fPq#Chf6yee#bF&qpr6Pt^XKO^e3;n>85Qo+>;6yG^>0x z?qCb8(J(r+);q4|cAZ9BH=O!?hcsH+sj{Hn5w|YhxHgnpt(+gAHa?URPga?FZ9?>x#FL=cvX?T4JeOstW0*+(mUGF>RJAN@Gmd)1>j zLGb9Zl)ty$k?h=(@!@F#f?jiNeQBk%epkGu-W7u$)Gv)-C(+<#nk3&Ho$$+31Yk>ZWM%&skch6nb8!*(ut|^F; zxb}LxydQ^OyHAQU2$?;eO?ZdEN2-@;GD2`oYuEpijAzwf`ZT%p_fHPbkqk&uHq5=a zSy{Thsruo_XrvoeAR+xVv~P<>k^I5yx856NkaHEs#W`{`ma>B=q@K@pY zMdE4^Es)QlVmY} zU6E&%yv+XYjj_Hb1)Na|GV^QU2Q1I_V^aMp@9T=HK!maW;!ZM(HoxnH^K z%ysr;Ek*Lh3STnhg$V)>fB*y_009U<00Izz00bZafmcglkW2I4X9vCW|F0O~t5++7 z$PEM_009U<00Izz00bZa0SG_<0zCna<9T}jf4^{#5&j|kRyZUxm>>WF2tWV=5P$## zAOHafKmY;|cnX2h{sHFd$f#~Q^bv8TuDj>jU1Qg<3|nhvxB+G=J?fCh12y(ki##aF zSfbBL+R>U$5aw22g1K@$z}!D{Hw^NOGuOY*zj;u;wXIewg$HYu;)DIE&c1s8PIs?7 zS+qOX?~>W->ULp%_vV9Qb?UvF2c2r6G`sq3c7VwV40%MFwyilvojlUXAoPmOKIbd5LmT({#WQ&Y`$*L0d%Ytk~va|YZ_^3Sp)=W|jqC&^;| zx+2dg)3d3qj4Vkxxme89O8H6eAHDvM@Be!NWs6-x00Izz00bZa0SG_<0uX=z1fHXS zcm03(FARC%`u}ru$F3j%0SG_<0uX=z1Rwwb2teR}A@FF7Jno+V==KMh1FdQ58O61` z#zgPUV%yFrTN%ePCmZClxxUlXY{PMylZ|#OGm-h>Wb|4(SrB_$^CPLYGYYwwF3UM- zCMU~Pd0HtH$!k)Qq;GdE9#t5k}@Agv~m6)!N4p8AOHafKmY;| QfB*y_009U<;8ha%H*LkKp8x;= literal 0 HcmV?d00001 diff --git a/package.json b/package.json index f279351ec..9d6ca25d7 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,6 @@ "dev": "vite --host", "start": "npm run start-server", "start-server": "node server/server.js", - "start-demo-server": "set NODE_ENV=demo && node server/server.js", - "update": "", "build": "vite build", "vite-preview-dist": "vite preview --host", "build-docker": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma -t louislam/uptime-kuma:1 -t louislam/uptime-kuma:1.5.2 --target release . --push", diff --git a/server/server.js b/server/server.js index 39191de79..3387631c3 100644 --- a/server/server.js +++ b/server/server.js @@ -50,6 +50,14 @@ const port = parseInt(process.env.PORT || args.port || 3001); const sslKey = process.env.SSL_KEY || args["ssl-key"] || undefined; const sslCert = process.env.SSL_CERT || args["ssl-cert"] || undefined; +// Demo Mode? +const demoMode = args["demo"] || false; + +if (demoMode) { + console.log("==== Demo Mode ===="); + Database.templatePath = "./demo_kuma.db"; +} + // Data Directory (must be end with "/") Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/"; Database.path = Database.dataDir + "kuma.db";