Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
change(sync): remove dist syncer
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jan 29, 2015
1 parent 8c0f905 commit 44c8e05
Show file tree
Hide file tree
Showing 16 changed files with 8 additions and 1,357 deletions.
14 changes: 4 additions & 10 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Authors:
* dead_horse <[email protected]>
* fengmk2 <[email protected]> (http://fengmk2.github.com)
* fengmk2 <[email protected]> (http://fengmk2.com)
*/

'use strict';
Expand Down Expand Up @@ -37,6 +37,7 @@ var config = {
/*
* server configure
*/

registryPort: 7001,
webPort: 7002,
bindingHost: '127.0.0.1', // only binding on 127.0.0.1 for local access
Expand All @@ -45,6 +46,8 @@ var config = {
// if in debug mode, some middleware like limit wont load
// logger module will print to stdout
debug: true,
// page mode, enable on development env
pagemock: process.env.NODE_ENV === 'development',
// session secret
sessionSecret: 'cnpmjs.org test session secret',
// max request json body size
Expand Down Expand Up @@ -181,15 +184,6 @@ var config = {
* sync configs
*/

// sync dist config
// sync node.js dist from nodejs.org
noticeSyncDistError: true,
disturl: 'http://nodejs.org/dist',
syncDist: false,

pythonDisturl: 'https://www.python.org/ftp',
syncPythonDist: false,

// the official npm registry
// cnpm wont directly sync from this one
// but sometimes will request it for some package infomations
Expand Down
100 changes: 0 additions & 100 deletions controllers/web/dist.js

This file was deleted.

8 changes: 3 additions & 5 deletions docs/web/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ So `cnpm` is meaning: **Company npm**.

## Registry

* Our public registry: [r.cnpmjs.org](http://r.cnpmjs.org), syncing from [registry.npmjs.org](http://registry.npmjs.org)
* Current [cnpmjs.org](/) version: <span id="app-version"></span>
* Mirror of [Node.js Manual & Documentation](/dist/latest/docs/api/index.html)
* Mirror of [nodejs.org/dist](http://nodejs.org/dist): [/dist mirror](/dist)
* Mirror of [phantomjs downloads](https://bitbucket.org/ariya/phantomjs/downloads): [phantomjs mirror](/dist/phantomjs/)
- Our public registry: [r.cnpmjs.org](http://r.cnpmjs.org), syncing from [registry.npmjs.org](http://registry.npmjs.org)
- [cnpmjs.org](/) version: <span id="app-version"></span>
- [Node.js](https://nodejs.org) version: <span id="node-version"></span>

<table class="downloads">
<tbody>
Expand Down
64 changes: 0 additions & 64 deletions models/dist_dir.js

This file was deleted.

82 changes: 0 additions & 82 deletions models/dist_file.js

This file was deleted.

2 changes: 0 additions & 2 deletions models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ module.exports = {
User: load('user'),
Total: load('total'),
DownloadTotal: load('download_total'),
DistFile: load('dist_file'),
DistDir: load('dist_dir'),

query: function* (sql, args) {
return yield this.sequelize.query(sql, null, {raw: true}, args);
Expand Down
3 changes: 0 additions & 3 deletions routes/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var showSync = require('../controllers/web/show_sync');
var showUser = require('../controllers/web/user/show');
var sync = require('../controllers/sync');
var showTotal = require('../controllers/total');
var dist = require('../controllers/web/dist');
var badge = require('../controllers/web/badge');

function routes(app) {
Expand Down Expand Up @@ -51,8 +50,6 @@ function routes(app) {

app.get('/_list/search/search', searchRange);

app.get(/^\/dist(\/.*)?/, dist.list);

app.get(/^\/badge\/v\/([@\w\-\.\/]+)\.svg$/, badge.version);
}

Expand Down
2 changes: 1 addition & 1 deletion servers/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ app.use(middlewares.rt({headerName: 'X-ReadTime'}));
app.use(middlewares.rewrite('/favicon.ico', '/favicon.png'));
app.use(staticCache);

if (process.env.NODE_ENV === 'development') {
if (config.pagemock) {
app.use(require('koa-mock')({
datadir: path.join(rootdir, 'test', 'mocks')
}));
Expand Down
Loading

0 comments on commit 44c8e05

Please sign in to comment.