@live-change/task-frontend 0.8.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/.nx/cache/file-map.json +257 -0
  2. package/.nx/cache/project-graph.json +6 -0
  3. package/Dockerfile +55 -0
  4. package/LICENSE +21 -0
  5. package/data/GeoLite2-Country.mmdb +0 -0
  6. package/dev.Dockerfile +35 -0
  7. package/docker/app.initd.sh +73 -0
  8. package/docker/build-and-upload.sh +30 -0
  9. package/docker/build-docker-and-upload.sh +33 -0
  10. package/docker/commit-new-version.sh +17 -0
  11. package/docker/k8s-rsync-helper.sh +4 -0
  12. package/docker/onlyDependencies.js +12 -0
  13. package/docker/parse-args-and-config.sh +19 -0
  14. package/docker/restore-backup-with-service.sh +14 -0
  15. package/docker/restore-backup.sh +22 -0
  16. package/docker/start-service.sh +4 -0
  17. package/docker/upload-backup-and-restore.sh +12 -0
  18. package/front/index.html +65 -0
  19. package/front/locales/en.js +26 -0
  20. package/front/locales/en.json +7 -0
  21. package/front/public/favicon.ico +0 -0
  22. package/front/public/images/empty-photo.svg +38 -0
  23. package/front/public/images/empty-user-photo.svg +33 -0
  24. package/front/public/images/logo.svg +34 -0
  25. package/front/public/images/logo128.png +0 -0
  26. package/front/src/App.vue +61 -0
  27. package/front/src/Index.vue +16 -0
  28. package/front/src/analytics/index.js +15 -0
  29. package/front/src/components/Clock.vue +22 -0
  30. package/front/src/config.js +26 -0
  31. package/front/src/entry-client.js +8 -0
  32. package/front/src/entry-server.js +8 -0
  33. package/front/src/router.js +76 -0
  34. package/front/tsconfig.json +26 -0
  35. package/front/tsconfig.node.json +11 -0
  36. package/front/vite.config.ts +41 -0
  37. package/index.js +2 -0
  38. package/package.json +106 -0
  39. package/server/app.config.js +100 -0
  40. package/server/init.js +10 -0
  41. package/server/page.documentType.js +103 -0
  42. package/server/security.config.js +53 -0
  43. package/server/services.list.js +49 -0
  44. package/server/start.js +11 -0
  45. package/server/testTasks.js +0 -0
  46. package/start-dev-docker.sh +4 -0
@@ -0,0 +1,257 @@
1
+ {
2
+ "version": "6.0",
3
+ "nxVersion": "18.0.6",
4
+ "deps": {
5
+ "@codemirror/language": "6.10.1",
6
+ "@dotenvx/dotenvx": "0.27.0",
7
+ "@fortawesome/fontawesome-free": "^6.4.2",
8
+ "@live-change/access-control-frontend": "0.8.23",
9
+ "@live-change/access-control-service": "0.8.23",
10
+ "@live-change/backup-service": "0.8.23",
11
+ "@live-change/blog-frontend": "0.8.23",
12
+ "@live-change/blog-service": "0.8.23",
13
+ "@live-change/cli": "0.8.23",
14
+ "@live-change/content-frontend": "0.8.23",
15
+ "@live-change/content-service": "0.8.23",
16
+ "@live-change/dao": "0.8.23",
17
+ "@live-change/dao-vue3": "0.8.23",
18
+ "@live-change/dao-websocket": "0.8.23",
19
+ "@live-change/db-client": "0.8.23",
20
+ "@live-change/email-service": "0.8.23",
21
+ "@live-change/framework": "0.8.23",
22
+ "@live-change/frontend-auto-form": "0.8.23",
23
+ "@live-change/frontend-base": "0.8.23",
24
+ "@live-change/geoip-service": "0.8.23",
25
+ "@live-change/image-frontend": "0.8.23",
26
+ "@live-change/locale-settings-service": "0.8.23",
27
+ "@live-change/password-authentication-service": "0.8.23",
28
+ "@live-change/prosemirror-service": "0.8.23",
29
+ "@live-change/secret-code-service": "0.8.23",
30
+ "@live-change/secret-link-service": "0.8.23",
31
+ "@live-change/session-service": "0.8.23",
32
+ "@live-change/upload-frontend": "0.8.23",
33
+ "@live-change/url-frontend": "0.8.23",
34
+ "@live-change/url-service": "0.8.23",
35
+ "@live-change/vote-service": "0.8.23",
36
+ "@live-change/task-service": "0.8.23",
37
+ "@live-change/user-frontend": "0.8.23",
38
+ "@live-change/user-identification-service": "0.8.23",
39
+ "@live-change/user-service": "0.8.23",
40
+ "@live-change/vue3-components": "0.8.23",
41
+ "@live-change/vue3-ssr": "0.8.23",
42
+ "@live-change/wysiwyg-frontend": "0.8.23",
43
+ "@vueuse/core": "^10.9.0",
44
+ "codeceptjs-assert": "^0.0.5",
45
+ "compression": "^1.7.4",
46
+ "cross-env": "^7.0.3",
47
+ "get-port-sync": "1.0.1",
48
+ "pica": "^9.0.1",
49
+ "pretty-bytes": "^6.1.1",
50
+ "primeflex": "^3.3.1",
51
+ "primeicons": "^7.0.0",
52
+ "primevue": "^3.51.0",
53
+ "rollup-plugin-node-builtins": "^2.1.2",
54
+ "rollup-plugin-visualizer": "5.12.0",
55
+ "serialize-javascript": "^6.0.2",
56
+ "serve-static": "^1.15.0",
57
+ "v-shared-element": "3.1.1",
58
+ "vue": "^3.4.19",
59
+ "vue-i18n": "^9.10.1",
60
+ "vue-router": "^4.2.5",
61
+ "vue3-scroll-border": "0.1.6",
62
+ "@live-change/codeceptjs-helper": "0.8.23",
63
+ "codeceptjs": "^3.5.12",
64
+ "generate-password": "1.7.1",
65
+ "playwright": "^1.41.2",
66
+ "random-profile-generator": "^2.3.0",
67
+ "txtgen": "^3.0.6",
68
+ "webdriverio": "^8.31.1"
69
+ },
70
+ "pathMappings": {},
71
+ "nxJsonPlugins": [],
72
+ "fileMap": {
73
+ "projectFileMap": {},
74
+ "nonProjectFiles": [
75
+ {
76
+ "file": ".gitignore",
77
+ "hash": "16528976885761916170"
78
+ },
79
+ {
80
+ "file": "Dockerfile",
81
+ "hash": "2886431590462419165"
82
+ },
83
+ {
84
+ "file": "LICENSE",
85
+ "hash": "11061867800085944532"
86
+ },
87
+ {
88
+ "file": "data/GeoLite2-Country.mmdb",
89
+ "hash": "18418324532701607635"
90
+ },
91
+ {
92
+ "file": "dev.Dockerfile",
93
+ "hash": "6907505572289099967"
94
+ },
95
+ {
96
+ "file": "docker/app.initd.sh",
97
+ "hash": "5689466769238316025"
98
+ },
99
+ {
100
+ "file": "docker/build-and-upload.sh",
101
+ "hash": "9432915210479550333"
102
+ },
103
+ {
104
+ "file": "docker/build-docker-and-upload.sh",
105
+ "hash": "9817365185106032741"
106
+ },
107
+ {
108
+ "file": "docker/commit-new-version.sh",
109
+ "hash": "5160018103227051012"
110
+ },
111
+ {
112
+ "file": "docker/k8s-rsync-helper.sh",
113
+ "hash": "12840580596915123557"
114
+ },
115
+ {
116
+ "file": "docker/onlyDependencies.js",
117
+ "hash": "13135394580253028435"
118
+ },
119
+ {
120
+ "file": "docker/parse-args-and-config.sh",
121
+ "hash": "11641932740456140593"
122
+ },
123
+ {
124
+ "file": "docker/restore-backup-with-service.sh",
125
+ "hash": "10918919254951884109"
126
+ },
127
+ {
128
+ "file": "docker/restore-backup.sh",
129
+ "hash": "17157081294258412437"
130
+ },
131
+ {
132
+ "file": "docker/start-service.sh",
133
+ "hash": "13107251553503965386"
134
+ },
135
+ {
136
+ "file": "docker/upload-backup-and-restore.sh",
137
+ "hash": "16296194178343837935"
138
+ },
139
+ {
140
+ "file": "front/index.html",
141
+ "hash": "9934749794764720310"
142
+ },
143
+ {
144
+ "file": "front/locales/en.js",
145
+ "hash": "10652573724821059037"
146
+ },
147
+ {
148
+ "file": "front/locales/en.json",
149
+ "hash": "7756539891184290419"
150
+ },
151
+ {
152
+ "file": "front/public/favicon.ico",
153
+ "hash": "11176796980188620760"
154
+ },
155
+ {
156
+ "file": "front/public/images/empty-photo.svg",
157
+ "hash": "9393138513813369674"
158
+ },
159
+ {
160
+ "file": "front/public/images/empty-user-photo.svg",
161
+ "hash": "17548039285248668212"
162
+ },
163
+ {
164
+ "file": "front/public/images/logo.svg",
165
+ "hash": "5934164668360941413"
166
+ },
167
+ {
168
+ "file": "front/public/images/logo128.png",
169
+ "hash": "4924117807669085214"
170
+ },
171
+ {
172
+ "file": "front/src/App.vue",
173
+ "hash": "3737234980433726371"
174
+ },
175
+ {
176
+ "file": "front/src/Index.vue",
177
+ "hash": "6141752239478277683"
178
+ },
179
+ {
180
+ "file": "front/src/analytics/index.js",
181
+ "hash": "492811393913301668"
182
+ },
183
+ {
184
+ "file": "front/src/components/Clock.vue",
185
+ "hash": "6241258097645393918"
186
+ },
187
+ {
188
+ "file": "front/src/config.js",
189
+ "hash": "4208481022464725661"
190
+ },
191
+ {
192
+ "file": "front/src/entry-client.js",
193
+ "hash": "1218837904372604167"
194
+ },
195
+ {
196
+ "file": "front/src/entry-server.js",
197
+ "hash": "7377383936979315921"
198
+ },
199
+ {
200
+ "file": "front/src/router.js",
201
+ "hash": "16714073484061964064"
202
+ },
203
+ {
204
+ "file": "front/tsconfig.json",
205
+ "hash": "6166366661637344199"
206
+ },
207
+ {
208
+ "file": "front/tsconfig.node.json",
209
+ "hash": "4208030242441905014"
210
+ },
211
+ {
212
+ "file": "front/vite.config.ts",
213
+ "hash": "4804285485121244435"
214
+ },
215
+ {
216
+ "file": "index.js",
217
+ "hash": "11269213519712721017"
218
+ },
219
+ {
220
+ "file": "package.json",
221
+ "hash": "11328295818425146716"
222
+ },
223
+ {
224
+ "file": "server/app.config.js",
225
+ "hash": "11753059881031204026"
226
+ },
227
+ {
228
+ "file": "server/init.js",
229
+ "hash": "10527942683746245757"
230
+ },
231
+ {
232
+ "file": "server/page.documentType.js",
233
+ "hash": "4319267302010918354"
234
+ },
235
+ {
236
+ "file": "server/security.config.js",
237
+ "hash": "6483730663450187822"
238
+ },
239
+ {
240
+ "file": "server/services.list.js",
241
+ "hash": "7926432475169575282"
242
+ },
243
+ {
244
+ "file": "server/start.js",
245
+ "hash": "3387118482182040319"
246
+ },
247
+ {
248
+ "file": "server/testTasks.js",
249
+ "hash": "3244421341483603138"
250
+ },
251
+ {
252
+ "file": "start-dev-docker.sh",
253
+ "hash": "1356997101209839594"
254
+ }
255
+ ]
256
+ }
257
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "nodes": {},
3
+ "externalNodes": {},
4
+ "dependencies": {},
5
+ "version": "6.0"
6
+ }
package/Dockerfile ADDED
@@ -0,0 +1,55 @@
1
+ FROM --platform=amd64 debian:buster
2
+
3
+ # SYSTEM
4
+ RUN echo no cache 3
5
+ RUN apt-get -qq update
6
+ RUN apt-get install -qq -y wget curl apt-utils git openssh-server locales gnupg2 make cmake gcc g++ unzip nano \
7
+ alpine-pico fish rsync
8
+
9
+ ENV LANG en_US.UTF-8
10
+ ENV LANGUAGE en_US.UTF-8
11
+ ENV LC_ALL en_US.UTF-8
12
+ RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment
13
+ RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
14
+ RUN echo "LANG=en_US.UTF-8" > /etc/locale.conf
15
+ RUN locale-gen en_US.UTF-8
16
+
17
+ # NODE
18
+ RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
19
+ RUN apt-get install -y nodejs
20
+
21
+ #NPM, PM2
22
+ RUN npm install cross-env yarn -g
23
+
24
+ # APP
25
+ RUN mkdir -p /app
26
+ WORKDIR /app
27
+ COPY package-deps.json package.json
28
+ RUN --mount=type=secret,id=npmrc,target=/root/.npmrc yarn install
29
+
30
+ RUN mkdir -p /app/docker
31
+ COPY docker/restore-backup-with-service.sh /app/docker/restore-backup-with-service.sh
32
+ COPY docker/restore-backup.sh /app/docker/restore-backup.sh
33
+ COPY /front front
34
+ COPY /server server
35
+ COPY package.json package.json
36
+
37
+ ARG VERSION='unknown'
38
+ ARG BASE_HREF='http://localhost:8001/'
39
+
40
+ ENV VERSION=$VERSION
41
+ ENV BASE_HREF=$BASE_HREF
42
+
43
+ RUN echo "VERSION=$VERSION" >> /etc/environment
44
+ RUN echo "BASE_HREF=$BASE_HREF" >> /etc/environment
45
+
46
+ RUN npm run build
47
+
48
+ # START
49
+ EXPOSE 8001
50
+ EXPOSE 8007
51
+ COPY docker/start-service.sh /start-service.sh
52
+ COPY docker/app.initd.sh /etc/init.d/app
53
+
54
+ #CMD /start-service.sh
55
+ CMD node server/start.js ssrServer --withApi --withServices --updateServices --enableSessions --createDb
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Michał Łaszczewski
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
Binary file
package/dev.Dockerfile ADDED
@@ -0,0 +1,35 @@
1
+ FROM --platform=amd64 debian:buster
2
+
3
+ # SYSTEM
4
+ RUN echo no cache 3
5
+ RUN apt-get -qq update
6
+ RUN apt-get install -qq -y wget curl apt-utils git openssh-server locales gnupg2 make cmake gcc g++ unzip nano \
7
+ alpine-pico fish rsync zip
8
+
9
+ ENV LANG en_US.UTF-8
10
+ ENV LANGUAGE en_US.UTF-8
11
+ ENV LC_ALL en_US.UTF-8
12
+ RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment
13
+ RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
14
+ RUN echo "LANG=en_US.UTF-8" > /etc/locale.conf
15
+ RUN locale-gen en_US.UTF-8
16
+
17
+ # NODE
18
+ RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
19
+ RUN apt-get install -y nodejs
20
+
21
+ # NPM YARN
22
+ RUN npm install cross-env yarn -g
23
+
24
+ # PATH
25
+ ENV PATH="${PATH}:/app/node_modules/.bin"
26
+ RUN echo 'export PATH="/app/node_modules/.bin:$PATH"' >> /root/.bashrc
27
+ RUN echo 'export HMR_PORT=9001' >> /root/.bashrc
28
+
29
+ EXPOSE 8001
30
+ EXPOSE 9001
31
+
32
+ WORKDIR /app
33
+
34
+ # APP
35
+ CMD bash -c "sleep infinity"
@@ -0,0 +1,73 @@
1
+ #!/bin/bash -e
2
+
3
+ # Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
4
+
5
+ NAME=app
6
+ DIR=/app
7
+ PIDFILE=/var/run/$NAME.pid
8
+ DAEMON=/usr/bin/node
9
+ DAEMON_ARGS="server/start.js server ssrServer --withApi --withServices --updateServices --enableSessions --createDb"
10
+ STOP_SIGNAL=INT
11
+ USER=root
12
+ LOG=/var/log/$NAME.log
13
+
14
+ export NODE_ENV=production
15
+ export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
16
+
17
+ common_opts="--quiet --chuid $USER --pidfile $PIDFILE"
18
+
19
+ do_start(){
20
+ start-stop-daemon --start $common_opts --chdir $DIR --make-pidfile --background --startas \
21
+ /bin/bash -- -c "exec $DAEMON $DAEMON_ARGS > $LOG 2>&1"
22
+ }
23
+
24
+ do_stop(){
25
+ opt=${@:-}
26
+ start-stop-daemon --stop $common_opts --signal $STOP_SIGNAL --oknodo $opt --remove-pidfile
27
+ }
28
+
29
+ do_status(){
30
+ start-stop-daemon --status $common_opts && exit_status=$? || exit_status=$?
31
+ echo asdf $exit_status
32
+ case "$exit_status" in
33
+ 0)
34
+ echo "Program '$NAME' is running."
35
+ ;;
36
+ 1)
37
+ echo "Program '$NAME' is not running and the pid file exists."
38
+ ;;
39
+ 3)
40
+ echo "Program '$NAME' is not running."
41
+ ;;
42
+ 4)
43
+ echo "Unable to determine program '$NAME' status."
44
+ ;;
45
+ esac
46
+ }
47
+
48
+ case "$1" in
49
+ status)
50
+ do_status
51
+ ;;
52
+ start)
53
+ echo -n "Starting daemon: "$NAME
54
+ do_start
55
+ echo "."
56
+ ;;
57
+ stop)
58
+ echo -n "Stopping daemon: "$NAME
59
+ do_stop
60
+ echo "."
61
+ ;;
62
+ restart)
63
+ echo -n "Restarting daemon: "$NAME
64
+ do_stop --retry 30
65
+ do_start
66
+ echo "."
67
+ ;;
68
+ *)
69
+ echo "Usage: "$1" {status|start|stop|restart}"
70
+ exit 1
71
+ esac
72
+
73
+ exit 0
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env bash
2
+
3
+ DIR="$( dirname -- "$( readlink -f -- "$0"; )"; )"
4
+ pushd "$DIR/.."
5
+
6
+ source ./docker/parse-args-and-config.sh
7
+
8
+ POD_NAME="${POD_NAME="$DEPLOYMENT-$PROJECT_NAME"}"
9
+ echo POD_NAME=$POD_NAME
10
+
11
+ echo Compiling
12
+
13
+ npm run build
14
+
15
+ echo Uploading
16
+
17
+ rsync -av --progress --stats --delete -e 'docker/k8s-rsync-helper.sh' \
18
+ front server package.json package-lock.json \
19
+ $POD_NAME:/app
20
+
21
+ echo Updating deps
22
+ kubectl exec $POD_NAME -- yarn install
23
+
24
+ echo Restarting
25
+
26
+ kubectl exec $POD_NAME -- /etc/init.d/app restart
27
+
28
+ echo Done
29
+
30
+ popd
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+
4
+ DIR="$( dirname -- "$( readlink -f -- "$0"; )"; )"
5
+
6
+ pushd "$DIR/.."
7
+
8
+ source ./docker/parse-args-and-config.sh
9
+
10
+ echo "Building ${NAME}:${VERSION}-${DEPLOYMENT}"
11
+
12
+ set -ex
13
+
14
+ ./docker/onlyDependencies.js > package-deps.json
15
+
16
+ docker build \
17
+ -t ${NAME}:${VERSION}-${DEPLOYMENT}\
18
+ -t ${NAME}:${DEPLOYMENT}\
19
+ -t ${REPO}/${NAME}:${VERSION}-${DEPLOYMENT}\
20
+ -t ${REPO}/${NAME}:${DEPLOYMENT}\
21
+ --secret id=npmrc,src=$HOME/.npmrc\
22
+ --build-arg VERSION=${VERSION}-${DEPLOYMENT}\
23
+ --build-arg BASE_HREF=${BASE_HREF}\
24
+ .
25
+
26
+ docker push ${REPO}/${NAME}:${VERSION}-${DEPLOYMENT}
27
+ docker push ${REPO}/${NAME}:${DEPLOYMENT}
28
+
29
+ set +x
30
+
31
+ echo "Done building ${NAME}:${VERSION}-${DEPLOYMENT}"
32
+
33
+ popd
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env bash
2
+
3
+ DIR="$( dirname -- "$( readlink -f -- "$0"; )"; )"
4
+ pushd "$DIR/.."
5
+
6
+ source ./docker/parse-args-and-config.sh
7
+
8
+ set +ex
9
+
10
+ git commit -a
11
+ npm version patch
12
+ git push
13
+ ./docker/build-docker-and-upload.sh $DEPLOYMENT
14
+
15
+ set -e
16
+
17
+ popd
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ pod=$1
3
+ shift
4
+ kubectl exec -i $pod -- "$@"
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "fs/promises"
4
+
5
+ const packageData = JSON.parse(await fs.readFile(process.argv[2] || "package.json"))
6
+
7
+ const { dependencies, devDependencies } = packageData
8
+
9
+ console.log(JSON.stringify({
10
+ dependencies,
11
+ devDependencies
12
+ }, null, 2))
@@ -0,0 +1,19 @@
1
+ REPO=docker.chaosu.pl
2
+
3
+ VERSION=`echo "console.log(require('./package.json').version)" | node`
4
+ NAME=`echo "console.log(require('./package.json').name.split('/').pop())" | node`
5
+
6
+ DEPLOYMENT=${1:-dev}
7
+ echo "DEPLOYMENT=${DEPLOYMENT}"
8
+
9
+ #BASE_HREF="https://$DEPLOYMENT.example.com/"
10
+
11
+ #if [ "$DEPLOYMENT" == "master" ]; then
12
+ BASE_HREF='https://www.example.com/'
13
+ #fi
14
+
15
+ PROJECT_NAME=${NAME}
16
+
17
+ if [ "$DEPLOYMENT" == "master" ]; then
18
+ echo ok
19
+ fi
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bash
2
+
3
+ BACKUP_PATH=${1:-../backup.tar.gz}
4
+
5
+ DIR="$( dirname -- "$( readlink -f -- "$0"; )"; )"
6
+ pushd "$DIR/.."
7
+
8
+ /etc/init.d/app stop
9
+ sleep 1
10
+ ./docker/restore-backup.sh $BACKUP_PATH
11
+ sleep 1
12
+ /etc/init.d/app start
13
+
14
+ popd
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env bash
2
+
3
+ BACKUP_PATH=${1:-../backup.tar.gz}
4
+ DB_NAME=${DB_NAME:-laszczewski-pl}
5
+
6
+ DIR="$( dirname -- "$( readlink -f -- "$0"; )"; )"
7
+ pushd "$DIR/.."
8
+
9
+ rm -rf backup
10
+ mkdir -p backup
11
+ pushd backup
12
+ tar -zxf $BACKUP_PATH
13
+ ../node_modules/.bin/lcdbc --serverUrl $DB_URL --verbose request database.deleteDatabase $DB_NAME
14
+ echo uploading data to database...
15
+ ../node_modules/.bin/lcdbc --serverUrl $DB_URL --verbose exec --targetDb $DB_NAME db.json
16
+ echo data uploaded
17
+ rm -rf ../storage/*
18
+ mv storage/* ../storage
19
+ echo backup restored
20
+ popd
21
+
22
+ popd
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+ touch /var/log/app.log
3
+ /etc/init.d/app start
4
+ tail -f /var/log/app.log
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env bash
2
+
3
+ POD_NAME=$1
4
+ BACKUP_PATH=${2:-../backup.tar.gz}
5
+
6
+ DIR="$( dirname -- "$( readlink -f -- "$0"; )"; )"
7
+ pushd "$DIR/.."
8
+
9
+ kubectl cp $BACKUP_PATH $POD_NAME:/app/backup.tar.gz
10
+ kubectl exec -it $POD_NAME -- /app/docker/restore-backup-with-service.sh /app/backup.tar.gz
11
+
12
+ popd