How can I simulate an offline directory with Heroku?

I used a standalone directory on my server with Perl scripts to dynamically create files.

Say this directory was in a standalone directory for security reasons ( /server/back/scripts) I used to access it using exec ( /server/back/scripts/auto.pl $arguments)

The contents of auto.pl:

system('cp /server/back/includes/default /server/front/ann/'.$enc.'.php');
system('chmod 555 /server/front/ann/'.$enc.'.php');
system("perl -pi -e 's/string/".$key."/g' /server/front/ann/".$enc.".php");

This script copy-paste the default file with the garbage values ​​to the public directory and replace the garbage values ​​with something else when setting the rights that we want.

How can I reproduce this on Heroku? - if not possible, is there any way to at least reproduce the behavior of this script?

+4
source share
2 answers

, script / PHP /.

Heroku , / .

Heroku:

heroku config:set MY_API_KEY=super-secret-hex-goes-here

... PHP-:

$api_key = getenv('MY_API_KEY');

/ Heroku - .

+3

Heroku -. , - , .

, . , Heroku.

, , , - , Winfield.

:

heroku config: VAR_NAME = [VAR_NAME_2 = .........]

heroku config: unset VAR_NAME [VAR_NAME2.......]

, :

heroku config: pull --overwrite

, , .env. .env :

heroku config: push

.env

: https://devcenter.heroku.com/articles/config-vars

+2

All Articles