Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
sails-adminpanel
Advanced tools
Only for use sails > v1.5
Community Link: Join SailsJS Discord Community Feel free to use this link to connect with the community and engage in discussions or ask any questions you may have.
The admin panel offers automatic generation capabilities, ensuring ease of use, and includes features such as internationalization, user and group access rights, policy enforcement, and a modern user interface. In the near future, installation steps will be provided for a smoother setup experience.
Key Features and Components:
This comprehensive set of features and components makes the admin panel a powerful tool for managing and controlling various aspects of your application with a focus on simplicity and a modern user interface.
To install this hook, you will need to run:
npm install sails-adminpanel
Currently, we have to patch sails framework, so you install our patches for using all functionality. Without these patches, i18n will not work. Read how to install the patch
Then you will need to create a config file for the admin panel generator into config/adminpanel.js
For use Typescript look below
This is an example of this file:
'use strict';
module.exports.adminpanel = {
models: {
pages: {
title: 'Pages',
model: 'Page',
list: {
fields: {
id: 'ID',
name: 'Article name'
}
},
edit: {
fields: {
name: 'Article name',
content: {
type: 'wysiwyg',
title: 'Article body'
}
}
}
}
}
};
And your admin panel will be accessible under: http://127.0.0.1:port/admin
The migration block is responsible for determining when the admin panel migrations should be executed. The conditions for running migrations are as follows:
process.env.NODE_ENV === "production"
) and the datastore is PostgreSQL (process.env.DATASTORE === "postgres"
).ADMINPANEL_MIGRATIONS_FORCE
is set to "TRUE" (process.env.ADMINPANEL_MIGRATIONS_FORCE === "TRUE"
).If these conditions are met, and the environment variable ADMINPANEL_MIGRATIONS_SKIP
is not set to "TRUE" (process.env.ADMINPANEL_MIGRATIONS_SKIP !== "TRUE"
), the following action will be performed:
MigrationsHelper.addToProcessMigrationsQueue
function is called to add migrations from the specified path (${sails.config.adminpanel.rootPath}/migrations
) to the process migrations queue.This block ensures that admin panel migrations are run under specific conditions, providing flexibility and control over the migration process.
Admin panel migrations will run if some conditions will be done. Set process.env.NODE_ENV = "production"
and process.env.DATASTORE = "postgres"
or use process.env.ADMINPANEL_MIGRATIONS_FORCE = "TRUE"
. But if you want to forbid migrations and cancel all these conditions use process.env.ADMINPANEL_MIGRATIONS_SKIP = "TRUE"
For comprehensive information on configuration and usage, it is highly recommended to refer to the docs folder within the project repository. The documentation provides detailed insights into various aspects of the admin panel, including configuration options and usage guidelines.
When working with TypeScript in the project, it is advisable to explore the type definitions located in the /interfaces/adminpanelConfig.d.ts
file. This TypeScript definition file outlines the types and structures associated with the admin panel configuration. It serves as a valuable resource for understanding the available options and ensuring type safety when configuring the admin panel.
For projects utilizing TypeScript, consider the following example:
import { ModelConfig, AdminpanelConfig } from "sails-adminpanel/interfaces/adminpanelConfig";
let models: { [key: string]: ModelConfig } = {
// Define your model configurations here
};
var config: AdminpanelConfig = {
//auth: true,
dashboard: {
autoloadWidgetsPath: 'api/dashboardWidgets',
defaultWidgets: ['reload_website']
},
brand: {
link: {
title: 'SailsJS adminpanel',
id: "brand_link",
link: "/admin"
}
}
};
module.exports.adminpanel = config;
This TypeScript example demonstrates how to structure model configurations and the overall admin panel configuration. Utilizing TypeScript enhances code clarity, provides autocompletion support, and helps prevent potential configuration errors.
The UI of the project is designed with the Tailwind CSS framework, providing a modern and responsive user interface.
gulpfile.js
gulp
- Executes in development mode.gulp prod
- Executes in production mode.assets/src/scripts/ckeditor5/app.js
gulp ckeditorBuild
The CKeditor5 section indicates the custom build file location for CKeditor5, which can be found at assets/src/scripts/ckeditor5/app.js
. Additionally, there is a Gulp task named gulp ckeditorBuild
associated with building CKeditor5.
These details provide information on the project's build process, specifically related to Gulp tasks and CKeditor5 customization.
for fileUploader (readmore in TODO)
csrf: false
MIT
FAQs
Basic adminpanel for Sails 1x
The npm package sails-adminpanel receives a total of 35 weekly downloads. As such, sails-adminpanel popularity was classified as not popular.
We found that sails-adminpanel demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.