npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

castor-admin

v0.8.2

Published

Administration for Castor instances using the same theme

Downloads

26

Readme

castor-admin

Administration for Castor instances using the same theme

Installation

Prequired: nodejs (version 0.11.13+), mongodb (version 2+)

From 0.6.0:

$ npm install -g castor-clean
$ npm install -g pm2
$ npm install -g castor-admin

Then, install at least one app in ~/apps (see Apps).

Until 0.5.0:

$ npm install -g castor-core
$ npm install -g castor-cli
$ npm install -g castor-clean
$ npm install -g pm2
$ npm install -g castor-admin

Configuration

Theme

Deprecated since 0.6.0, see Apps.

Install all the themes you want to usable in an instance through npm, using github:

$ npm install -g https://github.com/castorjs/castor-theme-dashboard.git

or using only npm (if the theme is published):

$ npm install -g castor-theme-dashboard

To set the default theme that castor-admin will use, set the environment variable THEME to the name of the theme (in .bashrc or .profile).

export THEME=castor-theme-dashboard

Apps

WARNING From 0.6.0 and up, the app notion has appeared. An app is a theme, in some specific version. The use of an app is mandatory for each new instance in 0.6.0+.

They are located in the same directory, $HOME/apps.

They have to be installed by unzipping a release of a theme from github.

Ex (for castor-theme-sbadmin, release v3.1.0, which gives a castor-theme-sbadmin-3.2.0.tar.gz) :

$ cd ~/apps
$ tar xvzf castor-theme-sbadmin-3.2.0.tar.gz
$ cd castor-theme-sbadmin-3.2.0
$ npm install

Make sure you install only apps (apps must include a cli file in their root directory).

Instances

Instances are differentiated only by their data, and their settings.

All instances data are stored in the same instances directory, which path has to be given to castor-admin:

$ castor-admin /path/to/instances

By default, instances are put into $HOME/instances.

Administrator

All user ids ending with administrator_end may create, modify, or delete an instance.

"administrator_end": "domain.co"

NOTE: at the moment, no authentication is used. This administrator_end is almost meaningless.

Port

The port used by the admin server:

"port": 35267

To set the port that castor-admin will use, set the environment variable PORT (in .bashrc or .profile). Default value: 35267.

export PORT=3000

domainProxy

castor-admin can behave like a proxy. To activate it, set the `domainProxỳ environment variable to the domain of your proxy.

export domainProxy=domain.co

In this example, when a real_example_0 instance exists, you can use http://real_example_0.domain.co to access to your instance, and not only with http://machine.intra.domain.co:port/

Items per page

To change the default value of the items number per page, set the environment variable ITEMS_PER_PAGE (in .bashrc or .profile). Default value: 30.

export ITEMS_PER_PAGE=30

Files tree

.
├── app.js
├── config.js
├── lib
├── package.json
├── public
│   ├── img
│   ├── javascripts
│   ├── SlickGrid
│   └── stylesheets
├── routes
├── test
├── tmp
├── README.md
└── views

Running

$ castor-admin [/path/to/instances/]

and you can manually start all the instances with:

$ pm2 startOrRestart /path/to/instances.json

Contributions

To test, first make sure you have development dependencies installed:

$ npm install -d

Next, run the admin:

$ ./bin/admin

Then, you can launch the tests:

$ npm test