failing to enable user-env-compile on Heroku - ruby

it is the first time I ask for something so sorry if I'm not enough precise!
I tried to upload my rails app on heroku using enabling the user-env-compile to manage my secret keys but I have an error "No such feature: user-env-compile".
I checked on Heroku devcenter and seems that user-env-compile has been deprecated and replaced by the ENV_DIR argument.
Here the link:
https://devcenter.heroku.com/articles/labs-user-env-compile
I cant really get what to do! can someone explain better to me what I'm supposed to do?
thank you,
Federico

You don't have to do anything (the labs is deprecated and you should delete it), by default now heroku is exporting your environement variables during slug compilation.
Be careful, it is not recommended to use the environement variable during slug compilation (you can check http://12factor.net/ for more informations)
Hope it helps.

Related

Heroku : Edit file without edit on github

I have a discord bot on heroku and I am using automatic deployment with github. I have a .json data file and I am trying to write data to it, but it doesn't seem to work. I guess this takes my data file straight from github and therefore remains empty. On my computer, it works well, I manage to write in my db.json but on heroku it does not work, I have no errors. I am using a relative path and not abosulu so I don't think the error is with my code. I don't know if I was clear
Thank you in advance

Heroku not applying environment variable changes in Okta OAuth 2.0 PKCE VueJs app

I' trying to execute the OAuth 2.0 PKCE demo with a VueJs app outlined here:
https://developer.okta.com/blog/2019/08/22/okta-authjs-pkce
https://github.com/oktadeveloper/okta-auth-js-pkce-example
Once in the Heroku App I have these Environment Variables:
Everything appears to be running fine except for the fact that the variables OKTA_CLIENT_ORGURL and OKTA_OAUTH2_ISSUER were refering to an incorrect dev-XXXXXX address, the correct one is the one shown on the picture (dev-371167), before it was someone else's url (dev-739491) for some reason.
The problem is that after making the changes shown in the image to the correct dev url, it's still making the calls to the old dev-739491 url.
Heroku doesn't seem to be refreshing or making the desired changes in the app.
Am I missing an option to refresh? Is it possible to rebuild so it reads the new changes? Could the problem be in the code/build itself?
Thanks.
EDIT: As per the suggestion in the comment I turned the app off then on again and it still didn't make the changes.
This is what my screen looks like:
EDIT 2: I have since deployed the same app two more times and reading the build logs it assigns a random CLIENT_ID and URls. Each deployed app has a different pair of these. I don't know where they come from.
I wrote the Okta Heroku Add-On. I'm looking into the behavior you're seeing.
When you change the environment variables, heroku should restart your app automatically.
So, the two issues are that the environment variables didn't match you saw in Heroku didn't match with what you expected them to be and that the app doesn't seem to be picking up on the environment variables.
How did you know that dev-371167 was the correct org and that dev-739491 was incorrect?
When you say you deployed the app two more times, what exactly are you doing to deploy? Are you using the Heroku cli?

Laravel logs in Heroku not showing up

I've deployed a Laravel app to heroku by following the official guide. It says to change APP_LOG=errorlog, which I've done.
I've also tried two different versions of this, the commented line being the variation.
$this->app->configureMonologUsing(function($monolog){
// $monolog->pushHandler(new \Monolog\Handler\SyslogHandler('papertrail'));
$monolog->pushHandler(new \Monolog\Handler\StreamHandler('php://stderr', \Monolog\Logger::WARNING));
});
If I use Log::error('something') I'm not seeing anything. I'm looking in both papertrail, and the CLI command heroku logs --tail --app {appname}
You must set LOG_CHANNEL=errorlog as a Heroku environment variable.
This setting is for Laravel 5.6, in older versions it was other. (and that "old" information is found on most internet sites, when searching for the problem)
This information can be found in .env file, which values must be manually set in Heroku.
Why?
The .env is not transferred to heroku, because it is listed in .gitignore.
BTW: I had the same issue today, seems like the setting you tried was valid for an older version of Laravel. I now use 5.6.

Phoenix - OTP release causing conn.secret_key_base not set error

This is surely a gap in my understanding so I am hoping someone could help clarify.
Over here in the phoenix docs, it says:
# If you are doing OTP releases, you need to instruct Phoenix
# to start the server for all endpoints:
#
config :phoenix, :serve_endpoints, true
I am not quite sure, what effect this has on a simple app, but actually not setting this also seems to work. In fact, enabling this is causing the below error:
"phoenix cookie store expects conn.secret_key_base to be set"
What is this setting for and why is it needed? If it is not enabled, everything seems to work ok.
Phoenix docs are outdated.
As I can see you'v forgot your prod.secret.exs while compiling.
In case you are building that for test purpose and it's not recommended to be in production but could be set like that:
# Configures the endpoint
config :hello_phoenix, HelloPhoenix.Endpoint,
secret_key_base: "SECRET_KEY"

Heroku No such app for Dropbox based app

I had a app hosted on 'inputbox.herokuapp.com'.
My app was giving error even after successful deployment. So, I deleted the app and recreated the same app.
But now I am getting error message as:
"Heroku | No such app
There is no app configured at that hostname.
Perhaps the app owner has renamed it, or you mistyped the URL."
I looked around for heroku docs but nothing works.
I dont know how to get this fixed. Please help.
Check what apps you currenty have using
heroku apps
It should say something like
=== My Apps
inputbox
If it doesn't, then you know what the problem is. Let's say it has one of those silly generated names, then you can rename it using the following command:
heroku apps:rename inputbox
Happy hacking!

Resources