webinstall / webi-roadmap

A space where we can ideate without cluttering the main repo with stale issues
Mozilla Public License 2.0
2 stars 0 forks source link

[Installer] Create a random string generate `rnd` and publish with goreleaser #23

Open coolaj86 opened 3 years ago

coolaj86 commented 3 years ago

Add rnd

This is two parts:

  1. A program called rnd that spits out a random string (for passwords, tokens, etc)
  2. Make installable via webi (could be done by a different person, such as myself)

Currently I have some aliases for creating random strings:

webi aliasman

aliasman alias rnd='xxd -l24 -ps /dev/urandom | xxd -r -ps | base64 | tr -d = | tr + - | tr / _'
aliasman alias xrnd='xxd -l24 -ps /dev/urandom'

It would be trivial to create a cross-platform Go program that spits out a random string.

rnd
2> (196-bit, base64)
> Zys_yZqEySPS5il0l1Vew_y46fQwAqvL
rnd --hex --bits 128
2> (128-bit, hexidecimal)
> 506cc039ef529b631d3d6a6baff6717e

Honestly, I'd prefer it in Rust, but I have yet to see a simple solution for cross compiling to multiple platforms from a Linux host (yes, Windows too, no the user to separately install the visual studio runtime distribution is not acceptable).

Getting this on webi would as simple as copying _example, updating the github releases info, and doing a find and replace on a few file system path names.

There are several Go programs on here which are released with goreleaser which could serve as examples.

Part 2. How to create a webi installer

Video Tutorial: How to create a webi Installer

Skills required

Steps

  1. Clone and setup the webi packages repo
    git clone git@github.com:webinstall/packages.git
    pushd packages/
    npm install
  2. Copy the example template and update with info from Official Releases: https://github.com/___CHANGE/ME___/releases
    rsync -av _example/ CHANGE-ME/
    • [ ] update CHANGE-ME/release.js to use the official repo
    • [ ] Learn how CHANGE-ME unpacks (i.e. as a single file? as a .tar.gz? as a .tar.gz with a folder named CHANGE-ME?)
    • [ ] find and replace to change the name
      • [ ] update CHANGE-ME/install.sh (see bat and jq as examples)
      • [ ] update CHANGE-ME/install.ps1 (see bat and jq as examples)
  3. Needs an updated tagline and cheat sheet
    • [ ] update CHANGE-ME/README.md
      • [ ] official URL
      • [ ] tagline
      • [ ] Switch versions
      • [ ] description / summary
      • [ ] General pointers on usage (and perhaps "gotchas")

It's also okay to have multiple people work on part of this (i.e. the Cheat Sheet can be done independently from the install.sh)

khairnarsaurabh23 commented 2 years ago

Can i work on this ?

coolaj86 commented 2 years ago

@khairnarsaurabh23 Sure. Take a look here: https://github.com/BeyondCodeBootcamp/beyondcodebootcamp/issues/10#issuecomment-882224603

Have you used GoReleaser before?

khairnarsaurabh23 commented 2 years ago

No, I haven't used it before. But I'll learn about it, for sure.

khairnarsaurabh23 commented 2 years ago

I'm finding it defficult to work on issue with given information. Sir, the link you have given in step 2 goes to nothing. Can you please help me out ? @coolaj86

coolaj86 commented 2 years ago

@khairnarsaurabh23 There is no link in step two. You'd have to create it yourself.

What's your experience programming in Go?

khairnarsaurabh23 commented 2 years ago

I've no programing experience in Go.

coolaj86 commented 2 years ago

Were you planning to write a cross-platform rnd program?

If you just want to add an existing program to Webi, you might try one that already exists, like delta (see https://github.com/webinstall/webi-installers/issues/320) instead.