Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Very simple tool for customizing layers values of a .mml
config file.
Warning: it's experimental and work in progress.
npm intall cartocc
For example, you may want to customize the database connection or some shp file path.
CartoCC makes it very simple. You just create some rules, stored in a json file, applying to layers fields. Each rule define some values to set to a layer if some field has some value.
Example of rules:
[
{
"if": {
"Datasource.type": "postgis"
},
"then": {
"Datasource.dbname": "osm2",
"Datasource.host": "localhost2",
"Datasource.password": "blahblah"
}
},
{
"if": {
"class": "shp"
},
"then": {
"Datasource.file": "/data/{id}.shp"
}
}
]
You can also have multiple conditions (which are ANDed):
[
{
"if": {
"geometry": "multipolygon",
"class": "bigdata"
},
"then": {
"Datasource.dbname": "anotherdb",
"Datasource.host": "hostforbigqueries",
"Datasource.password": "123456"
}
}
]
You can also test on an array of values (which are ORed):
[
{
"if": {
"id": ["id1", "id2"]
},
"then": {
"Datasource.dbname": "anotherdb",
"Datasource.host": "anotherhost",
"Datasource.password": "123456"
}
}
]
You can use dynamic properties of the layer in the final value (this will use Layer.id in the final path):
[
{
"if": {
"Datasource.type": "shape"
},
"then": {
"Datasource.file": "/data/{id}/{id}.shp"
}
}
]
Notes:
Layer
. You can use a path as field reference.
For example, Datasource.type
will look for the field type
of Layer.Datasource
.Then run the script from command line to get the customized .mml
file:
cartocc <path-to-project.mml> <path-to-custom-rules.json> > local_project.mml
FAQs
Carto Config Customizer is a very simple tool for customizing layers values of a `.mml` config file
We found that cartocc 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.