GithubHelp home page GithubHelp logo

cli's People

Contributors

dependabot[bot] avatar dylanjha avatar eropple avatar jaredsmith avatar luwes avatar mmcc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

martinbean

cli's Issues

Running `mux init` twice doesn't update the credentials

I'm working with two different orgs and needing to switch the token credentials. I ran mux init again and everything appeared to work, but then when I uploaded a new asset, it uploaded it to the previous account, not the one I just initialized.

mux init - credentials error

mux init returns credentials error while CURL is working fine

mux init
? What's your token ID? 1ec...
? What's your token secret? [hidden]
? Do you want to go ahead and set up a Signing Key? This is used to create tokens for signed playback policies. Yes
 ›   Error: Couldn't create a signing key pair! Are you sure your token credentials were right?

CURL

curl --location 'https://api.mux.com/system/v1/signing-keys' \
-H 'Accept: application/json' \
-u ${MUX_TOKEN_ID}:${MUX_TOKEN_SECRET}
{"total_row_count":1,"data":[{"id":"whe123","created_at":"1683369357"}]}

Version

mux version
@mux/cli/0.8.0 darwin-arm64 node-v20.0.0

Proposal: add `mux assets:server`

Just putting this here to prime interest. Seems like this would be a good fit in this pkg and could also help adoption as @mux/cli would be a dependency for these Mux SSG components.

Idea is to create a mux assets:server or mux assets:serve command which would spin up a node http server on port 1352 (<= easter egg in there, 26-Number(mux))

This little local server would accept commands with data similar that mux create/upload accepts, primarily a remote video url or local video file path and create or upload these assets showing a nice little progress bar etc.

It would save the returned playback ids and input data in a JSON file locally similar to

{"data":{"https://muxed.s3.amazonaws.com/ink.mp4":{"assetId":"iGWOYSm8WqOwS01OR00qj71Wq3U00DaLaYY6i3ODkyCHn4","playbackId":"9YHhYABjohpd4m001qzFGf1TdOgLTB46ySlA7ThlFziA"}}}

This would be very useful for site builders like Next.js etc. to quickly request an upload from a UI component but don't hang the yarn dev process. It being a decoupled process would also make it a lot easier to build lightweight components / plugins / tags for other builders like Astro, Eleventy, Hugo etc.

I'm creating it separately at the moment for https://github.com/muxinc/nextjs-components/blob/main/src/mux-assets-cli.ts

Thoughts? Good to add or best to create a separate package?

Incorrect TypeError: Signing Key ID required

I did the following steps

  1. fresh install @muxinc/cli
  2. chose option to set up a signing key (CLI created it for me)
  3. config saved to ~/.config/@mux/cli/config.json (as expected) - see output below
  4. tried to generate a signed URL with a playback id using mux sign -t video
  5. Got error TypeError: Signing Key ID required

signing-key-required-err_2021-05-25_19-09-17

When signing non-video URLs the URL that gets printed and copied to the keyboard is in the format of a video URL

For example:

❯ mux sign qIJBqaJPkhNXiHbed8j2jyx02tQQWBI5fL6WkIQYL63w -t thumbnail -e 10y

🔑 Your Mux Signed Token
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFkamYzb2JpYURUcEF0QVlpS3NCMkpvRlkwMXBpbEJMTHdYcUQzaHpJYURJIn0.eyJleHAiOjE5NjE2NTkzOTQsImF1ZCI6InQiLCJzdWIiOiJxSUpCcWFKUGtoTlhpSGJlZDhqMmp5eDAydFFRV0JJNWZMNldrSVFZTDYzdyJ9.nzOv2MvH96ujApUL8trma91HrNb1eJjQNbDTYvcP2jJgrv_fsiEdwxvAjvwyo1ZNUgzdjvsVVezLdlt2rBsav7ZTPptZ4NR5a-e_L2ar3KUJWt0eRi-B52i1lzJ1CriEDkHgz7qGoIvdfIZdMwg6h-cuCEeQsyFR-v37X7pZt9YHThLRCW6ITisZEeZy4IifrTAsXQm0jwS2IkjMAGOVStm4Q8lwyZ_4UmhTUbZruadqKXcYnJP9bV-dHV-EcIRul6spbjVIw78kswRvmJ24pu93MOhhFeaQN6Wg9gc_dBHJo9meJk4E_LYTatPUxHZd5k5twxYnBHt7WtOtJ-BT3w

🌏 Full URL
https://stream.mux.com/qIJBqaJPkhNXiHbed8j2jyx02tQQWBI5fL6WkIQYL63w.m3u8?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFkamYzb2JpYURUcEF0QVlpS3NCMkpvRlkwMXBpbEJMTHdYcUQzaHpJYURJIn0.eyJleHAiOjE5NjE2NTkzOTQsImF1ZCI6InQiLCJzdWIiOiJxSUpCcWFKUGtoTlhpSGJlZDhqMmp5eDAydFFRV0JJNWZMNldrSVFZTDYzdyJ9.nzOv2MvH96ujApUL8trma91HrNb1eJjQNbDTYvcP2jJgrv_fsiEdwxvAjvwyo1ZNUgzdjvsVVezLdlt2rBsav7ZTPptZ4NR5a-e_L2ar3KUJWt0eRi-B52i1lzJ1CriEDkHgz7qGoIvdfIZdMwg6h-cuCEeQsyFR-v37X7pZt9YHThLRCW6ITisZEeZy4IifrTAsXQm0jwS2IkjMAGOVStm4Q8lwyZ_4UmhTUbZruadqKXcYnJP9bV-dHV-EcIRul6spbjVIw78kswRvmJ24pu93MOhhFeaQN6Wg9gc_dBHJo9meJk4E_LYTatPUxHZd5k5twxYnBHt7WtOtJ-BT3w

👉 Copied Full URL to your system clipboard

Notice that this type of signed URL is a thumbnail, but the CLI is giving me a URL for stream.mux.com -- it should be: https://image.mux.com/{playback_id}/thumbnail.jpg?token=xxxxx

For the example above, it should have generated:

https://image.mux.com/qIJBqaJPkhNXiHbed8j2jyx02tQQWBI5fL6WkIQYL63w/thumbnail.jpg?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImFkamYzb2JpYURUcEF0QVlpS3NCMkpvRlkwMXBpbEJMTHdYcUQzaHpJYURJIn0.eyJleHAiOjE5NjE2NTkzOTQsImF1ZCI6InQiLCJzdWIiOiJxSUpCcWFKUGtoTlhpSGJlZDhqMmp5eDAydFFRV0JJNWZMNldrSVFZTDYzdyJ9.nzOv2MvH96ujApUL8trma91HrNb1eJjQNbDTYvcP2jJgrv_fsiEdwxvAjvwyo1ZNUgzdjvsVVezLdlt2rBsav7ZTPptZ4NR5a-e_L2ar3KUJWt0eRi-B52i1lzJ1CriEDkHgz7qGoIvdfIZdMwg6h-cuCEeQsyFR-v37X7pZt9YHThLRCW6ITisZEeZy4IifrTAsXQm0jwS2IkjMAGOVStm4Q8lwyZ_4UmhTUbZruadqKXcYnJP9bV-dHV-EcIRul6spbjVIw78kswRvmJ24pu93MOhhFeaQN6Wg9gc_dBHJo9meJk4E_LYTatPUxHZd5k5twxYnBHt7WtOtJ-BT3w

Windows and ENOENT

Summary

It seems that on the Windows platform, when you run the init command for the first time, that there is a difference with how the ENOENT is raised to the NodeJS runtime.

This is a problem because there is a check in the ./src/command-bases/base.ts file that looks for -2 specifically to know if it needs to create a new config.json or not.

Repro

  • On the Windows platform, clone the master branch
  • Run yarn install
  • Run yarn build
  • Run ./bin/run init
  • Observer the exception

Additional details

On the macOS platform, it comes through accompanied with a -2 errno value—

[Error: ENOENT: no such file or directory, open '/Users/erik.pena/.config/@mux/cli/config.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/erik.pena/.config/@mux/cli/config.json'
}

On the Windows platform, it comes through accompanied with a -4058 errno value—

[Error: ENOENT: no such file or directory, open 'C:\Users\erikp\AppData\Local\@mux\cli\config.json'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\erikp\\AppData\\Local\\@mux\\cli\\config.json'
}

I also tested on the Linux platform, it comes through accompanied with a -2 errno (like macOS) value—

[Error: ENOENT: no such file or directory, open '/home/erikpena/.config/@mux/cli/config.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/home/erikpena/.config/@mux/cli/config.json'
}

Just running init fails

Tried to find a way to quickly check out mux (beyond the demo on the website). Thought the cli might be a way.

Installed with npm globally, running mux init myenv.env brings up this error:

Error: Cannot find module '/usr/local/lib/node_modules/@mux/cli/lib/commands/init'
    Require stack:
    - /usr/local/lib/node_modules/@mux/cli/node_modules/@oclif/config/lib/plugin.js
    - /usr/local/lib/node_modules/@mux/cli/node_modules/@oclif/config/lib/config.js
    - /usr/local/lib/node_modules/@mux/cli/node_modules/@oclif/config/lib/index.js
    - /usr/local/lib/node_modules/@mux/cli/node_modules/@oclif/command/lib/command.js
    - /usr/local/lib/node_modules/@mux/cli/node_modules/@oclif/command/lib/index.js
    - /usr/local/lib/node_modules/@mux/cli/bin/run
    Code: MODULE_NOT_FOUND

as I was just about to quickly checkout mux I am not diving into debugging this on my own, maybe you can resolve this issue on your side?

@mux/cli/0.6.0 darwin-x64 node-v12.19.0
(also tried with node 14, doesn't work)

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.