Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:bitmaelum/bitmaelum-suite into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
jaytaph committed May 5, 2022
2 parents dbb2b3c + f43387e commit 541fa2c
Show file tree
Hide file tree
Showing 25 changed files with 604 additions and 578 deletions.
94 changes: 94 additions & 0 deletions .goreleaser-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
before:
hooks:
- go mod download

builds:
- <<: &build_defaults
env:
- CGO_ENABLED=0
- PKG=github.com/bitmaelum/bitmaelum-suite/internal
ldflags:
- -X '{{.Env.PKG}}.BuildDate={{.Date}}' -X '{{.Env.PKG}}.GitCommit={{.FullCommit}}' -X '{{.Env.PKG}}.VersionTag=develop-nightly'
goarch:
- amd64
- arm64
goos:
- linux
- darwin
- windows
ignore:
- goos: windows
goarch: arm64
- goos: darwin
goarch: arm64

main: ./cmd/bm-client/main.go
id: "bm-client"
binary: bm-client

- <<: *build_defaults
main: ./cmd/bm-config/main.go
id: "bm-config"
binary: bm-config

- <<: *build_defaults
main: ./cmd/bm-json/main.go
id: "bm-json"
binary: bm-json

- <<: *build_defaults
main: ./cmd/bm-send/main.go
id: "bm-send"
binary: bm-send

- <<: *build_defaults
main: ./cmd/bm-server/main.go
id: "bm-server"
binary: bm-server

- <<: *build_defaults
main: ./cmd/bm-mail/main.go
id: "bm-mail"
binary: bm-mail

- <<: *build_defaults
main: ./cmd/bm-bridge/main.go
id: "bm-bridge"
binary: bm-bridge


archives:
- id: nix
# builds: [darwin, linux]
<<: &archive_defaults
name_template: "{{ .ProjectName }}_nightly_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- LICENSE
wrap_in_directory: true
format: tar.gz
replacements:
amd64: x86_64
- id: windows
# builds: [windows]
<<: *archive_defaults
wrap_in_directory: false
format: zip
replacements:
amd64: 64bit

checksum:
name_template: 'checksums.txt'

signs:
- artifacts: checksum
args: ["-u", "C2D6C816449D7AF38853F6FEDFD61AEF353E9701", "--no-tty", "--output", "${signature}", "--detach-sign", "${artifact}"]

nfpms:
- license: MIT
maintainer: GitHub
homepage: https://bitmaelum.org
bindir: /usr
description: BitMaelum Suite
formats:
- deb
- rpm
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Default opening notepad on windows when editting config or messages
- Service support: Now you can install both bm-bridge and bm-server as system services using bm-config
- bm-client: accounts can be activated and deactivated on the key resolver. Deactivated accounts will be removed after a while (not yet defined)
- bm-client: Reserved certain accounts and organisations for registration (see https://github.com/bitmaelum/bitmaelum-suite/wiki/reserved-addresses)
- bm-client: OTP generation works properly

# Security
Expand All @@ -15,6 +16,8 @@
- bm-bridge: Support for mail relay (aka gateway mode) for organizations, this way an organization can "host" using the BitMaelum protocol.
- bm-client: reserved certain accounts and organisations for registration (see https://github.com/bitmaelum/bitmaelum-suite/wiki/reserved-addresses)
- resolver configuration has been overhauled
- bm-client: Added `--debug` flag to display HTTP traffic (override the client config's server.debughttp option)



## 0.1.1-1 (2021-feb-19)
Expand Down
9 changes: 7 additions & 2 deletions cmd/bm-client/cmd/account_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ This assumes you have a BitMaelum invitation token for the specific server.`,
Run: func(cmd *cobra.Command, args []string) {
v := vault.OpenDefaultVault()

if *token == "" && *target == "" {
logrus.Fatal("please specify either --token or --target")
}

kt, err := bmcrypto.FindKeyType(*keytype)
if err != nil {
logrus.Fatal("incorrect key type")
}
handlers.CreateAccount(v, *account, *name, *token, kt)
handlers.CreateAccount(v, *account, *name, *token, kt, *target)
},
}

Expand All @@ -49,6 +53,7 @@ var (
name *string
token *string
keytype *string
target *string
)

func init() {
Expand All @@ -57,9 +62,9 @@ func init() {
account = createAccountCmd.Flags().String("account", "", "Account to create")
name = createAccountCmd.Flags().String("name", "", "Your full name")
token = createAccountCmd.Flags().String("token", "", "Invitation token from server")
target = createAccountCmd.Flags().String("target", "", "Target address to link to")
keytype = createAccountCmd.Flags().String("keytype", "ed25519", "Type of key you want to generate (defaults to ed25519)")

_ = createAccountCmd.MarkFlagRequired("account")
_ = createAccountCmd.MarkFlagRequired("name")
_ = createAccountCmd.MarkFlagRequired("token")
}
13 changes: 12 additions & 1 deletion cmd/bm-client/cmd/account_key_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

"github.com/bitmaelum/bitmaelum-suite/cmd/bm-client/internal/container"
"github.com/bitmaelum/bitmaelum-suite/internal"
"github.com/bitmaelum/bitmaelum-suite/internal/resolver"
"github.com/bitmaelum/bitmaelum-suite/internal/vault"
"github.com/bitmaelum/bitmaelum-suite/pkg/bmcrypto"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -89,8 +90,18 @@ WITHOUT THESE WORDS, ALL ACCESS TO YOUR ACCOUNT IS LOST!
if *advertise {
info.SetActiveKey(kp)

addrObj := &resolver.AddressInfo{
Hash: info.Address.Hash().String(),
PublicKey: info.GetActiveKey().PubKey,
RoutingID: info.RoutingID,
RedirHash: info.RedirAddress.Hash().String(),
Pow: info.Pow.String(),
}

pk := info.GetActiveKey().PrivKey

ks := container.Instance.GetResolveService()
err = ks.UploadAddressInfo(*info, "")
err = ks.UploadAddressInfo(*info.Address, *addrObj, &pk)
}

// Error or we didn't advertise
Expand Down
7 changes: 7 additions & 0 deletions cmd/bm-client/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ var rootCmd = &cobra.Command{
if _, exist := cmd.Annotations["dont_load_config"]; !exist {
config.LoadClientConfig(internal.Opts.Config)

if internal.Opts.Debug {
config.Client.Server.DebugHTTP = true
}

// Set vault path if not already set
if vault.VaultPath == "" {
vault.VaultPath = config.Client.Vault.Path
Expand All @@ -65,7 +69,10 @@ func Execute() {
}

func init() {
// These are not used directly, but are here for --help purposes only. These flags are actually located inside the
// internal.opts structure
rootCmd.PersistentFlags().StringP("config", "c", "", "configuration file")
rootCmd.PersistentFlags().StringP("password", "p", "", "password to unlock your account vault")
rootCmd.PersistentFlags().StringP("vault", "", "", "custom vault file")
rootCmd.PersistentFlags().Bool("debug", false, "debug HTTP traffic")
}

0 comments on commit 541fa2c

Please sign in to comment.