This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 744
Deploy
rhinoceros.xn edited this page Sep 15, 2018
·
25 revisions
- Node >= 6.11.3
- MySQL >= 0.5.0, include
mysqld
andmysql
cli - Simple File Store Service, like qiniu, aliyun-oss, tfs, upyun
- First you need create your own mysql database and tables. Get all the sqls here.
- Then you can see a complete example here custom-cnpm-example.
# clone from github
$ git clone git://github.com/cnpm/cnpmjs.org.git $HOME/cnpmjs.org
$ cd $HOME/cnpmjs.org
# create mysql tables
$ mysql -u yourname -p
mysql> create database cnpmjs
mysql> use cnpmjs;
mysql> source docs/db.sql
Replace qiniu CDN with Your Own CDN System
$ vim config/config.js
module.exports = {
debug: false,
enableCluster: true, // enable cluster mode
enablePrivate: true, // enable private mode, only admin can publish, other use just can sync package from source npm
database: {
db: 'cnpmjstest',
host: 'localhost',
port: 3306,unknown database cnpmjs
username: 'cnpmjs',
password: 'cnpmjs123'
},
admins: {
admin: 'admin@cnpmjs.org',
},
syncModel: 'exist'// 'none', 'all', 'exist'
};
$ npm install --build-from-source --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/mirrors/node
$ npm run start
#open registry and web
# registry
open http://localhost:7001
# web
open http://localhost:7002
See an example with oss: oss-cnpm
Use oss-cnpm
:
- First install oss-cnpm
$ cd $HOME/cnpmjs.org
$ cnpm install oss-cnpm
- Then edit the
config/index.js
, addnfs
options:
nfs: require('oss-cnpm').create({
accessKeyId: 'YOUR_OSS_AccessKeyID',
accessKeySecret: 'YOUR_OSS_AccessKeySecret:',
// change to your endpoint
endpoint: 'YOUR_OSS_Endpoint',
bucket: 'YOUR_OSS_Bucket',
mode: 'private',
}),
Copyright @ 2013 - present cnpmjs.org