Skip to content

Commit e92e5ee

Browse files
committed
Adding release workflow, updating gitignore, adding version numbers, and other small fixes.
1 parent e7878b0 commit e92e5ee

File tree

14 files changed

+193
-13
lines changed

14 files changed

+193
-13
lines changed

.github/workflows/release.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
include:
17+
- goos: linux
18+
goarch: amd64
19+
- goos: linux
20+
goarch: arm64
21+
- goos: darwin
22+
goarch: amd64
23+
- goos: darwin
24+
goarch: arm64
25+
- goos: windows
26+
goarch: amd64
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- uses: actions/setup-go@v5
32+
with:
33+
go-version: '1.24'
34+
35+
- name: Build
36+
env:
37+
GOOS: ${{ matrix.goos }}
38+
GOARCH: ${{ matrix.goarch }}
39+
run: |
40+
EXT=""
41+
if [ "$GOOS" = "windows" ]; then
42+
EXT=".exe"
43+
fi
44+
45+
go build -ldflags "-s -w" -o flashingestor-$GOOS-$GOARCH$EXT ./cmd/flashingestor
46+
go build -ldflags "-s -w" -o dcprobe-$GOOS-$GOARCH$EXT ./cmd/dcprobe
47+
go build -ldflags "-s -w" -o ingest2json-$GOOS-$GOARCH$EXT ./cmd/ingest2json
48+
49+
if [ "$GOOS" = "windows" ]; then
50+
zip flashingestor-$GOOS-$GOARCH.zip flashingestor-$GOOS-$GOARCH$EXT dcprobe-$GOOS-$GOARCH$EXT ingest2json-$GOOS-$GOARCH$EXT
51+
else
52+
tar czf flashingestor-$GOOS-$GOARCH.tar.gz flashingestor-$GOOS-$GOARCH$EXT dcprobe-$GOOS-$GOARCH$EXT ingest2json-$GOOS-$GOARCH$EXT
53+
fi
54+
55+
- uses: actions/upload-artifact@v4
56+
with:
57+
name: flashingestor-${{ matrix.goos }}-${{ matrix.goarch }}
58+
path: |
59+
*.tar.gz
60+
*.zip
61+
62+
release:
63+
needs: build
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- uses: actions/download-artifact@v4
68+
with:
69+
pattern: flashingestor-*
70+
merge-multiple: true
71+
72+
- name: Release
73+
env:
74+
GH_TOKEN: ${{ github.token }}
75+
run: |
76+
gh release create ${{ github.ref_name }} \
77+
*.tar.gz \
78+
*.zip \
79+
--title "${{ github.ref_name }}" \
80+
--generate-notes \
81+
--repo ${{ github.repository }}
82+

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,49 @@
1+
# Outputs
12
output/
3+
4+
# Binaries
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
flashingestor
11+
dcprobe
12+
ingest2json
13+
14+
# Test binaries
15+
*.test
16+
*.out
17+
18+
# Coverage
19+
*.coverprofile
20+
coverage.txt
21+
22+
# Go workspace file
23+
go.work
24+
go.work.sum
25+
26+
# IDEs and editors
27+
.idea/
28+
.vscode/
29+
*.swp
30+
*.swo
31+
*~
32+
.project
33+
.settings/
34+
35+
# OS files
36+
.DS_Store
37+
Thumbs.db
38+
desktop.ini
39+
40+
# Logs
41+
*.log
42+
43+
# Vendor
244
vendor/
45+
46+
# Temporary files
47+
tmp/
48+
temp/
49+
*.tmp

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The main goals of this project are:
1313
2. Be faster, less noisy, and more customizable than other collectors
1414
3. Be a friendly TUI (terminal user interface) with progress tracking
1515

16-
This is still a *beta* version, released just to demonstrate the concept - don't expect everything to work perfectly. If you find any bugs pleasee contribute with issues, PRs or discussions 🙂
16+
This is still a *beta* version, released just to demonstrate the concept - don't expect everything to work perfectly. If you find any bugs please contribute with issues, PRs or discussions 🙂
1717

1818
# Implementation Details
1919

@@ -126,7 +126,7 @@ A nice way of inspecting these files would be to use [JQ](https://jqlang.org/)/[
126126

127127
# Contributing
128128

129-
Contributions are welcome by [opening an issue](https://github.com/Macmod/godap/issues/new) or by [submitting a pull request](https://github.com/Macmod/godap/pulls).
129+
Contributions are welcome by [opening an issue](https://github.com/Macmod/flashingestor/issues/new) or by [submitting a pull request](https://github.com/Macmod/flashingestor/pulls).
130130

131131
# Acknowledgements
132132

bloodhound/builder/domain.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package builder
22

33
import (
44
"encoding/hex"
5-
"log"
65
"strconv"
76
"strings"
87

@@ -79,15 +78,13 @@ func parseTrust(flags int, direction int) (string, string, bool, bool, bool) {
7978
// BuildDomainFromEntry constructs a Domain object from LDAP entries.
8079
func BuildDomainFromEntry(domainEntry *gildap.LDAPEntry, trustEntries []gildap.LDAPEntry) *Domain {
8180
if domainEntry == nil {
82-
log.Println("❌ Domain object is nil; aborting domain enumeration.")
8381
return nil
8482
}
8583

8684
// --- Functional level ---
8785
levelID := domainEntry.GetAttrVal("msDS-Behavior-Version", "")
8886
functionalLevel, ok := gildap.FUNCTIONAL_LEVELS[levelID]
8987
if !ok {
90-
log.Println("❌ Domain functional level doesn't make sense")
9188
return nil
9289
}
9390

cmd/dcprobe/main.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import (
1515
"github.com/spf13/pflag"
1616
)
1717

18+
var (
19+
version = "0.1.0"
20+
)
21+
1822
type DCResult struct {
1923
Hostname string
2024
IPAddress string
@@ -71,6 +75,8 @@ func main() {
7175
}
7276

7377
func parseFlags() {
78+
var showVersion bool
79+
pflag.BoolVarP(&showVersion, "version", "v", false, "Show version information and exit")
7480
pflag.StringVarP(&domain, "domain", "d", "", "Domain name to query for DCs (required)")
7581
pflag.StringVar(&dnsServer, "dns", "", "Custom DNS server (default: system resolver)")
7682
pflag.BoolVar(&dnsTCP, "dns-tcp", false, "Use TCP for DNS queries instead of UDP")
@@ -80,6 +86,11 @@ func parseFlags() {
8086
pflag.StringVar(&tests, "tests", "ldap,ldaps,kerberos,ping", "Comma-separated list of tests to run (ldap,ldaps,kerberos,kpasswd,gc,gcssl,smb,epm,netbios,rdp,ping)")
8187
pflag.Parse()
8288

89+
if showVersion {
90+
fmt.Printf("dcprobe %s\n", version)
91+
os.Exit(0)
92+
}
93+
8394
if noColors {
8495
color.NoColor = true
8596
}

cmd/flashingestor/main.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@ import (
1616
"github.com/Macmod/flashingestor/ui"
1717
)
1818

19-
var versionString = "v1.0.0"
19+
var (
20+
version = "0.1.0"
21+
)
2022

2123
// Application entry point
2224
func main() {
2325
cfg, err := config.ParseFlags()
2426
if err != nil {
27+
if err.Error() == "VERSION_REQUESTED" {
28+
printVersion()
29+
os.Exit(0)
30+
}
2531
log.Fatal(err)
2632
}
2733

@@ -56,7 +62,7 @@ func main() {
5662
logger := core.NewLogger(logChannel, logFile, uiApp, verboseLevel)
5763
go logger.Start()
5864

59-
logFunc("🧩 Welcome to FlashIngestor " + versionString)
65+
logFunc("🧩 Welcome to FlashIngestor " + version)
6066
logFunc("⭕ [blue]Config file[-]: " + cfg.ConfigPath)
6167
logFunc("⭕ [blue]Output folder[-]: " + cfg.OutputDir)
6268

@@ -265,3 +271,8 @@ func main() {
265271
log.Fatal(err)
266272
}
267273
}
274+
275+
// printVersion prints version information
276+
func printVersion() {
277+
fmt.Printf("flashingestor %s\n", version)
278+
}

cmd/ingest2json/main.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,22 @@ import (
1111
"github.com/Macmod/flashingestor/reader"
1212
)
1313

14+
var (
15+
version = "0.1.0"
16+
)
17+
1418
func main() {
19+
showVersion := flag.Bool("version", false, "Show version information and exit")
1520
inputFile := flag.String("in", "", "Input msgpack file path (required)")
1621
outputFile := flag.String("out", "", "Output JSON file path (required)")
17-
indent := flag.Bool("indent", false, "Pretty-print JSON with indentation")
22+
indent := flag.Bool("pretty", false, "Pretty-print JSON with indentation")
1823
flag.Parse()
1924

25+
if *showVersion {
26+
fmt.Printf("ingest2json %s\n", version)
27+
os.Exit(0)
28+
}
29+
2030
if *inputFile == "" || *outputFile == "" {
2131
fmt.Fprintln(os.Stderr, "Usage: ./ingest2json -in <msgpack_file> -out <json_file> [-indent]")
2232
flag.PrintDefaults()

config/config.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Package config handles command-line flags, authentication, and runtime
2+
// configuration for flashingestor.
13
package config
24

35
import (
@@ -88,10 +90,15 @@ func (d *DialerWithResolver) Dial(network, addr string) (net.Conn, error) {
8890
// ParseFlags parses command line flags and returns a configuration instance
8991
func ParseFlags() (*Config, error) {
9092
var err error
93+
var showVersion bool
94+
9195
config := &Config{
9296
LdapAuthOptions: &ldapauth.Options{},
9397
}
9498

99+
// Version flag
100+
pflag.BoolVarP(&showVersion, "version", "v", false, "Show version information and exit")
101+
95102
// Basic settings
96103
pflag.StringVar(&config.OutputDir, "outdir", "./output", "Directory to store results")
97104
pflag.StringVar(&config.LogFile, "log", "", "Path to log file (optional, logs will be written to both file and UI)")
@@ -116,6 +123,12 @@ func ParseFlags() (*Config, error) {
116123

117124
pflag.Parse()
118125

126+
// Check for version flag first
127+
if showVersion {
128+
// Return a special error that signals version was requested
129+
return nil, fmt.Errorf("VERSION_REQUESTED")
130+
}
131+
119132
// Setup DNS resolver
120133
resolver := net.DefaultResolver
121134
if config.CustomDns != "" {

core/directories.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
// Package core provides core functionality for flashingestor including
2+
// directory management, logging, and event handling.
13
package core
24

35
import (
4-
"log"
6+
"fmt"
57
"os"
68
"path/filepath"
79
)
@@ -22,15 +24,15 @@ func SetupDirectories(baseDir string) (*Directories, error) {
2224
}
2325

2426
if err := os.MkdirAll(dirs.LDAP, 0755); err != nil {
25-
log.Fatal("Failed to create `"+dirs.LDAP+"` folder:", err)
27+
return nil, fmt.Errorf("failed to create %s folder: %w", dirs.LDAP, err)
2628
}
2729

2830
if err := os.MkdirAll(dirs.Remote, 0755); err != nil {
29-
log.Fatal("Failed to create `"+dirs.Remote+"` folder:", err)
31+
return nil, fmt.Errorf("failed to create %s folder: %w", dirs.Remote, err)
3032
}
3133

3234
if err := os.MkdirAll(dirs.BloodHound, 0755); err != nil {
33-
log.Fatal("Failed to create `"+dirs.BloodHound+"` folder:", err)
35+
return nil, fmt.Errorf("failed to create %s folder: %w", dirs.BloodHound, err)
3436
}
3537

3638
return dirs, nil

ldap/ingestor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Package ldap implements LDAP ingestion functionality for Active Directory
2+
// queries and data collection.
13
package ldap
24

35
import (

0 commit comments

Comments
 (0)