Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin #138

Open
wants to merge 60 commits into
base: development
Choose a base branch
from
Open

Admin #138

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
6963c96
refactor: remove axios, fs-extra, morgan, rotating-file-stream. Repla…
felixleo22 Aug 19, 2024
b9ab570
docs: update docs
felixleo22 Aug 19, 2024
9012547
refactor: remove unused route
felixleo22 Aug 19, 2024
b10f969
perf: use useFetch than when it's recommanded
felixleo22 Aug 20, 2024
778b042
chore: use npm-run-all
felixleo22 Aug 20, 2024
4d2a8f1
fix: remove unused code and lint message
felixleo22 Sep 11, 2024
6af4e57
build: update dockerfile
felixleo22 Oct 3, 2024
2ca6f69
docs: syntax
felixleo22 Oct 3, 2024
e7748a6
fix: architecture and metrics and homepage
felixleo22 Oct 3, 2024
1a620b7
docs: jsdoc
felixleo22 Oct 16, 2024
2852419
refactor: add route config, rename function, update middleware. updat…
felixleo22 Oct 21, 2024
f739ae7
feat: add new administration vue in frontend and refactor update process
felixleo22 Nov 8, 2024
2ff74c1
fix: locale
felixleo22 Nov 8, 2024
a6d4608
feat: update style of text for admin menu
felixleo22 Nov 8, 2024
e44609e
feat: update docker-compose for build, style of admin menu
felixleo22 Nov 13, 2024
1c5c408
fix: update path of volumes
felixleo22 Nov 13, 2024
5fa38cb
feat: update path of start and readd healthcheck
felixleo22 Nov 13, 2024
f50527e
build(front): sync package-lock.json
nojhamster Nov 13, 2024
ac2444b
fix: version of nginx and access log in prod
felixleo22 Nov 15, 2024
1d0fc8b
fix: remove entrypoint
felixleo22 Nov 15, 2024
6031ebd
fix: remove /
felixleo22 Nov 15, 2024
1e55b32
fix: active = false for cron data update history
felixleo22 Nov 15, 2024
6d93abd
fix: accessLogger: use - as default for count doi
felixleo22 Nov 15, 2024
a9b0b61
fix: ping unpaywall
felixleo22 Nov 15, 2024
4d0770b
fix: i18n
felixleo22 Nov 15, 2024
69a470f
fix: create route to update metrics
felixleo22 Nov 15, 2024
cd3f8a9
fix: use downloadInsertChangefilesProcess function
felixleo22 Nov 18, 2024
c53f5d2
style: rename function
felixleo22 Nov 18, 2024
e6a7ae0
doc:s update docs
felixleo22 Nov 19, 2024
1fb535d
feat: update time of healthcheck
felixleo22 Nov 19, 2024
a39a9c1
fix: env of frontend, i18n, enrich config
felixleo22 Nov 19, 2024
323d210
refactor: rename function
felixleo22 Nov 19, 2024
d24a186
refactor: remove console.log
felixleo22 Nov 19, 2024
8eb9d99
refactor: update type of job
felixleo22 Nov 19, 2024
52a9a49
docs: update open api
felixleo22 Nov 19, 2024
6c270b8
fix: add type for cron
felixleo22 Nov 19, 2024
f8037e1
fix: update redis client
felixleo22 Nov 19, 2024
11af4ed
test: update index
felixleo22 Nov 19, 2024
3e1b4c1
fix: route for insert file
felixleo22 Nov 20, 2024
3730e85
fear: add index for insert file
felixleo22 Nov 20, 2024
fe4b900
fix: active cron
felixleo22 Nov 22, 2024
dfb0374
fix: add cleanFile on each jobs
felixleo22 Nov 22, 2024
3e23190
feat: config in one page
felixleo22 Nov 22, 2024
1752e8d
feat: add page on file
felixleo22 Nov 22, 2024
62910f5
refactor: use delete dialog from store for apikey
felixleo22 Nov 22, 2024
f86fd4e
feat: add cleanFile in job option
felixleo22 Nov 22, 2024
3278bad
test: add cleanFile
felixleo22 Nov 22, 2024
b5c8a9e
feat: allow delete file in prod
felixleo22 Nov 25, 2024
8251c81
fix: log message
felixleo22 Nov 25, 2024
6acb6ae
refactor
felixleo22 Nov 27, 2024
da4f08a
feat: use elastic jokers
felixleo22 Dec 12, 2024
54ffc49
fix: use all history for update
felixleo22 Dec 17, 2024
361ce26
build: optimize
felixleo22 Dec 17, 2024
1d6b12e
build: optimize
felixleo22 Dec 17, 2024
ff2dffc
fix: update default index
felixleo22 Dec 17, 2024
80827ab
build: fix user group
felixleo22 Dec 17, 2024
a590098
build: update Dockerfile
felixleo22 Jan 6, 2025
bc433fa
build: update healthcheck
felixleo22 Jan 6, 2025
25e92d2
build: update user for Dockerfile
felixleo22 Jan 14, 2025
8d51178
build: use nginx user
felixleo22 Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ A web interface is also available as a demonstrator. It allows you to :
On the front, a nginx acts as a reverse proxy, redirecting all these services to a single entry point.

Each service :
* [admin](./services/update#ezunpaywall-admin)
* [graphql](./services/graphql#ezunpaywall-graphql)
* [enrich](./services/enrich#ezunpaywall-enrich)
* [update](./services/update#ezunpaywall-update)
* [apikey](./services/apikey#ezunpaywall-apikey)
* [frontend](./services/frontend#ezunpaywall-frontend)
* [health](./services/health#ezunpaywall-health)
* [nginx](./services/nginx#ezunpaywall-nginx)
* [mail](./services/mail#ezunpaywall-mail)
* [fakeUnpaywall](./services/fakeUnpaywall#ezunpaywall-fakeUnpaywall) (only for dev)

## Network-flow
Expand Down Expand Up @@ -91,16 +88,15 @@ To run tests, you need ezunpaywall to be launched in dev mode with fakeUnpaywall
```bash
# there are alias on root folder
npm run test
npm run test:apikey
npm run test:admin
npm run test:enrich
npm run test:graphql
npm run test:update


# you can run test for each service
ezunpaywall/src/apikey npm run test
ezunpaywall/src/admin npm run test
ezunpaywall/src/enrich npm run test
ezunpaywall/src/graphql npm run test
ezunpaywall/src/update npm run test
```
### Deployment

Expand Down Expand Up @@ -146,4 +142,4 @@ docker-compose ps
## Data update

You can update your data via update snapshots provided by unpaywall on a weekly or daily basis (if you have API key).
in the update service, there is a cron that allows to automatically update the data from unpaywall, weekly or daily.
in the admin service, there is a cron that allows to automatically update the data from unpaywall, weekly or daily.
Binary file removed doc/network-flow.png
Binary file not shown.
179 changes: 63 additions & 116 deletions docker-compose.debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ services:
environment:
- NODE_ENV
# elastic
- ELASTICSEARCH_HOSTS
- ELASTICSEARCH_PORT
- ELASTICSEARCH_NODES
- ELASTICSEARCH_USERNAME
- ELASTICSEARCH_PASSWORD
- ELASTICSEARCH_INDEX_ALIAS
Expand All @@ -22,53 +21,6 @@ services:
command: "npm run dev"
ports:
- ${GRAPHQL_PORT:-59701}:3000
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"wget -Y off --no-verbose --tries=1 --spider http://localhost:3000/healthcheck || exit 1"
]
interval: 10s
timeout: 10s
retries: 5

update:
image: node:18.19.1
container_name: ezunpaywall-update-dev
environment:
- NODE_ENV
- LOG_LEVEL=debug
# unpaywall
- UNPAYWALL_APIKEY
- UNPAYWALL_HOST
# elastic
- ELASTICSEARCH_HOSTS
- ELASTICSEARCH_PORT
- ELASTICSEARCH_USERNAME
- ELASTICSEARCH_PASSWORD
- ELASTICSEARCH_INDEX_ALIAS
- ELASTICSEARCH_TIMEOUT
# redis
- REDIS_HOST
- REDIS_PORT
- REDIS_PASSWORD
# cron
- UPDATE_CRON_SCHEDULE
- UPDATE_CRON_ACTIVE
- UPDATE_CRON_INDEX
- UPDATE_CRON_INTERVAL
# password
- UPDATE_APIKEY
working_dir: /usr/src/app
volumes:
- ./services/update:/usr/src/app
command: "npm run dev"
ports:
- ${UPDATE_PORT:-59702}:3000
restart: unless-stopped
healthcheck:
test:
Expand All @@ -90,18 +42,13 @@ services:
- REDIS_PORT
- REDIS_PASSWORD
# graphql
- GRAPHQL_HOST=http://graphql:3000
- GRAPHQL_URL=http://graphql:3000
working_dir: /usr/src/app
volumes:
- ./services/enrich:/usr/src/app
command: "npm run dev"
ports:
- ${ENRICH_PORT:-59703}:3000
depends_on:
redis:
condition: service_healthy
elastic:
condition: service_healthy
- ${ENRICH_PORT:-59702}:3000
restart: unless-stopped
healthcheck:
test:
Expand All @@ -112,54 +59,63 @@ services:
interval: 10s
timeout: 10s
retries: 5

apikey:
admin:
image: node:18.19.1
container_name: ezunpaywall-apikey-dev
container_name: ezunpaywall-admin-dev
environment:
- NODE_ENV
- LOG_LEVEL=debug
# smtp
- SMTP_HOST=maildev
- SMTP_PORT
# mail
- NOTIFICATIONS_SENDER
- NOTIFICATIONS_RECEIVERS
- NOTIFICATIONS_MACHINE
# unpaywall
- UNPAYWALL_APIKEY
- UNPAYWALL_URL
# elastic
- ELASTICSEARCH_NODES
- ELASTICSEARCH_USERNAME
- ELASTICSEARCH_PASSWORD
- ELASTICSEARCH_INDEX_ALIAS
- ELASTICSEARCH_TIMEOUT
# redis
- REDIS_HOST
- REDIS_PORT
- REDIS_PASSWORD
working_dir: /usr/src/app
volumes:
- ./services/apikey:/usr/src/app
command: "npm run dev"
ports:
- ${APIKEY_PORT:-59704}:3000
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"wget -Y off --no-verbose --tries=1 --spider http://localhost:3000/healthcheck || exit 1"
]
interval: 10s
timeout: 10s
retries: 5

mail:
image: node:18.19.1
container_name: ezunpaywall-mail-dev
environment:
- NODE_CONFIG
- MAIL_SMTP_HOST=maildev
- MAIL_SMTP_PORT
- MAIL_NOTIFICATIONS_SENDER
- MAIL_NOTIFICATIONS_RECEIVERS
- MAIL_NOTIFICATIONS_MACHINE
# cron snapshot
- CRON_DOWNLOAD_SNAPSHOT_SCHEDULE
- CRON_DOWNLOAD_SNAPSHOT_ACTIVE
- CRON_DOWNLOAD_SNAPSHOT_INDEX
# cron date update
- CRON_DATA_UPDATE_SCHEDULE
- CRON_DATA_UPDATE_ACTIVE
- CRON_DATA_UPDATE_INDEX
- CRON_DATA_UPDATE_INTERVAL
# cron date update history
- CRON_DATA_UPDATE_HISTORY_SCHEDULE
- CRON_DATA_UPDATE_HISTORY_ACTIVE
- CRON_DATA_UPDATE_HISTORY_INDEX
- CRON_DATA_UPDATE_HISTORY_INDEX_HISTORY
- CRON_DATA_UPDATE_HISTORY_INTERVAL
# cron clean file
- CRON_CLEAN_FILE_SCHEDULE
- CRON_CLEAN_FILE_CHANGEFILE_THRESHOLD
- CRON_CLEAN_FILE_REPORT_THRESHOLD
- CRON_CLEAN_FILE_SNAPSHOT_THRESHOLD
# password
- MAIL_APIKEY
- ADMIN_APIKEY
# health
- HEALTH_TIMEOUT
working_dir: /usr/src/app
volumes:
- ./services/mail:/usr/src/app
- ./services/admin:/usr/src/app
command: "npm run dev"
ports:
- ${MAIL_PORT:-59705}:3000
- ${ADMIN_PORT:-59703}:3000
restart: unless-stopped
healthcheck:
test:
Expand All @@ -183,19 +139,17 @@ services:
- 24678:24678
environment:
- NODE_ENV
- NUXT_PUBLIC_ENVIRONMENT=development
- NUXT_PUBLIC_ENVIRONMENT
- NUXT_PUBLIC_ELASTIC_ENV=development
- NUXT_PUBLIC_VERSION=development
- NUXT_PUBLIC_UNPAYWALL_HOMEPAGE_HOST
- NUXT_PUBLIC_UNPAYWALL_API_HOST
- NUXT_PUBLIC_UNPAYWALL_HOST
- NUXT_PUBLIC_GRAPHQL_HOST
- NUXT_PUBLIC_UPDATE_HOST
- NUXT_PUBLIC_ENRICH_HOST
- NUXT_PUBLIC_APIKEY_HOST
- NUXT_PUBLIC_MAIL_HOST
- NUXT_MAIL_HOST
- NUXT_MAIL_APIKEY
- NUXT_PUBLIC_UNPAYWALL_HOMEPAGE_URL
- NUXT_PUBLIC_UNPAYWALL_API_URL
- NUXT_PUBLIC_UNPAYWALL_URL
- NUXT_PUBLIC_GRAPHQL_URL
- NUXT_PUBLIC_ENRICH_URL
- NUXT_PUBLIC_ADMIN_URL
- NUXT_ADMIN_URL
- NUXT_ADMIN_APIKEY
healthcheck:
test:
[
Expand Down Expand Up @@ -226,18 +180,15 @@ services:
retries: 5

nginx:
image: nginx:1.25.2
image: nginx:1.27.2
container_name: ezunpaywall-nginx-dev
environment:
# host of service
- NGINX_HOST=localhost
- FRONTEND_HOST=http://frontend:3000/
- GRAPHQL_HOST=http://graphql:3000/
- UPDATE_HOST=http://update:3000/
- ENRICH_HOST=http://enrich:3000/
- APIKEY_HOST=http://apikey:3000/
- MAIL_HOST=http://mail:3000/
- HEALTH_HOST=http://health:3000/
- FRONTEND_URL=http://frontend:3000/
- GRAPHQL_URL=http://graphql:3000/
- ENRICH_URL=http://enrich:3000/
- ADMIN_URL=http://admin:3000/
ports:
- ${NGINX_PORT:-80}:80
volumes:
Expand All @@ -246,14 +197,10 @@ services:
depends_on:
enrich:
condition: service_healthy
update:
admin:
condition: service_healthy
graphql:
condition: service_healthy
apikey:
condition: service_healthy
mail:
condition: service_healthy
frontend:
condition: service_healthy
healthcheck:
Expand Down
Loading