Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
cht-conf-testing-ci-release
Advanced tools
Configure CHT deployments
CHT Conf is a command-line interface tool to manage and configure your apps built using the Core Framework of the Community Health Toolkit.
docker build -t cht-conf:v0 .
docker run cht-conf:v0
docker exec -it <container_name> /bin/bash
npm install -g cht-conf
sudo python -m pip install git+https://github.com/medic/pyxform.git@medic-conf-1.17#egg=pyxform-medic
npm install -g cht-conf
pip install git+https://github.com/medic/pyxform.git@medic-conf-1.17#egg=pyxform-medic
As Administrator:
npm install -g cht-conf
python -m pip install git+https://github.com/medic/pyxform.git@medic-conf-1.17#egg=pyxform-medic --upgrade
To enable tab completion in bash, add the following to your .bashrc
/.bash_profile
:
eval "$(cht-conf --shell-completion=bash)"
To upgrade to the latest version
npm install -g cht-conf
cht
will upload the configuration from your current directory.
If you are using the default actionset, or performing any actions that require a CHT instance to function (e.g. upload-xyz
or backup-xyz
actions) you must specify the server you'd like to function against.
For developers, this is the instance defined in your COUCH_URL
environment variable.
cht --local
For configuring against Medic Mobile-hosted instances.
cht --instance=instance-name.dev
Username admin
is used. A prompt is shown for entering password.
If a different username is required, add the --user
switch:
--user user-name --instance=instance-name.dev
cht --url=https://username:password@example.com:12345
cht --archive
The resulting archive is consumable by Medic's API >v3.7 to create default configurations.
cht <--archive|--local|--instance=instance-name|--url=url> <...action>
The list of available actions can be seen via cht --help
.
cht <--local|--instance=instance-name|--url=url> <...action> -- <...form>
Added in v3.2.0
In order to avoid overwriting someone else's configuration cht-conf records the last uploaded configuration snapshot in the .snapshots
directory. The remote.json
file should be committed to your repository along with the associated configuration change. When uploading future configuration if cht-conf detects the snapshot doesn't match the configuration on the server you will be prompted to overwrite or cancel.
.xlsx
To edit existing couchdb documents, create a CSV file that contains the id's of the document you wish to update, and the columns of the document attribute(s) you wish to add/edit. By default, values are parsed as strings. To parse a CSV column as a JSON type, refer to the Property Types section to see how you can parse the values to different types. Also refer to the Excluded Columns section to see how to exclude column(s) from being added to the docs.
Parameter | Description | Required |
---|---|---|
column(s) | Comma delimited list of columns you wish to add/edit. If this is not specified all columns will be added. | No |
docDirectoryPath | This action outputs files to local disk at this destination | No. Default json-docs |
file(s) | Comma delimited list of files you wish to process using edit-contacts. By default, contact.csv is searched for in the current directory and processed. | No. |
updateOfflineDocs | If passed, this updates the docs already in the docDirectoryPath instead of downloading from the server. | No. |
Create a contact.csv file with your columns in the csv folder in your current path. The documentID column is a requirement. (The documentID column contains the document IDs to be fetched from couchdb.)
documentID | is_in_emnch:bool |
---|---|
documentID1 | false |
documentID2 | false |
documentID3 | true |
Use the following command to download and edit the documents:
cht --instance=*instance* edit-contacts -- --column=*is_in_emnch* --docDirectoryPath=*my_folder*
or this one to update already downloaded docs
cht --instance=*instance* edit-contacts -- --column=*is_in_emnch* --docDirectoryPath=*my_folder* --updateOfflineDocs
Then upload the edited documents using the upload-docs command.
This tool expects a project to be structured as follows:
example-project/
.eslintrc
app_settings.json
contact-summary.js
privacy-policies.json
privacy-policies/
language1.html
…
purge.js
resources.json
resources/
icon-one.png
…
targets.js
tasks.js
task-schedules.json
forms/
app/
my_project_form.xlsx
my_project_form.xml
my_project_form.properties.json
my_project_form-media/
[extra files]
…
contact/
person-create.xlsx
person-create.xml
person-create-media/
[extra files]
…
…
…
translations/
messages-xx.properties
…
If you are starting from scratch you can initialise the file layout using the initialise-project-layout
action:
cht initialise-project-layout
Configuration can be inherited from another project, and then modified. This allows the app_settings.json
and contained files (task-schedules.json
, targets.json
etc.) to be imported, and then modified.
To achieve this, create a file called settings.inherit.json
in your project's root directory with the following format:
{
"inherit": "../path/to/other/project",
"replace": {
"keys.to.replace": "value-to-replace-it-with"
},
"merge": {
"complex.objects": {
"will_be_merged": true
}
},
"delete": [
"all.keys.listed.here",
"will.be.deleted"
],
"filter": {
"object.at.this.key": [
"will",
"keep",
"only",
"these",
"properties"
]
}
}
Fetch logs from a CHT v2.x production server.
This is a standalone command installed alongside cht-conf
. For usage information, run cht-logs --help
.
cht-logs <instance-name> <log-types...>
Accepted log types:
api
couchdb
gardener
nginx
sentinel
To develop a new action or improve an existing one, check the "Actions" doc.
Execute npm test
to run static analysis checks and the test suite.
node <project_dir>/src/bin/index.js
. This will run as if you installed via npm.npm install <project_dir>
to use the local version of cht-conf.npm version patch
, npm version minor
, or npm version major
as appropriate. This will:
package.json
and package-lock.json
npm publish
to publish the new tag to npmgit push && git push --tags
to push the npm generated commit and tag up to your pre-approved pull requestmaster
npm version --no-git-tag-version <major>.<minor>.<patch>-beta.1
. This will only update the versions in package.json
and package-lock.json
. It will not create a git tag and not create an associated commit.npm publish --tag beta
. This will publish your beta tag to npm's beta channel.To install from the beta channel, run npm install cht-conf@beta
.
Builds brought to you courtesy of GitHub actions.
Copyright 2013-2019 Medic Mobile, Inc. hello@medicmobile.org
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.
FAQs
Configure CHT deployments
The npm package cht-conf-testing-ci-release receives a total of 1 weekly downloads. As such, cht-conf-testing-ci-release popularity was classified as not popular.
We found that cht-conf-testing-ci-release demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.