Skip to content

Commit

Permalink
feat: upgrade aws SDK (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tchoupinax authored Apr 4, 2023
1 parent 7561670 commit 0b9052d
Show file tree
Hide file tree
Showing 24 changed files with 4,621 additions and 7,638 deletions.
19 changes: 10 additions & 9 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
**

!package*.json
!tsconfig.json

!src
!config

config/local.json
**

!package.json
!yarn.lock
!tsconfig.json

!src
!config

config/local.json
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf

[*.md]
max_line_length = off
trim_trailing_whitespace = false
12 changes: 0 additions & 12 deletions .eslintrc

This file was deleted.

55 changes: 55 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module.exports = {
env: {
es2022: true,
node: true,
},
extends: [
"standard",
"plugin:@typescript-eslint/recommended",
"plugin:typescript-sort-keys/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: [
"@typescript-eslint",
"simple-import-sort",
"typescript-sort-keys",
"unused-imports",
],
root: true,
overrides: [
{
files: ["*.ts"],
rules: { "@typescript-eslint/explicit-function-return-type": "warn" },
},
],
rules: {
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/no-unused-vars": "error",
indent: ["error", 2, { ignoredNodes: ["PropertyDefinition"] }],
"arrow-body-style": "off",
"comma-dangle": ["error", "always-multiline"],
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
// "max-len": ["error", { code: 100 }],
"no-useless-constructor": "off",
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",
"space-before-function-paren": ["error", "always"],
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": "error",
camelcase: "off",
quotes: ["error", "double"],
semi: ["error", "always"],
"key-spacing": ["error", {
singleLine: {
beforeColon: false,
afterColon: true,
},
}],
},
};
52 changes: 23 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
FROM node:19-alpine as builder

WORKDIR /app

COPY package*.json .

RUN npm install

COPY . .

RUN npm run build

###

FROM node:19-alpine

WORKDIR /app

COPY package*.json .

RUN npm install

RUN mkdir src
COPY --from=builder /app/dist src/
COPY config config

USER node

CMD node src/index.js
FROM node:19-alpine as builder

WORKDIR /app
COPY package.json yarn.lock .
RUN yarn
COPY . .
RUN npm run build

###

FROM node:19-alpine

WORKDIR /app

COPY package.json yarn.lock .
RUN yarn install --production
RUN mkdir src
COPY --from=builder /app/dist src/
COPY config config

USER node

CMD node src/index.js
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# s3-prometheus-exporter

## Docker

```
docker pull tchoupinax/s3-prometheus-exporter
```
# s3-prometheus-exporter

## Docker

```
docker pull tchoupinax/s3-prometheus-exporter
```

## Configuration


`S3_ACCESS_KEY`:
`S3_BUCKET_NAME`: The name of the bucket to watch
`S3_ENDPOINT`:
`PORT`: The port on which the server listens
`S3_PREFIXES`: The prefix of files to watch. You can provide a list separataed by a comma. (e.g `prefix1,prefix2`)
`S3_SECRET_KEY`:
6 changes: 3 additions & 3 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"port": "PORT",
"accessKey": "S3_ACCESS_KEY",
"secretKey": "S3_SECRET_KEY",
"bucket": "S3_BUCKET_NAME",
"endpoint": "S3_ENDPOINT",
"port": "PORT",
"prefixes": "S3_PREFIXES",
"endpoint": "S3_ENDPOINT"
"secretKey": "S3_SECRET_KEY"
}
8 changes: 4 additions & 4 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"port": 6004,
"accessKey": "minio",
"secretKey": "minio",
"bucket": "minio",
"prefixes": "default",
"endpoint": "http://s3.fr-par.scw.cloud",
"logger": {
"level": "debug",
"pretty": true
}
},
"port": 6004,
"prefixes": "default",
"secretKey": "minio"
}
32 changes: 16 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
version: '3'
services:
minio:
image: quay.io/minio/minio:RELEASE.2022-04-12T06-55-35Z
command: server /data --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: adminminio
MINIO_ROOT_PASSWORD: adminminio
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
version: '3'
services:
minio:
image: quay.io/minio/minio:RELEASE.2022-04-12T06-55-35Z
command: server /data --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: adminminio
MINIO_ROOT_PASSWORD: adminminio
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
Loading

0 comments on commit 0b9052d

Please sign in to comment.