Skip to content

Commit

Permalink
renamed template to spf
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Jul 23, 2022
1 parent 9a4eb0d commit 58e645b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 55 deletions.
28 changes: 2 additions & 26 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
## 1.0.0 - 2022-07-23

### Unreleased


### [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

- packaging updates


### 1.0.1 - 2021-02-04

- added example tests that set up conn/txn
- add automated package publishing
- GH actions: 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
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Code Climate][clim-img]][clim-url]
[![NPM][npm-img]][npm-url]

# haraka-plugin-template
# haraka-plugin-spf

Clone me, to create a new Haraka plugin!

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

Clone and rename the template repo:
Clone and rename the spf 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-spf.git
mv haraka-plugin-spf $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 @@ -37,7 +37,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 `spf` with your plugin's name.

./redress.sh [something]

Expand All @@ -50,8 +50,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-spf
echo "spf" >> config/plugins
service haraka restart
```

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

exports.register = function () {
this.load_template_ini()
this.load_spf_ini()
}

exports.load_template_ini = function () {
exports.load_spf_ini = function () {
const plugin = this

plugin.cfg = plugin.config.get('template.ini', {
plugin.cfg = plugin.config.get('spf.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-spf",
"version": "1.0.3",
"description": "Haraka plugin that frobnicates email connections",
"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-spf.git"
},
"keywords": [
"haraka",
"plugin",
"template"
"spf"
],
"author": "Welcome Member <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/haraka/haraka-plugin-template/issues"
"url": "https://github.com/haraka/haraka-plugin-spf/issues"
},
"homepage": "https://github.com/haraka/haraka-plugin-template#readme",
"homepage": "https://github.com/haraka/haraka-plugin-spf#readme",
"devDependencies": {
"eslint": "8",
"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('spf')
done() // if a test hangs, assure you called done()
})

describe('template', function () {
describe('spf', 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_spf_ini', function () {
it('loads spf.ini from config/spf.ini', function (done) {
this.plugin.load_spf_ini()
assert.ok(this.plugin.cfg)
done()
})

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

0 comments on commit 58e645b

Please sign in to comment.