Issue in configuring Cloudinary in laravel 8 - configuration

I am having an issue with configuring Cloudinary version 2.9 in laravel 8.
getting the error given in the picture. And I also want to know which files I must change.
I put API key, secret key, and cloud name in vendor/cloudinary/src/configuration/cloudconfig
and
following in vendor/cloudinary/src/configuration/configuration
const CLOUDINARY_URL_ENV_VAR = 'CLOUDINARY_URL=*****************************************';
Also not getting any variable in the .env file, also not getting file named Cloudinary in /config folder

Related

Environment variable not found: DATABASE_URL. Prisma and mysql

I've developped an API with Node.Js, Express, Prisma and Mysql in local firstly. After that it works, I have deployed my API on Heroku and I took the ClearDB add-on to have a Mysql DB on Heroku.
So the deployment is OKAY when I go on my root root URI I have the "Cannot GET /" message, and when I try to connect to my ClearDB with MysqlWorkbench I have my tables, columns etc...
The main problem is from Prisma.
When I go to the "Run console" of my Heroku's project, the command npx prisma init works perfectly BUT when I type npx prisma migrate deploy || dev or also if I try to npx prisma db push I have this error =>
Error: Get Config: Schema parsing - Error while interacting with query-engine-node-api library
Error code: P1012
error: Environment variable not found: DATABASE_URL.
--> schema.prisma:10
|
9 | provider = "mysql"
10 | url = env("DATABASE_URL")
|
All my code is in a GitHub repo, I've configured my .env (which is in the root folder of my server) like this :
DATABASE_URL="mysql://<username>:<my-password>#eu-cdbr-west-30.cleardb.net/heroku_36d295ebb6686a2"
NODE_ENV="development"
APP_SECRET="jwtsecret12"
NODE_PATH="./src"
ACCESS_TOKEN_SECRET="651651651848754cdfce9fz8ef4ef54se8f4sef48s69ef84e"
I hope you have all the informations that you need to help me :)
PS : Locally my project works perfectly
Waiting for your answers, thank you very much !
Your .env file is irrelevant. It should not be used on Heroku (and should not be tracked in your repository).
ClearDB provides an environment variable called CLEARDB_DATABASE_URL, not DATABASE_URL. You can either change your code to use this variable instead of DATABASE_URL, or you can set DATABASE_URL to the same value:
Retrieve your database URL by issuing the following command:
heroku config | grep CLEARDB_DATABASE_URL
CLEARDB_DATABASE_URL => mysql://adffdadf2341:adf4234#us-cdbr-east.cleardb.com/heroku_db?reconnect=true
Copy the value of the CLEARDB_DATABASE_URL config variable.
If you’re using Ruby on Rails and the mysql2 gem, you will need to change the mysql:// scheme in the CLEARDB_DATABASE_URL to mysql2://
heroku config:set DATABASE_URL='mysql://adffdadf2341:adf4234#us-cdbr-east.cleardb.com/heroku_db?reconnect=true'
Adding config vars:
DATABASE_URL => mysql2://adffd...b?reconnect=true
Restarting app... done, v61.
The connection information for Heroku Postgres can change at any time, but since the ClearDB documentation provides the preceding guidance I would hope that it does not do so.

Error reading credential file from location in xamarin.forms while connecting to Cloud Firestore

I am developing a mobile application in xamarin.forms. I will use Google CloudFirestore as Cloud Database. When I want to connect to the database, I get the following error:
One or more errors occurred. (Error reading credential file from location D:\ yemekbagisiyapbucak.json: Could not find file "/D:\ yemekbagisiyapbucak.json"
Please check the value of the Environment Variable GOOGLE_APPLICATION_CREDENTIALS)
public static FirestoreDb db;
path = "D:\\yemekbagisiyapbucak.json";
Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", path);
db = FirestoreDb.Create("yemekbagisiyapbucak");
At first, please make sure the .josn file is in the path you set. var path = Path.Combine(FileSystem.AppDataDirectory, "yemekbagisiyapbucak.json"); get different path on different platforms.
So you can debug it and check the value of the path, and then copy the .josn file to the path.
If you need more information, please check the following link:Connecting to Google cloud firestore in a cross platform mobile app (xamarin c#)

How do you get the settings.py file of a django project to read from .env?

I am trying to configure email environment settings in my django project. I am using django-environ package. I have pasted this code:
EMAIL_CONFIG = env.email_url('EMAIL_URL',default='smtp://user#:password#localhost:25')
vars().update(EMAIL_CONFIG)
in my .env file. But when i run the server am getting an error saying:
"django.core.exceptions.ImproperlyConfigured: Set the EMAIL_CONFIG environment variable"
what am getting wrong?
I don't think that this settings should part of your .env. This file should look like this
DEBUG=on
SECRET_KEY=your-secret-key
DATABASE_URL=psql://user:un-githubbedpassword#127.0.0.1:8458/database
SQLITE_URL=sqlite:///my-local-sqlite.db
CACHE_URL=memcache://127.0.0.1:11211,127.0.0.1:11212,127.0.0.1:11213
REDIS_URL=rediscache://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient&password=ungithubbed-secret
I guess your settings (taken from the docs) should be used inside settings.py or in a custom email_config
EMAIL_CONFIG = env.email_url('EMAIL_URL',default='smtp://user#:password#localhost:25')
vars().update(EMAIL_CONFIG)
Check the installation and usage docs from django-environ.

Heroku - Can't access or create database JSON data of ruby app, error HTTP 500

I'm having a problem in Production when accessing the JSON (let's call it mydata.json) where I store the data of my ruby webapp, deployed with Heroku. The way I access the download of this file is by putting into the browser:
my-heroku-page.herokuapp.com/mydata.json
but I get the HTTP 500 error page.
Always using the browser, when I try to create it I get the Ruby page:
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
First I must say I'm using the same source code I used for another webapp that is actually working, I just modified the database.yml according to my new host, database, username and password. The previous webapp was perfectly working, i.e I could create the table and access the data. Secondly the error doesn't occur with localhost.
I tried to create a Dataclip in Heroku:
Select * from mydata order by created_at desc;
but I get the error:
"Your query couldn't be created."
ERROR: relation "mydata" does not exist
LINE 3: FROM mydata
Plus when I check the heroku pg:info I get 0 Tables
=== DATABASE_URL
Plan: Hobby-dev
Status: Available
Connections: 0/20
PG Version: 9.5.5
Created: 2016-11-15 08:30 UTC
Data Size: 7.4 MB
Tables: 0
Rows: 0/10000 (In compliance)
Fork/Follow: Unsupported
Rollback: Unsupported
Add-on: postgresql-convex-54172
It seems like mydata.json is not created in production, but in localhost is working fine and I can create/download a blank one. I'm sure I'm missing something easy here, maybe in the database.yml.
I will edit the question if additional info are required. Any help is appreciated.
Thanks,
Simone

Google_auth JSON key with Heroku config var?

To make a server-server interact with a Google API in development I need to put my service-account JSON key in the root of myapp, set
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "api-test-key.json"
and all is good.
But in production on Heroku there are config vars and the google_auth credentials_loader.rb insists on a file.
I managed to put the JSON's contents in a heroku config var nicely and can get it by calling
puts ENV["GOOGLE_APPLICATION_CREDENTIALS"]
What to do?
There is this question where they figured out a workaround but that is for oauth2 not for service-account type JSON:
How to upload a json file with secret keys to Heroku
We config our GoogleAPI credentials via the application.yml file ... found in the root/config/application.yml file.
In it we have;
AUTH_URI: https://accounts.google.com/o/oauth2/auth
CLIENT_SECRET: xxxxxxx
TOKEN_URI: https://accounts.google.com/o/oauth2/token
CLIENT_EMAIL: xxxx
REDIRECT_URIS: http://localhost:3000/signin/connect
CLIENT_X509_CERT_URL: https://www.googleapis.com/robot/v1/metadata/x509/901506026811-q0am03i585627ptu5r38o7cpkt8pk98l#developer.gserviceaccount.com
CLIENT_ID: xxx
AUTH_PROVIDER_X509_CERT_URL: https://www.googleapis.com/oauth2/v1/certs
JAVASCRIPT_ORIGINS: http://localhost:3000
PLUS_LOGIN_SCOPE: https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/plus.circles.read
You could maybe load in your config settings here?