I have a script in my NuxtJS app, server/index.js, and I'd like to access a private runtime variable in it: apiUrl. The apiUrl comes from a .env file, which is imported in nuxt.config.js under privateRuntimeConfig. Because this .js file isn't a component or anything, $config and context appear to be unavailable. However, I can still access process.env from this file (coming directly from .env). This .js file is exported as a module for use elsewhere in the app.
Here are my questions:
Is there any way to call the privateRuntimeConfig variables from a script like this? I know it's running server-side.
Is there even any point to doing so? The process.env.apiURl variable is already available in this script. So do I even need to use privateRuntimeConfig for the variable?
If I can access the apiUrl from process.env, what is the point of privateRuntimeConfig at all? Is using process.env less secure?
Related
My challenge is that I'm working on a public Flutter app and I don't want to expose my API keys in the source code. I'm specifically looking to inject the Google Maps API key into my AppDelegate.swift file.
Ideally I'd want to be able to pass this through with a .env file (and the then inject these keys as environment variables in CI/CD), but I'm also fine doing a --dart-define. I have not found any working example of how to get this working.
I'm able to get this working on the Android side of things without any issues.
You can save it as an plist dictionary, and add the reading code from the file. For example: https://stackoverflow.com/a/62916637/11798831
Also you could rename file by adding Bundle.main.path(forResource: "config", ofType: "env").object(...
You can do not commit it in the project, just keep it locally. Also add it as additional file in CI/CD.
I managed to get a Netlify "serverless" function working, but I noticed something, and hope someone can confirm what I'm seeing:
I believe the default location for Netlify functions in your project is netlify/functions, but if you save your function file, say hello-world.js, in the /functions folder, it won't work. Digging a little deeper, it seems the Netlify function endpoint refers to a FOLDER and not a FILE. Thus, to make this work, hello-world.js must be saved at /functions/hello-world/, in its own folder within /functions. Why this is, I don't know, and the Netlify docs aren't terribly clear and explicit about this. It's a bit confusing because in your code, you must obviously refer to the file path as netlify/functions/hello-world/hello-world.js [edit: actually the fetch is (or can be?) '/.netlify/functions/hello-world' which is the same as the endpoint, just make sure that is a folder, not the file itself] , yet the function endpoint in Netlify is netlify/functions/hello-world/.
Am I on the right track here?
I'm trying to set CommType in connection string for Advantage DataBase Server using Entity Framework 5 and Advantage Data Provider in a .NET Web Application.
Connection string is in properties.config file.
I trie to use ads.ini but I don't know where to put it (I try in wwwroot/site/bin but nothing happened)
I need to set this parameters:
RETRY_ADS_CONNECTS = 5
PACKET_SIZE=512
USE_TCP_IP = 1
I can do this whiteout errors, but not using properties.config file.
AdsConnection conn = new AdsConnection("data source=\\\\SERVER1\\DATA; ServerType=remote;TableType=CDX;CommType = TCP_IP");
Any clue about how to solve this? Using ADS.INI or properties.config file, same for me.
Thank you!
Gaston Brave.
You can use the ADS.INI file for this purpose. Where it needs to be located (or how to tell Advantage where to find it) depends on the OS you're using.
From the Advantage Help file topic ADS.INI:
Windows
In order for the ads.ini file to be used, it must be located in the application directory, the Windows directory, the Windows System directory, or the client's search path.
In addition, if an environment variable exists with the name adsini_path, that path will be used to locate the ads.ini file. This can be helpful when you do not want to modify the application’s search path, but still need the ads.ini file to exist in a directory multiple users have rights to (for example on Windows Vista installations). An application can often set the environment variable at run-time before calling any Advantage functions, which avoids the need to set a per-workstation environment variable.
Linux
In order for the ads.ini file to be used, it must be located in the application directory, a directory specified in an environment variable named ADSPATH, in the users home directory, or in the /etc directory. If located in the users home directory the ads.ini file should be named .ads.ini (note the initial "dot").
I need to store Houdini *.hda files on a network share.
This folder needs to be sourced by all users.
Usually, for those kind of requests, I use an environment variable in ~/houdini17.0/houdini.env like for exemple:
HOUDINI_TEMP_DIR="/my/custom/temp/path"
But the issue is that I can find a solution for hda/otls files.
Adding it to HOUDINI_PATH="${HOUDINI_PATH};/my/custom/hda/path" or HOUDINI_OTLSCAN_PATH doesn't work and worst, it seems to break other links since a few other houdini nodes aren't available anymore.
Can someone point me to the right environnement variables?
Try using $HSITE and/or $JOB environment variables. Houdini will scan sub folders of the paths defined by $HSITE and $JOB for all relevant files and folders so you don't need to set a bunch of different env vars. You can mirror the folder structure found in C:\Users\username\Documents\houdini16.5
Obviously replace the Houdini version with yours. Also note that $HSITE needs to point the the folder that contains the houdini16.5 folder not the folder itself. This way you can support multiple houdini versions with a single env var.
http://www.sidefx.com/docs/houdini/basics/config.html
For example if $HSITE= //myNetworkShare/Houdini
You would need this folder structure:
//myNetworkShare/Houdini
/Houdini16.5
/otls
/scripts
/python2.7libs
/.....
Note you can only give $HSITE a single path.
Where to store sencitive information like signing configs, api keys etc on Cicrle without adding them to git.
Normaly I dont upload such files to git repositories, but I dont see how can I use Circle without them
You would use private environment variables. This would be loaded into CircleCI via the webapp or API, and then injected into a running build. This way, sensitive information won't have to be stored in your repository.
Here's a doc on Environment Variables in CircleCI 1.0 and CircleCI 2.0.
Use environment variable. If you want to use file, encode it as base 64 string https://support.circleci.com/hc/en-us/articles/360003540393-How-to-insert-files-as-environment-variables-with-Base64
If you need to insert sensitive text-based documents or even small binary files into your project in secret it is possible to insert them as an environment variable by leveraging base64 encoding.
It seems CircleCI does not support sensitive file yet.