91 Commits
Author SHA1 Message Date
bachir fe99df7339 submodules update, added gdpFtIndex 2023-02-27 16:12:22 +01:00
bachir 2d36a12966 updated data & client 2023-02-18 20:42:21 +01:00
bachir 665a8f005f api update 2022-05-18 10:46:48 +02:00
bachir 1443588a11 #1243 2022-05-13 16:53:28 +02:00
bachir a7d89f4ebb #1265 2022-05-13 16:49:18 +02:00
bachir c1fe629589 #806 2022-05-13 15:28:29 +02:00
bachir a9860c79da client update 2022-04-07 22:49:24 +02:00
bachir 8ea27d3701 client update 2022-04-07 12:43:05 +02:00
bachir 8282acffd4 client update 2022-04-07 12:28:04 +02:00
bachir 02d923e064 client update 2022-04-07 10:54:45 +02:00
bachir 8a7f62e955 api update 2022-04-07 09:38:47 +02:00
bachir 66d1d722c3 client update 2022-03-18 15:37:21 +01:00
bachir a9db81d292 client update 2022-03-18 15:22:12 +01:00
bachir 0962464c8d client update 2022-03-17 19:05:24 +01:00
bachir 4e861c276a client update 2022-03-17 18:40:17 +01:00
bachir 24df0ab253 client update 2022-03-17 18:35:13 +01:00
bachir 4f56a7c8db client update 2022-03-17 18:27:38 +01:00
bachir 8b69854af5 client update 2022-03-17 16:34:32 +01:00
bachir f0b7f21bc6 client & webapp update: path matching 2022-03-17 15:47:28 +01:00
bachir 578cfec628 client update 2022-03-10 21:48:16 +01:00
bachir 062db05406 client update 2022-03-10 18:07:58 +01:00
bachir b91a1bb855 client update 2022-03-10 15:49:09 +01:00
bachir 999985c45e docker tryong to fix stage, client update 2022-03-10 10:42:42 +01:00
bachir 2086e9f3d2 client update 2022-03-04 17:23:41 +01:00
bachir 0879ec6185 client update 2022-03-04 00:15:49 +01:00
bachir 56104de8a3 client update 2022-03-03 18:30:11 +01:00
bachir f0f67b5182 client update 2022-03-03 18:00:02 +01:00
bachir a0c1fec080 client update 2022-03-03 17:18:23 +01:00
bachir 0ddcd650ee client update 2022-03-03 17:09:54 +01:00
bachir 4efccc1421 client, data, webapp updates 2022-03-03 16:37:21 +01:00
bachir 647cd93cd2 client update 2022-02-03 20:17:35 +01:00
bachir d4e70aa5d2 updated api 2022-02-03 19:19:26 +01:00
bachir cfda98a478 client: better typo 2022-01-20 18:35:16 +01:00
bachir 7d71e616a0 client: ligne de base 2022-01-20 17:31:34 +01:00
bachir 0d2d8ec548 docker basex bug fix, corpus list added texts, webapp update 2022-01-20 16:37:51 +01:00
bachir c14b7ab8af fixed /srv owner bug for basex 2022-01-20 16:36:57 +01:00
bachir 0065009a28 readme trouble shooting 2021-12-06 13:26:36 +01:00
bachir 5ff77b9cb1 readme trouble shooting 2021-12-06 13:26:25 +01:00
bachir 34ff18b0bd switched to right branch dev on repos webapp 2021-11-30 14:08:44 +01:00
bachir 29d31a172f client 2021-11-29 16:04:16 +01:00
bachir e509db16a6 misc 2021-11-29 15:51:56 +01:00
bachir 3c70fe7a1e client 2021-11-29 15:06:23 +01:00
bachir 5ba190b8d7 changed client doker port 2021-11-29 11:50:46 +01:00
bachir 8a0ebb3214 bug fixed: limited basex version to 9.4.6 2021-11-23 20:33:30 +01:00
bachir c461d5b1e4 makefile 2021-05-04 14:53:05 +02:00
bachir 8e84a71d83 updated DATA 2021-01-04 10:24:16 +01:00
bachir e42a4f012c client typo fix 2020-07-31 16:52:54 +02:00
bachir 085cc3bc29 database update 2020-07-31 16:11:30 +02:00
bachir 1a2297490c client: images 2020-07-31 13:13:12 +02:00
bachir a25987222a full update 2020-07-31 11:50:54 +02:00
bachir f293944dcb client update 2020-07-30 11:09:48 +02:00
bachir f3550bf5c6 client update 2020-07-29 18:19:34 +02:00
bachir 454d8a0bae client update 2020-07-29 18:15:54 +02:00
bachir 1846475aed client bugfix 2020-07-29 16:45:22 +02:00
bachir f438b24249 testing -webkit-overflow-scrolling 2020-07-29 11:14:53 +02:00
bachir 862b02584d client update 2020-07-28 13:10:38 +02:00
bachir 01b1955a66 client update 2020-07-28 12:02:39 +02:00
bachir 5f1dc1a71a client, webapp, synopsix update 2020-07-28 11:12:28 +02:00
bachir 0ca97afd07 client responsive 2020-07-27 19:19:16 +02:00
bachir ce41cdaeed update webapp, synopsix, client (biblio) 2020-07-27 11:12:13 +02:00
bachir c66592cf9f webapp update 2020-07-26 13:40:20 +02:00
bachir ef2f102e37 client refactoring, bug fix 2020-07-26 13:33:55 +02:00
bachir d636a2b79a client update 2020-07-26 00:18:43 +02:00
bachir 4bf8adb3d9 api update 2020-07-25 18:48:55 +02:00
bachir f0af68f2c4 client update 2020-07-23 12:03:09 +02:00
bachir 8b9ac95b30 client refactoring tocs and paginations 2020-07-22 19:12:42 +02:00
bachir 8ffe23f447 client update 2020-07-22 15:50:24 +02:00
bachir 5db80516bc client update 2020-07-22 15:46:51 +02:00
bachir d5b865b626 all updated (pagniation) 2020-07-22 13:04:03 +02:00
bachir 92797fee72 bug fix 2020-07-21 17:50:17 +02:00
bachir be1c9e8bc3 client update 2020-07-21 17:41:09 +02:00
bachir d42f6e5cb5 client pagination 2020-07-19 13:01:23 +02:00
bachir 8505ea611f nginx config bugfix (query params) -> readme) 2020-07-18 16:38:21 +02:00
bachir b5883150fc bugfix 2020-07-18 16:29:42 +02:00
bachir 4ddd13640f filters on server side integrated and other things 2020-07-18 16:17:09 +02:00
bachir 700edfdd40 client: search filter (faked), index item's text preview 2020-07-17 13:00:41 +02:00
bachir cd8ecfea69 added restart: always to basex in prod compose file 2020-07-15 00:11:09 +02:00
bachir 70117bb616 prod deployement fully functionnal 2020-07-15 00:05:44 +02:00
bachir c0c2a85ac4 bugfix 2020-07-14 22:51:35 +02:00
bachir a5c4d734c0 bugfix 2020-07-14 22:45:55 +02:00
bachir d70a20d3a6 bugfix 2020-07-14 22:37:47 +02:00
bachir 1ecd244343 client api access refactored bugfix 2020-07-14 22:34:00 +02:00
bachir 83cd5c8d6d client api access refactored 2020-07-14 22:27:41 +02:00
bachir 4be7c33948 client ready for prod (app_env) bugfix 2020-07-14 22:01:33 +02:00
bachir 3b877d2fb3 client ready for prod (app_env) bugfix 2020-07-14 18:15:28 +02:00
bachir c7ac1b3463 client ready for prod (app_env) 2020-07-14 18:11:39 +02:00
bachir f4811c7956 readme 2020-07-14 16:52:39 +02:00
bachir 0ace942135 readme 2020-07-14 16:52:12 +02:00
bachir 12bad6c56f readme 2020-07-14 16:50:26 +02:00
bachir f4b5497c36 bugfix 2020-07-14 16:39:15 +02:00
bachir ac94d2ca2f added APP_ENV dev or stage 2020-07-14 16:18:21 +02:00
15 changed files with 281 additions and 35 deletions
+1
View File
@@ -4,4 +4,5 @@ CLIENT_ROOT=./client
SYNOPSX_ROOT=./synopsx
WEBAPP_ROOT=./webapp
DATA_ROOT=./data
FTINDEX_ROOT=./gdpFtIndex
LOG_ROOT=./log
+3
View File
@@ -10,3 +10,6 @@
[submodule "webapp"]
path = webapp
url = https://github.com/guidesDeParis/webapp
[submodule "gdpFtIndex"]
path = gdpFtIndex
url = https://github.com/guidesDeParis/gdpFtIndex.git
+7 -4
View File
@@ -1,13 +1,16 @@
# FROM basex/basexhttp:9.4.6
FROM basex/basexhttp:latest
COPY ./bashrc /srv/.bashrc
COPY ./inputrc /srv/.inputrc
# COPY ./bashrc /srv/.bashrc
# COPY ./inputrc /srv/.inputrc
# RUN basex "db:create('gdp','/srv/basex/src/gdp.tei.xml', (),map {'ftindex': true(),'stemming': true(),'casesens': true(),'diacritics': true(),'language': 'fr','updindex': true(),'autooptimize': true(),'maxlen': 96,'maxcats': 100,'splitsize': 0,'chop': false(),'textindex': true(),'attrindex': true(),'tokenindex': true(), 'xinclude': true()})"
COPY ./gdp-entrypoint.sh /usr/local/bin
USER root
RUN chmod +x /usr/local/bin/gdp-entrypoint.sh
# RUN ln -s /usr/local/bin/gdp-entrypoint.sh /srv/ # backwards compat
USER basex
# RUN chown -R basex:basex /usr/local/bin/gdp-entrypoint.sh
# # RUN ln -s /usr/local/bin/gdp-entrypoint.sh /srv/ # backwards compat
RUN chown -R basex:basex /srv
# USER basex
CMD ["/bin/sh","/usr/local/bin/gdp-entrypoint.sh"]
+27 -3
View File
@@ -2,17 +2,41 @@
# todo: run some checks
id
ls -ls / | grep srv
echo "Creating GDP BaseX db"
basex "db:create('gdp','/srv/basex/src/gdp.tei.xml', (),map {'ftindex': true(),'stemming': true(),'casesens': true(),'diacritics': true(),'language': 'fr','updindex': true(),'autooptimize': true(),'maxlen': 96,'maxcats': 100,'splitsize': 0,'chop': false(),'textindex': true(),'attrindex': true(),'tokenindex': true(), 'xinclude': true()})"
# , 'serializer': 'indent=no'
echo "Creating FullText Index tmp file"
basex "xslt:transform(fn:doc('/srv/basex/src/gdp.tei.xml'), fn:doc('/srv/basex/src/xslt/generateFullTextIndex.xsl'))" > /tmp/gdpFtIndex.xml
# echo "Creating FullText Index tmp file"
# basex "xslt:transform(fn:doc('/srv/basex/src/gdp.tei.xml'), fn:doc('/srv/basex/src/xslt/generateFullTextIndex.xsl'))" > /tmp/gdpFtIndex.xml
echo "Creating FullText Index DB"
basex "db:create('gdpFtIndex', '/tmp/gdpFtIndex.xml', (),map {'ftindex': true(),'stemming': true(),'casesens': true(),'diacritics': true(),'language': 'fr','updindex': true(),'autooptimize': true(),'maxlen': 96,'maxcats': 100,'splitsize': 0,'chop': false(),'textindex': true(),'attrindex': true(),'tokenindex': true(), 'xinclude': true()})"
basex "db:create('gdpFtIndex', '/srv/basex/ftindex/gdpFtIndex.xml', (),map {'ftindex': true(),'stemming': true(),'casesens': true(),'diacritics': true(),'language': 'fr','updindex': true(),'autooptimize': true(),'maxlen': 96,'maxcats': 100,'splitsize': 0,'chop': false(),'textindex': true(),'attrindex': true(),'tokenindex': true(), 'xinclude': true()})"
# , 'serializer': 'indent=no'
# echo "Creating Advanced Search Index"
# basex -q "import module namespace gdp.models.tei = 'gdp.models.tei' at '/srv/basex/webapp/synopsx/workspace/gdp/models/tei.xqm' ;
# let $index := ('gdpIndexNominum', 'gdpIndexLocorum')
# return gdp.models.tei:addId2IndexedEntities($index)"
# basex "declare namespace tei = 'http://www.tei-c.org/ns/1.0' ;
# let $db := db:open('gdp')
# let $index := $db//tei:TEI[tei:teiHeader//tei:sourceDesc[@xml:id = $indexId]]
# for $occurence in fn:distinct-values($index//tei:listRelation/tei:relation/@passive ! fn:tokenize(., '\s+'))
# let $entries := $index//*[tei:listRelation/tei:relation[fn:contains(@passive, $occurence)]]
# let $element := $db//*[@xml:id = fn:substring-after($occurence, '#')]
# let $values := for $entry in $entries/@xml:id return fn:concat('#', $entry)
# return
# if ($element[fn:not(@ref)])
# then insert node attribute ref { $values } into $element
# else replace value of node $element/@ref with $values"
# as we override the parent container CMD, we have to launch basexhttp here
echo "Launching basexhttp"
basexhttp
# todo never launched, prev command never ends
echo "Launching indexing"
wget -S http://localhost:8984/indexing
+52 -13
View File
@@ -1,29 +1,68 @@
FROM node:lts-alpine
# FROM node:lts-alpine
# RUN apk update && apk --no-cache add shadow && \
# usermod -u 1001 node && \
# groupmod -g 1001 node
# ARG UID=1000
# ARG UNAME=gdp
# ARG GID=1000
# ARG GNAME=users
# #RUN find / -group ${UID} -exec chgrp -h node {} \;
# #RUN find / -user ${UID} -exec chown -h node {} \;
# # RUN addgroup -g ${GID} ${GNAME}
# RUN if [ $(getent group ${GNAME}) ]; then echo "group ${GNAME} already exists"; else addgroup -g ${GID} ${GNAME}; fi
# # else
# # echo "group does not exist."
# # fi
# # adduser -h /home/gdp -D -u 1000 gdp && \
# RUN adduser -u ${UID} -G ${GNAME} -s /bin/sh -D ${UNAME}
# # chown -R gdp:gdp /home/gdp
# USER ${UNAME}
# COPY ./bashrc /home/${UNAME}/.bashrc
# COPY ./inputrc /home/${UNAME}/.inputrc
# COPY ./client-entrypoint.sh /usr/local/bin
# USER root
# RUN chmod +x /usr/local/bin/client-entrypoint.sh
# USER ${UNAME}
# CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
# /////////////////////////////////////////////////////////////////////////////////
FROM node:16-alpine
RUN apk update && apk --no-cache add shadow && \
usermod -u 1001 node && \
groupmod -g 1001 node
ARG UID=1000
ARG UNAME=gdp
ARG GID=1000
ARG GNAME=users
# RUN find / -group 1000 -exec chgrp -h node {} \;
# RUN find / -user 1000 -exec chown -h node {} \;
#RUN find / -group ${UID} -exec chgrp -h node {} \;
#RUN find / -user ${UID} -exec chown -h node {} \;
ARG USER_UID
ARG USER_UNAME
ARG USER_GID
ARG USER_GNAME
RUN addgroup -g ${DID} ${GNAME}
RUN if [ $(getent group ${USER_GNAME}) ]; then echo "group ${USER_GNAME} already exists"; else addgroup -g ${USER_GID} ${USER_GNAME}; fi
# RUN addgroup -g 1000 ${USER_GNAME}
# adduser -h /home/gdp -D -u 1000 gdp && \
RUN adduser -u ${UID} -G ${GNAME} -s /bin/sh -D ${UNAME}
RUN adduser -u ${USER_UID} -G ${USER_GNAME} -s /bin/sh -D ${USER_UNAME}
# chown -R gdp:gdp /home/gdp
USER ${UNAME}
USER ${USER_UNAME}
COPY ./bashrc /home/${UNAME}/.bashrc
COPY ./inputrc /home/${UNAME}/.inputrc
COPY ./bashrc /home/${USER_UNAME}/.bashrc
COPY ./inputrc /home/${USER_UNAME}/.inputrc
COPY ./client-entrypoint.sh /usr/local/bin
USER root
RUN chmod +x /usr/local/bin/client-entrypoint.sh
USER ${UNAME}
USER ${USER_UNAME}
CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
+21 -6
View File
@@ -4,11 +4,26 @@ cat /etc/passwd|grep 1000
cd /app
echo "Cleaning node_modules"
rm -rf node_modules
# echo "Cleaning node_modules"
# rm -rf node_modules
echo "Npm install"
npm install
# echo "Cleaning npm cache"
# npm cache clean --f
echo "Run npm dev"
npm run dev
# echo "Npm install"
# npm install
echo "Npm clean install"
npm ci
# echo "Run npm dev"
# npm run dev
echo "APP_ENV $APP_ENV"
if [ "$APP_ENV" = "prod" ]; then
echo "Run npm prod"
npm run prod
else
echo "Run npm dev"
npm run dev
fi
+71
View File
@@ -0,0 +1,71 @@
#!/usr/bin/make
SHELL = /bin/sh
USER_UID := $(shell id -u)
USER_UNAME := $(shell id -un)
USER_GID := $(shell id -g)
USER_GNAME := $(shell id -gn)
export USER_UID
export USER_UNAME
export USER_GID
export USER_GNAME
build: build_basex build_client
build_basex:
docker-compose build basex
build_client:
docker-compose build --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) client
buildnc: buildnc_basex buildnc_client
buildnc_basex:
docker-compose build --pull --no-cache basex
buildnc_client:
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) client
up:
docker-compose up
upd:
docker-compose up -d
up_basex:
docker-compose up -d basex
up_client:
docker-compose up -d client
restart_basex:
docker-compose restart basex
restart_client:
docker-compose restart client
# upbuild:
# docker-compose up -d --build
ps:
docker-compose ps
logs:
docker-compose logs -f
logs_basex:
docker-compose logs basex -f
logs_client:
docker-compose logs client -f
down:
docker-compose down
exec_client:
docker exec -it gdp-client-1 sh
exec_basex:
docker exec -it gdp-basex-1 sh
exec_basex_root:
docker exec -u 0 -it gdp-basex-1 sh
+80 -2
View File
@@ -27,7 +27,7 @@ sudo docker-compose build
```
or with args for groups and users
```
docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg UNAME=$(id -un) --build-arg GNAME=$(id -gn)
docker-compose build --no-cache --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg UNAME=$(id -un) --build-arg GNAME=$(id -gn) [client | basex]
```
### run
then each time you want to launch the app
@@ -42,11 +42,13 @@ the api is ready, you can go to http://localhost:8984/home
before you can use the client you need to trigger this url http://localhost:8984/indexing
## Client
open http://localhost:8988 in your browser
open http://localhost:8998 in your browser
## Vhost or Cross Origins Policy
Cross origin poilicy will block the api requests from client
You'll need to install vhost domain for api and client, like dev.gdp.net and dev.api.gdp.net
Or in firefox install this addon to allow cors addons.mozilla.org/en-US/firefox/addon/cors-everywhere/
## Logs
@@ -70,6 +72,82 @@ or rebuild if data was updated
```
docker-compose up -d --build
```
or
```sh
docker-compose build --no-cache [client | basex]
docker-compose up -d [client | basex]
```
## Prod
run containers for prod
```
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
```
client will be built the client container stop
basex container will stay up
you have to serve client/dist/index.html with your own webserver (e.g. nginx, apache, etc)
### nginx conf
```nginx
server {
listen 80;
server_name dev.api.gdp.fr;
access_log off;
error_log /var/log/nginx/gdp/error.log error;
location / {
proxy_pass http://127.0.0.1:8984;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
add_header Access-Control-Allow-Origin *;
}
}
server {
listen 80;
server_name dev.gdp.fr;
access_log off;
error_log /var/log/nginx/gdp/error.log error;
location / {
proxy_pass http://127.0.0.1:8998;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
add_header Access-Control-Allow-Origin *;
}
}
```
## trouble shooting
/srv/basex has bad owner : 1000:users instead of basex:basex (1948:1984) (WHY ??)
```
docker exec -u 0 -it gdp-basex-1 sh
chown -R basex:basex /srv/basex
```
gdp-entrypoint is never launched, "launchit by hand" (WHY ??)
```
docker exec -it gdp-basex-1 sh
. /usr/local/bin/gdp-entrypoint.sh
```
## Doc
+1 -1
Submodule client updated: 14beb796ea...232b44f3c6
+1 -1
Submodule data updated: beee67faae...86052c67d5
+7
View File
@@ -0,0 +1,7 @@
version: '3.7'
services:
basex:
restart: always
client:
environment:
- APP_ENV=prod
+7 -3
View File
@@ -6,7 +6,9 @@ services:
- "${SYNOPSX_ROOT}:/srv/basex/webapp/synopsx"
- "${WEBAPP_ROOT}:/srv/basex/webapp/synopsx/workspace/gdp"
- "${DATA_ROOT}:/srv/basex/src"
- "${FTINDEX_ROOT}:/srv/basex/ftindex"
- basex-home:/srv
# - basex-data:/srv/basex/data
# - "${LOG_ROOT}:/var/log:rw"
ports:
- 1984:1984
@@ -17,13 +19,15 @@ services:
build: ./Docker/client
volumes:
- "${CLIENT_ROOT}:/app"
# - client-home:/home/gdp
- client-home:/home/${USER_UNAME}
ports:
- 8988:8988
- 8998:8998
working_dir: "/app"
depends_on:
- basex
environment:
- APP_ENV=dev
volumes:
basex-home:
# client-home:
client-home:
Submodule
+1
Submodule gdpFtIndex added at 9fc8e27978
+1 -1
Submodule synopsx updated: c84136501e...5185bab9fa
+1 -1
Submodule webapp updated: 34356e0fc7...220e4d0b21