Fork me on GitHub
#tools-deps
<
2018-11-05
>
slipset06:11:07

I see that https://github.com/healthfinch/depstar/ and https://github.com/juxt/pack.alpha both are in the business of packaging your project where depstar seems a bit more focussed on uberjars. Any thoughts on this?

slipset06:11:56

Reason I’m asking is that I’m pondering creating a deps-shipit which would generate/refresh the pom, update the versions in it, create your choice of (skinny/uber) jar and then upload it to Clojars.

dominicm07:11:34

Uberjars aren't really suitable for uploading to clojars

slipset08:11:20

true enough

dominicm08:11:59

@slipset fwiw, I'd be interesting in a tool which only concerns itself with uploading jars to maven repos. Maybe with support for s3 wagons too.

dominicm08:11:20

Having a tool which starts a JVM to run this shell script isn't immediately on my list of problems I need solving:

#!/bin/sh

clojure -A:pack -m …
clojure -Spom

clojure -A:shipit output.jar pom.xml

dominicm08:11:41

This is fantastic ❤️ 2 comments: 1. Can we look at getting gpg support for credentials, I think this is really important. Environment variables are far from secure. 2. I'd love to have this replace my current documentation in pack for using mvn:deploy-file 🙂

slipset08:11:24

1) Yes. If I could ask you to file an issue/submit PR, that’d be fantastic

dominicm08:11:28

I asked for this to exist about a week ago, so I'm glad it now does. I'm going to have to try imagining more things. Pile of Gold. Pile of Gold.

slipset08:11:04

2) I’m more than happy to improve it in any way 🙂

slipset08:11:40

In fact, I was about to submit a PR against pack suggesting the use of deps-deploy this morning 🙂

slipset08:11:10

@dominicm the gpg support for credentials, that would basically be supporting passing private-key-file to aether, right? https://github.com/cemerick/pomegranate/blob/master/src/main/clojure/cemerick/pomegranate/aether.clj#L325

dominicm08:11:43

@slipset I don't think so. I am not aware of that feature at all though 🙂

slipset08:11:33

Ok, then if you could outline a solution in a ticket, I’d be very happy. I haven’t worked much with gpg.

dominicm08:11:54

I've put quickly jotted down some thoughts, I've tried to capture my overarching goal of "moar secure" and provide some options.

slipset08:11:21

Thank you! I’ll have a closer look this evening.

slipset08:11:48

Btw, concerning a potential deps-shipit, you’d actually end up just firing up one jvm, as the plan for deps-shipit would be to compose the three steps you are outlining into one.

dominicm08:11:56

I know 🙂 But it's similar to this also:

#!/usr/bin/env clojure

(require '[pack.onejar])
(require '[deploy])
(require '[t.d.a])

(pack.onejar/jar)
(t.d.a/generate-pom)
(deploy/deploy jar pom)
Having said that, I'm usually happier to automate myself than others are 🙂

dominicm08:11:23

Supporting jar signing seems important too, trying to find some good references on it

slipset08:11:24

Shouldn’t be too hard, lein already provides this. Just need to RTFS a bit.

dominicm08:11:23

yeah. Reading the source looks like the best option, given that maven + gpg signing isn't giving me anything useful.

rickmoynihan12:11:35

In my experience gpg and lein has been a bit awkward to setup… and I’ve seen lots of people struggle to do it. Is there an option to use something like bouncy castle here ( https://www.bouncycastle.org/java.html )? Or perhaps something that ships with the JVM? I’m assuming the main thing gpg brings to the table (aside from the crypto) is being able to interact with the OS keychain.

rickmoynihan12:11:56

Not sure if bouncy castle has any support for that

dominicm13:11:14

@rickmoynihan You've highlighted my concern with BouncyCastle immediately. It would be good to enumerate the exact issues people have. I would expect it's around gpg vs gpg2. But I'm potentially projecting the issue I personally have.

dominicm13:11:41

I would expect using Bouncy Castle with PGP brings in a new class of issues, like support smart cards.

dominicm13:11:19

One option is to search & present options. e.g. if only gpg/gpg2 are found, use those. If both, then ask the user.

rickmoynihan13:11:39

Yeah; I suspect gpg/gpg2 are the best options… as lein and others have been through this before and everyone always seem to settle on gpg. It’s just frustrating that that choice often leaves to brittleness and installation/configuration issues… but I guess it’s always going to be a bit of a cross platform nightmare 😞

dominicm13:11:27

It doesn't have to be I think 🙂

dominicm13:11:41

Lein also doesn't prompt the user ever. There are other mistakes there.

rickmoynihan14:11:49

I can’t really recall my issues with gpg… it could well have been gpg vs gpg2. IIRC mine might also have been due to config cruft from .bashrc which I ported from linux to mac years back. In my experience it’s just one of those areas which can be fiddly, where you really don’t want something fiddly.

dominicm14:11:12

If gpg is hard to use, I'd be inclined to not tackle the problem 🙂

dominicm14:11:15

But that's just me.

dominicm14:11:49

What I mean is, if gpg is easy to shoot yourself in the foot with, that's gpg's problem. I don't think it's a good use of time to handle the thousands of config combinations.

slipset15:11:06

lein actually prompts me for my gpg thing (if I don’t turn off the signed artifacts thingy)

dominicm15:11:36

@slipset your gpg passphrase you mean?

slipset16:11:42

yes, I guess that’s the correct term.

seancorfield16:11:34

After some updates to software on my Mac I could never get gpg working again so I just told leiningen not to sign things. I mostly use boot to upload to clojars to avoid gpg anyway.

seancorfield16:11:32

And I have my clojars credentials in my dot file unencyrpted - again so I can avoid trying to deal with gpg.

seancorfield16:11:58

(And I was never able to get anything to work on windows in this area)

seancorfield16:11:16

Phil was always the one pushing gpg. No one used to bother until he bugged everyone 🙃 and the boot crowd never pushed it.

dominicm16:11:13

@seancorfield do you mean exclusively with lein it broke, or it's broken altogether?

dominicm16:11:56

@slipset I was thinking more about prompting if both commands gpg and gpg2 are available. Things like that.

dominicm16:11:29

No rush. I think it's good to think on & compare.

dominicm16:11:34

Hammock time 🙂

slipset16:11:43

I’d be really happy if you could comment on my comment there so I have something to hammock on 🙂

dominicm16:11:01

Sorry, I've got my emails turned off 😄

slipset16:11:20

Nothing to be sorry about, it’s actually very smart if you want to get things done 🙂

dominicm16:11:51

We have a large number of (non-)errors in a production environment at the moment, only way I can stay sane

rickmoynihan16:11:18

FWIW on mac with GPG this is what I use and it seems to work: https://gpgtools.org/

seancorfield17:11:40

Yeah, that's what I was using but it stopped working and uninstalling/reinstalling didn't fix it so I gave up. The whole thing seemed more hassle than it was worth -- given the only thing that seemed to care about it was Leiningen...

dominicm18:11:52

I consider gpg an important part of my security system, I think its a shame more people don't use it with jars. But I can't speak to how well the gnu toolchain works elsewhere.

slipset19:11:16

I used gpg --encrypt .clojars_creds.edn to encrypt my creds.

slipset19:11:36

which may or may not be what you were asking for, as this is a symmetric encryption.

dominicm19:11:03

I'll see if I can get it working with my smart card. Looking at the code, I don't expect it will, as I don't have a gpg passphrase.

slipset20:11:26

May I ask what kind of smart card you have?