Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
grunt-elastic-sc
Advanced tools
This is a Grunt set of tasks for source control your ElasticSearch. I know it's not quite necessary to have a source control on your ES installation. But, when you work with pairs, it's not confortable when all of you need to update the your mappings or add custom data to your types.
Whit this Tasks, you will be able to create a Master Changelog when you references your Changelogs. In this changelogs you can Create Mappings, Add Data and Delete Data having full control.
If you make a change and push your changes, then your partner can pull and update his ES with a simple grunt command.
Your need to add to your dependencies
"dependencies": {
"grunt-elastic-sc": "X.X.X"
}
You have two main tasks
You must create this directory structure on your project.
-> es-source-control
-> changelogs
-> sc-master.json
This will be the master changelog file. This file is going to have the changelogs references to execute.
{
"changelogs": [
{
"id": "create-testing",
"folder": "testing",
"file": "mapping",
"type": "mapping"
},
{
"id": "add-data",
"folder": "testing",
"file": "data",
"type": "data"
},
{
"id": "deleting-data",
"folder": "testing",
"file": "delete",
"type": "delete"
},
{
...
}
]
}
The **id** must be unique.
All the changelogs are going to be find on the folder "changelogs" on your "es-source-control" root directory.
This task will create an index called "sc". With this index, a type called "changelogs" also be created. This type is going to contain the ids already executed. This will keep the control of the code already executed.
The next are the properties of "changelogs"
"properties": {
"id_runned": { "type": "string", "index": "not_analyzed" },
"success": { "type":"boolean" },
"run_date": { "type": "date" }
}
This task will execute all the changelog that aren't yet executed
Parameters:
Example:
grunt sc-process --from:add-data
Follow this example, this command will only execute "deleting-data".
This command should be used when you update your ES from a Snapshot, and you don't want to execute the previous changes again (Assuming your "es" Index is empty or outdated). If you are going to use this option all the time, add it to your Gruntfile configurations.
To add data, the JSON file should be like this:
{
"changes": [
{
"index": "sc",
"type": "test_mapping",
"records": [
{
"id": 1,
"text": "This is a text message 1"
},
{
"id": 2,
"text": "This is a text message 2"
},
{
...
}
]
}
]
}
To add a type, the JSON file should be like this:
{
"changes": [
{
"index": "sc",
"type": "test_mapping",
"body": {
"test_mapping": {
"_all": { "enabled": false },
"dynamic": false,
"_id": {
"path": "id"
},
"properties": {
"id": { "type": "integer" },
"text": { "type": "string", "index": "not_analyzed" }
}
}
}
}
]
}
To make a delete by query, the JSON file should be like this:
{
"changes": [
{
"index": "sc",
"type": "test_mapping",
"records": [
{
"query": {
"term": {
"id": 3
}
}
}
]
}
]
}
On the package folder, you will find a basic example already created
This is a base for creating a better Souce Control for ElasticSearch, all Forks and PR would be accepted. Thanks!
The MIT License (MIT)
Copyright (c) <2015> <Ariel Rey>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
FAQs
Grunt ElasticSearch Source Control
We found that grunt-elastic-sc 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.