Skip to content

Commit

Permalink
Upgrades & Cleanup (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
zrosenbauer authored Feb 18, 2023
1 parent 96fdf56 commit 6c11aa0
Show file tree
Hide file tree
Showing 19 changed files with 1,743 additions and 1,791 deletions.
9 changes: 2 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint'
],
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'eslint-config-semistandard'
],
ignorePatterns: [
'src/**/testUtils/',
'src/**/__tests__/'
],
ignorePatterns: ['src/**/testUtils/', 'src/**/__tests__/'],
rules: {
'@typescript-eslint/no-unused-vars': 0,
'no-unused-vars': 0,
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ about: Create a bug report to fix an existing issue.
title: ''
labels: bugfix
assignees: ''

---

**Please do not report security vulnerabilities here**. Submit all security issues to [[email protected]](mailto:[email protected]).

**Thank you in advance for helping us to improve this library!** Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. Finally, to avoid duplicates, please search existing Issues before submitting one here.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ about: Suggest new functionality for this project.
title: ''
labels: enhancement
assignees: ''

---

**Please do not report security vulnerabilities here**. Submit all security issues to [[email protected]](mailto:[email protected]).

**Thank you in advance for helping us to improve this library!** Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. Finally, to avoid duplicates, please search existing Issues before submitting one here.
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "CI"
name: 'CI'

on:
pull_request:
Expand All @@ -22,16 +22,18 @@ jobs:
- name: Install Packages
run: yarn install
- name: Format Check
run: yarn format-check
run: yarn format:check
- name: Lint
run: yarn lint
run: yarn lint:check
- name: Typecheck
run: yarn type:check
- name: Test
run: yarn test
- id: runActionValid
name: Try Valid URL
uses: ./
with:
domain: https://bluenova.io
domain: https://joggr.io
expiration_days: 7
- id: runActionInvalid
name: Try Invalid URL
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ main ]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
branches: [main]
schedule:
- cron: '25 4 * * 5'

Expand All @@ -21,14 +21,13 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ['javascript']
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
run: gh pr merge --auto --squash "$PR_URL" # Use Github CLI to automatically merge the PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 2 additions & 3 deletions .github/workflows/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: SSL/TLS Monitor

on:
schedule:
- cron: "0 16 * * *"
- cron: '0 16 * * *'
workflow_dispatch: {}

jobs:
Expand All @@ -19,8 +19,7 @@ jobs:
uses: zrosenbauer/action-tls-monitor@main
with:
domain: ${{ matrix.domain }}
expiration_days: "7"
expiration_days: '7'
approved_protocols: TLSv1.2,TLSv1.3
alert_method: slack
alert_token: ${{ secrets.SLACK_WEBHOOK_URL_OPS }}

3 changes: 1 addition & 2 deletions .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Release Drafter"
name: 'Release Drafter'

on:
workflow_dispatch: {}
Expand All @@ -17,4 +17,3 @@ jobs:
- uses: toolmantim/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Change Log

We do not provide a change log as each Pull-Request merged in will be added to
We do not provide a change log as each Pull-Request merged in will be added to
release notes that are automatically generated.

[View Release Notes](/releases)
58 changes: 41 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,42 @@
# SSL/TLS Monitor
<div>
<p align="center">
<img src="/logo.png" align="center" width="300" />
</p>
<hr>
</div>

[![CI](https://github.com/bluenovaio/action-tls-monitor/actions/workflows/ci.yaml/badge.svg)](https://github.com/bluenovaio/action-tls-monitor/actions/workflows/ci.yaml)
[![CodeQL](https://github.com/bluenovaio/action-tls-monitor/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/bluenovaio/action-tls-monitor/actions/workflows/codeql-analysis.yml)
> Monitor your certificates!
# Overview

[![CI](https://github.com/zrosenbauer/tls-monitor/actions/workflows/ci.yaml/badge.svg)](https://github.com/zrosenbauer/tls-monitor/actions/workflows/ci.yaml)
[![CodeQL](https://github.com/zrosenbauer/tls-monitor/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/zrosenbauer/tls-monitor/actions/workflows/codeql-analysis.yml)
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/standard/semistandard)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Monitor SSL/TLS certificates for your domains.

## Usage

You can run against a single domain or use the matrix strategy to run against multiple domains.

#### Single Domain
### Single Domain

```yaml
name: SSL/TLS Monitor
name: SSL/TLS Monitor
on:
schedule:
- cron: "0 16 * * *"
- cron: '0 16 * * *'

jobs:
monitor:
name: SSL/TLS Monitor
runs-on: ubuntu-latest
steps:
- name: Monitor
uses: bluenovaio/action-tls-monitor@main
with:
domain: bluenova.io
uses: zrosenbauer/action-tls-monitor@main
with:
domain: joggr.io
expiration_days: 30
approved_protocols: TLSv1.2,TLSv1.3
alert_method: slack
Expand All @@ -36,10 +46,10 @@ jobs:
#### Multiple Domains
```yaml
name: SSL/TLS Monitor
name: SSL/TLS Monitor
on:
schedule:
- cron: "0 16 * * *"
- cron: '0 16 * * *'

jobs:
monitor:
Expand All @@ -48,11 +58,11 @@ jobs:
strategy:
matrix:
domain:
- bluenova.io
- docs.bluenova.io
- joggr.io
- docs.joggr.io
steps:
- name: Monitor - ${{ matrix.domain }}
uses: bluenovaio/action-tls-monitor@main
uses: zrosenbauer/action-tls-monitor@main
with:
domain: ${{ matrix.domain }}
expiration_days: 30
Expand All @@ -64,15 +74,29 @@ jobs:
## Alerting
Alerting is built in to this action. It is also possible to ignore the alerts and use the outputs to send your own alerts or do
another action (i.e. trigger a certificate update/renewal).
another action (i.e. trigger a certificate update/renewal).
### Slack Alerts
Slack is supported out of the box. The alerts are formatted and have a default emoji and name. You should start to see alerts
Slack is supported out of the box. The alerts are formatted and have a default emoji and name. You should start to see alerts
similar to the below image if an issue is found.
<details><summary>Slack Alert Example</summary>
<details>
<summary>Slack Alert Example</summary>
![Slack Alert](/docs/images/alert-slack.png)
</details>
<br>
<br>
<hr>
<div align="center">
<h2>Sponsorship</h1>
<sup>Special thanks to:</sup>
<br>
<br>
<a href="https://joggr.io">
<img src="https://storage.googleapis.com/joggr-public-assets/logos/logo.png" width="160"/>
</a>
</div>
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

## Reporting a Vulnerability

If you find a vulnerability please fill out our [OSS Vulnerability Form](https://forms.gle/eQy85QNmjSDdpUbB6). If you don't hear back from us within 5 days
If you find a vulnerability please fill out our [OSS Vulnerability Form](https://forms.gle/eQy85QNmjSDdpUbB6). If you don't hear back from us within 5 days
please email [[email protected]](mailto:[email protected]) directly.
8 changes: 4 additions & 4 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: SSL/TLS Monitor
description: Monitor SSL/TLS certificates for your domains.
author: "@bluenovaio"
author: '@zrosenbauer'
inputs:
domain:
description: The domain to monitor, i.e. example.com.
required: true
expiration_days:
description: The number of days prior to expiration to trigger an alert, MUST be a valid integer.
default: "7"
default: '7'
required: false
approved_protocols:
description: (Optional) A common separted list of supported protocols, MUST be one of - SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3.
description: (Optional) A common separated list of supported protocols, MUST be one of - SSLv3,TLSv1,TLSv1.1,TLSv1.2,TLSv1.3.
default: TLSv1.2,TLSv1.3
required: false
alert_method:
Expand All @@ -21,7 +21,7 @@ inputs:
required: false
outputs:
protocol:
description: A common separted list of supported protocols - SSLv3, TLSv1, TLSv1.1, TLSv1.2 or TLSv1.3.
description: A common separated list of supported protocols - SSLv3, TLSv1, TLSv1.1, TLSv1.2 or TLSv1.3.
valid_to:
description: The validTo date for the certificate in ISO-8601 format (i.e. 2021-01-01T10:20:11Z).
valid_from:
Expand Down
8 changes: 2 additions & 6 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ const config: Config.InitialOptions = {
tsconfig: 'tsconfig.json'
}
},
testMatch: [
'**/__tests__/**/*.ts?(x)'
],
testPathIgnorePatterns: [
'dist'
],
testMatch: ['**/__tests__/**/*.ts?(x)'],
testPathIgnorePatterns: ['dist'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest'
}
Expand Down
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 30 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
{
"name": "action-tls-monitor",
"name": "tls-monitor",
"version": "1.0.0",
"description": "Monitor SSL/TLS certificates for your domains.",
"main": "dist/main.js",
"repository": "[email protected]:bluenovaio/action-tls-monitor.git",
"author": "@bluenovaio",
"repository": "[email protected]:zrosenbauer/tls-monitor.git",
"author": "@zrosenbauer",
"license": "MIT",
"private": false,
"scripts": {
"build": "tsc",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"type:check": "tsc --noEmit",
"format:fix": "prettier --write .",
"format:check": "prettier --check .",
"lint:check": "eslint src/**/*.ts",
"lint:fix": "eslint src/**/*.ts --fix",
"package": "ncc build --source-map --license licenses.txt",
"test": "jest"
"test": "jest --passWithNoTests"
},
"dependencies": {
"@actions/core": "^1.4.0",
"@actions/core": "^1.10.0",
"@slack/webhook": "^6.1.0",
"gaxios": "^4.3.0",
"gaxios": "^5.0.2",
"lodash": "^4.17.21"
},
"devDependencies": {
"@jest/types": "^27.4.2",
"@types/jest": "^27.4.0",
"@types/lodash": "^4.14.178",
"@types/node": "^17.0.8",
"@typescript-eslint/eslint-plugin": "^5.9.1",
"@typescript-eslint/parser": "^5.9.1",
"@vercel/ncc": "0.33.1",
"eslint": "^8.8.0",
"eslint-config-semistandard": "^16.0.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.4",
"@jest/types": "^29.4.3",
"@types/jest": "^29.4.0",
"@types/lodash": "^4.14.191",
"@types/node": "^18.14.0",
"@typescript-eslint/eslint-plugin": "^5.52.0",
"@typescript-eslint/parser": "^5.52.0",
"@vercel/ncc": "0.36.1",
"eslint": "^8.34.0",
"eslint-config-semistandard": "^17.0.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "6.0.0",
"jest": "^27.4.7",
"prettier": "^2.5.1",
"ts-jest": "^27.1.3",
"ts-node": "^10.1.0",
"typescript": "^4.5.4",
"webpack": "^5.66.0"
"eslint-plugin-promise": "6.1.1",
"jest": "^29.4.3",
"prettier": "^2.8.4",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"webpack": "^5.75.0"
}
}
Loading

0 comments on commit 6c11aa0

Please sign in to comment.