Skip to content

from ups6tream #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d09bde8
fix: upgrade mongodb from 3.5.9 to 3.6.0
snyk-bot Aug 21, 2020
f82a992
Bump bl from 2.2.0 to 2.2.1
dependabot[bot] Sep 3, 2020
1589992
Bump ini from 1.3.5 to 1.3.7
dependabot[bot] Dec 10, 2020
e29fedf
Merge pull request #75 from BretFisher/snyk-upgrade-53b821e37711ce700…
BretFisher Feb 4, 2021
dc7869d
Merge pull request #76 from BretFisher/dependabot/npm_and_yarn/bl-2.2.1
BretFisher Feb 4, 2021
245c6ff
Merge pull request #78 from BretFisher/dependabot/npm_and_yarn/ini-1.3.7
BretFisher Feb 4, 2021
1bab5e5
fixes #79
BretFisher Feb 4, 2021
59d2d90
fix: upgrade mongodb from 3.6.0 to 3.6.3
snyk-bot Feb 5, 2021
a379736
NPM manifests should be owned by node user
Feb 10, 2021
5e4366f
Merge pull request #82 from earnubs/main
BretFisher Mar 4, 2021
667a81f
Merge pull request #81 from BretFisher/snyk-upgrade-b1b206119b2bc07c5…
BretFisher Mar 4, 2021
1f5c652
Merge pull request #84 from BretFisher/master
BretFisher Mar 4, 2021
0dbf37e
Remove :delegated
mcculleydj Mar 21, 2021
127323a
Merge pull request #85 from mcculleydj/patch-1
BretFisher Mar 21, 2021
047d776
Bump y18n from 4.0.0 to 4.0.1
dependabot[bot] Apr 1, 2021
5a291c4
Merge pull request #86 from BretFisher/dependabot/npm_and_yarn/y18n-4…
BretFisher Apr 21, 2021
e3ae9c6
Bump lodash from 4.17.19 to 4.17.21
dependabot[bot] May 11, 2021
2d902f3
Bump glob-parent from 5.1.1 to 5.1.2
dependabot[bot] Jun 8, 2021
5bf3cbd
Merge pull request #88 from BretFisher/dependabot/npm_and_yarn/lodash…
BretFisher Jun 11, 2021
584ff17
Bump normalize-url from 4.5.0 to 4.5.1
dependabot[bot] Jun 11, 2021
b2a7c32
Merge pull request #89 from BretFisher/dependabot/npm_and_yarn/glob-p…
BretFisher Jun 11, 2021
69bef51
Merge pull request #90 from BretFisher/dependabot/npm_and_yarn/normal…
BretFisher Jul 2, 2021
8934a1d
chore: update lockfile to v2 and packages to latest semver constraine…
snowbytes Sep 13, 2021
45c5f30
Merge pull request #93 from snowbytes/chore/upgrade-lockfile
BretFisher Sep 20, 2021
01e5b7f
adding gha (#95)
BretFisher Jan 17, 2022
4dd2005
package updates
BretFisher Jan 17, 2022
034b816
Merge remote-tracking branch 'refs/remotes/origin/main'
BretFisher Jan 17, 2022
43acc6e
general updates
BretFisher Jan 17, 2022
ca32980
fixing lints
BretFisher Jan 17, 2022
323dd8e
moving to remote job
BretFisher Jan 17, 2022
c49e1eb
Create FUNDING.yml
BretFisher Jan 21, 2022
6f64eaa
Bump minimist from 1.2.5 to 1.2.6
dependabot[bot] Apr 9, 2022
452f8ed
Merge pull request #96 from BretFisher/dependabot/npm_and_yarn/minimi…
BretFisher May 10, 2022
b3f3303
update gha reusable workflows (#97)
BretFisher May 10, 2022
ed043de
Update README.md
BretFisher May 10, 2022
050927f
Update README.md
BretFisher Sep 19, 2022
5da9c6c
Fixes, docs, and example tweaks for 2022 (#101)
BretFisher Sep 20, 2022
222235b
Fix spelling error in docker-compose.yml (#105)
remnantkevin Sep 26, 2022
b9a1d89
moving to central funding URL
BretFisher Jan 21, 2023
14f6638
Bump cookiejar from 2.1.3 to 2.1.4
dependabot[bot] Jan 24, 2023
f2ea028
Merge pull request #106 from BretFisher/dependabot/npm_and_yarn/cooki…
BretFisher Jul 1, 2023
406a6cf
2023 updates (#107)
BretFisher Jul 1, 2023
7fd4a14
Bump mongodb from 4.16.0 to 4.17.0
dependabot[bot] Aug 30, 2023
bdeeab5
Merge pull request #110 from BretFisher/dependabot/npm_and_yarn/mongo…
BretFisher Aug 31, 2023
40237dd
Bump ip from 2.0.0 to 2.0.1
dependabot[bot] Feb 20, 2024
ef05546
Merge pull request #111 from BretFisher/dependabot/npm_and_yarn/ip-2.0.1
BretFisher Feb 20, 2024
7d3a30a
Bump express from 4.18.2 to 4.19.2
dependabot[bot] Mar 29, 2024
3d825cd
Merge pull request #114 from BretFisher/dependabot/npm_and_yarn/expre…
BretFisher Mar 29, 2024
45a3654
Bump braces from 3.0.2 to 3.0.3
dependabot[bot] Jun 16, 2024
0f1db02
Merge pull request #117 from BretFisher/dependabot/npm_and_yarn/brace…
BretFisher Jun 17, 2024
5ff1c11
Bump serve-static and express
dependabot[bot] Sep 17, 2024
2ace0f0
Bump send and express
dependabot[bot] Sep 17, 2024
1fe9991
Merge pull request #119 from BretFisher/dependabot/npm_and_yarn/multi…
BretFisher Sep 17, 2024
74de3c2
Merge pull request #118 from BretFisher/dependabot/npm_and_yarn/multi…
BretFisher Sep 17, 2024
b30cd0d
Bump fast-xml-parser and @aws-sdk/credential-providers
dependabot[bot] Sep 17, 2024
06b87f6
Merge pull request #120 from BretFisher/dependabot/npm_and_yarn/multi…
BretFisher Sep 17, 2024
25b79c8
Bump cookie and express
dependabot[bot] Oct 19, 2024
9c6136c
Merge pull request #121 from BretFisher/dependabot/npm_and_yarn/multi…
BretFisher Oct 19, 2024
73aba08
Bump path-to-regexp and express
dependabot[bot] Dec 5, 2024
de1bfba
Merge pull request #123 from BretFisher/dependabot/npm_and_yarn/multi…
BretFisher Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
44 changes: 44 additions & 0 deletions .github/linters/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# README: https://github.com/hadolint/hadolint

# Often it's a good idea to do inline disables rather that repo-wide in this file.
# Example of inline Dockerfile rules:
# hadolint ignore=DL3018
#RUN apk add --no-cache git

failure-threshold: warning

# or just ignore rules repo-wide
ignored:
- DL3003 #ignore that we use cd sometimes
- DL3006 #image pin versions
- DL3008 #apt pin versions
- DL3018 #apk add pin versions
- DL3022 #bad rule for COPY --from
- DL3028 #gem install pin versions
- DL3059 #multiple consecutive runs
- DL4006 #we don't need pipefail in this
- SC2016 #we want single quotes sometimes


# FULL TEMPLATE
# failure-threshold: string # name of threshold level (error | warning | info | style | ignore | none)
# format: string # Output format (tty | json | checkstyle | codeclimate | gitlab_codeclimate | gnu | codacy)
# ignored: [string] # list of rules
# label-schema: # See Linting Labels below for specific label-schema details
# author: string # Your name
# contact: string # email address
# created: timestamp # rfc3339 datetime
# version: string # semver
# documentation: string # url
# git-revision: string # hash
# license: string # spdx
# no-color: boolean # true | false
# no-fail: boolean # true | false
# override:
# error: [string] # list of rules
# warning: [string] # list of rules
# info: [string] # list of rules
# style: [string] # list of rules
# strict-labels: boolean # true | false
# disable-ignore-pragma: boolean # true | false
# trustedRegistries: string | [string] # registry or list of registries
9 changes: 9 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MD013/line-length - Line length
MD013:
# Number of characters, default is 80
# I'm OK with long lines. All editors now have wordwrap
line_length: 9999
# Number of characters for headings
heading_line_length: 100
# check code blocks?
code_blocks: false
53 changes: 53 additions & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
###########################################
# These are the rules used for #
# linting all the yaml files in the stack #
# NOTE: #
# You can disable line with: #
# # yamllint disable-line #
###########################################
rules:
braces:
level: warning
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: 0
max-spaces-inside-empty: 5
brackets:
level: warning
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: 0
max-spaces-inside-empty: 5
colons:
level: warning
max-spaces-before: 0
max-spaces-after: 1
commas:
level: warning
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments: disable
comments-indentation: disable
document-end: disable
document-start: disable
empty-lines:
level: warning
max: 2
max-start: 0
max-end: 0
hyphens:
level: warning
max-spaces-after: 1
indentation:
level: warning
spaces: consistent
indent-sequences: true
check-multi-line-strings: false
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
54 changes: 54 additions & 0 deletions .github/workflows/call-docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
# template source: https://github.com/bretfisher/docker-build-workflow/blob/main/templates/call-docker-build.yaml
name: Docker Build

on:
push:
branches:
- main
# don't rebuild image if someone only edited unrelated files
paths-ignore:
- 'README.md'
- '.github/linters/**'
pull_request:
# don't rebuild image if someone only edited unrelated files
paths-ignore:
- 'README.md'
- '.github/linters/**'

jobs:
call-docker-build:

name: Call Docker Build

uses: bretfisher/docker-build-workflow/.github/workflows/reusable-docker-build.yaml@main

permissions:
contents: read
packages: write # needed to push docker image to ghcr.io
pull-requests: write # needed to create and update comments in PRs

secrets:

# Only needed if with:dockerhub-enable is true below
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}

# Only needed if with:dockerhub-enable is true below
# https://hub.docker.com/settings/security
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}

with:

### REQUIRED
### ENABLE ONE OR BOTH REGISTRIES
### tell docker where to push.
### NOTE if Docker Hub is set to true, you must set secrets above and also add account/repo/tags below
dockerhub-enable: true
ghcr-enable: true

### REQUIRED
### A list of the account/repo names for docker build. List should match what's enabled above
### defaults to:
image-names: |
ghcr.io/${{ github.repository }}
${{ github.repository }}
36 changes: 36 additions & 0 deletions .github/workflows/call-super-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
# template source: https://github.com/bretfisher/super-linter-workflow/blob/main/templates/call-super-linter.yaml
name: Lint Code Base

on:

push:
branches: [main]

pull_request:

jobs:
call-super-linter:

name: Call Super-Linter

permissions:
contents: read # clone the repo to lint
statuses: write #read/write to repo custom statuses

### use Reusable Workflows to call my workflow remotely
### https://docs.github.com/en/actions/learn-github-actions/reusing-workflows
### you can also call workflows from inside the same repo via file path

uses: bretfisher/super-linter-workflow/.github/workflows/reusable-super-linter.yaml@main

### Optional settings examples

with:
### For a DevOps-focused repository. Prevents some code-language linters from running
### defaults to false
devops-only: true

### A regex to exclude files from linting
### defaults to empty
# filter-regex-exclude: html/.*
34 changes: 19 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# if you're doing anything beyond your local machine, please pin this to a specific version at https://hub.docker.com/_/node/
# FROM node:12-alpine also works here for a smaller image
FROM node:12-slim
# If you're doing anything beyond your local machine, please pin this to a specific version at https://hub.docker.com/_/node/
# Always use slim. If you need additional packages, add them with apt
# Alpine variants are not offically supported by Node.js, so we use the default debian variant
FROM node:18-slim

# set our node environment, either development or production
# defaults to production, compose overrides this to development on build and run
Expand All @@ -16,29 +17,32 @@ EXPOSE $PORT 9229 9230
# but pin this version for the best stability
RUN npm i npm@latest -g

# install dependencies first, in a different location for easier app bind mounting for local development
# due to default /opt permissions we have to create the dir with root and change perms
RUN mkdir /opt/node_app && chown node:node /opt/node_app
WORKDIR /opt/node_app
# remember to put things that don't change much at the top for better caching
# this entrypoint script will copy any file-based secrets into envs
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]

# the official node image provides an unprivileged user as a security best practice
# but we have to manually enable it. We put it here so npm installs dependencies as the same
# user who runs the app.
# user who runs the app.
# https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#non-root-user
USER node
COPY package.json package-lock.json* ./
RUN npm install --no-optional && npm cache clean --force

# install dependencies first, in a different location for easier app bind mounting for local development
# WORKDIR now sets correct permissions if you set USER first
WORKDIR /opt/node_app

COPY --chown=node:node package.json package-lock.json* ./
RUN npm ci && npm cache clean --force
ENV PATH /opt/node_app/node_modules/.bin:$PATH

# check every 30s to ensure this service returns HTTP 200
HEALTHCHECK --interval=30s CMD node healthcheck.js

# copy in our source code last, as it changes the most
# copy in as node user, so permissions match what we need
WORKDIR /opt/node_app/app
COPY . .

COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]

COPY --chown=node:node . .

# if you want to use npm start instead, then use `docker run --init in production`
# so that signals are passed properly. Note the code in index.js is needed to catch Docker signals
Expand Down
Loading