
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@digital-garden-builder/git-cms
Advanced tools
Git-based CMS with optional React components and Next.js-integrations that dreams of being a distributed knowledge graph.
Git-based CMS with optional React components and Next.js-integrations that dreams of being a distributed knowledge graph.
An experiment by Josh Pollock.
yarn add @digital-garden-builder/git-cms
GitCMS uses a service-based architecture. It is being developed to work with React and Next.JS, but neither are required. You could use the controllers with any HTTP framework or impliment the services in some other way.
The application container is a service that provides all of the services that make up GitCMS.
To simplify creating the application service, there is an application factory, that accepts two arguments:
import {applicationFactory} from "@shelob9/gitcms"
const app = await applicationFactory(
undefined,//storage path, defaults to '/data'
{
config: {
useGit: {owner: "repo-org",repo: "repo-name"}
},
gitAuth
}
)
string|undefined
/data is used.GitCmsConfig|undefinedimport {applicationService} from "@shelob9/gitcms"
const app = await applicationService(
'/my-data-path',//Storage path
[], //Invite codes
false// Use Git
gitAuth//Gitub authentication
)
string|undefined
/data is used.string[]
bool|gitRepoDetials
{owner: "repo-org",repo: "repo-name"}string|any
GitCMS supports user registration and login. Users are authenticatied by email and password. User data is encrypted.
User system should not be considered secure yet beacuse, there is no email verification or two factor. Emails are public right now, if git repo is public.
Also, passwords are annoying, I will impliment magic.link soon.
The user service, which is availble from the main app instance, can create and modify users:
//Create a user
let user = await app.userService.createUser("test@email.com", "password");
//Set user as current user
await app.setCurrentUser(user);
It can also modify their encryped user data. This is an ecrypted key, value store. Each value, can be a string or number.
await app.currentUserMeta.saveMeta("doggo", "puppers");
let value = await service.currentUserMeta.getMeta("doggo");
To create a user API, you will need to create an instance of the app, and provide it, along with HTTP request and response objects to one of the controllers. The API is developed for NextJS, but should work with Express. I have not test that yet.
import { NextApiResponse, NextApiRequest } from "next";
import { applicationFactory, loginController } from "@shelob9/gitcms";
export default async (req: NextApiRequest, res: NextApiResponse) => {
let app = await applicationFactory(undefined);
await loginController(app, req, res);
};
import { NextApiResponse, NextApiRequest } from "next";
import { applicationFactory, registerationController } from "@shelob9/gitcms";
export default async (req: NextApiRequest, res: NextApiResponse) => {
let app = await applicationFactory(undefined);
await registerationController(app, req, res);
};
import { NextApiResponse, NextApiRequest } from "next";
import { applicationFactory, logoutController } from "@shelob9/gitcms";
export default async (req: NextApiRequest, res: NextApiResponse) => {
let app = await applicationFactory(undefined);
await logoutController(app, req, res);
};
There are two files services. The first, gitFileService, uses Git and the other, localFileService uses the file system -- this is for development. They both impliment the AbstractFileService interface.
The gitFileService service depenes on GitApi.
import {GitApi} from "@shelob9/gitcms"
let api = GitApi(
//Repo details
{
owner: "repo-org",
repo: "repo-name"
},
//Branch
"main",
//Authentication
auth
);
Both file services have the same API, but only the git service requires GitAPI. File services read and write files from one directory. You must specify a file type -- markdown or JSON. Only those files will be used. Markdown files will be parsed to HTML using mdx-js.
let git = await gitFileService(
api,//GitApi instance
'products',//directory
'json'//extension
);
let local = await localFileService(
'posts',//directory
'md'//extension
);
Working with files is the same, does not matter which service:
//Get all files in directory
let fileIndex = await fileService.fetchIndex();
let { content } = await service.fetchFile("name-of-file-no-extension");
{ content } = await service.saveFile("write-test", "Spatula");
Not implimented yet.
Not impimented yet.
git clone ...yarnyarn devyarn testyarn test --watchyarn test --ciyarn build:libyarn lintyarn release
GITCMS_USE_GIT
GITCMS_USE_GIT=trueGITCMS_USE_GIT=trueFAQs
Git-based CMS with optional React components and Next.js-integrations that dreams of being a distributed knowledge graph.
We found that @digital-garden-builder/git-cms 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.