bitnami / ini-file Goto Github PK
View Code? Open in Web Editor NEWCLI tool for modifying .ini files
Home Page: https://bitnami.com
License: Apache License 2.0
CLI tool for modifying .ini files
Home Page: https://bitnami.com
License: Apache License 2.0
Trying to create a PR for the postgresql pgbouncer image of yours for the auth_query value I ran into this issue...
doing a
ini-file --section "section" -- key "key" --value "test;" ./test.ini
will create file that looks like:
[section]
key=`test;`
it back-ticks the value, which seems to break some ini-parsers like the pgbouncer ini parser
I expected:
[section]
key=test;
We found an issue with ini-file: it doesn’t respect the original permissions of a file. See this example:
$ touch file.ini
$ sudo chown bitnami:bitnami file.ini
$ sudo chmod 0664 file.ini
$ ls -la file.ini
-rw-rw--r-- 1 bitnami bitnami 0 May 4 09:15 file.ini
$ sudo ini-file set --section section --key foo --value bar file.ini
$ ls -la file.ini
-rw-r--r-- 1 root root 17 May 4 09:16 file.ini
The tool should respect whatever original permissions/ownership the file had.
Hi,
I ran into this issue while trying to extend the bitnami-docker-matomo image and modifying the config file. It uses ini-file to set keys in matomo's config.ini.php file, which uses arrays to define installed and activated plugins. It took me a while to figure our why all but one plugin were deactivated after running through the configuration, it and seems like it was caused by setting unrelated config values using the ini-file
utility.
Here is an example using a generic ini file and ini-file v1.4.1:
cat <<EOF > sample.ini
[third_section]
phpversion[] = "5.0"
phpversion[] = "5.1"
phpversion[] = "5.2"
phpversion[] = "5.3"
urls[svn] = "http://svn.php.net"
urls[git] = "http://git.php.net"
EOF
ini-file set -s "some_section" -k "some_key" -v "some_value" sample.ini
cat sample.ini
sample.ini
now looks like this:
[third_section]
phpversion[]=5.3
urls[svn]=http://svn.php.net
urls[git]=http://git.php.net
[some_section]
some_key=some_value
Note that all but the last line of phpversion[] were removed. Any idea what might be causing this?
Thanks in advance!
given any "blackbox" .ini file, the tool will be able to return an array of all the section headers and a count of the number of sections
add capability to return:
none
Hi!
When the input file has commented out attributes, the file gets messed up after using ini-file
.
Input file:
[Global]
;proxy_client_headers[] = HTTP_X_FORWARDED_FOR
Command:
ini-file set --section "General" --key "proxy_client_headers[]" --value "HTTP_X_FORWARDED_FOR" /path/to/file
Expected result (either this):
[Global]
proxy_client_headers[] = HTTP_X_FORWARDED_FOR
Expected result (or something like this):
[Global]
;proxy_client_headers[] = HTTP_X_FORWARDED_FOR
proxy_client_headers[] = HTTP_X_FORWARDED_FOR
Actual result:
; ;proxy_client_headers[] = HTTP_X_FORWARDED_FOR
Background info and use case
I came in contact with this tool in my efforts to create a custom image based on bitnami/matomo
and found a potential bug/feature request.
I wanted to do this:
I needed to create a custom image based on
bitnami/matomo
with a custom Matomo configuration, since the configuration changes I desire cannot be configured using evironment variables (which are parsed by libmatomo.sh).
This is how I did it:
Use the ini-file tool to manipulate
global.ini.php
while building a custom image based onbitnami/matomo
.
Dockerfile:
FROM bitnami/matomo:4-debian-10 AS build-env
USER 0
RUN ini-file set --section "General" --key "proxy_client_headers[]" --value "HTTP_X_FORWARDED_FOR" /opt/bitnami/matomo/config/global.ini.php
USER 1001
EXPOSE 8080 8443
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.