-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9bd3cb9
Showing
20 changed files
with
446 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
engines: | ||
eslint: | ||
enabled: true | ||
channel: 'eslint-8' | ||
config: | ||
config: '.eslintrc.yaml' | ||
|
||
ratings: | ||
paths: | ||
- '**.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
env: | ||
node: true | ||
es6: true | ||
mocha: true | ||
es2022: true | ||
|
||
extends: ['@haraka'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
### system info | ||
|
||
Please report your OS, Node version, and Haraka version by running this shell script on your Haraka server and replacing this section with the output. | ||
|
||
echo "Haraka | $(haraka -v)"; echo " --- | :--- "; echo "Node | $(node -v)"; echo "OS | $(uname -a)"; echo "openssl | $(openssl version)" | ||
|
||
### Expected behavior | ||
|
||
### Observed behavior | ||
|
||
### Steps to reproduce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Changes proposed in this pull request: | ||
|
||
- | ||
- | ||
|
||
Fixes # | ||
|
||
Checklist: | ||
|
||
- [ ] docs updated | ||
- [ ] tests updated | ||
- [ ] Changes.md updated | ||
- [ ] package.json.version bumped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: 'monthly' | ||
allow: | ||
- dependency-type: production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
CI: true | ||
|
||
jobs: | ||
lint: | ||
uses: haraka/.github/.github/workflows/lint.yml@master | ||
|
||
# coverage: | ||
# uses: haraka/.github/.github/workflows/coverage.yml@master | ||
# secrets: inherit | ||
|
||
ubuntu: | ||
needs: [lint] | ||
uses: haraka/.github/.github/workflows/ubuntu.yml@master | ||
|
||
windows: | ||
needs: [lint] | ||
uses: haraka/.github/.github/workflows/windows.yml@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: 'CodeQL' | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
schedule: | ||
- cron: '18 7 * * 4' | ||
|
||
jobs: | ||
codeql: | ||
uses: haraka/.github/.github/workflows/codeql.yml@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- package.json | ||
|
||
env: | ||
CI: true | ||
|
||
jobs: | ||
publish: | ||
uses: haraka/.github/.github/workflows/publish.yml@master | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
package-lock.json | ||
bower_components | ||
# Optional npm cache directory | ||
.npmrc | ||
.idea | ||
.DS_Store | ||
haraka-update.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule ".release"] | ||
path = .release | ||
url = git@github.com:msimerson/.release.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
singleQuote: true | ||
semi: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Changelog | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/). | ||
|
||
### Unreleased | ||
|
||
### [1.0.6] - 2024-04-08 | ||
|
||
- dep: eslint-plugin-haraka -> @haraka/eslint-config | ||
- lint: remove duplicate / stale rules from .eslintrc | ||
- populate [files] in package.json. Delete .npmignore. | ||
- doc: Changes.md -> CHANGELOG.md | ||
- test: switch to node --test | ||
|
||
### 1.0.5 - 2023-12-12 | ||
|
||
- ci: run tests on PR | ||
- ci(publish): add on.release trigger | ||
- deps(dev\*): pin versions | ||
|
||
### [1.0.3] - 2022-06-05 | ||
|
||
- ci: replace hard coded vers with node-lts-versions | ||
- ci(publish): add secrets: inherit | ||
- ci: use reusable workflows (#18) | ||
|
||
### [1.0.2] - 2022-05-23 | ||
|
||
- ci: replace hard coded node vers with node-lts-versions | ||
- ci(publish): add secrets: inherit | ||
- ci: use reusable workflows (#18) | ||
- packaging updates | ||
|
||
### [1.0.1] - 2021-02-04 | ||
|
||
- test: added example tests that set up conn/txn | ||
- ci: add automated package publishing | ||
- ci(GHA): consolidate \*nix & win tests | ||
|
||
### 1.0.0 - 2017-02-02 | ||
|
||
- initial release | ||
|
||
[1.0.1]: https://github.com/haraka/haraka-plugin-template/releases/tag/1.0.1 | ||
[1.0.2]: https://github.com/haraka/haraka-plugin-template/releases/tag/1.0.2 | ||
[1.0.3]: https://github.com/haraka/haraka-plugin-template/releases/tag/1.0.3 | ||
[1.0.6]: https://github.com/haraka/haraka-plugin-template/releases/tag/v1.0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Haraka | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
[![CI Test Status][ci-img]][ci-url] | ||
[![Code Climate][clim-img]][clim-url] | ||
|
||
[![NPM][npm-img]][npm-url] | ||
|
||
# haraka-plugin-template | ||
|
||
Clone me, to create a new Haraka plugin! | ||
|
||
# Template Instructions | ||
|
||
These instructions will not self-destruct after use. Use and destroy. | ||
|
||
See also, [How to Write a Plugin](https://github.com/haraka/Haraka/wiki/Write-a-Plugin) and [Plugins.md](https://github.com/haraka/Haraka/blob/master/docs/Plugins.md) for additional plugin writing information. | ||
|
||
## Create a new repo for your plugin | ||
|
||
Haraka plugins are named like `haraka-plugin-something`. All the namespace after `haraka-plugin-` is yours for the taking. Please check the [Plugins](https://github.com/haraka/Haraka/blob/master/Plugins.md) page and a Google search to see what plugins already exist. | ||
|
||
Once you've settled on a name, create the GitHub repo. On the [template repo's main page](https://github.com/haraka/haraka-plugin-template), click the _Use this template_ button and create your new repository. Then paste that URL into a local ENV variable with a command like this: | ||
|
||
```sh | ||
export MY_GITHUB_ORG=haraka | ||
export MY_PLUGIN_NAME=haraka-plugin-SOMETHING | ||
``` | ||
|
||
Clone and rename the template repo: | ||
|
||
```sh | ||
git clone git@github.com:haraka/$MY_PLUGIN_NAME.git | ||
cd $MY_PLUGIN_NAME | ||
``` | ||
|
||
Now you'll have a local git repo to begin authoring your plugin | ||
|
||
## rename boilerplate | ||
|
||
Replaces all uses of the word `template` with your plugin's name. | ||
|
||
./redress.sh [something] | ||
|
||
You'll then be prompted to update package.json and then force push this repo onto the GitHub repo you've created earlier. | ||
|
||
# Add your content here | ||
|
||
## INSTALL | ||
|
||
```sh | ||
cd /path/to/local/haraka | ||
npm install haraka-plugin-template | ||
echo "template" >> config/plugins | ||
service haraka restart | ||
``` | ||
|
||
### Configuration | ||
|
||
If the default configuration is not sufficient, copy the config file from the distribution into your haraka config dir and then modify it: | ||
|
||
```sh | ||
cp node_modules/haraka-plugin-template/config/template.ini config/template.ini | ||
$EDITOR config/template.ini | ||
``` | ||
|
||
## USAGE | ||
|
||
<!-- leave these buried at the bottom of the document --> | ||
|
||
[ci-img]: https://github.com/haraka/haraka-plugin-template/actions/workflows/ci.yml/badge.svg | ||
[ci-url]: https://github.com/haraka/haraka-plugin-template/actions/workflows/ci.yml | ||
[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-template/badges/gpa.svg | ||
[clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-template | ||
[npm-img]: https://nodei.co/npm/haraka-plugin-template.png | ||
[npm-url]: https://www.npmjs.com/package/haraka-plugin-template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
[main] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict' | ||
|
||
exports.register = function () { | ||
this.load_template_ini() | ||
|
||
// register hooks here. More info at https://haraka.github.io/core/Plugins/ | ||
// this.register_hook('data_post', 'do_stuff_with_message') | ||
} | ||
|
||
exports.load_template_ini = function () { | ||
this.cfg = this.config.get( | ||
'template.ini', | ||
{ | ||
booleans: [ | ||
'+enabled', // this.cfg.main.enabled=true | ||
'-disabled', // this.cfg.main.disabled=false | ||
'+feature_section.yes', // this.cfg.feature_section.yes=true | ||
], | ||
}, | ||
() => { | ||
this.load_template_ini() | ||
}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "haraka-plugin-template", | ||
"version": "1.0.6", | ||
"description": "Haraka plugin that...CHANGE THIS", | ||
"main": "index.js", | ||
"files": [ | ||
"CHANGELOG.md", | ||
"config" | ||
], | ||
"scripts": { | ||
"format": "npm run prettier:fix && npm run lint:fix", | ||
"lint": "npx eslint@^8 *.js test", | ||
"lint:fix": "npx eslint@^8 *.js test --fix", | ||
"prettier": "npx prettier . --check", | ||
"prettier:fix": "npx prettier . --write --log-level=warn", | ||
"test": "node --test", | ||
"versions": "npx dependency-version-checker check", | ||
"versions:fix": "npx dependency-version-checker update" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/haraka/haraka-plugin-template.git" | ||
}, | ||
"keywords": [ | ||
"haraka", | ||
"plugin", | ||
"template" | ||
], | ||
"author": "Welcome Member <happy-haraka-hacker@example.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/haraka/haraka-plugin-template/issues" | ||
}, | ||
"homepage": "https://github.com/haraka/haraka-plugin-template#readme", | ||
"devDependencies": { | ||
"@haraka/eslint-config": "1.1.3", | ||
"haraka-test-fixtures": "1.3.5" | ||
} | ||
} |
Oops, something went wrong.