Skip to content

Commit

Permalink
Merge pull request #114 from BanklessDAO/develop
Browse files Browse the repository at this point in the history
Update main to Mad Hatter v1.5
  • Loading branch information
nonsense authored May 19, 2023
2 parents 072492a + dc15263 commit a462aa4
Show file tree
Hide file tree
Showing 21 changed files with 1,891 additions and 1,012 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.10.0'
node-version: '18.12.1'
- name: Install dependencies
run: yarn install
- name: Lint Code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.10.0'
node-version: '18.12.1'
- name: Install dependencies
run: yarn install
- name: Lint Code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.10.0'
node-version: '18.12.1'
- name: Install dependencies
run: yarn install
- name: Lint Code
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.5-PRE-RELEASE (2023-03-15)

1. Bump json5 from 2.2.0 to 2.2.3 per Dependabot alert
2. Bump webpack from 5.64.1 to 5.76.0 per Dependabot alert
3. Changed Node engine from 16.x to 18.x
4. Update doc:developer.md to include grafana and mongodb setup
5. Update Docker to use Node v18

## 1.4.7-RELEASE (2022-12-30)

1. Update `slash-create`
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.10.0-alpine
FROM node:18-alpine
WORKDIR /app
COPY package*.json yarn.lock ./
RUN yarn install
Expand Down
8 changes: 1 addition & 7 deletions Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM node:16.13.0-buster-slim

FROM node:18.16.0-buster-slim
WORKDIR /app

RUN apt-get update && \
apt-get install --quiet --yes \
build-essential \
Expand All @@ -10,11 +8,7 @@ RUN apt-get update && \
libjpeg-dev \
libgif-dev \
librsvg2-dev

COPY package*.json yarn.lock ./

RUN yarn install

COPY . ./

CMD ["yarn", "start"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

## Development Setup
### Prerequisites
- Install [Node.js 16.x](https://nodejs.org/en/) which includes [Node Package Manager](https://docs.npmjs.com/getting-started)
- Install [Node.js 18.x](https://nodejs.org/en/) which includes [Node Package Manager](https://docs.npmjs.com/getting-started)
- Install [Yarn 1.x](https://classic.yarnpkg.com/lang/en/docs/install)
- Install [Docker Desktop](https://www.docker.com/products/docker-desktop) which includes Docker Engine, Docker CLI client, and Docker Compose.
- Configure Discord application on the [Discord Developer Portal](https://discord.com/developers/applications).
Expand Down
55 changes: 54 additions & 1 deletion docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,66 @@ Invite link:
https://discord.com/api/oauth2/authorize?client_id=<YOUR_CLIENT_ID_HERE>&permissions=399163616342&scope=applications.commands%20bot
```


### Enable Developer Mode

Open Discord User Settings, navigate to Advanced, and enable Developer Mode:
![](images/discord_developer_mode.png)

## Setup local environment file

Create a `.env` file in the project root directory using `.env.template` as a template.

### Setup grafana
1. Visit [Grafana.com](https://grafana.com/) :

![](images/grafana-landing.png)

Sign in or create an account if you don't already have one. :

![](images/grafana-create-acct.png)

Click `API keys` to create a new API key or use one you already have.
Copy your API key and your username into the .env file:
![](images/grafana-create-api.png)

### Setup MongoDB.

1. Visit MongoDB [website](https://account.mongodb.com/account/login) to create an account or login to your account:

2. create Project.:

![](images/createdb.png)

3. Create your project Database:

![](images/deployproject.png)

4. Setup your project details.: Username and password.
NB: copy and save your username and password somewhere as this will be included in the .env file as MONGODB_USERNAME and MONGODB_PASS

![](images/setFinish.png)

5. Add IP address:

![](images/addIP.png)

6. Complete setup. Click on the finish and close button:

![](images/finishup.png)

7. You should have a dashboard that looks likes this,
Click on the connect button to get the connection link:
![](images/dashboard.png)

8. Click on Connect your application button to get your connections link (MONGODB_CLUSTER):
![](images/connect.png)

9. Copy your connection link.

Copy your MONGODB_PREFIX and MONGODB_CLUSTER in to your .env file from the connection link provided has as specified in the image below:
![](images/link-ex.png)


| Variable | Description|
| --- | --- |
| DISCORD_BOT_APPLICATION_ID | Copy value of `APPLICATION ID` from Discord Developer Portal under your applications "General Information" tab. |
Expand All @@ -73,6 +124,8 @@ Create a `.env` file in the project root directory using `.env.template` as a te
| MONGODB_USERNAME | Omit if using Docker to build the application. |
| MONGODB_PASS | Omit if using Docker to build the application. |
| MONGODB_CLUSTER | Omit if using Docker to build the application. |
| LOKI_USER_NAME | Put in your grafana `username` here. |
| LOKI_PASSWORD | Put in your copied grafana `API key` here. |


Example `.env` file (example uses random fake keys):
Expand Down
Binary file added docs/images/addIP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/createdb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/deployproject.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/finishup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/grafana-create-acct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/grafana-create-api.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/grafana-landing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/link-ex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/setFinish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mad-hatter",
"version": "1.4.7",
"version": "1.5",
"description": "Administrative and Utilitarian bot for the Bankless Discord Server.",
"main": "app.js",
"private": true,
Expand Down Expand Up @@ -53,23 +53,23 @@
"uuid": "^8.3.2"
},
"devDependencies": {
"@shelf/jest-mongodb": "^2.1.0",
"@types/jest": "^27.0.1",
"@shelf/jest-mongodb": "^4.1.7",
"@types/jest": "^29.5.0",
"@types/mongodb": "^3.6.20",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"builder-pattern": "^1.3.0",
"eslint": "^7.27.0",
"jest": "^27.0.6",
"ts-jest": "^27.0.5",
"jest": "^29.5.0",
"ts-jest": "^29.0.5",
"ts-loader": "^9.2.3",
"typescript": "4.4.3",
"webpack": "^5.44.0",
"webpack": "^5.76.0",
"webpack-cli": "^4.7.2"
},
"engines": {
"yarn": "1.x",
"node": "16.x"
"node": "18.x"
},
"engineStrict": true
}
Loading

0 comments on commit a462aa4

Please sign in to comment.