configuration-files

Java - encrypt / decrypt user name and password from a configuration file

若如初见. 提交于 2019-11-26 10:36:24
问题 We are busy developing a Java web service for a client. There are two possible choices: Store the encrypted user name / password on the web service client. Read from a config. file on the client side, decrypt and send. Store the encrypted user name / password on the web server. Read from a config. file on the web server, decrypt and use in the web service. The user name / password is used by the web service to access a third-party application. The client already has classes that provide this

How to version control config files pragmatically?

做~自己de王妃 提交于 2019-11-26 10:35:33
问题 Suppose we have a config file with sensitive passwords. I\'d like to version control the whole project, including the config file as well, but I don\'t want to share my passwords. That could be good, if this config file: database_password=secret foo=bar becomes database_password=* foo=bar and the other users of the vcs could also set up the password on they own. To ignoring the file isn\'t a good approach, the developers should be aware, if the config file changes. Example: Local version:

WCF service configuration file question regarding <baseAddresses>

♀尐吖头ヾ 提交于 2019-11-26 09:45:43
问题 From what I\'ve seen the tag is ignored when hosting a WCF service in IIS. I understand that when self-hosting this is required but is this harmful or even used when operating under IIS? ex. <system.serviceModel> <service blah blah blah> <host> <baseAddresses> <add baseAddress=\"http://localhost/blah\" /> </baseAddresses> </host> </service> </system.serviceModel> From what I\'ve seen you can take a config file describing a service from one machine and use that on a completely different

Mercurial: How to ignore changes to a tracked file

与世无争的帅哥 提交于 2019-11-26 09:29:45
问题 I have a file with database settings in my project which I have set to some defaults. The file is tracked by Mercurial and checked in. Since this file will be edited with different values various developer machines, is there a way I can tell Mercurial to ignore new changes to this file? I tried adding the file to the .hgignore file, but since the file is tracked it isn\'t ignored. This is alright and good in other situations, but I am wondering if there is something I can do here? 回答1: Using

How to manage configuration files when collaborating?

雨燕双飞 提交于 2019-11-26 09:07:55
问题 I\'m writing a short script with a few simple variables at the top of the page. I want to work on them with a friend, but we aren\'t sure how to manage the variables needing to be changed after pulling each time for one of us, adding unnecessary junk to git status. I thought about just creating different named branches for each of us, and then the master will just have example usernames set, but it seems silly to have to do all that extra work merging. We could have the variables passed to

2 php.ini files

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 07:37:17
问题 I have found that: When I type the following on terminal: php -i | grep php.ini I get the output: The Loaded Configuration file is @ /etc/php5/cli/php.ini However, from phpinfo() , I get to see: The loaded ini file is @ /etc/php5/apache2/php.ini Which one of these is working right now? How is it possible to have two php.ini files ? 回答1: Depends on where you are running PHP from. If you run it from command line, it uses the cli/php.ini and apache2/php.ini when run through apache. You are

Creating a config file in PHP

久未见 提交于 2019-11-26 06:58:49
问题 I want to create a config file for my PHP project, but I\'m not sure what the best way to do this is. I have 3 ideas so far. 1-Use Variable $config[\'hostname\'] = \"localhost\"; $config[\'dbuser\'] = \"dbuser\"; $config[\'dbpassword\'] = \"dbpassword\"; $config[\'dbname\'] = \"dbname\"; $config[\'sitetitle\'] = \"sitetitle\"; 2-Use Const define(\'DB_NAME\', \'test\'); define(\'DB_USER\', \'root\'); define(\'DB_PASSWORD\', \'\'); define(\'DB_HOST\', \'localhost\'); define(\'TITLE\', \

WCF Configuration without a config file

不羁的心 提交于 2019-11-26 06:36:59
Does anyone know of a good example of how to expose a WCF service programatically without the use of a configuration file? I know the service object model is much richer now with WCF, so I know it's possible. I just have not seen an example of how to do so. Conversely, I would like to see how consuming without a configuration file is done as well. Before anyone asks, I have a very specific need to do this without configuration files. I would normally not recommend such a practice, but as I said, there is a very specific need in this case. Consuming a web service without a config file is very

How to programmatically modify WCF app.config endpoint address setting?

只愿长相守 提交于 2019-11-26 05:21:26
问题 I\'d like to programmatically modify my app.config file to set which service file endpoint should be used. What is the best way to do this at runtime? For reference: <endpoint address=\"http://mydomain/MyService.svc\" binding=\"wsHttpBinding\" bindingConfiguration=\"WSHttpBinding_IASRService\" contract=\"ASRService.IASRService\" name=\"WSHttpBinding_IASRService\"> <identity> <dns value=\"localhost\" /> </identity> </endpoint> 回答1: I think what you want is to swap out at runtime a version of

Using ConfigParser to read a file without section name

余生颓废 提交于 2019-11-26 04:44:02
问题 I am using ConfigParser to read the runtime configuration of a script. I would like to have the flexibility of not providing a section name (there are scripts which are simple enough; they don\'t need a \'section\'). ConfigParser will throw a NoSectionError exception, and will not accept the file. How can I make ConfigParser simply retrieve the (key, value) tuples of a config file without section names? For instance: key1=val1 key2:val2 I would rather not write to the config file. 回答1: Alex