From 92638beb0fe5d4344c9b8b87c5f6999a4413325f Mon Sep 17 00:00:00 2001 From: Daniel Bugl Date: Tue, 19 Jun 2018 13:46:56 +0200 Subject: [PATCH 1/8] create docker images for elektra web --- scripts/docker/web/base/Dockerfile | 29 +++++++++++ scripts/docker/web/elektrad-demo/Dockerfile | 52 ++++++++++++++++++++ scripts/docker/web/elektrad/Dockerfile | 9 ++++ scripts/docker/web/web/Dockerfile | 12 +++++ scripts/docker/web/webd-demo/Dockerfile | 13 +++++ scripts/docker/web/webd-demo/demo.kdb | Bin 0 -> 2246 bytes scripts/docker/web/webd/Dockerfile | 9 ++++ 7 files changed, 124 insertions(+) create mode 100644 scripts/docker/web/base/Dockerfile create mode 100644 scripts/docker/web/elektrad-demo/Dockerfile create mode 100644 scripts/docker/web/elektrad/Dockerfile create mode 100644 scripts/docker/web/web/Dockerfile create mode 100644 scripts/docker/web/webd-demo/Dockerfile create mode 100644 scripts/docker/web/webd-demo/demo.kdb create mode 100644 scripts/docker/web/webd/Dockerfile diff --git a/scripts/docker/web/base/Dockerfile b/scripts/docker/web/base/Dockerfile new file mode 100644 index 00000000000..6ab782b2b5b --- /dev/null +++ b/scripts/docker/web/base/Dockerfile @@ -0,0 +1,29 @@ +FROM ubuntu:16.04 + +# elektra deps +RUN apt-get update -y +RUN apt-get install -y cmake git build-essential + +# elektra web deps +RUN apt-get install -y libyajl-dev curl nodejs-legacy npm +RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - +RUN apt-get install -y nodejs + +# pull latest libelektra +RUN mkdir /home/elektra +WORKDIR /home/elektra +RUN git clone https://github.com/omnidan/libelektra.git +WORKDIR /home/elektra/libelektra +RUN git checkout elektra-web1.5 + +# build & install libelektra +RUN mkdir /home/elektra/libelektra/build +WORKDIR /home/elektra/libelektra/build +RUN cmake .. -DTOOLS="kdb;web" +RUN make +RUN make install + +# prepare user and home dir +RUN groupadd -r elektra && useradd --no-log-init -r -g elektra elektra +RUN chown -R elektra:elektra /home/elektra + diff --git a/scripts/docker/web/elektrad-demo/Dockerfile b/scripts/docker/web/elektrad-demo/Dockerfile new file mode 100644 index 00000000000..5efc44670f7 --- /dev/null +++ b/scripts/docker/web/elektrad-demo/Dockerfile @@ -0,0 +1,52 @@ +FROM elektra/web-base:latest + +WORKDIR /home/elektra + +# prepare demo environment + +# mount copy of /etc/hosts to user/hosts + +# mount as root user +RUN kdb mount --with-recommends hosts user/hosts hosts + +# then switch to elektra user +USER elektra +RUN mkdir /home/elektra/.config +RUN cp /etc/hosts /home/elektra/.config/hosts + +# create user/app structure +RUN kdb set user/app + +RUN kdb set user/app/peers +RUN kdb set user/app/peers/#0 "192.168.0.43" +RUN kdb setmeta user/app/peers/#0 check/validation "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" +RUN kdb setmeta user/app/peers/#0 check/validation/message "invalid ip address" +RUN kdb setmeta user/app/peers/#1 check/validation "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" +RUN kdb setmeta user/app/peers/#1 check/validation/message "invalid ip address" +RUN kdb set user/app/peers/#1 "192.168.0.44" +RUN kdb setmeta user/app/peers array 2 +RUN kdb setmeta user/app/peers visibility "advanced" + +RUN kdb set user/app/database "production" +RUN kdb setmeta user/app/database check/type "enum" +RUN kdb setmeta user/app/database check/enum/#0 "production" +RUN kdb setmeta user/app/database check/enum/#1 "staging" +RUN kdb setmeta user/app/database check/enum/#2 "development" + +RUN kdb set user/app/host "192.168.0.42" +RUN kdb setmeta user/app/host check/validation "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" +RUN kdb setmeta user/app/host check/validation/message "invalid ip address" +RUN kdb setmeta user/app/host visibility "advanced" + +RUN kdb set user/app/maxConnections "1" +RUN kdb setmeta user/app/maxConnections check/type "unsigned_long" +RUN kdb setmeta user/app/maxConnections check/range "1-999" + +RUN kdb set user/app/running "1" +RUN kdb setmeta user/app/running check/type "boolean" +RUN kdb setmeta user/app/running restrict/write "1" + +# run elektrad +EXPOSE 33333 +CMD ["kdb","run-elektrad"] + diff --git a/scripts/docker/web/elektrad/Dockerfile b/scripts/docker/web/elektrad/Dockerfile new file mode 100644 index 00000000000..7234cac6369 --- /dev/null +++ b/scripts/docker/web/elektrad/Dockerfile @@ -0,0 +1,9 @@ +FROM elektra/web-base:latest + +WORKDIR /home/elektra +USER elektra + +# run elektrad +EXPOSE 33333 +CMD ["kdb","run-elektrad"] + diff --git a/scripts/docker/web/web/Dockerfile b/scripts/docker/web/web/Dockerfile new file mode 100644 index 00000000000..bfc161247be --- /dev/null +++ b/scripts/docker/web/web/Dockerfile @@ -0,0 +1,12 @@ +FROM elektra/web-base:latest + +WORKDIR /home/elektra +USER elektra + +# create start script +RUN printf "#!/bin/bash\nkdb run-elektrad &\nkdb run-web" > start +RUN chmod +x start + +# run elektrad and webd in one container +CMD ["/home/elektra/start"] + diff --git a/scripts/docker/web/webd-demo/Dockerfile b/scripts/docker/web/webd-demo/Dockerfile new file mode 100644 index 00000000000..c64d6c577de --- /dev/null +++ b/scripts/docker/web/webd-demo/Dockerfile @@ -0,0 +1,13 @@ +FROM elektra/web-base:latest + +WORKDIR /home/elektra +USER elektra + +# prepare demo environment +COPY --chown=elektra:elektra demo.kdb /home/elektra/ +RUN kdb import user/sw < /home/elektra/demo.kdb + +# run webd (serves client) +EXPOSE 33334 +CMD ["kdb","run-web"] + diff --git a/scripts/docker/web/webd-demo/demo.kdb b/scripts/docker/web/webd-demo/demo.kdb new file mode 100644 index 0000000000000000000000000000000000000000..8266ad1898234ec461a463e20c4e702d82892c05 GIT binary patch literal 2246 zcmchZ(Qbnv6o$R-Q<&`9A_`J>w=BEeF7^Zn$CYT&h;7ripSZRfwb^Kz-5C=;IOqI) zTFC692JPcjVcy~BN6D&ylYJt%d$~8zAag`eLeVxH9U((cArkwh0o@{{P0O_a<9T-3 zo0iwr#9?)ZoB?R!20#*wXjI**O3z><_2cBv#n=kBm1(_g+t$zMQoIZ#?5cICvU4}q zRr58goB1(w+DS=|CX7-Ziy&e-4G7I~kVcsdHkgDtV73YKaJEtEW8$=t<~#5{)vhkV zf30+`W{0P-W6$?GuSyAW*6?n6)ah^+l8u55-LzaAhrh?sPH-UNp4gAnEOFhEF>s?1 z7peL{9tn>p@MHm=-q~XE!{&9p0LAwXj$Wy#259E3rjD67D5Ek}s`k{Ar)MQ@ior`E zb%_*ysABNHDF&lXF?b^q9w%YIM3i@m5pj^oG!Al>F+n+#oQhe4JH@!%4UBrlyvT$7 zCdkJ~2464o()?VqI*=YEnKAJf$+%qAG4|}38&}nBI)k~Ua#=Ljy}cdma?=BD-57a* MpR+YY)!3hoZ}=ncKL7v# literal 0 HcmV?d00001 diff --git a/scripts/docker/web/webd/Dockerfile b/scripts/docker/web/webd/Dockerfile new file mode 100644 index 00000000000..8274795dac5 --- /dev/null +++ b/scripts/docker/web/webd/Dockerfile @@ -0,0 +1,9 @@ +FROM elektra/web-base:latest + +WORKDIR /home/elektra +USER elektra + +# run webd (serves client) +EXPOSE 33334 +CMD ["kdb","run-web"] + From 1d59bcd5f931ab53033969863ac72a13f82ffc22 Mon Sep 17 00:00:00 2001 From: Daniel Bugl Date: Tue, 19 Jun 2018 14:04:04 +0200 Subject: [PATCH 2/8] expose ports in elektra/web image --- scripts/docker/web/web/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/docker/web/web/Dockerfile b/scripts/docker/web/web/Dockerfile index bfc161247be..a4b57d14709 100644 --- a/scripts/docker/web/web/Dockerfile +++ b/scripts/docker/web/web/Dockerfile @@ -8,5 +8,7 @@ RUN printf "#!/bin/bash\nkdb run-elektrad &\nkdb run-web" > start RUN chmod +x start # run elektrad and webd in one container +EXPOSE 33333 +EXPOSE 33334 CMD ["/home/elektra/start"] From cd58fbde21e5d9edd46ec0212b12d1d63855fd79 Mon Sep 17 00:00:00 2001 From: Daniel Bugl Date: Tue, 19 Jun 2018 14:08:11 +0200 Subject: [PATCH 3/8] add README --- scripts/docker/web/web/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 scripts/docker/web/web/README.md diff --git a/scripts/docker/web/web/README.md b/scripts/docker/web/web/README.md new file mode 100644 index 00000000000..15eb108ccf9 --- /dev/null +++ b/scripts/docker/web/web/README.md @@ -0,0 +1,9 @@ +# Elektra Web docker images + +- `elektra/web-base` - base image for elektra web, all other images build upon this (builds elektra with `yajl` and `kdb`) +- `elektra/elektrad` - image that only starts elektrad +- `elektra/webd` - image that only starts webd +- `elektra/elektrad-demo` - same as `elektrad`, but with a KDB config set up (for demo, should run on http://elektrad-demo.libelektra.org) +- `elektra/webd-demo` - same as `webd`, but with 2 instances already created, they both connect to http://elektrad-demo.libelektra.org with different visibility levels (for demo, should run on http://webui.libelektra.org) +- `elektra/web` - image that starts elektrad & webd (for those who just want to try out Elektra Web locally, also mentioned in quickstart in README of #2099) + From e173bdc6f9c531c0d1fbd6a7e6845810af6998f2 Mon Sep 17 00:00:00 2001 From: Daniel Bugl Date: Tue, 19 Jun 2018 14:13:23 +0200 Subject: [PATCH 4/8] add comments to docker files --- scripts/docker/web/{web => }/README.md | 0 scripts/docker/web/base/Dockerfile | 3 ++- scripts/docker/web/elektrad-demo/Dockerfile | 3 ++- scripts/docker/web/elektrad/Dockerfile | 3 ++- scripts/docker/web/web/Dockerfile | 3 ++- scripts/docker/web/webd-demo/Dockerfile | 3 ++- scripts/docker/web/webd/Dockerfile | 3 ++- 7 files changed, 12 insertions(+), 6 deletions(-) rename scripts/docker/web/{web => }/README.md (100%) diff --git a/scripts/docker/web/web/README.md b/scripts/docker/web/README.md similarity index 100% rename from scripts/docker/web/web/README.md rename to scripts/docker/web/README.md diff --git a/scripts/docker/web/base/Dockerfile b/scripts/docker/web/base/Dockerfile index 6ab782b2b5b..0ef1810e537 100644 --- a/scripts/docker/web/base/Dockerfile +++ b/scripts/docker/web/base/Dockerfile @@ -1,3 +1,5 @@ +# base image for elektra web, all other images build upon this (builds elektra with `yajl` and `kdb`) + FROM ubuntu:16.04 # elektra deps @@ -26,4 +28,3 @@ RUN make install # prepare user and home dir RUN groupadd -r elektra && useradd --no-log-init -r -g elektra elektra RUN chown -R elektra:elektra /home/elektra - diff --git a/scripts/docker/web/elektrad-demo/Dockerfile b/scripts/docker/web/elektrad-demo/Dockerfile index 5efc44670f7..424248d7918 100644 --- a/scripts/docker/web/elektrad-demo/Dockerfile +++ b/scripts/docker/web/elektrad-demo/Dockerfile @@ -1,3 +1,5 @@ +# same as `elektrad`, but with a KDB config set up (for demo) + FROM elektra/web-base:latest WORKDIR /home/elektra @@ -49,4 +51,3 @@ RUN kdb setmeta user/app/running restrict/write "1" # run elektrad EXPOSE 33333 CMD ["kdb","run-elektrad"] - diff --git a/scripts/docker/web/elektrad/Dockerfile b/scripts/docker/web/elektrad/Dockerfile index 7234cac6369..c37d34cecc4 100644 --- a/scripts/docker/web/elektrad/Dockerfile +++ b/scripts/docker/web/elektrad/Dockerfile @@ -1,3 +1,5 @@ +# image that only starts elektrad + FROM elektra/web-base:latest WORKDIR /home/elektra @@ -6,4 +8,3 @@ USER elektra # run elektrad EXPOSE 33333 CMD ["kdb","run-elektrad"] - diff --git a/scripts/docker/web/web/Dockerfile b/scripts/docker/web/web/Dockerfile index a4b57d14709..de8daea9ab0 100644 --- a/scripts/docker/web/web/Dockerfile +++ b/scripts/docker/web/web/Dockerfile @@ -1,3 +1,5 @@ +# image that starts elektrad & webd (for quickstart with elektra web) + FROM elektra/web-base:latest WORKDIR /home/elektra @@ -11,4 +13,3 @@ RUN chmod +x start EXPOSE 33333 EXPOSE 33334 CMD ["/home/elektra/start"] - diff --git a/scripts/docker/web/webd-demo/Dockerfile b/scripts/docker/web/webd-demo/Dockerfile index c64d6c577de..1f5a8262124 100644 --- a/scripts/docker/web/webd-demo/Dockerfile +++ b/scripts/docker/web/webd-demo/Dockerfile @@ -1,3 +1,5 @@ +# same as `webd`, but with 2 instances already created, they both connect to http://elektrad-demo.libelektra.org with different visibility levels (for demo) + FROM elektra/web-base:latest WORKDIR /home/elektra @@ -10,4 +12,3 @@ RUN kdb import user/sw < /home/elektra/demo.kdb # run webd (serves client) EXPOSE 33334 CMD ["kdb","run-web"] - diff --git a/scripts/docker/web/webd/Dockerfile b/scripts/docker/web/webd/Dockerfile index 8274795dac5..dca83f2eceb 100644 --- a/scripts/docker/web/webd/Dockerfile +++ b/scripts/docker/web/webd/Dockerfile @@ -1,3 +1,5 @@ +# image that only starts webd + FROM elektra/web-base:latest WORKDIR /home/elektra @@ -6,4 +8,3 @@ USER elektra # run webd (serves client) EXPOSE 33334 CMD ["kdb","run-web"] - From 8b8c564661aa29193a5a9963f0e7c03467b23d9a Mon Sep 17 00:00:00 2001 From: Daniel Bugl Date: Tue, 19 Jun 2018 14:16:05 +0200 Subject: [PATCH 5/8] add release notes --- doc/news/_preparation_next_release.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index 1c8fac75397..e56c9928f8a 100644 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -39,7 +39,7 @@ You can also read the news [on our website](https://www.libelektra.org/news/0.8. - Type system preview - Chef Cookbook -- <> +- Elektra Web 1.5 ### Type system preview @@ -96,10 +96,28 @@ end Thanks to Michael Zronek and Vanessa Kos. -### <> +### Elektra Web 1.5 + +The new release of Elektra Web features many UX improvements from the usability test! + +[![Elektra Web 1.5 video](https://img.youtube.com/vi/lLg9sk6Hx-E/0.jpg)](https://www.youtube.com/watch?v=lLg9sk6Hx-E) + +Try it out now on: http://webui.libelektra.org:33334/ + +- search completely reworked - it does not act as a filter on already opened keys anymore, and instead searches the whole key database - feedback from the search was also greatly improved (pulsating while searching, glowing blue when done) +- added "abort" buttons to dialogs to revert actions +- added "create array" button to easily create arrays +- removed confirmation dialog before deletion (undo can be used instead) +- created a docker image: `elektra/web` +- small fixes: + - updated visibility levels + - removed "done" button in main view + - fixed issues with the opener click area + - remove metakeys when they are set to the default value or empty/0 + - improved keyboard support + - fixed many small issues (#2037) -### <> ## Plugins From 93a05811a3f22d79b033ee5739454a078c45b81c Mon Sep 17 00:00:00 2001 From: Daniel Bugl Date: Tue, 19 Jun 2018 17:32:50 +0200 Subject: [PATCH 6/8] web ui docker: update repo for base image --- scripts/docker/web/base/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/docker/web/base/Dockerfile b/scripts/docker/web/base/Dockerfile index 0ef1810e537..b05c26e57fd 100644 --- a/scripts/docker/web/base/Dockerfile +++ b/scripts/docker/web/base/Dockerfile @@ -14,9 +14,8 @@ RUN apt-get install -y nodejs # pull latest libelektra RUN mkdir /home/elektra WORKDIR /home/elektra -RUN git clone https://github.com/omnidan/libelektra.git +RUN git clone --depth 1 https://github.com/ElektraInitiative/libelektra.git WORKDIR /home/elektra/libelektra -RUN git checkout elektra-web1.5 # build & install libelektra RUN mkdir /home/elektra/libelektra/build From 1851751b4ba9c9c2912c1e7a34bd42fd3f6953c5 Mon Sep 17 00:00:00 2001 From: Daniel Bugl Date: Tue, 19 Jun 2018 17:43:04 +0200 Subject: [PATCH 7/8] web ui docker: put demo data into a file --- scripts/docker/web/elektrad-demo/Dockerfile | 32 ++------------------ scripts/docker/web/elektrad-demo/demo.kdb | Bin 0 -> 1258 bytes 2 files changed, 2 insertions(+), 30 deletions(-) create mode 100644 scripts/docker/web/elektrad-demo/demo.kdb diff --git a/scripts/docker/web/elektrad-demo/Dockerfile b/scripts/docker/web/elektrad-demo/Dockerfile index 424248d7918..2af0928ecaf 100644 --- a/scripts/docker/web/elektrad-demo/Dockerfile +++ b/scripts/docker/web/elektrad-demo/Dockerfile @@ -17,36 +17,8 @@ RUN mkdir /home/elektra/.config RUN cp /etc/hosts /home/elektra/.config/hosts # create user/app structure -RUN kdb set user/app - -RUN kdb set user/app/peers -RUN kdb set user/app/peers/#0 "192.168.0.43" -RUN kdb setmeta user/app/peers/#0 check/validation "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" -RUN kdb setmeta user/app/peers/#0 check/validation/message "invalid ip address" -RUN kdb setmeta user/app/peers/#1 check/validation "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" -RUN kdb setmeta user/app/peers/#1 check/validation/message "invalid ip address" -RUN kdb set user/app/peers/#1 "192.168.0.44" -RUN kdb setmeta user/app/peers array 2 -RUN kdb setmeta user/app/peers visibility "advanced" - -RUN kdb set user/app/database "production" -RUN kdb setmeta user/app/database check/type "enum" -RUN kdb setmeta user/app/database check/enum/#0 "production" -RUN kdb setmeta user/app/database check/enum/#1 "staging" -RUN kdb setmeta user/app/database check/enum/#2 "development" - -RUN kdb set user/app/host "192.168.0.42" -RUN kdb setmeta user/app/host check/validation "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" -RUN kdb setmeta user/app/host check/validation/message "invalid ip address" -RUN kdb setmeta user/app/host visibility "advanced" - -RUN kdb set user/app/maxConnections "1" -RUN kdb setmeta user/app/maxConnections check/type "unsigned_long" -RUN kdb setmeta user/app/maxConnections check/range "1-999" - -RUN kdb set user/app/running "1" -RUN kdb setmeta user/app/running check/type "boolean" -RUN kdb setmeta user/app/running restrict/write "1" +COPY --chown=elektra:elektra demo.kdb /home/elektra/ +RUN kdb import user/app < /home/elektra/demo.kdb # run elektrad EXPOSE 33333 diff --git a/scripts/docker/web/elektrad-demo/demo.kdb b/scripts/docker/web/elektrad-demo/demo.kdb new file mode 100644 index 0000000000000000000000000000000000000000..99f4e9b9ba45a6a02c5ac83b2d074ac963246e65 GIT binary patch literal 1258 zcmdT^!A`?449$685eW|Lz&d9wv?mUTBk%!ZptP|@)Hbb}bTBdgog~|6#z5MYixb5! zwx9iyQsj>1DFmFuTMHYqG^= zK83}N-+FU1ewvIwW}l~F&xfomp^zPAjcU}IFOf*)OQEu*T!_w|4p#waHd;w7b6H8V zCS0tzDp34v0gEXcI#BcX+eRt$1Jne9c#Q7(cU;-zaG7OU;0HVAu;0DXa;Z?fRLyRF zp?WN_A#01+>8--HdO5Lnr@>%+K8({=Fv3|-;XfK-*s5PiLP#?H|0J(N6?VN+?$L+x n1N$#+e-Qtg^QNhghks0BBiJWkI$4 Date: Tue, 19 Jun 2018 18:31:31 +0200 Subject: [PATCH 8/8] web ui docker: pin version and add build argument --- scripts/docker/web/base/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/docker/web/base/Dockerfile b/scripts/docker/web/base/Dockerfile index b05c26e57fd..04bd4ed0c0a 100644 --- a/scripts/docker/web/base/Dockerfile +++ b/scripts/docker/web/base/Dockerfile @@ -14,7 +14,8 @@ RUN apt-get install -y nodejs # pull latest libelektra RUN mkdir /home/elektra WORKDIR /home/elektra -RUN git clone --depth 1 https://github.com/ElektraInitiative/libelektra.git +ARG ELEKTRA_VER=master +RUN git clone -b ${ELEKTRA_VER} --depth 1 https://github.com/ElektraInitiative/libelektra.git WORKDIR /home/elektra/libelektra # build & install libelektra