Skip to content

Commit

Permalink
renamed template to dns-list
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Dec 15, 2023
1 parent 8747e81 commit 04fe951
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 68 deletions.
40 changes: 2 additions & 38 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,3 @@
## 1.0.0 - 2023-12-15

### Unreleased


### 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.3]: https://github.com/haraka/haraka-plugin-template/releases/tag/1.0.3
- Initial release
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

[![NPM][npm-img]][npm-url]

# haraka-plugin-template
# haraka-plugin-dns-lists


Clone me, to create a new Haraka plugin!

# Template Instructions

Expand All @@ -24,11 +24,11 @@ export MY_GITHUB_ORG=haraka
export MY_PLUGIN_NAME=haraka-plugin-SOMETHING
```

Clone and rename the template repo:
Clone and rename the dns-list repo:

```sh
git clone [email protected]:haraka/haraka-plugin-template.git
mv haraka-plugin-template $MY_PLUGIN_NAME
git clone [email protected]:haraka/haraka-plugin-dns-list.git
mv haraka-plugin-dns-list $MY_PLUGIN_NAME
cd $MY_PLUGIN_NAME
git remote rm origin
git remote add origin "[email protected]:$MY_GITHUB_ORG/$MY_PLUGIN_NAME.git"
Expand All @@ -38,7 +38,7 @@ 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.
Replaces all uses of the word `dns-list` with your plugin's name.

./redress.sh [something]

Expand All @@ -51,8 +51,8 @@ You'll then be prompted to update package.json and then force push this repo ont

```sh
cd /path/to/local/haraka
npm install haraka-plugin-template
echo "template" >> config/plugins
npm install haraka-plugin-dns-list
echo "dns-list" >> config/plugins
service haraka restart
```

Expand All @@ -61,17 +61,17 @@ service haraka restart
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
cp node_modules/haraka-plugin-dns-list/config/dns-list.ini config/dns-list.ini
$EDITOR config/dns-list.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
[ci-img]: https://github.com/haraka/haraka-plugin-dns-list/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/haraka/haraka-plugin-dns-list/actions/workflows/ci.yml
[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-dns-list/badges/gpa.svg
[clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-dns-list
[npm-img]: https://nodei.co/npm/haraka-plugin-dns-list.png
[npm-url]: https://www.npmjs.com/package/haraka-plugin-dns-list
File renamed without changes.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
'use strict'

exports.register = function () {
this.load_template_ini()
this.load_dns-list_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 () {
exports.load_dns-list_ini = function () {
const plugin = this

plugin.cfg = plugin.config.get('template.ini', {
plugin.cfg = plugin.config.get('dns-list.ini', {
booleans: [
'+enabled', // plugin.cfg.main.enabled=true
'-disabled', // plugin.cfg.main.disabled=false
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "haraka-plugin-template",
"name": "haraka-plugin-dns-list",
"version": "1.0.5",
"description": "Haraka plugin that...CHANGE THIS",
"main": "index.js",
Expand All @@ -11,19 +11,19 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/haraka/haraka-plugin-template.git"
"url": "git+https://github.com/haraka/haraka-plugin-dns-list.git"
},
"keywords": [
"haraka",
"plugin",
"template"
"dns-list"
],
"author": "Welcome Member <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/haraka/haraka-plugin-template/issues"
"url": "https://github.com/haraka/haraka-plugin-dns-list/issues"
},
"homepage": "https://github.com/haraka/haraka-plugin-template#readme",
"homepage": "https://github.com/haraka/haraka-plugin-dns-list#readme",
"devDependencies": {
"eslint": "^8.55.0",
"eslint-plugin-haraka": "*",
Expand Down
12 changes: 6 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ const fixtures = require('haraka-test-fixtures')
// mocha: http://mochajs.org

beforeEach(function (done) {
this.plugin = new fixtures.plugin('template')
this.plugin = new fixtures.plugin('dns-list')
done() // if a test hangs, assure you called done()
})

describe('template', function () {
describe('dns-list', function () {
it('loads', function (done) {
assert.ok(this.plugin)
done()
})
})

describe('load_template_ini', function () {
it('loads template.ini from config/template.ini', function (done) {
this.plugin.load_template_ini()
describe('load_dns-list_ini', function () {
it('loads dns-list.ini from config/dns-list.ini', function (done) {
this.plugin.load_dns-list_ini()
assert.ok(this.plugin.cfg)
done()
})

it('initializes enabled boolean', function (done) {
this.plugin.load_template_ini()
this.plugin.load_dns-list_ini()
assert.equal(this.plugin.cfg.main.enabled, true, this.plugin.cfg)
done()
})
Expand Down

0 comments on commit 04fe951

Please sign in to comment.