configuration-files

Where do you put your app-config-files when deploying rails with capistrano and svn

I have two config-files /app/config/database.yml and /app/config/userconfig.yml i don't want to put the database credentials and userconfig in the svn-repository, so i have database.yml.dist and userconfig.yml.dist checked in. What is the best way to get copys of the dist-files in the shared-directory when deploying the app for th...

Custom configuration in .NET

I am seeing simple examples regarding custom configuration in .NET. My case is a bit more complex, with nested nodes. I'd like to be able to read this from the configuration file: <environments> <environment name="live" url="http://www.live.com"&gt; <server name="a" IP="192.168.1.10"></server> <server name="b" IP="192.168.1.20"><...

Best-practice for documenting available/required Java properties file contents

Is there a well-established approach for documenting Java "properties" file contents, including: specifying the data type/contents expected for a given key specifying whether a key is required for the application to function providing a description of the key's meaning Currently, I maintain (by hand) a .properties file that is the de...

Why there's no configuration file at all for dependency injection with Google Guice?

I am checking out Google Guice as DI framework but I am a bit puzzled: why there's no configuration file at all? I found a partial explanation on this question but it is still not clear how I would be able to set my component roles (or any other thing I need to use a switch) without a config file. Any help appreciated! ...

How to get the current directory on a class library?

I've been looking around but I have not found a solution for this problem: I want to create a class library that has a configuration file under a sub-directory called Configuration. I want that class library to be deployed anywhere and I want it to find its configuration files by knowing its own location. Previous attempts with Assembly...

Perl Script Configuration and Relative Path Implementation on both Windows (XP) / Unix (Solaris)

Heylo, I'm experiencing, somewhat of, a conundrum regarding perl script development. I have written a small Perl script using the standard (basic) Perl installation. I have the following setup: C:\MyScript\perl.pl C:\MyScript\configuration\config.ini C:\MyScript\output\output.txt This is the perl.pl source: $config = '/configu...

How to programatically modify assemblyBinding in app.config?

I am trying to change the bindingRedirect element at install time by using the XmlDocument class and modifying the value directly. Here is what my app.config looks like: <configuration> <configSections> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Cu...

my_config.ini vs my_config.php

At work we use a .ini file to set variables prior to calling the rest of the framework (I think it goes function getConfigVars(){ //read my_config.ini file .... //call framework } and I have always wondered if there was a benefit to doing it that way. It seems to me that you then have to write access rules to stop people ...

Editing PHP files for configuration via PHP

First of all, I am assuming this is NOT bad practice due to various popular software using this method, such as SMF. Anyway, so I currently have this code: <?php // main visual config $cfg['lang'] = 'en'; // paths $path['admin'] = 'index.php?p=admin'; $path['admin2'] = 'zvfpcms/admin'; $path['root'] = 'zvfpcms'; $path['images'] ...

awk: Either modify or append a line, based on its existence

I have a small awk script that does some in-place file modifications (to a Java .properties file, to give you an idea). This is part of a deployment script affecting a bunch of users. I want to be able to set defaults, leaving the rest of the file at the user's preferences. This means appending a configuration line if it is missing, mod...

Find $HOME or Windows equivalent with FreePascal

My purpose is to deploy user configuration files under: $HOME/.appname for Unix/Linux. \Documents and Settings\(user)\Application Data\AppName for Windows. What are the API's or group of functions that I can use, with the appropriate {$IFDEF}'s, so I can deploy my config files on the appropriate places? ...

How use __setattr__ & __getattr__ for map INI values?

Hi, I want to map a INI file as a python object. So if the file have: [UserOptions] SampleFile = sample.txt SamplePort = 80 SampleInt = 1 Sample = Aja SampleDate = 10/02/2008 Then I want: c = Configuration('sample.ini') c.UserOptions.SamplePort = 90 I'm looking to setattr but I get a recursion error. This is what I have: class ...

How to keep a text file readable just from php and python, and not by users?

There is a way to keep a text file on my server, but that only my php and python scripts would be able to read it, and if the user just type the url of the file will obtain a forbitten state? I'll like to keep it in the website directory, httpdocs (or httpsdocs, maybe). Tha file will contain my database user and passord, and other stuf...

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

I'd like to programatically 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.IASRServ...

Python Advice for a beginner. Regex, Dictionaries etc ?

I'm writing my second python script to try and parse the contents of a config file and would like some noob advice. I'm not sure if its best to use regex to parse my script since its multiple lines? I've also been reading about dictionaries and wondered if this would be good practice. I'm not necessarily looking for the code just a push ...

How to write own Configformat

Hi there, I've developed an own file format for configuration files (plaintext and line based -> EOL = one configuration) for an application. This format is nothing quit special and the only reason I do this, is to learn something! The reader and writer functions will be implemented in C (with GLib because it should be a UTF8 encoded fi...

IDE complains Config files referenced in ConfigSource attributes do not comply with DotNetConfig.xsd

Hi. I find configsource references in the .config-files to be very helpful. However, since these referenced config-files only contain fragments of the entire app.config hierarchy, the IDE complains. In the app.config file: <configuration> <configSections> <section name="customProfiles" type="SomeConfigClass, SomeAssembly"/...

How do you handle command line options and config files?

What packages do you use to handle command line options, settings and config files? I'm looking for something that reads user-defined options from the command line and/or from config files. The options (settings) should be dividable into different groups, so that I can pass different (subsets of) options to different objects in my co...

How can I perform a substitutions on multiple variables whose names I don't know ahead of time?

I'm working on a Perl script where the user adds a number of set variables at the beginning of the script, all prefixed with $XX, as seen below. The user-set variables, however, need to go through a short transformation function to clean them up. Is there a way to run the sub on all the variables with the $XX prefix? my $XXvar1 = "some...

Override grails.serverURL and application specific grails.propname settings in application.properties file

I need to override grails.serverURL at runtime WITHOUT having to regenerate the application WAR file. I have tried various ways of setting the grails.serverURL in the application.properties file and cannot get it to work. Here is the environment specific portion of the Config.groovy: environments { prod { grails.serverURL...