npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ckstack/ck-gw-core

v2.101.2

Published

core api gateway module

Downloads

2,280

Readme

버전 제한

  • NodeJS : 14.16.0
  • npm : 7.6.1

package-lock.json 은 npm 버전에 따라서 바뀔 수 있기 때문에, npm 버전을 맞추어야 한다.

NodeJS 특정 버전 설치하기 위해서는 NodeJS 홈페이지에서 버전 다운로드 받아 설치하면 된다. NPM 은 다음 명령어로 특정 버전을 설치 하면 된다.

$ npm i -g [email protected]

GRPC

GRPC 서버 접근 소스에 접근 하기 위해서 다음 파일을 복사 해야 한다.

  • ms-core/src/proto : src/proto 에 덮어 쓰도록 한다.

Docker

설명

ras5 기본 Rest API를 처리하는 docker 이미지 이다. 다음과 같이 버전 관리 하도록 한다.

  • 개발 : x.<0 또는 odd>.x
  • 상용 : x..x

즉, 개발은 중간 버전을 홀수(1.0.0, 또는 1.1.0) 으로 상용은 짝수(1.2.0) 으로 한다. 즉, 1.0.0 과 1.2.0 은 같은 버전이고, 1.1.0 과 1.4.0 도 같은 버전이다.(환경-개발, 상용만 다름)

이미지 생성

$ docker image build --build-arg BUILDER_TYPE=development -t ras5/gw_core:1.0.0 .
$ docker image build --build-arg BUILDER_TYPE=production -t ras5/gw_core:1.0.0 .

이미지 삭제

$ docker image rm ras5/gw_core:1.0.0

dangle 이미지

  • 조회
$ docker image ls -f dangling=true
  • 삭제
$ docker image rm -f $(docker images -f "dangling=true" -q)

이미지 추출

$ docker image save -o ras5_gw_core_1_0_0.tar ras5/gw_core:1.0.0

이미지 로드

$ docker image load -i ras5_gw_core_1_0_0.tar

컨테이너

테스트용 실행

$ docker container run -dit --name ras5_gw_core \
          -p 9000:9000 \
          ras5/gw_core:1.0.0 \
          /bin/sh

접근

$ docker container attach ras5_gw_core

중단

$ docker container stop ras5_gw_core ; docker container rm ras5_gw_core

환경 변수

  • PG_TIME_ZONE : 기본 타임존
  • PG_LANG : 기본 언어
  • PG_LOG_LEVEL : 로그 레벨
  • PG_FILE_ERR_MILLI_SEC : 파일 처리 제한 시간. 파일 처리시 설정 시간 보다 더 걸리면 에러 로그 출력. milli-sec 단위
  • PG_PROC_ERR_MILLI_SEC : 로직 처리 제한 시간. 로직 처리시 설정 시간 보다 더 걸리면 에러 로그 출력. milli-sec 단위
  • PG_REDIS_ERR_MILLI_SEC : Redis 처리 제한 시간. Redis 처리시 설정 시간 보다 더 걸리면 에러 로그 출력. milli-sec 단위
  • PG_INFLUX_ERR_MILLI_SEC : Influx 처리 제한 시간. Influx 처리시 설정 시간 보다 더 걸리면 에러 로그 출력. milli-sec 단위
  • PG_MQTT_PUB_ERR_MILLI_SEC : Mqtt publish 처리 제한 시간. Mqtt publish 처리시 설정 시간 보다 더 걸리면 에러 로그 출력. milli-sec 단위
  • PG_GRPC_ERR_MILLI_SEC : GRPC 서버 연동 제한 시간. GRPC 연동시 설정 시간 보다 더 걸리면 에러 로그 출력. milli-sec 단위
  • PG_GWCORE_MSCORE_USE : ms-core 를 사용 할지 여부. true 라면 사용 한다.
  • PG_GWCORE_MSCORE_GRPC_HOST : ms-core 의 hostname
  • PG_GWCORE_MSCORE_GRPC_PORT : ms-core 의 port
  • PG_GWCORE_MSBOARD_USE : ms-board 를 사용 할지 여부. true 라면 사용 한다.
  • PG_GWCORE_MSBOARD_GRPC_HOST : ms-board 의 hostname
  • PG_GWCORE_MSBOARD_GRPC_PORT : ms-board 의 port
  • PG_GWCORE_API_URL_PATH_PREFIX : Rest API 의 prefix. 일반적으로 버전명을 붙인다. v1, v2 등등
  • PG_GWCORE_USER_EXTRA_TEMPLATE_RID : 유저 가입시 사용될 유저 부가 정보 템플릿의 리소스 아이디. 값이 없으면 부가 정보 사용 하지 않음
  • PG_GWCORE_HTTP_REQUEST_JSON_BODY_SIZE_LIMIT : Rest API 의 body max size. 10000kb 형태로 사용
  • PG_GWCORE_AUTH_FILTER_ERR_MILLI_SEC : authorization 필터 처리 제한 시간. 설정 시간 보다 더 걸리면 에러 로그 출력. milli-sec 단위
  • PG_GWCORE_FILE_UPLOAD_MAX_BYTE : 파일 업로드 허용 최대 사이즈. byte 단위.
  • PG_GWCORE_NON_S3_PRIVATE_FILE_URL_PREFIX : S3에 업로드 되지 않고, private 파일이 아닐때, 파일에 접근하는 URL Prefix. nginx 에서 해당 패스에 대해서 url location alias 설정을 해 주어야 한다.
  • PG_GWCORE_FILE_SERVER : 파일에 접근 할 수 있는 파일 서버 주소. https://ras5.ckpush.com 형태
  • PG_GWCORE_GOOGLE_OAUTH2_CLIENT_ID : 구글 로그인을 위한 OAuth2 클라이언트 아이디

디렉토리 및 파일

  • /data/log/gw : 로그 디렉토리
  • /data/files/gw : 파일 업로드시 저장되는 디렉토리
  • /data/oauth2/apple/key.p8 : 애플 로그인시 사용될 Apple Developer Key 파일의 파일 경로