Should server/database config files, including passwords, be stored in source control?

There’s no single “silver bullet” answer here and it would all greatly depend on details. First of all, I consider best practice to separate all source code from configuration in separate repository. So, source code remains source code, but it’s installation or deployment (with configuration, passwords, etc) is the whole other thing. This way you’ll … Read more

Credentials in pip.conf for private PyPI

You could store credentials for Pip to use in ~/.netrc like this: machine pypi.example.com login johndoe password changeme Pip will use these credentials when accessing https://pypi.example.com but won’t log them. You must specify the index server separately (such as in pip.conf as in the question). Note that ~/.netrc must be owned by the user pip … Read more

How to get the values of a ConfigurationSection of type NameValueSectionHandler

Suffered from exact issue. Problem was because of NameValueSectionHandler in .config file. You should use AppSettingsSection instead: <configuration> <configSections> <section name=”DEV” type=”System.Configuration.AppSettingsSection” /> <section name=”TEST” type=”System.Configuration.AppSettingsSection” /> </configSections> <TEST> <add key=”key” value=”value1″ /> </TEST> <DEV> <add key=”key” value=”value2″ /> </DEV> </configuration> then in C# code: AppSettingsSection section = (AppSettingsSection)ConfigurationManager.GetSection(“TEST”); btw NameValueSectionHandler is not supported any … Read more

Angularjs ui-router. How to redirect to login page

The point is, do not redirect if not needed === if already redirected to intended state. There is a working plunker with similar solution .run(function($rootScope, $location, $state, authenticationSvc) { $rootScope.$on( ‘$stateChangeStart’, function(e, toState , toParams , fromState, fromParams) { var isLogin = toState.name === “login”; if(isLogin){ return; // no need to redirect } // now, … Read more

Spring Java Config vs Jboss 7

I was using @SpringBootApplication As I read in this thread I needed to: Change the mapping of the DispatcherServlet to “/*” instead of “https://stackoverflow.com/” (by adding a @Bean of type ServletRegistrationBean with a servlet named “dispatcherServlet”) In this url I found the code solution: Add Servlet Mapping to dispatch servlet @SpringBootApplication public class Application extends … Read more