Cannot authorize the Slack CLI with my Slack workspace - slack

I was following this tutorial to authorize the Slack CLI with my workspace but the slash command /slackauthticket is not recognized.
I am getting this error:
/slackauthticket is not a valid command. In Slack, all messages that start with the "/" character are interpreted as commands.
If you are trying to send a message and not run a command, try preceding the "/" with an empty space.
Screenshot of the error:
I am using Slack v4.27.154 and Slack CLI v1.9.0.
How can I get this to work ?

I just found out that this feature is in closed beta, which is why I can't use it.

Related

Web browser not pulling up after "pressing any key" to login to heroku

I'm using Git Bash to login to heroku. I'm at the part where I press any key to open the web browser so I can login. I've logged in via the command prompt and it opened the browser just fine. I've tried the heroku login -i method but when I enter my email address it doesn't do anything (just like pressing any key after prompted to do so). I added System32 to my PATH environment variable and have logged in via the command prompt, both of which seem to be the common solutions I can find.
If it helps, I'm trying to push a Python script I've written. I followed Codemy for creating the virtual environment, procfile, requirements.txt, etc. I've used git to add and commit everything, but I get stuck when asked to login. I've successfully logged in via the command prompt.
I tried it right now and it worked as expected. There were the steps:
Download installer https://devcenter.heroku.com/articles/heroku-cli
Install it
Open the cmd and enter: heroku login
It printed this
then a new tab in my default browser was opened
I entered my credentials with success. It showed the following message:
I closed the browser tab and finally I returned to the cmd:
After these steps, you could use any other git tool to perform git operations. Heroku login is just to store a kind of long live token in some part of the o.s.

What is the difference between the `heroku` and `heroku login` commands?

the heroku and heroku login commands both seem to do the exact same thing when you first download the Heroku cli. After logging in the commands do not do the same thing.
What is the difference between these two commands? Is there a difference at all?
Like #VipinMohan said:
Unless you do heroku login, each time you invoke a command the cli will ask for credentials. Once you use heroku login and verify the credentials, that login is valid till closing the command line is closed

Automate Heroku CLI login

I'm developing a bash script to automatic clone some projects and another task in dev VM's, but we have one project in Heroku and repository is in it. In my .sh file I have:
> heroku login
And this prompt to enter credentials, I read the "help" guide included on binary and documentation but I can't found anything to automatic insert username and password, I want something like this:
> heroku login -u someUser -p mySecurePassword
Exist any way similar to it?
The Heroku CLI only uses your username and password to retrieve your API key, which it stores in your ~/.netrc file ($HOME\_netrc on Windows).
You can manually retrieve your API key and add it to your ~/.netrc file:
Log into the Heroku web interface
Navigate to your Account settings page
Scroll down to the API Key section and click the Reveal button
Copy your API key
Open your ~/.netrc file, or create it, with your favourite text editor
Add the following content:
machine api.heroku.com
login <your-email#address>
password <your-api-key>
machine git.heroku.com
login <your-email#address>
password <your-api-key>
Replace <your-email#address> with the email address registered with Heroku, and <your-api-key> with the API key you copied from Heroku.
This should manually accomplish what heroku login does automatically. However, I don't recommend this. Running heroku login does the same thing more easily and with fewer opportunities to make a mistake.
If you decide to copy ~/.netrc files between machines or accounts you should be aware of two major caveats:
This file is used by many other programs; be careful to only copy the configuration stanzas you want.
Your API key offers full programmatic access to your account. You should protect it as strongly as you protect your password.
Please be very careful if you intend to log into Heroku using any mechanism other than heroku login.
You can generate a non-expiring OAuth token then pass it to the CLI via an environment variable. This is useful if you need to run Heroku CLI commands indefinitely from a scheduler and you don't want the login to expire. Do it like this (these are not actual Tokens and IDs, BTW):
$ heroku authorizations:create
Creating OAuth Authorization... done
Client: <none>
ID: 80fad839-876b-4ea0-a41e-6a9a2fb0cf97
Description: Long-lived user authorization
Scope: global
Token: ddf4a0e5-9294-4c5f-8820-b51c52fce4f9
Updated at: Fri Aug 02 2019 21:26:09 GMT+0100 (British Summer Time) (less than a minute ago)
Get the token (not the ID) from that authorization and pass it to your CLI:
$ HEROKU_API_KEY='ddf4a0e5-9294-4c5f-8820-b51c52fce4f9' heroku run ls --app my-app
Running ls on ⬢ my-app... up, run.2962 (Hobby)
<some file names>
$
By the way this also solves the problem of how to use the Heroku CLI when you have MFA enabled on your Heroku account but your machine doesn't have a web browser e.g., if you are working on an EC2 box via SSH:
$ heroku run ls --app my-app
heroku: Press any key to open up the browser to login or q to exit:
› Error: quit
$ HEROKU_API_KEY='ddf4a0e5-9299-4c5f-8820-b51c52fce4f9' heroku run ls --app my-app
Running ls on ⬢ my-app... up, run.5029 (Hobby)
<some file names>
$
EDIT: For Windows Machines
After you run heroku authorizations:create, copy the "Token", and run the following commands:
set HEROKU_API_KEY=ddf4a0e5-9299-4c5f-8820-b51c52fce4f9
heroku run ls --app my-app
If your goal is just to get the source code, you could use a simple git client. You just need the api key.
Steps to get api key
Log into the Heroku web interface
Navigate to your Account settings page
Scroll down to the API Key section and click the Reveal button
Copy your API key
Download source code using git
Use this url template for git clone
https://my_user:my_password#git.heroku.com/name_of_your_app.git
In my case the user value was my email without domain.
Example :
if mail is **duke#gmail.com**
user for heroku auth will be **duke**
Finally just clone it like any other git repositories:
git clone https://duke:my_password#git.heroku.com/name_of_your_app.git
I agree that Heroku should have by now provided a way to do this with their higher level CLI tool.
You can avoid extreme solutions (and you should, just like Chris mentioned in his answer) by simply using curl and the Heroku API. Heroku allow you to use your API Token (obtainable through your user settings / profile page on the Heroku dashboard).
You can then use the API to achieve whatever it is you wanted to do with their command line tool.
For example, if I wanted to get all config vars for an app I would write a script that did something like the following:
-H "Accept: application/vnd.heroku+json; version=3" \
-H "Authorization: Bearer YOUR_TOKEN```
If *YOUR_APP_NAME* had only one config variable called *my_var* the response of the above call would be
{
"my_var": some_value
}
I've found using this all the time in CI tools that need access to *Heroku* information / resources.

Heroku deployment error via codeship

I want to deploy django app to heroku via codeship and it generate an error and that is wget -O/dev/null http://something.herokuapp.com
How to fix the problem
Marko from the Codeship team here. Could you paste some more log output, or open a ticket on https://helpdesk.codeship.com?
Judging from the command you pasted above, I'd guess the check if the Heroku app, that you just deployed to, is running fails and this causes the build itself to fail.
Without any additional configuration we check the root URL for your application at http://HEROKU_APP_NAME.herokuapp.com via wget and see if it returns an HTTP/2xx or HTTP/3xx status code.
If it does, the check succeeds, else the build fails.
You can take a look at the script we use to perform the check at https://github.com/codeship/scripts/blob/master/utilities/check_url.sh

Why do I get a 401 error in git when pushing changes to github?

I get the following error when trying to push changes to github from the cygwin command promt on windows xp.
$ git push
Password: [my-password-here]
error: The requested URL returned error: 401 while accessing https://[username]:github.com/[username]/[repository-location]/info/refs
fatal: HTTP request failed
Searches from google seemed to point at changing the path to the certificate file on windows, which i had already done in order to clone the repository.
Turns out that my password is quite secure and contains the '£' symbol. To get this on my keyboard it's Shift+3 when typing my password into the command prompt it was producing a '#' symbol. My keyboard settings are correct I'm guessing this issue is due to the cygwin window.
My solution was to change my github password so it doesn't contain this character

Resources