Is duplicating a config file from vendor a must in Lumen? - package

I've installed a new package on Lumen and there is a config file in that package(vendor/friskals/countries/config/country). Do I have to duplicate that file to the folder config in my project to use the value in that file? I try not to copy it and there is no impact. So, I wonder whether it will have an impact in the future or not.
folder config

Related

Do I have to add .env file to versioning in react project?

I have seen some medium blogs and StackOverflow answers that I shouldn't add .env file to the versioning.
I quite understand why that is needed.
But how about when dealing with a Reactjs project?
Reactjs is for the frontend and all the environment variables are public even it is bundled for production and anyone can read it using a web browser.
I have 2 env files, .env.production for production and .env.staging for staging. The environment variable values are put to the bundled version while building. These files are the same across all other team members.
Actually there is no secret at all in these files.
The question is:
Should I add these 2 files to versioning or do I have to distribute these files manually to other team members? Then why?
No.
Preferred way is to have a file called .env.sample This will contain all the keys with random or no values in it. Any developer who clones the repo, will get to know the env_vars that are needed to run/build the project.
Within the teams, have a secrets sharing mechanism. There are lots of tools available to solve this.
First time after cloning the repo, the developers needs to run cp .env.sample .env and copy the values from the secret manager.
Make sure to add .env to .gitignore so no-one accidently pushes the .env containing secrets to the repo.
No you don't. .env file should be put on server in a separated way. Otherwise whoever can access to your source code repository can read or even modify .env file.

DNN Module installation

Is it possible to "install" a module just by pasting the file of the module and just paste it into the DesktopModules folder and have the modules working on the website?
If not, is there a way where I can export the whole module from one system and install it onto another system?
Have you tried creating a module package for this module? (when you click the edit pen for the extension, you should find a "Create package" button on the top right).
Take care to include the assembly/assemblies needed, and also the Sql Server scripts to install the module correctly (often found in the module folder under Providers/DataProvider/SqlDataProvider/*.SqlDataProvider). There might be other files in the module folder (images, css, etc), be sure to include them in the package, then try to create it. You will find the ZIP file under /install/Modules then, move it away from there somewhere on your local file system (otherwise the installer might try to install it with the next update). Then try to update the extension in a testing system, check if it works and you're done. If there are errors it might be that you are missing some files that have to be included. Check the error messages, and restart.
There used to be a way using the /Install/Module/ folder (put ZIP file there, then call /install/install.aspx?mode=installresources) If you are on an old version of DNN (7 and earlier?) you can still use this. But you've got a load of security issues that should drive you to upgrade.
I don't know of a good way to do this now. For security purposes DNN removes the Install resources after an upgrade.
IF you already have the module installed in both locations, you could copy the resources for the file from server to server (DLL in the BIN folder and the contents of the desktopmodules folder) assuming you don't have any MANIFEST file changes that need registered.

Config File in ReactJS application

I have developed a reactjs application and have hosted in azure cloud. Now we want to implement the CI/CD process through Azure pipelines. I am quiet new in both the platforms. Need to know the process.
Currently, I have one file index.js where I have used the axios and have set the base URL to connect to the server. All my web services in different components class access this axios settings for accessing data from server. We have four environments, DEV,SIT, UAT and PROD. So for now I use to manually change the axios base URL and create the build and zip it and host it to the respective environments.
I need to understand for CI/CD what steps should I take. Most of the google finding suggested to have a config file. But how I can change my current implementation is a big challenge for me. For example my axios base URL, how it will take the value from the config file, or where I should create the config file, because when I create the build, all the js files are minified into one file and are put in the static folder. Apart from the static folder, the app icons and the files in the public folder of the project directory are listed (in the build folder). So shall I include a config file in the public folder or something else.
There are also webpack.config.dev.js and webpack.config.prod.js in the config folder of the project directory. Will it help. Because the requirement is first through Azure pipelines, the code will go to the DEV environment, then from DEV to SIT and from SIT to UAT and then to PROD. So subequently my axios Base URL should also change accordingly.
Can anyone suggest anything?
I'm not sure I fully understand your question but you could create a json file and put your config data in there, i.e. server_config.json. It would not be minified as it is not a js file. Then you will need to read the json in your code to get all the settings. Your CI/CD can also read this fille should it need to.
You should also make sure that the json config file is ignored from version control so that each environment has to have its own file.

Webpack 2 and react production

Is it possible when I build my project npm run build to generate config files where we can change a few variable value on the fly without rebuilding the whole project every time I change a value?
The config file need to be in .json or in .js and will contain variables like : updateDelay, pageNumber, path, graphQlUri... Variables that are used in the projects and can be changed by the user.
If it's possible how I'm doing it?
Thanks

Config file (App.config) does not update on new installation

I am creating setup of my project using Visula Studio 2008. I am facing problem in setup installation.
If I uninstall old setup (application) and install the new one then config file (App.config) updates the attributes (surely it is new file) of config file but if I install new setup without uninstalling the old one then config file does not update.
from config file I mean MyProject.exe.config
Why is this behavior of config file. Should it not be updated on installation of the new setup
Is this possible to delete and copy the config file of new setup?
Is there a way to update only config file forcefully during installation.
Thanks for your help!
The "app.config" per se in your project directory won't be and shouldn't be deployed!
When you compile your project, you should get a YourProject.exe.config in your bin\debug or bin\release folder. That file should be updated with each compile (if needed), and if you add your "project output" to the setup project, it should be included in that setup.
Does your YourProject.exe.config get installed on a new install? Does it get properly removed on uninstall?
MyProject.exe.config won't be updated since this file typically contains data or information depending on decisions the admin or user has taken during the first installation process (or afterwards by manually changing this file). This information would get lost if the file is overwritten during an update.
However, when you have to add some new configuration options to MyProject.exe.config in your newest version of MyProject , you can build a custom action to your installer and add those new options to the existing file without overwriting the content.

Resources