Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to goreleaser build for generate .deb and also implement journal log #164

Closed
wants to merge 12 commits into from

Conversation

josejuanmontiel
Copy link

Hi!

I want to use this relay in my raspberry (in this case) but if power restart in my house, i want that could be a service...

I could do in many ways ... but as proof of concept try to:

  1. Change to the release builder with https://goreleaser.com/ and then use https://goreleaser.com/customization/nfpm/ (the default config could solve Also build arm #144)
  2. Even journal log could capture stdout... also try to use this wrapper of core https://github.com/wercker/journalhook

What do you think?

@decke
Copy link
Owner

decke commented Sep 28, 2024

I think the same rules apply for all distributions (and also docker).

  • I will not commit any distro specific stuff to this repository.
  • Feel free to repackage smtprelay as you wish.
  • If you need some specifics feel free to create a separate repository for that or just submit it to the distro where it belongs to.

I am a FreeBSD ports maintainer myself and also will not commit any of that integration here.

@josejuanmontiel
Copy link
Author

Hi, a long story of my case, I have an old ip cam that to send movent alerts use SMTP, but the in this case the old android app only allows 32 characters isn't enough to place the token that the most SMTP providers use as password.

It's totally respectful don't include any specific stuff to any distribution (in this case more than distribution it's more than service management, systemd, because Deb it's more a consequence...but) and probably any person that came here probably know sufficient to make this generic binary run like a service or any need... Even can compile to any arch/os that go support.

In my case add goreleaser was as proof of concept to use this approach, that includes many distribution package...

And add journals to log in systemd ... As said before, another option to log.

Probably, to keep learning i'll try to submit to Debian repository. Meanwhile I'll use my Deb in my raspy...

Thank for this piece of code, that solve my problem.

@decke
Copy link
Owner

decke commented Sep 28, 2024

I cannot create packages for most Linux distros myself except the ones I use myself which are currently Alpine Linux and OpenWRT. In addition to that I have also created the port net/smtprelay for FreeBSD.

If someone wants to step up and bring smtprelay to his/her favourite distro I'd be glad.

Comment on lines +1 to +11
//go:build linux

package main

import (
"github.com/wercker/journalhook"
)

func enableLinuxJournal() {
journalhook.Enable()
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changes to have the linux journal where interesting
can they be included ?

Comment on lines +1 to +11
[Unit]
Description=smtprelay
Wants=network-online.target
After=network-online.target

[Service]
User=root
Group=root
WorkingDirectory=/usr/bin
Type=simple
RemainAfterExit=yes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Takes a boolean value that specifies whether the service shall be considered active even when all its processes exited. Defaults to no.

Why did you use yes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants