
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
A tool for database operations with encryption and decryption, configurable table and column names, and additional CLI features.
中文 | English
dsqlenv
is a SQL database operation tool designed to help developers quickly synchronize common variables, such as API keys, across different environments or hosts. All variables stored in the database are encrypted using AES for enhanced security.
To install dsqlenv
, follow these steps:
Clone the repository:
git clone https://gitee.com/iint/dsqlenv.git
cd dsqlenv
Install the required dependencies:
pip install -r requirements.txt
Create a .env
file in the root directory and define the necessary environment variables, as explained in the next section.
or
pip install dsqlenv
Before using dsqlenv
, ensure that your environment variables contain the following database information:
DB_USER='<username>' # Database username for authentication
DB_PASSWORD='<password>' # Password for the database user
DB_NAME='xxx' # The name of the database to connect to
DB_HOST='xxx' # Hostname or IP address of the database server
DB_PORT='xxx' # Port number for the database connection (default for MySQL is 3306)
AES_KEY='xxx' # AES encryption key for securing sensitive data
TABLE_NAME='dagent_info' # The name of the table to perform operations on
ID_COLUMN='name' # The column name that acts as the unique identifier for records
INFO_COLUMN='data' # The column name that stores the data you want to retrieve or update
Make sure to replace the placeholder values with your actual database credentials.
To get started with dsqlenv
, you can use the command-line interface (CLI) for quick database and environment variable operations.
Get a Record:
dsqlenv db --action get --id <Record ID>
Insert a Record:
dsqlenv db --action insert --id <Record ID> --data <Record data>
Update a Record:
dsqlenv db --action update --id <Record ID> --data <Record data>
Delete a Record:
dsqlenv db --action delete --id <Record ID>
You can also use the dsqlenv
library directly in your Python code.
from dsqlenv.core import SQL
from dsqlenv.config import load_config
# Load configuration
config = load_config()
db = SQL(config)
# Insert a new record
db.insert_data("api_key", "your_api_key")
# Get a record by ID
data = db.get_data_by_id("api_key")
print(data)
# Update a record
db.update_data("api_key", "new_api_key")
# Delete a record
db.delete_data("api_key")
Here are some examples of how to use the CLI effectively:
Search for Environment Variables:
dsqlenv search-env --keyword SECRET
Update an Environment Variable:
dsqlenv update-env --key API_KEY --value new_value
Search using Regular Expressions:
dsqlenv re search '^SECRET'
Update using Regular Expressions:
dsqlenv re update '^API_' 'new_value'
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A tool for database operations with encryption and decryption, configurable table and column names, and additional CLI features.
We found that dsqlenv demonstrated a healthy version release cadence and project activity because the last version was released less than 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.