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

gophish: add new package #23052

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

gophish: add new package #23052

wants to merge 1 commit into from

Conversation

flyn-org
Copy link
Contributor

@flyn-org flyn-org commented Jan 3, 2024

Maintainer: me
Compile tested: x86_64 master
Run tested: x86_64 master

mail/gophish/Makefile Outdated Show resolved Hide resolved
mail/gophish/Makefile Outdated Show resolved Hide resolved
mail/gophish/patches/gophish-0.12.1-env-version.patch Outdated Show resolved Hide resolved
@flyn-org flyn-org force-pushed the gophish branch 2 times, most recently from 1fd153b to 2d98e2f Compare January 4, 2024 14:50
@flyn-org
Copy link
Contributor Author

flyn-org commented Jan 4, 2024

Running make package/gophish/refresh removed the commentary headers Git added to my patches.

procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param user gophish
procd_set_param env GOPHISH_VERSION="0.12.1"
Copy link
Member

Choose a reason for hiding this comment

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

Why? I dont think this is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean the environment variable? The application requires this. Normally it is set by a file named VERSION in the application's working directory. I patched Gophish to support an environment variable instead to better suit procd.

Copy link
Member

Choose a reason for hiding this comment

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

Ping @jefferyto about this.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it makes sense to read the version from an environment variable, because the version number is a constant and not a configuration value that needs to be changed. (The version number also needs to be hardcoded into the init script.)

I suggest patching the full path of the VERSION file into the program.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I simply patch the version directly in the application now.

@flyn-org flyn-org force-pushed the gophish branch 3 times, most recently from 3b75b12 to d2202c0 Compare January 5, 2024 19:03
@BKPepe BKPepe requested a review from jefferyto January 26, 2024 00:05
@flyn-org
Copy link
Contributor Author

flyn-org commented Jan 7, 2025

@jefferyto, would you mind taking a look at this? I think @BKPepe wanted your opinion on my use of the environment variable in gophish.init. He has some comments above.

PKG_BUILD_FLAGS:=no-mips16

GO_PKG:=github.com/gophish/gophish
GO_PKG_LDFLAGS_X:=$(GO_PKG)/cmd.Version=$(PKG_VERSION)
Copy link
Member

Choose a reason for hiding this comment

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

Is setting this version value necessary / used in the program somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the GO_PKG_LDFLAGS definition.

dialect: sqlite3
- import: github.com/mattn/go-sqlite3
\ No newline at end of file
+ import: modernc.org/sqlite
Copy link
Member

Choose a reason for hiding this comment

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

Is using modernc.org/sqlite instead of github.com/mattn/go-sqlite3 strictly necessary? This feels like a change that should be accepted upstream first.

Copy link
Contributor Author

@flyn-org flyn-org Jan 8, 2025

Choose a reason for hiding this comment

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

I proposed this upstream last year:

gophish/gophish#3063

The sqlite upstream selected uses cgo, which make cross-compiling more difficult. I replaced this with a pure-Go implementation.

Signed-off-by: W. Michael Petullo <[email protected]>
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