-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
e76708c
commit d59f370
Showing
6 changed files
with
95 additions
and
7 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,44 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
env: | ||
BUILD_VERSION: ${{ github.ref_name }} | ||
OUT_ARCHIVE: "${{ github.event.repository.name }}-${{ github.ref_name }}" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
|
||
- uses: arduino/setup-task@v2 | ||
with: | ||
version: 3.x | ||
|
||
- name: Build | ||
run: task build:release | ||
|
||
- id: extract-changelog | ||
uses: sean0x42/markdown-extract@v2 | ||
with: | ||
file: CHANGELOG.md | ||
pattern: ${{ github.ref_name }} | ||
no-print-matched-heading: true | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
if: ${{ !env.ACT }} | ||
with: | ||
body: | | ||
## Changelog | ||
${{ steps.extract-changelog.outputs.markdown }} | ||
files: | | ||
*.tar.gz |
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 |
---|---|---|
|
@@ -2,3 +2,5 @@ dist/ | |
*.tar.gz | ||
|
||
coverage.out | ||
|
||
.task |
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 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
Initial release 🎉 |
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 |
---|---|---|
|
@@ -2,10 +2,23 @@ | |
|
||
> 📨 Send emails right from your terminal. | ||
We use this tool to send an informational email whenever someone logs in to one of our servers. | ||
Intended usage is via [pam_exec(8)](https://linux.die.net/man/8/pam_exec). | ||
|
||
Emails are sent directly via SMTP. The config is read from a json file, see [Config](#config). | ||
|
||
The message body is produced via go templates, see [Templates](#templates). | ||
|
||
## Installation | ||
|
||
Download an archive (`.tar.gz`) from the latest release and run the `install.sh` script. | ||
|
||
## Usage | ||
|
||
```shell | ||
$ smtp-cli --help | ||
Add the following snippet to `/etc/pam.d/sshd`: | ||
|
||
``` | ||
session required pam_exec.so /usr/local/bin/smtp-cli -config /usr/local/etc/smtp-cli/config.json -template /usr/local/etc/smtp-cli/template.gotmpl | ||
``` | ||
|
||
## Config | ||
|
@@ -20,10 +33,23 @@ $ smtp-cli --help | |
"to": [ | ||
"info <[email protected]>" | ||
], | ||
"subject": "Neue Anmeldung auf dem Server" | ||
"subject": "New login to the server" | ||
} | ||
``` | ||
|
||
## Templates | ||
|
||
The following variables are made available to the go template: | ||
|
||
| Variable | Type | | ||
| --- | --- | | ||
| Host | string | | ||
| User | string | | ||
| RemoteUser | string | | ||
| RemoteHost | string | | ||
| Tty | string | | ||
| Timestamp | time.Time | | ||
|
||
## License | ||
|
||
[MIT](LICENSE) |
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
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