The Charm Tool and Library 🌟

Related tags

Command Line charm
Overview

Charm

Manage your Charm account and access The Charm Cloud.

Charm Tool Header Treatment
Latest Release GoDoc Build Status

Charm UI Trailer

Installation

Use your fave package manager:

# macOS or Linux
brew tap charmbracelet/tap && brew install charmbracelet/tap/charm

# Arch Linux (btw)
yay -S charm-tool

# Nix
nix-env -iA nixpkgs.charm

Or you can download a binary from the releases page. macOS, Linux, Windows, FreeBSD, and OpenBSD binaries are available, as well as Debian, RPM, and Alpine packages. ARM builds are also available for Linux, FreeBSD, and OpenBSD.

Or just build and install it yourself:

git clone https://github.com/charmbracelet/charm.git
cd charm
go install

Bash/Zsh/Fish completion is also available. See charm help completion.

Usage

Run without arguments for the TUI. Or, for shortcuts and additional functionality see the CLI usage at charm help.

Encryption and Decryption

The Charm Tool (and Charm library) includes a simple, powerful encryption interface. Data encrypted with Charm is decryptable only by machines linked to your Charm account. Even we couldn’t decrypt your data if we somehow got our hands on it.

# Encryption is easy
echo "Secret message" | charm encrypt

# Save an encrypted message to disk
echo "Secret message" | charm encrypt > secret_message.json

# Decryption is easy too
cat secret_message.json | charm decrypt

# You can encrypt any kind of data
charm encrypt < my_secret_photo.jpg > encrypted_photo.json

# Encrypt and compress
charm encrypt < secret_document.md | gzip > encrypted_document.json.gz

# Decompress, decrypt, and read wth Glow
gunzip encrypted_document.json.gz | charm decrypt | glow -p -

How It Works

Encryption works by issuing symmetric keys (basically a generated password) and encrypting it with the local SSH public key generated by this library. That encrypted key is then sent up to our server. We can’t read it since we don’t have your private key. When you want to decrypt something or view your stash, that key is downloaded from our server and decrypted locally using the SSH private key. When you link accounts, the symmetric key is encrypted for each new public key. This happens on your machine and not our server, so we never see any unencrypted data.

The Library

The Charm library is a simple API to the Charm Cloud for doing things like:

  • Frictionless user identification
  • User accounts linking
  • Encrypt and decrypt data
  • Simple SSH key generation
  • Programatically read, write and delete from a user’s Glow markdown stash

For more details and the full feature set check out the Go docs.

Charming Projects

Check out these projects, which use the charm library:

  • Glow, a markdown reader for the CLI

License

MIT


Part of Charm.

the Charm logo

Charm热爱开源! / Charm loves open source!

Comments
  • Docker only: error fetching encrypt keys when using skate

    Docker only: error fetching encrypt keys when using skate

    Hi, I tried to spin up a self hosted charm using docker, the docker image seems to store invalid created_at dates for encrypt_key. When using charm serve instead, there is no problem.

    On a first glance regarding the error message:

    The docker image seems to set encrypt_key.created_at to 2021-12-08 12:15:47.525768 +0100 +0100 while charm serve stores 2021-12-08 12:09:31.894222 +0100 CET. I guess that produces the error message Error fetching encrypt keys: sql: Scan error on column index 2, name "created_at": unsupported Scan, storing driver.Value type string into type *time.Time.

    Versions

    • charmcli/charm:v0.9.0 (tested on linux and macOS 12.0.1)
    • charm v0.9.0 (on macOS brew install charmbracelet/tap/charm)
    • skate v0.1.0 (bb1d9c9) (on macOS brew install charmbracelet/tap/skate)

    Fails: docker

    1. Run Docker image
    2. skate set hello world -> Encryption key mismatch
    3. skate set hello world -> failed crypt check
    4. Stop docker image
    5. Start charm serve
    6. skate list -> failed crypt check
    $ rm -rf ./data "~/Library/Application Support/charm/"
    $ cat docker-compose.yml
    ---
    version: "3.1"
    services:
      soft-serve:
        image: charmcli/charm:v0.9.0
        container_name: charm
        volumes:
          - ./data:/data
        ports:
          - 35353:35353
          - 35354:35354
          - 35355:35355
          - 35356:35356
        restart: unless-stopped
    
    $ docker-compose up                                   
    Creating network "charm_default" with the default driver
    Creating charm ... done
    Attaching to charm
    charm         | 2021/12/08 11:15:41 Opening SQLite db: /data/db
    charm         | 2021/12/08 11:15:42 Starting SSH server on :35353
    charm         | 2021/12/08 11:15:42 HTTP server listening on: :35354
    charm         | 2021/12/08 11:15:47 ssh api-auth
    charm         | 2021/12/08 11:15:47 Creating user for key 37f0505b79ab53d19e595489d7911c28f348ce6a
    charm         | 2021/12/08 11:15:47 JWT for user b3ef3220-3beb-401d-8b48-e0fb9a0f30e4
    charm         | 2021/12/08 11:15:47 <- POST /v1/encrypt-key 172.21.0.1
    charm         | 2021/12/08 11:15:47 Adding encrypted key 539f7c93-a0fa-4d65-8279-f414e3fbf699 2021-12-08 12:15:47.525768 +0100 +0100 for user b3ef3220-3beb-401d-8b48-e0fb9a0f30e4
    charm         | 2021/12/08 11:15:47 -> 200 OK 0B 33.6366ms
    charm         | 2021/12/08 11:15:49 ssh api-auth
    charm         | 2021/12/08 11:15:49 JWT for user b3ef3220-3beb-401d-8b48-e0fb9a0f30e4
    charm         | 2021/12/08 11:15:49 Error fetching encrypt keys: sql: Scan error on column index 2, name "created_at": unsupported Scan, storing driver.Value type string into type *time.Time
    ^CGracefully stopping... (press Ctrl+C again to force)
    Killing charm  ... done
    ERROR: 2
    
    $ charm serve                                         
    2021/12/08 12:16:04 Opening SQLite db: ./data/db
    2021/12/08 12:16:04 Starting SSH server on :35353
    2021/12/08 12:16:04 HTTP server listening on: :35354
    2021/12/08 12:16:09 ssh api-auth
    2021/12/08 12:16:09 JWT for user b3ef3220-3beb-401d-8b48-e0fb9a0f30e4
    2021/12/08 12:16:09 Error fetching encrypt keys: sql: Scan error on column index 2, name "created_at": unsupported Scan, storing driver.Value type string into type *time.Time
    
    

    Here the commands for the client

    $ export CHARM_HOST=127.0.0.1
    
    # during docker-compose up
    $ skate set hello world
    Error: Encryption key mismatch
    Usage:
       set KEY[@DB] VALUE [flags]
    
    Flags:
      -h, --help   help for set
    
    Encryption key mismatch
    
    $ skate set hello world
    Error: failed crypt check
    Usage:
       set KEY[@DB] VALUE [flags]
    
    Flags:
      -h, --help   help for set
    
    failed crypt check
    
    # during charm serve
    $ skate list           
    Error: failed crypt check
    Usage:
       list [@DB] [flags]
    
    Flags:
      -d, --delimiter string   delimiter to separate keys and values (default "\t")
      -h, --help               help for list
      -k, --keys-only          only print keys and don't fetch values from the db
      -r, --reverse            list in reverse lexicographic order
      -v, --values-only        only print values
    
    failed crypt check
    
    

    Works: charm serve

    1. Run charm serve
    2. skate set hello world -> works
    3. Stop docker image
    4. Run docker image
    5. skate list -> works
    $ charm --version
    charm version v0.9.0 (e554127)
    $ rm -rf ./data "~/Library/Application Support/charm/"
    $ charm serve
    2021/12/08 12:09:17 Opening SQLite db: ./data/db
    2021/12/08 12:09:19 Starting SSH server on :35353
    2021/12/08 12:09:19 HTTP server listening on: :35354
    2021/12/08 12:09:31 ssh api-auth
    2021/12/08 12:09:31 Creating user for key 37f0505b79ab53d19e595489d7911c28f348ce6a
    2021/12/08 12:09:31 JWT for user 72dad0be-b338-4f45-918f-519c1cae3806
    2021/12/08 12:09:31 <- POST /v1/encrypt-key 127.0.0.1
    2021/12/08 12:09:31 Adding encrypted key 42f2ce6f-89c5-4c1f-baa4-5cee035cd3d7 2021-12-08 12:09:31.894222 +0100 CET for user 72dad0be-b338-4f45-918f-519c1cae3806
    2021/12/08 12:09:31 -> 200 OK 0B 2.310272ms
    2021/12/08 12:09:31 <- GET /v1/seq/b1f17f58c3aed7b14e097fbc55b3dc410d9f9c92f3cd974544e358cb0b9e26d82db7808901b0 127.0.0.1
    2021/12/08 12:09:31 -> 200 OK 10B 2.989027ms
    2021/12/08 12:09:31 <- GET /v1/fs/b1f17f58c3aed7b14e097fbc55b3dc410d9f9c92f3cd974544e358cb0b9e26d82db7808901b0 127.0.0.1
    2021/12/08 12:09:31 -> 404 Not Found 29B 568.249µs
    2021/12/08 12:09:31 <- POST /v1/seq/b1f17f58c3aed7b14e097fbc55b3dc410d9f9c92f3cd974544e358cb0b9e26d82db7808901b0 127.0.0.1
    2021/12/08 12:09:31 -> 200 OK 10B 1.580633ms
    2021/12/08 12:09:31 <- POST /v1/fs/b1f17f58c3aed7b14e097fbc55b3dc410d9f9c92f3cd974544e358cb0b9e26d82db7808901b0/825034e5c6b9fc697cb0214f873d34baa8?mode=432 127.0.0.1
    2021/12/08 12:09:31 -> 200 OK 0B 1.983326ms
    ^C
    
    $ cat docker-compose.yml
    ---
    version: "3.1"
    services:
      soft-serve:
        image: charmcli/charm:v0.9.0
        container_name: charm
        volumes:
          - ./data:/data
        ports:
          - 35353:35353
          - 35354:35354
          - 35355:35355
          - 35356:35356
        restart: unless-stopped
    
    $ docker-compose up
    Starting charm ... done
    Attaching to charm
    charm         | 2021/12/08 11:09:46 Opening SQLite db: /data/db
    charm         | 2021/12/08 11:09:46 Starting SSH server on :35353
    charm         | 2021/12/08 11:09:46 HTTP server listening on: :35354
    charm         | 2021/12/08 11:09:50 ssh api-auth
    charm         | 2021/12/08 11:09:50 JWT for user 72dad0be-b338-4f45-918f-519c1cae3806
    charm         | 2021/12/08 11:09:50 <- GET /v1/fs/b1f17f58c3aed7b14e097fbc55b3dc410d9f9c92f3cd974544e358cb0b9e26d82db7808901b0 172.19.0.1
    charm         | 2021/12/08 11:09:50 -> 200 OK 308B 9.3245ms
    
    
    

    And here are the commands of the client:

    $ export CHARM_HOST=127.0.0.1
    
    # while charm serve
    $ skate set hello world
    
    # while docker-compose up
    $ skate list
    hello	world
    
    

    Any skate set with this user will succeed with docker-compose from now on.

    opened by vknabel 8
  • ui/keygen not generating keys for host

    ui/keygen not generating keys for host

    Apologies if I've missed something obvious here. I was looking to test charm KV and ran the following commands:

    $ charm keygen
    
      ✔  Generated keys
    
    $ charm id
    
      We were’t able to authenticate via SSH, which means
      there’s likely a problem with your key.
    
      You can generate SSH keys by running  charm keygen . You
      can also set the environment variable  CHARM_SSH_KEY_PATH
      to point to a specific private key, or use  -i specifify a
      location.
    

    I expected charm id to report an identity associated with the keys I just created.

    I tried this in a basic Docker container and got the same result:

    $ docker run -it ubuntu:latest /bin/bash
    ...
    
    # apt update && apt install -y wget
    ...
    
    # wget https://github.com/charmbracelet/charm/releases/download/v0.10.3/charm_0.10.3_linux_amd64.deb
    ...
    
    # dpkg -i charm_0.10.3_linux_amd64.deb
    Selecting previously unselected package charm.
    (Reading database ... 4470 files and directories currently installed.)
    Preparing to unpack charm_0.10.3_linux_amd64.deb ...
    Unpacking charm (0.10.3) ...
    Setting up charm (0.10.3) ...
    
    # charm keygen
    
      ✔  Generated keys
    
    # charm id
    
      We were’t able to authenticate via SSH, which means
      there’s likely a problem with your key.
    
      You can generate SSH keys by running  charm keygen . You
      can also set the environment variable  CHARM_SSH_KEY_PATH
      to point to a specific private key, or use  -i specifify a
      location.
    

    I also tried running a local charm server, but got the same result (output from the same Docker container):

    # charm serve &
    [1] 2609
    2022/03/08 21:34:47 Opening SQLite db: data/db/charm_sqlite.db
    2022/03/08 21:34:47 http://localhost:35354
    2022/03/08 21:34:47 Starting SSH server on :35353
    2022/03/08 21:34:47 Starting HTTP server on: :35354
    2022/03/08 21:34:47 Starting HTTP health server on: :35356
    
    # export CHARM_HOST=localhost
    
    # charm id
    
      We were’t able to authenticate via SSH, which means
      there’s likely a problem with your key.
    
      You can generate SSH keys by running  charm keygen . You
      can also set the environment variable  CHARM_SSH_KEY_PATH
      to point to a specific private key, or use  -i specifify a
      location.
    

    Is there something that I'm missing?

    bug 
    opened by twpayne 7
  • Expose client http scheme as an env variable

    Expose client http scheme as an env variable

    Add the ability to set the client HTTP scheme and default to the server's scheme when the environment variable is not provided.

    Fixes: https://github.com/charmbracelet/charm/issues/37

    opened by aymanbagabas 6
  • Charm keys import to the wrong directory

    Charm keys import to the wrong directory

    As I can't run both OS at the same time, I can't complete the verification process. I've tried backing up and loading the backup on the other OS, but that didn't work either.

    bug 
    opened by benthillerkus 6
  • KV generates very big files filled with null bytes

    KV generates very big files filled with null bytes

    I recently tried the program Skate v0.1.2 and I think I observed a big bug with kv. A very big file (000001.vlog or 000003.vlog) is generated at the path ~/.local/share/charm/<charm server>/kv/charm.sh.skate.default/. It is 2 GiB long it is mostly filled with null bytes.

    This is very problematic as this prevent me to run Skate on my Raspberry Pi which have not enough RAM to load this file.

    I observed this bug by using Skate release v0.1.2 on my local machine and on the self-hosted Charm server I tried the commit f4634fe and the release v0.9.1.

    opened by Arkaeriit 5
  • Secret management

    Secret management

    I was looking for a way to store my secrets recently, and a common occurrence among the suggestions and solutions was to encrypt each secret using another key and store the encrypted keys in a secure place where only you have access to it (automated solutions would handle the encrypting and storing for you). but the problem with those is, the secrets are not synced across all my devices. and if I loose the access to my device or the "master" key, I loose all my secrets.

    Today this idea popped in my head: If charm can securely store and sync my markdown notes across my devices, why can it not store my secrets? So the immediate solution would be to create a markdown file with all the secrets in it but that's not really a solution at all imo.

    So I propose the following feature request:

    
    charm secrets                                     # list all secrets' names (similar to `charm keys`)
    
    charm secrets add SECRET_NAME < cat secret_file   # add a secret (similar to `glow stash`)
    
    charm secrets get SECRET_NAME                     # get the value of the secret
    
    charm secrets remove SECRET_NAME                  # get the value of the secret
    
    

    this would allow things like

    
    some_tool --passphrase $(charm secrets get SECRET_NAME)
    
    

    command name and format can change

    enhancement 
    opened by maximousblk 5
  • Allow for Docker containers to run charm with a specified user/group id.

    Allow for Docker containers to run charm with a specified user/group id.

    When running the Docker container, it creates files with root as the owner.

    [email protected]:~/charm-r/data$ ls -al total 28 drwxr-xr-x 5 root root 4096 Feb 27 18:08 . drwxr-xr-x 3 jeff jeff 4096 Feb 27 18:08 .. drwx------ 2 root root 4096 Feb 27 18:08 db drwx------ 2 root root 4096 Feb 27 18:08 files drwx------ 2 root root 4096 Feb 27 18:08 .ssh -rw-r--r-- 1 root root 8192 Feb 27 18:08 stats

    Ideally, there should be a way to set a uid/gid for the application, like how the linuxserver.io folks do their containers that allow environment variables to be set (PUID/PGID). See https://hub.docker.com/r/linuxserver/radarr and https://github.com/linuxserver/docker-baseimage-ubuntu for examples. The base image is where all the smarts are for PUID/PGID.

    I was able to create my own docker image using linuxserver/docker-baseimage-ubuntu and adapting the raddar docker config. I'm not sure if that is the approach that should be taken, but the linuxserver folks have already done the hard work.

    "charm with custom docker container" [email protected]:~/charm/data$ ls -al total 28 drwxr-xr-x 5 jeff jeff 4096 Feb 27 17:47 . drwxr-xr-x 3 jeff jeff 4096 Feb 27 18:19 .. drwx------ 2 jeff jeff 4096 Feb 27 17:47 db drwx------ 3 jeff jeff 4096 Feb 27 17:47 files drwx------ 2 jeff jeff 4096 Feb 27 17:46 .ssh -rw-r--r-- 1 jeff jeff 8192 Feb 27 17:47 stats

    question 
    opened by macfisherman 4
  • Add basic charm serve integration tests

    Add basic charm serve integration tests

    Tests for https://github.com/charmbracelet/charm/pull/36 that was merged recently.

    Some notes:

    Introduced the testify dependency. Happy to remove it if you prefer to test without it.

    The test waits for the server to start serving requests so we can test the output, database path, etc. I did it testing we can actually establish a connection to the HTTP port which also works as a test, but has the potential of introducing test flakiness, given we wait for a fixed amount of time for the server to start. Unlikely since 5 secs should be plenty for the server to start, but the potential is there.

    cc @muesli @toby

    enhancement 
    opened by rubiojr 4
  • Added methods to allow updating Body of stashed documents

    Added methods to allow updating Body of stashed documents

    Adds a method to allow updating a stashed document's Body and a method to update the Body and Note simultaneously.

    Addresses https://github.com/charmbracelet/glow/pull/214

    opened by shitchell 4
  • Charm KV .Keys() function returning duplicate keys

    Charm KV .Keys() function returning duplicate keys

    Issue

    Listing out the keys using the the db.Keys() function gives me wrong results.

    If I run a small program that creates 3 kv pairs and then use db.Keys() to list them out I get a duplicate key value.

    I ran my example program to generate the keys, then used the charm cli tool to list my keys out, then run the program again which shows the difference between .Keys() and .View() functions:

    ➜  charm-test charm kv list @charm-kv-keys-test-db      
    key1	value1
    key2	value2
    key3	value3
    ➜  charm-test go run main.go                      
    Charm kv .Keys()
    0: key3
    1: key2
    2: key3
    Charm kv .View() to list keys and values
    key1 - value1
    key2 - value2
    key3 - value3
    

    Example program to demonstrate

    package main
    import (
    	"github.com/charmbracelet/charm/kv"
        "github.com/dgraph-io/badger/v3"
        "fmt"
        "log"
    )
    
    func main(){
        // Open a database (or create one if it doesn’t exist)
        db, err := kv.OpenWithDefaults("charm-kv-keys-test-db")
        if err != nil {
            log.Fatal(err)
        }
        defer db.Close()
    
    
        // Save some data
        if err := db.Set([]byte("key1"), []byte("value1")); err != nil {
            log.Fatal(err)
        }
    
        if err := db.Set([]byte("key2"), []byte("value2")); err != nil {
            log.Fatal(err)
        }
    
        if err := db.Set([]byte("key3"), []byte("value3")); err != nil {
            log.Fatal(err)
        }
    
        fmt.Println("Charm kv .Keys()")
        if keys,err := db.Keys(); err != nil{
            log.Fatal(err)
        }else{
            for i,k := range keys{
                fmt.Printf("%d: %s\n", i, string(k))
            }
        }
    
        fmt.Println("Charm kv .View() to list keys and values")
        // Go full-blown Badger and use transactions to list values and keys
    	db.View(func(txn *badger.Txn) error {
    		opts := badger.DefaultIteratorOptions
    		opts.PrefetchSize = 10
    		it := txn.NewIterator(opts)
    		defer it.Close() //nolint:errcheck
    		for it.Rewind(); it.Valid(); it.Next() {
    			item := it.Item()
    			k := item.Key()
    			err := item.Value(func(v []byte) error {
    				fmt.Printf("%s - %s\n", k, v)
    				return nil
    			})
    			if err != nil {
    				panic(err)
    			}
    		}
    		return nil
    	})
    }
    

    Possible fix?

    Disclaimer: I only started looking at Go last week, so could be that I'm doing something dumb here!

    However, when running a debug session to try and figure it out, I did find that I could get it to work if I changed the following line in the kv.go file from

    ks = append(ks, it.Item().Key())
    

    to

    ks = append(ks, it.Item().KeyCopy(nil))
    
    opened by huntlyc 3
  • fixed: proper way to handle context values

    fixed: proper way to handle context values

    Fixed the issue with context values - staticcheck: SA1029 - Inappropriate key in call to context.WithValue in middleware.go.

    And in the second file http.go added proper way to assert the type of a context value.

    opened by enkeyz 3
  • self-hosting: enabling TLS causes the client to always receive '400 Bad Request'

    self-hosting: enabling TLS causes the client to always receive '400 Bad Request'

    I've been trying to setup a self-hosted version of the charm service using the package from your APT/DEB repo on an Ubuntu 22.04.1 LTS system (I've tried on both amd64 and arm64 systems).

    % charm -v
    charm version v0.12.4 (099f4f1)
    

    I have a Let's Encrypt-provided TLS certificate, and I've set it up via systemd with these environment variables:

    CHARM_SERVER_DATA_DIR=/some/path/charm/data
    CHARM_SERVER_HOST=myhostname
    CHARM_SERVER_USE_TLS=true
    CHARM_SERVER_TLS_KEY_FILE=/etc/letsencrypt/live/myhostname/privkey.pem
    CHARM_SERVER_TLS_CERT_FILE=/etc/letsencrypt/live/myhostname/fullchain.pem
    

    Starting it, I see this in the systemd journal:

    Jan 07 17:20:24 irmin charm[84564]: 2023/01/07 17:20:24 Opening SQLite db: /some/path/charm/data/db/charm_sqlite.db
    Jan 07 17:20:24 irmin charm[84564]: 2023/01/07 17:20:24 Starting SSH server on :35353
    Jan 07 17:20:24 irmin charm[84564]: 2023/01/07 17:20:24 Starting HTTPS server on: :35354
    Jan 07 17:20:24 irmin charm[84564]: 2023/01/07 17:20:24 Starting HTTPS health server on: :35356
    

    I can see that the certificate served up is valid, using certigo:

    % certigo connect myhostname:35354
    ** TLS Connection **
    Version: TLS 1.3
    Cipher Suite: CHACHA20_POLY1305_SHA256 cipher
    
    ** CERTIFICATE 1 **
    Valid: 2023-01-07 02:57 UTC to 2023-04-07 02:57 UTC
    Subject:
            CN=myhostname
    Issuer:
            C=US, O=Let's Encrypt, CN=R3
    DNS Names:
            myhostname
    
    ** CERTIFICATE 2 **
    Valid: 2020-09-04 00:00 UTC to 2025-09-15 16:00 UTC
    Subject:
            C=US, O=Let's Encrypt, CN=R3
    Issuer:
            C=US, O=Internet Security Research Group, CN=ISRG
            Root X1
    
    ** CERTIFICATE 3 **
    Valid: 2021-01-20 19:14 UTC to 2024-09-30 18:14 UTC
    Subject:
            C=US, O=Internet Security Research Group, CN=ISRG
            Root X1
    Issuer:
            O=Digital Signature Trust Co., CN=DST Root CA X3
    
    Checked OCSP status for certificate, got:
            Good (last update: 07 Jan 23 04:02 UTC)
    
    Found 1 valid certificate chain(s):
    [0] CN=myhostname
            => CN=R3
            => CN=ISRG Root X1 [self-signed]
    

    When I run charm from another host, I see this in the server's journal:

    Jan 07 17:20:31 irmin charm[84564]: 2023/01/07 17:20:31 ssh id
    Jan 07 17:20:31 irmin charm[84564]: 2023/01/07 17:20:31 ID for user <UUID redacted>
    Jan 07 17:20:31 irmin charm[84564]: 2023/01/07 17:20:31 ssh api-auth
    Jan 07 17:20:31 irmin charm[84564]: 2023/01/07 17:20:31 JWT for user <UUID redacted>
    

    But back on the other host, I just see

    
       Charm
    
      Uh oh, there’s been an error: server error: 400 Bad Request
    
    

    If I change CHARM_SERVER_USE_TLS to false and restart the service, then running charm from another host seems to work just fine (I see the menu to Link a machine, Manage linked keys, Set username, Backup or Exit.)

    What am I doing wrong when I have TLS turned on?

    Cheers, Cos.

    opened by ajc 0
  • feat(deps): bump modernc.org/sqlite from 1.18.1 to 1.20.1

    feat(deps): bump modernc.org/sqlite from 1.18.1 to 1.20.1

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • feat(deps): bump github.com/spf13/cobra from 1.5.0 to 1.6.1

    feat(deps): bump github.com/spf13/cobra from 1.5.0 to 1.6.1

    Bumps github.com/spf13/cobra from 1.5.0 to 1.6.1.

    Release notes

    Sourced from github.com/spf13/cobra's releases.

    v1.6.1

    Bug fixes 🐛

    • Fixes a panic when AddGroup isn't called before AddCommand(my-sub-command) is executed. This can happen within more complex cobra file structures that have many different inits to be executed. Now, the check for groups has been moved to ExecuteC and provides more flexibility when working with grouped commands - @​marckhouzam (and shout out to @​aawsome, @​andig and @​KINGSABRI for a deep investigation into this! 👏🏼)

    v1.6.0

    Summer 2022 Release

    Some exciting changes make their way to Cobra! Command completions continue to get better and better (including adding --help and --version automatic flags to the completions list). Grouping is now possible in your help output as well! And you can now use the OnFinalize method to cleanup things when all "work" is done. Checkout the full changelog below:


    Features 🌠

    Deprecation 👎🏼

    • ExactValidArgs is deprecated (but not being removed entirely). This is abit nuanced, so checkout #1643 for further information and the updated user_guide.md on how this may affect you (and how you can take advantage of the correct behavior in the validators): @​umarcor #1643

    Bug fixes 🐛

    Dependencies 🗳️

    Testing 🤔

    Docs ✏️

    Misc 💭

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Pre-populate username

    Pre-populate username

    If a username is set, charm now pre-populates the input field with it in the "set username" section. Resolves #16.

    I tried to incorporate some of the feedback given in https://github.com/charmbracelet/charm/pull/17#issuecomment-751406322 but I'm new to bubble tea.

    opened by jesselang 1
  • Serving on IPv6 addresses?

    Serving on IPv6 addresses?

    I want to run Charm via Yggdrasil network (which uses IPv6 addresses), but when I try to use CHARM_HOST=[201:XXXX::XXXX:XXXX], it crashes:

    > charm
    
       Charm
    
      ⣻  Authenticating...
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x55d9f267c58f]
    
    goroutine 10 [running]:
    golang.org/x/crypto/ssh.(*connection).clientAuthenticate(0xc000232200, 0xc000140000)
            golang.org/x/[email protected]/ssh/client_auth.go:93 +0x64f
    golang.org/x/crypto/ssh.(*connection).clientHandshake(0xc000232200, {0xc0005e00c0, 0x25}, 0xc000140000)
            golang.org/x/[email protected]/ssh/client.go:113 +0x29f
    golang.org/x/crypto/ssh.NewClientConn({0x55d9f2fabc00, 0xc000114008}, {0xc0005e00c0, 0x25}, 0xc00023aea0)
            golang.org/x/[email protected]/ssh/client.go:83 +0x131
    golang.org/x/crypto/ssh.Dial({0x55d9f2c98692?, 0x5?}, {0xc0005e00c0, 0x25}, 0xc00023aea0)
            golang.org/x/[email protected]/ssh/client.go:181 +0x59
    github.com/charmbracelet/charm/client.(*Client).sshSession(0xc0005ccc40)
            github.com/charmbracelet/charm/client/client.go:274 +0xb4
    github.com/charmbracelet/charm/client.(*Client).ID(0x1?)
            github.com/charmbracelet/charm/client/client.go:145 +0x3a
    github.com/charmbracelet/charm/client.(*Client).Bio(0x0?)
            github.com/charmbracelet/charm/client/client.go:253 +0x46
    github.com/charmbracelet/charm/ui/info.GetBio.func1()
            github.com/charmbracelet/charm/ui/info/info.go:94 +0x1d
    github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func6.1()
            github.com/charmbracelet/[email protected]/tea.go:470 +0x33
    created by github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func6
            github.com/charmbracelet/[email protected]/tea.go:468 +0x14d
    

    When I try to use IPv6 address without square brackets, it just says Uh oh, there’s been an error: dial tcp: address 201:XXXX::XXXX:XXXX: too many colons in address

    Yes, these ports are exposed:

    > curl http://$CHARM_HOST:35354/; echo
    {"message":"JWT is missing."}
    
    > curl http://$CHARM_HOST:35356/; echo
    We live!
    
    > # ssh also works but when I remove brackets
    
    opened by hatkidchan 1
  • feat(deps): bump github.com/caarlos0/env/v6 from 6.10.0 to 6.10.1

    feat(deps): bump github.com/caarlos0/env/v6 from 6.10.0 to 6.10.1

    Bumps github.com/caarlos0/env/v6 from 6.10.0 to 6.10.1.

    Release notes

    Sourced from github.com/caarlos0/env/v6's releases.

    v6.10.1

    Changelog

    Bug fixes

    • f3ddf1f7ee602a224429717ddc431e9083d45882: fix: non empty struct pointer value (#236) (@​akutuev)

    Released with GoReleaser Pro!

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Releases(v0.12.4)
Owner
Charm
We build tools to make the command line glamorous
Charm
Gocheat - Golang terminal client for cht.sh that uses charm.sh's bubbletea project

Go Cheat.sh install gotext go get -u golang.org/x/text/cmd/gotext go generate

Cyber Oliveira 22 Jun 3, 2022
A simple shopping list that keeps track of a users shopping list using charm.sh tools

Terminal Shopping List This repo is a practise project for learning practical Go. I have chosen to use a toolset called Charm as it provides a rich se

Ben Clarke 0 Jan 13, 2022
A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

null 0 Nov 22, 2021
fofax is a fofa query tool written in go, positioned as a command-line tool and characterized by simplicity and speed.

fofaX 0x00 Introduction fofax is a fofa query tool written in go, positioned as

null 516 Jan 8, 2023
CLI tool and library for generating a Software Bill of Materials from container images and filesystems

A CLI tool and Go library for generating a Software Bill of Materials (SBOM) from container images and filesystems. Exceptional for vulnerability dete

Anchore, Inc. 3.5k Jan 6, 2023
Nebula Diagnosis CLI Tool is an information diagnosis cli tool for the nebula service and the node to which the service belongs.

Nebula Diagnosis CLI Tool is an information diagnosis cli tool for the nebula service and the node to which the service belongs.

Katz 1 Jan 12, 2022
A command-line tool and library for generating regular expressions from user-provided test cases

Table of Contents What does this tool do? Do I still need to learn to write regexes then? Current features How to install? 4.1 The command-line tool 4

Peter M. Stahl 5.8k Jan 9, 2023
CLI tool (hcron) and Go library (cron) to convert CRON expression into human readable description.

cron cron is a Go library that parses a cron expression and outputs a human readable description of the cron schedule. For example, given the expressi

Quy Le 74 Nov 12, 2022
A Go library and a command-line tool to manage Docker Swarm clusters

go-swarm go-swarm is a Go library and command-line tool for managing the creation and maintenance of Docker Swarm cluster. Features: Creates new Swarm

AUCloud 3 Jul 26, 2022
Library and command line tool for reading xDSL stats

xDSL Stats Parser This is a library and command line tool for reading basic xDSL stats, as well bitloading, SNR, QLN and Hlog data. It supports many d

Jan Hoffmann 10 Nov 12, 2022
Gowebdav - A golang WebDAV client library and command line tool.

GoWebDAV A golang WebDAV client library. Main features gowebdav library allows to perform following actions on the remote WebDAV server: create path g

Studio-B12 203 Jan 3, 2023
This tool is a CLI-interactive tool for TA who use eeclass platform

NTHU eeclass TA helper. This tool is a CLI-interactive tool for TA who use eeclass platform. It helps TA to download all the submitted homework, and use CSV to record the score and comment, and upload CSV score directly to the eeclass platform with just 2 Enter key!

Bo-Wei Chen 1 Dec 11, 2021
A tiny Go library + client for downloading Youtube videos. The library is capable of fetching Youtube video metadata, in addition to downloading videos.

A tiny Go library + client (command line Youtube video downloader) for downloading Youtube videos. The library is capable of fetching Youtube video metadata, in addition to downloading videos. If ffmpeg is available, client can extract MP3 audio from downloaded video files.

Kunal Diwan 3 Oct 14, 2022
Got: Simple golang package and CLI tool to download large files faster 🏃 than cURL and Wget!

Got. Simple and fast concurrent downloader. Installation ❘ CLI Usage ❘ Module Usage ❘ License Comparison Comparison in cloud server: [[email protected]

Mohamed El Bahja 620 Dec 29, 2022
Command-line tool to load csv and excel (xlsx) files and run sql commands

csv-sql supports loading and saving results as CSV and XLSX files with data processing with SQLite compatible sql commands including joins.

Dhamith Hewamullage 24 Nov 2, 2022
F2 is a cross-platform command-line tool for batch renaming files and directories quickly and safely. Written in Go!

F2 is a cross-platform command-line tool for batch renaming files and directories quickly and safely.

Ayooluwa 588 Dec 31, 2022
It‘s a cmd-line tool like `make` and `task`, supporting nested args and alias using `cobra`

It‘s a cmd-line tool like `make` and `task`, supporting nested args and alias using `cobra`. It's a makefile alternative and a shell wrapper.

null 2 Oct 18, 2022
A Go library and common interface for running local and remote commands

go-runcmd go-runcmd is a Go library and common interface for running local and remote commands providing the Runner interface which helps to abstract

AUCloud 1 Nov 25, 2021
pgCenter is a command-line admin tool for observing and troubleshooting Postgres.

Command-line admin tool for observing and troubleshooting Postgres.

Lesovsky Alexey 1.4k Dec 29, 2022