Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
koolerjaebee committed Jan 22, 2025
0 parents commit c645c33
Show file tree
Hide file tree
Showing 31 changed files with 6,801 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**/node_modules/
**/.git
**/README.md
**/LICENSE
**/.vscode
**/npm-debug.log
**/coverage
**/.editorconfig
**/dist
**/*.pem
Dockerfile
76 changes: 76 additions & 0 deletions .github/workflows/azure-container-registry-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build and Push Docker Image
on:
push:
branches:
- develop

jobs:
build-and-push-image:
runs-on: ubuntu-22.04
environment: rndsillog-github
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: |
zarathucorp/indulgentia-github
- name: Set TAG env
run: echo "RELEASE_VERSION=v$(date +'%Y%m%d')" >> $GITHUB_ENV

- name: Metadata
run: echo "container tag will be 'latest' and '${{ env.RELEASE_VERSION }}'"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Set env before build
run: |
touch .env
echo "APP_ID=${{ secrets.APP_ID }}" >> .env
echo "PORT=${{ secrets.PORT }}" >> .env
echo "HOST=${{ secrets.HOST }}" >> .env
echo "PRIVATE_KEY=${{ secrets.PRIVATE_KEY }}" >> .env
echo "WEBHOOK_SECRET=${{ secrets.WEBHOOK_SECRET }}" >> .env
echo "GITHUB_CLIENT_ID=${{ secrets.PROBOT_GITHUB_CLIENT_ID }}" >> .env
echo "GITHUB_CLIENT_SECRET=${{ secrets.PROBOT_GITHUB_CLIENT_SECRET }}" >> .env
echo "CONNECTION_STRING=${{ secrets.CONNECTION_STRING }}" >> .env
echo "CONTAINER_NAME=${{ secrets.CONTAINER_NAME }}" >> .env
echo "SUPABASE_URL=${{ secrets.SUPABASE_URL }}" >> .env
echo "SUPABASE_KEY=${{ secrets.SUPABASE_KEY }}" >> .env
echo "API_SERVER_URL=${{ secrets.API_SERVER_URL }}" >> .env
ls -a
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/indulgentia-github:latest
ghcr.io/${{ github.repository_owner }}/indulgentia-github:${{ env.RELEASE_VERSION }}
- name: Trigger rndsillog-network repo action
run: |
curl -X POST -H "Authorization: token ${{ secrets.GHCR_TOKEN }}" \
-d '{"event_type": "trigger"}' \
https://api.github.com/repos/zarathucorp/rndsillog-network/dispatches
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
npm-debug.log
*.pem
!mock-cert.pem
.env
coverage
lib
.DS_Store
73 changes: 73 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
education, socio-economic status, nationality, personal appearance, race,
religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at . All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Contributing

[fork]: /fork
[pr]: /compare
[code-of-conduct]: CODE_OF_CONDUCT.md

Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.

Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms.

## Issues and PRs

If you have suggestions for how this project could be improved, or want to report a bug, open an issue! We'd love all and any contributions. If you have questions, too, we'd love to hear them.

We'd also love PRs. If you're thinking of a large PR, we advise opening up an issue first to talk about it, though! Look at the links below if you're not sure how to open a PR.

## Submitting a pull request

1. [Fork][fork] and clone the repository.
1. Configure and install the dependencies: `npm install`.
1. Make sure the tests pass on your machine: `npm test`, note: these tests also apply the linter, so there's no need to lint separately.
1. Create a new branch: `git checkout -b my-branch-name`.
1. Make your change, add tests, and make sure the tests still pass.
1. Push to your fork and [submit a pull request][pr].
1. Pat your self on the back and wait for your pull request to be reviewed and merged.

Here are a few things you can do that will increase the likelihood of your pull request being accepted:

- Write and update tests.
- Keep your changes as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).

Work in Progress pull requests are also welcome to get feedback early on, or if there is something blocked you.

## Resources

- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
- [GitHub Help](https://help.github.com)
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:20-slim
WORKDIR /usr/src/app

# Install app dependencies
RUN apt-get update && apt-get install -y \
bzip2

COPY package.json package-lock.json ./
RUN npm ci # --production 플래그를 제거하여 devDependencies 설치
RUN npm cache clean --force
ENV NODE_ENV="production"
COPY . .
RUN npm run build
CMD [ "npm", "start" ]
15 changes: 15 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2024, Changwoo Lim

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
72 changes: 72 additions & 0 deletions README.ko.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# indulgentia-github

> [Probot](https://github.com/probot/probot)으로 구축된 GitHub 앱 "indulgentia-github" GitHub 모듈
## 설정 전 준비사항
다음 정보가 필요합니다:
1. Azure Blob Storage
- CONNECTION_STRING
- CONTAINER_NAME
2. Supabase
- SUPABASE_URL
- SUPABASE_KEY
3. indulgentia-back URL

## 설정

### indulgentia-github 등록

1. "indulgentia-github"을 등록하세요.

```sh
# 의존성 설치
npm install

# 봇 실행
npm start
```

2. http://localhost:3000을 방문하여 다음과 같은 화면을 확인하세요:

![Rndsillog Probot Setup Wizard Example](./public/rndsillog-probot-setup-wizard.svg)

3. GitHub 앱 등록 버튼을 클릭하세요.
4. 고유한 "indulgentia-github" 이름을 설정하세요.
5. GitHub 앱을 등록한 후, 앱을 설치할 저장소로 리디렉션됩니다. 로컬 .env 파일은 리디렉션 중 GitHub에서 전송된 값으로 채워집니다.
6. "indulgentia-github"을 시작하기 전에 .env (또는 도커 환경 변수)를 다음과 같이 설정해야 합니다:

```.env
# Azure
CONNECTION_STRING=<blob-storage-connection-string>
CONTAINER_NAME=<blob-storage-container-name>
# Supabase
SUPABASE_URL=<supabase-URL>
SUPABASE_KEY=<supabase-service_role-key>
# API 서버
API_SERVER_URL=<indulgentia-back-URL>
```
> **(정보)** "indulgentia-github"을 "indulgentia-front" 및 "indulgentia-back"와 별도로 "open-rndsillog-network"를 수정하여 설정할 수 있습니다.
7. 이제 준비가 완료되었습니다! "open-rndsillog-network"의 지침을 따르세요.

### Docker 사용 시작

```sh
# 1. 컨테이너 빌드
docker build -t indulgentia-github .

# 2. 컨테이너 시작
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> indulgentia-github
```

## 기여

"indulgentia-github"을 개선할 수 있는 제안이나 버그 신고가 있다면 이슈를 열어주세요! 모든 기여를 환영합니다.

자세한 내용은 [기여 가이드](CONTRIBUTING.md)를 확인하세요.

## 라이선스

[ISC](LICENSE) © 2024 Changwoo Lim
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# indulgentia-github

> A GitHub App built with [Probot](https://github.com/probot/probot) that "indulgentia-github" GitHub Module
## Before Setup
You need the following information:
1. Azure blob storage
- CONNECTION_STRING
- CONTAINER_NAME
2. Supabase
- SUPABASE_URL
- SUPABASE_KEY
3. indulgentia-back URL

## Setup

### Register indulgentia-github

1. Register your own "indulgentia-github"

```sh
# Install dependencies
npm install

# Run the bot
npm start
```

2. Visit http://localhost:3000 to see something like this:

![Rndsillog Probot Setup Wizard Example](./public/rndsillog-probot-setup-wizard.svg)

3. Click the Register GitHub App button.
4. Set a unique "indulgentia-github" name.
5. After registering your GitHub App, you'll be redirected to install the app on any repositories. Your local .env file will be populated with values GitHub sends during the redirect.
6. Before starting your "indulgentia-github", you must set .env (or docker env parameter) like this:

```.env
# Azure
CONNECTION_STRING=<blob-storage-connection-string>
CONTAINER_NAME=<blob-storage-container-name>
# Supabase
SUPABASE_URL=<supabase-URL>
SUPABASE_KEY=<supabase-service_role-key>
# API Server
API_SERVER_URL=<indulgentia-back-URL>
```
> **(info)** You can set "indulgentia-github" separately from "indulgentia-front" & "indulgentia-back" by fixing "open-rndsillog-network".
7. Now you are ready to go! Please follow the instructions of "open-rndsillog-network".

### Start using Docker

```sh
# 1. Build container
docker build -t indulgentia-github .

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> indulgentia-github
```

## Contributing

If you have suggestions for how "indulgentia-github" could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the [Contributing Guide](CONTRIBUTING.md).

## License

[ISC](LICENSE) © 2024 Changwoo Lim
Loading

0 comments on commit c645c33

Please sign in to comment.