13 Commits

Author SHA1 Message Date
cd980f2af9 Merge pull request 'feature/deploy-from-image-2' (#4) from feature/deploy-from-image-2 into main
Reviewed-on: #4
2023-05-10 00:48:40 +00:00
0e02c8ab15 add develop branch pr's to test checks
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone Build is failing
2023-05-09 20:39:35 -04:00
01cb2818ff Perhaps this will work! 2023-05-09 20:38:01 -04:00
67c84a7254 Merge pull request 'Switch to docker image for deploy' (#3) from feature/deploy-from-image into main
Reviewed-on: #3
2023-05-10 00:32:10 +00:00
5b15fcd60f Merge branch 'main' into feature/deploy-from-image
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone Build was killed
2023-05-10 00:27:59 +00:00
1e1eac9dd6 Switch to docker image for deploy
All checks were successful
continuous-integration/drone/pr Build is passing
2023-05-09 20:27:28 -04:00
0d2ffe0f54 Merge pull request 'Probably not...' (#2) from feature/updated_compose into main
Reviewed-on: #2
2023-05-10 00:07:49 +00:00
991dc32ce4 Some extra changes
All checks were successful
continuous-integration/drone/pr Build is passing
2023-05-09 20:04:11 -04:00
d6a72ace83 Probably not...
All checks were successful
continuous-integration/drone/pr Build is passing
2023-05-09 19:43:58 -04:00
7a0d5dc48c Merge branch 'release/0.0.37'
# Conflicts:
#	package.json
2023-05-09 19:36:14 -04:00
fbc1e55e5c Merge branch 'main' of ssh://git.mifi.dev:12022/mifi/auth 2023-05-09 19:15:25 -04:00
653fc7d52f promnotions 2023-05-09 19:15:01 -04:00
84881edb61 promnotions 2023-05-09 19:14:04 -04:00
3 changed files with 51 additions and 4 deletions

View File

@@ -60,6 +60,7 @@ steps:
trigger: trigger:
branch: branch:
- main - main
- develop
event: event:
- pull_request - pull_request
@@ -155,6 +156,9 @@ name: Deploy Pipeline
workspace: workspace:
path: /drone/grow path: /drone/grow
clone:
disable: true
steps: steps:
- name: Deploy Container - name: Deploy Container
image: docker image: docker
@@ -165,10 +169,10 @@ steps:
ROUTE_PREFIX: /auth ROUTE_PREFIX: /auth
PORT: 9001 PORT: 9001
commands: commands:
- docker compose -f docker-compose.staging.yml pull - docker compose -f docker-compose.staging_image.yml pull
- docker compose -f docker-compose.staging.yml build --no-cache - docker compose -f docker-compose.staging_image.yml build --no-cache
- docker compose -f docker-compose.staging.yml rm --stop - docker compose -f docker-compose.staging_image.yml rm --stop
- docker compose -f docker-compose.staging.yml up --wait - docker compose -f docker-compose.staging_image.yml up --wait
volumes: volumes:
- name: env-secrets - name: env-secrets
path: /drone/grow/staging.env path: /drone/grow/staging.env
@@ -210,3 +214,5 @@ depends_on:
trigger: trigger:
event: event:
- promote - promote
target:
- production

View File

@@ -0,0 +1,38 @@
version: '3.8'
services:
auth-service_mongo:
container_name: ${CONTAINER_PREFIX}-auth-service_mongo
env_file:
- staging.env
networks:
- docknet
volumes:
- '/volume1/docker/labs/auth/mongo:/data/db'
# - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
restart: unless-stopped
image: mongo:latest
auth-service:
env_file:
- staging.env
container_name: ${CONTAINER_PREFIX}-auth-service
environment:
- DB_HOST=${CONTAINER_PREFIX}-auth-service_mongo
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.grow.rule=Host(`${HOST}`) && Path(`${ROUTE_PREFIX}`)'
- 'traefik.http.routers.grow.entrypoints=websecure'
- 'traefik.http.routers.grow.tls=true'
- 'traefik.http.routers.grow.tls.certresolver=letsencrypt'
- 'traefik.http.routers.grow.service=grow-service'
- 'traefik.http.services.grow-service.loadbalancer.server.port=${PORT}'
networks:
- docknet
restart: unless-stopped
image: git.mifi.dev/mifi/mifi/auth:latest
depends_on:
- auth-service_mongo
networks:
docknet:
name: docknet
external: true

View File

@@ -45,6 +45,9 @@ router.post(process.env.RESET_ROUTE || RESET_ROUTE, async (ctx, next) => {
}); });
router.patch('/:record', authenticated(), (ctx: Koa.Context) => { router.patch('/:record', authenticated(), (ctx: Koa.Context) => {
if (ctx.user !== ctx.param.record) {
ctx.throw(StatusCodes.UNAUTHORIZED);
}
const data = Auth.findOneAndUpdate({ record: ctx.params.record }); const data = Auth.findOneAndUpdate({ record: ctx.params.record });
if (!data) { if (!data) {
ctx.throw(StatusCodes.NOT_FOUND); ctx.throw(StatusCodes.NOT_FOUND);