Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API shell text does not apply to Windows #1008

Closed
djdv opened this issue Apr 10, 2019 · 5 comments · Fixed by #1496
Closed

API shell text does not apply to Windows #1008

djdv opened this issue Apr 10, 2019 · 5 comments · Fixed by #1496
Labels
effort/hours Estimated to take one or several hours exp/novice Someone with a little familiarity can pick up need/maintainers-input Needs input from the current maintainer(s) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked topic/design-ux UX strategy, research, not solely visual design

Comments

@djdv
Copy link

djdv commented Apr 10, 2019

Describe the bug
When failing to connect to the daemon, the webui shows shell prompts that are invalid on Windows.
shell


ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://127.0.0.1:8080", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
returns these messages in:

  • PowerShell: Error: failed to unmarshal json. invalid character 'h' looking for beginning of value
  • CMD: Error: Unknown Command "API.HTTPHeaders.Access-Control-Allow-Origin"

Valid forms of this are:

  • PowerShell: ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '[\"http://127.0.0.1:8080\", \"http://127.0.0.1:5001\", \"https://webui.ipfs.io\"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '[\"PUT\", \"GET\", \"POST\"]'
  • CMD: ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin "["""http://127.0.0.1:8080""", """http://127.0.0.1:5001""", """https://webui.ipfs.io"""]" ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods "["""PUT""", """GET""", """POST"""]"

It would be nice if the shell element had some way to select what command shell you're using, and formatted the string so the arguments matched the escape type.

@abdenoursouidi
Copy link

You are a hero ♥

@lidel lidel added exp/novice Someone with a little familiarity can pick up effort/hours Estimated to take one or several hours need/maintainers-input Needs input from the current maintainer(s) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked topic/design-ux UX strategy, research, not solely visual design labels May 19, 2020
@lidel
Copy link
Member

lidel commented May 19, 2020

cc @jessicaschilling @rafaelramalho19 see the snippets created by @djdv :-)

(context: we discussed this very thing today!)

@jessicaschilling
Copy link
Contributor

Moving this to the "Quick Fixes" in Zenhub ...

@rafaelramalho19 -- is this something you're still able to take on at some point?

@lidel -- thank you!

@rafaelramalho19
Copy link
Contributor

Thank you so much for looking into this in the past @djdv 🙏

Will fix it ASAP 😄

@itm-platform
Copy link

Hi there,
I tried both (Windows 11)

  • PowerShell: ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '[\"true\"]'
  • CMD: ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials "["""true"""]"
    And I get in both cases
 failure to decode config: json: cannot unmarshal string into Go struct field API.API.HTTPHeaders of type []string

I also tried all forms of adding the config file

  "API": {
    "HTTPHeaders": {
	"Access-Control-Allow-Origin": "['*']"
	}
  }

But I get the same error.
Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/novice Someone with a little familiarity can pick up need/maintainers-input Needs input from the current maintainer(s) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked topic/design-ux UX strategy, research, not solely visual design
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants