Set config variables in heroku using `cat example.file` - bash

I'm following this tutorial (best answer) SSH tunneling from Heroku
And they say to set some heroku config vars like MY_VAR=cat my.file to save the contents of the file to heroku. The problem is, I don't think this method works anymore. I'm looking for help on either how to do this the right way, or how to emulate this. Here is the traceback.
(bosnetvenv) michael#michael-VivoBook-ASUSLaptop-MJ401TA:~/projects/znet/bosnet$ heroku config:set ZEAL_FULL_NODE_PRIVATE_KEY=`cat ~/.ssh/heroku_id_rsa`
› Warning: heroku update available from 7.35.0 to 7.38.1.
▸ RSA is invalid. Must be in the format FOO=bar.
(bosnetvenv) michael#michael-VivoBook-ASUSLaptop-MJ401TA:~/projects/znet/bosnet$ heroku config
› Warning: heroku update available from 7.35.0 to 7.38.1.
=== zealchain Config Vars
DATABASE_URL: REDACTED
IS_PRODUCTION: True
ZEAL_FULL_NODE_PRIVATE_KEY:
(bosnetvenv) michael#michael-VivoBook-ASUSLaptop-MJ401TA:~/projects/znet/bosnet$ heroku config:set ZEAL_FULL_NODE_PUBLIC_KEY=`cat ~/.ssh/heroku_id_rsa.pub`
› Warning: heroku update available from 7.35.0 to 7.38.1.
▸ REDACTED
▸ is invalid. Must be in the format FOO=bar.
Thank in advance.

needed quotes.
heroku config:set "MY_VAR=test.file"

Related

How to add -a -app in my Websockets file?

I've got a problem when I upload my project on Heroku. I've trying changing value of socket.io and MongoUrl, but I get this error:
Error: Missing required flag:
› -a, --app APP app to run command against
This has nothing to do with any of your files. It's an argument that you must provide to the Heroku CLI itself, e.g.
heroku config:set SOME_VARIABLE=some_value -a myapp
where myapp is the name of your Heroku app.
The -a / --app argument is required when heroku can't figure out what app to connect to, either bcause there is no Heroku remote configured or because there is more than one Heroku remote configured.
See also How to avoid the --app option with heroku CLI?

Heroku missing required flag when restoring database

I've seen a couple of SO posts, and despite googleing and the heroku --help, I keep getting the same error
I've been working off of this:
https://devcenter.heroku.com/articles/heroku-postgres-import-export
$ heroku pg:backups:restore 'secure-file-location-url' DATABASE_URL --app heroku-app-name --confirm heroku-app-name
Starting restore of secure-file-location-url to postgresql-flat-47715... done
Use Ctrl-C at any time to stop monitoring progress; the backup will continue restoring.
Use heroku pg:backups to check progress.
Stop a running restore with heroku pg:backups:cancel.
Restoring... !
▸ An error occurred and the backup did not finish.
▸
▸ waiting for restore to complete
▸ pg_restore finished with errors
▸ waiting for download to complete
▸ download finished with errors
▸ please check the source URL and ensure it is publicly accessible
▸
▸ Run heroku pg:backups:info r018 for more details.
$ heroku pg:backups:info r018
› Error: Missing required flag:
› -a, --app APP app to run command against
› See more help with --help
My secure-file-location-url is a public Google Drive link, which I can access in an incognito browser window.
As discussed in the comments, your database dump is being hosted on Google Drive and the link you're providing goes to a viewer with a "download file" button.
Instead, you must provide a direct link to the file. The documentation recommends using Amazon S3.
I ran into this problem as well, how I solved it was by adding run to the Heroku CLI command. Formatted like so:
heroku pg:backups:restore '<signed url>' DATABASE_URL -a <your-application-name>
Literally, put DATABASE_URL in there and it will read it from your environment variables. If you try putting in the postgress address it will fail. Also, the application needs to be the last thing added to this command, order matters here.

Heroku error:Name must start with a letter and can only contain lowercase letters, numbers, and dashes

I have just deployed php project on Heroku.
And receive app name :aqueous-thicket-59864
Now I want to change it "dynamic_datatable_ajax"
so I tryed these cmd but they don't work.
heroku apps:rename dynamic_datatable_ajax
heroku apps:rename dynamic_datatable_ajax --app aqueous-thicket-59864
git remote rm heroku
heroku git:remote -a dynamic_datatable_ajax
Please help me.
The command you want is:
heroku apps:rename dynamic-datatable-ajax --app aqueous-thicket-59864
An underscore (what you were using) is invalid.

Heroku CLI: How to reference an app by custom domain? (Example in documentation not working)

Heroku's documentation on CLI says to do this (link):
If you have multiple heroku remotes or want to execute an app command outside of a local working copy, you can specify an explicit app name, domain, or git remote as follows:
$ heroku info --app myapp
$ heroku info --app www.example.com
$ heroku info --remote staging
However, I'm unable to get that second one to work. This is what I get:
$ heroku info --app foo
=== foo
[...]
$ heroku domains --app foo
Domain names for foo.herokuapp.com:
foo.example.com
$ heroku info --app foo.example.com
! Resource not found
At the very least, the documentation seems incorrect. But is it possible to reference an app by one of its custom domains another way?
Thanks!
Yep, I concur that - using the latest Heroku CLI all the methods work except using the domain name. Is there a particular reason why you want to use that way if the other ways work for you?

heroku DATABASE_URL

On heroku, how to get the whole value of DATABASE_URL ?
When I issue a
heroku config --app APP_NAME
I get several config parameters but the DATABASE_URL is not entirely visible
DATABASE_URL => postgres://ruhej...s.com/oeuhenchej
Any idea ?
$ heroku config --app APP_NAME
(The Heroku toolbelt has been updated since the question was asked; the command now shows the entire DATABASE_URL.)
$ heroku pg:credentials:url YOUR_DATABASE_NAME
Gives you all the informations needed (url, port, dbname, user, password):
Connection information for default credential.
Connection info string:
"dbname=xxxxxxxxxxxxxx host=yyyyyyyyyyyyyyyyyyyyyyyyyyy.amazonaws.com port=5432 user=zzzzzzzzzzzzzz password=************* sslmode=require"
Connection URL:
postgres://zzzzzzzzzzzzzz:*************#yyyyyyyyyyyyyyyyyyyyyyyyyyy.amazonaws.com:5432/xxxxxxxxxxxxxx
This may seem really basic but your heroku APP_NAME is app_name.heroku.com. You can find that by logging into heroku.com and looking in your account. In order to get your app config variables you simply type into the console:
heroku config --app APP_NAME
To get the full database URL, use config:get from the Heroku CLI;
heroku config:get DATABASE_URL -a my-app-name
To get PostgreSQL dump file from heroku :-
heroku pg:backups:capture
heroku pg:backups
it shows all the backups
heroku pg:backups:url BackupID

Resources