Merge branch 'master' into master-fork

# Conflicts:
#	lib/notify.js
This commit is contained in:
Ryan Graham 2017-04-18 13:49:24 +01:00
commit 7d62824936
47 changed files with 749 additions and 442 deletions

View File

@ -11,6 +11,7 @@
env:
node: true
es6: true
rules:
# useful to have in node.js,

31
.github/issue_template.md vendored Normal file
View File

@ -0,0 +1,31 @@
#### My reason:
<!--
a brief explanation of the issue, suggestion, feature
-->
#### Steps to reproduce:
<!--
(if it applies)
how can I do in order to reproduce it? environment? configuration?
-->
#### Additional information:
<!--
provide the following information would be helpful
-->
- `$ set DEBUG=express:* verdaccio` enable extreme verdaccio debug mode
- `$ npm --verbose` prints:
- `$ npm config get registry` prints:
- Verdaccio terminal output
- Windows, OS X/macOS, or Linux?:
- Verdaccio configuration file, eg: `cat ~/.config/verdaccio/config.yaml`
- Container:
- [ ] I use local environment
- [ ] I develop / deploy using Docker.
- [ ] I deploy to a PaaS.
#### Additional verbose log:

14
.gitignore vendored
View File

@ -1,15 +1,23 @@
npm-debug.log
sinopia-*.tgz
verdaccio-*.tgz
.DS_Store
###
!bin/sinopia
!bin/verdaccio
test-storage*
node_modules
# Istanbul
coverage/
.nyc*
# Visual Studio Code
.vscode/*
.jscsrc
.jshintrc
jsconfig.json
# Yarn
yarn*

View File

@ -1,5 +1,6 @@
node_modules
npm-debug.log
coverage/
verdaccio-*.tgz
test-storage*
/.*

View File

@ -3,12 +3,9 @@ node_js:
- '4'
- '6'
- '7'
- '1'
- '2'
- 'iojs'
sudo: false
matrix:
allow_failures:
- node_js: 'iojs'
fast_finish: true
script: npm install . && npm run test-travis
script: npm install . && npm run test-travis

62
AUTHORS Normal file
View File

@ -0,0 +1,62 @@
030 <chocolatey030@gmail.com>
Alex Kocharin <alex@kocharin.ru>
Alex Kocharin <rlidwka@kocharin.ru>
Alex Vernacchia <avernacchia@exacttarget.com>
Alexander Makarenko <estliberitas@gmail.com>
Alexandre-io <Alexandre-io@users.noreply.github.com>
Aram Drevekenin <grimsniffer@gmail.com>
Barthélemy Vessemont <bvessemont@gmail.com>
Brandon Nicholls <brandon.nicholls@gmail.com>
Bren Norris <bnorris@enterrasolutions.com>
Brett Trotter <brett.trotter@webfilings.com>
Brian Peacock <bpeacock@fastfig.com>
Chad Killingsworth <chad.killingsworth@banno.com>
Chris Breneman <crispy@cluenet.org>
Cody Droz <cody-geest@uiowa.edu>
Daniel Rodríguez Rivero <rdanielo@gmail.com>
Denis Babineau <denis.babineau@gmail.com>
Fabio Poloni <fabio@APP-roved.com>
Facundo Chambó <fchambo@despegar.com>
Guilherme Bernal <dev@lbguilherme.com>
Jakub Jirutka <jakub@jirutka.cz>
James Newell <j.newell@nib.com.au>
Jan Vansteenkiste <jan@vstone.eu>
Jannis Achstetter <jannis.achstetter@schneider-electric.com>
Jeremy Moritz <jeremy@jeremymoritz.com>
John Gozde <johng@pandell.com>
Jon de la Motte <jondlm@gmail.com>
Joseph Gentle <me@josephg.com>
José De Paz <josedepaz@users.noreply.github.com>
Juan Carlos Picado <juan@encuestame.org>
Juan Carlos Picado <juanpicado19@gmail.com>
Juan Picado <juanpicado19@gmail.com>
Juan Picado @jotadeveloper <juanpicado19@gmail.com>
Kalman Speier <kalman.speier@gmail.com>
Keyvan Fatehi <keyvanfatehi@gmail.com>
Kody J. Peterson <kodypeterson@users.noreply.github.com>
Madison Grubb <madison.grubb@itential.com>
Manuel de Brito Fontes <aledbf@gmail.com>
Mark Doeswijk <mark.doeswijk@marviq.com>
Michael Crowe <michael@developrise.com>
Miguel Mejias <miguelangelmejias@dorna.com>
Miroslav Bajtoš <miroslav@strongloop.com>
Nate Ziarek <natez@OSX12-L-NATEZ.local>
Nick <nick.edelenbos@trimm.nl>
Rafael Cesar <rafa.cesar@gmail.com>
Robert Groh <robert.groh@medesso.de>
Robin Persson <rprssn@gmail.com>
Romain Lai-King <romain.laiking@opentrust.com>
Sam Day <sday@atlassian.com>
Tarun Garg <tarun1793@users.noreply.github.com>
Thomas Cort <thomasc@ssimicro.com>
Tom Vincent <git@tlvince.com>
Trent Earl <trent@trentearl.com>
Yannick Croissant <yannick.croissant@gmail.com>
Yannick Galatol <ygalatol@teads.tv>
danielo515 <rdanielo@gmail.com>
jmwilkinson <j.wilkinson@f5.com>
jotadeveloper <juanpicado@users.noreply.github.com>
maxlaverse <max@laverse.net>
saheba <saheba@users.noreply.github.com>
steve-p-com <github@steve-p.com>
trent.earl <trent.earl@malauzai.com>

View File

@ -1,3 +1,33 @@
## 2.1.4 (April 13, 2017)
- Added Nexus Repository OSS as similar existing software - ([@nedelenbos030](https://github.com/nedelenbos) in [#147](https://github.com/verdaccio/verdaccio/pull/147))
- Increase verbose on notify request - ([@juanpicado](https://github.com/juanpicado) in [#153](https://github.com/verdaccio/verdaccio/pull/153))
- Add fallback support to previous config files - ([@juanpicado](https://github.com/juanpicado) in [#155](https://github.com/verdaccio/verdaccio/pull/155))
- Allows retrieval of all local package contents via http://server/-/search/* - ([@Verikon](https://github.com/Verikon) in [#152](https://github.com/verdaccio/verdaccio/pull/155))
## 2.1.3 (March 29, 2017)
- [GH-83] create systemd service - ([@030](https://github.com/030) in [#89](https://github.com/verdaccio/verdaccio/pull/89))
- optional scope in the readme package name. - ([@psychocode](https://github.com/psychocode) in [#136](https://github.com/verdaccio/verdaccio/pull/136))
- Added docker image for rpi - ([@danielo515](https://github.com/danielo515) in [#137](https://github.com/verdaccio/verdaccio/pull/137))
- Allow configuring a tagline that is displayed on the webpage between. ([@jachstet-sea](https://github.com/jachstet-sea) in [#143](https://github.com/verdaccio/verdaccio/pull/143))
## 2.1.2 (March 9, 2017)
- Contribute guidelines - ([@juanpicado](https://github.com/juanpicado) in [#133](https://github.com/verdaccio/verdaccio/pull/133))
- fix(plugin-loader): plugins verdaccio-* overwrite by sinopia- ([@Alexandre-io](https://github.com/Alexandre-io) in [#129](https://github.com/verdaccio/verdaccio/pull/129))
## 2.1.1 (February 7, 2017)
- [GH-86] updated readme to point to new chef cookbook ([@kgrubb](https://github.com/kgrubb) in [#117](https://github.com/verdaccio/verdaccio/pull/117))
- [GH-88] rename to Verdaccio instead of Sinopia ([@kgrubb](https://github.com/kgrubb) in [#93](https://github.com/verdaccio/verdaccio/pull/93))
- Unit testing coverage ([@juanpicado](https://github.com/juanpicado) in [#116](https://github.com/verdaccio/verdaccio/issues/116))
- Allow htpasswd-created users to log in [@imsnif](https://github.com/imsnif) in [#112](https://github.com/verdaccio/verdaccio/issues/112))
- remove travis io.js support ([@juanpicado](https://github.com/juanpicado) in [#115](https://github.com/verdaccio/verdaccio/issues/115))
- rename clean up ([@juanpicado](https://github.com/juanpicado) in [#114](https://github.com/verdaccio/verdaccio/issues/114))
- _npmUser / author not showing up ([@juanpicado](https://github.com/juanpicado) in [#65](https://github.com/verdaccio/verdaccio/issues/65))
- Docs: correct config attribute `proxy_access` ([@robertgroh](https://github.com/robertgroh) in [#96](https://github.com/verdaccio/verdaccio/pull/96))
- Problem with docker.yaml ([@josedepaz](https://github.com/josedepaz) in [#72](https://github.com/verdaccio/verdaccio/pull/72))
- Prevent logging of user and password ([@tlvince](https://github.com/tlvince) in [#94](https://github.com/verdaccio/verdaccio/pull/94))
- Updated README.md to reflect the availability of the docker image ([@jmwilkinson](https://github.com/jmwilkinson)) in [#71](https://github.com/verdaccio/verdaccio/pull/71))
## 2.1.0 (October 11, 2016)
- Use __dirname to resolve local plugins ([@aledbf](https://github.com/aledbf) in [#25](https://github.com/verdaccio/verdaccio/pull/25))
@ -11,3 +41,322 @@
- Register entry partial even if custom template is provided ([@plitex](https://github.com/plitex) in [#46](https://github.com/verdaccio/verdaccio/pull/46))
- Rename process to verdaccio ([@juanpicado](https://github.com/juanpicado) in [#57](https://github.com/verdaccio/verdaccio/pull/57))
## 7 Jun 2015, version 1.4.0
- avoid sending X-Forwarded-For through proxies (issues [#19](https://github.com/rlidwka/sinopia/issues/19), [#254](https://github.com/rlidwka/sinopia/issues/254))
- fix multiple issues in search (issues [#239](https://github.com/rlidwka/sinopia/issues/239), [#253](https://github.com/rlidwka/sinopia/pull/253))
- fix "maximum stack trace exceeded" errors in auth (issue [#258](https://github.com/rlidwka/sinopia/issues/258))
## 10 May 2015, version 1.3.0
- add dist-tags endpoints (issue [#211](https://github.com/rlidwka/sinopia/issues/211))
## 22 Apr 2015, version 1.2.2
- fix access control regression in `1.2.1` (issue [#238](https://github.com/rlidwka/sinopia/issues/238))
- add a possibility to bind on unix sockets (issue [#237](https://github.com/rlidwka/sinopia/issues/237))
## 11 Apr 2015, version 1.2.1
- added more precise authorization control to auth plugins (issue [#207](https://github.com/rlidwka/sinopia/pull/207))
## 29 Mar 2015, version 1.1.0
- add a possibility to listen on multiple ports (issue [#172](https://github.com/rlidwka/sinopia/issues/172))
- added https support (issues [#71](https://github.com/rlidwka/sinopia/issues/71), [#166](https://github.com/rlidwka/sinopia/issues/166))
- added an option to use a custom template for web UI (issue [#208](https://github.com/rlidwka/sinopia/pull/208))
- remove "from" and "resolved" fields from shrinkwrap (issue [#204](https://github.com/rlidwka/sinopia/issues/204))
- fix hanging when rendering readme (issue [#206](https://github.com/rlidwka/sinopia/issues/206))
- fix logger-related crash when using sinopia as a library
- all requests to uplinks should now have proper headers
## 12 Feb 2015, version 1.0.1
- fixed issue with `max_users` option (issue [#184](https://github.com/rlidwka/sinopia/issues/184))
- fixed issue with not being able to disable the web interface (issue [#195](https://github.com/rlidwka/sinopia/pull/195))
- fixed 500 error while logging in with npm (issue [#200](https://github.com/rlidwka/sinopia/pull/200))
## 26 Jan 2015, version 1.0.0
- switch markdown parser from `remarkable` to `markdown-it`
- update `npm-shrinkwrap.json`
- now downloading tarballs from upstream using the same protocol as for metadata (issue [#166](https://github.com/rlidwka/sinopia/issues/166))
## 22 Dec 2014, version 1.0.0-beta.2
- fix windows behavior when `$HOME` isn't set (issue [#177](https://github.com/rlidwka/sinopia/issues/177))
- fix sanitization for highlighted code blocks in readme (issue [render-readme/#1](https://github.com/rlidwka/render-readme/issues/1))
## 15 Dec 2014, version 1.0.0-beta
- Markdown rendering is now a lot safer (switched to remarkable+sanitizer).
- Header in web interface is now static instead of fixed.
- `GET /-/all?local` now returns list of all local packages (issue [#179](https://github.com/rlidwka/sinopia/pull/179))
## 5 Dec 2014, version 1.0.0-alpha.3
- Fixed an issue with scoped packages in tarballs
## 25 Nov 2014, version 1.0.0-alpha
- Config file is now created in `$XDG_CONFIG_HOME` instead of current directory.
It is printed to stdout each time sinopia starts, so you hopefully won't have any trouble locating it.
The change is made so sinopia will pick up the same config no matter which directory it is started from.
- Default config file is now a lot shorter, and it is very permissive by default. You could use sinopia without modifying it on your own computer, but definitely should change it on production.
- Added auth tokens. For now, auth token is just a username+password encrypted for security reasons, so it isn't much different from basic auth, but allows to avoid "always-auth" npm setting.
- Added scoped packages.
Please note that default `*` mask won't apply to them. You have to use masks like `@scope/*` to match scoped packages, or `**` to match everything.
- Enabled web interface by default. Wow, it looks almost ready now!
- All dependencies are bundled now, so uncompatible changes in 3rd party stuff in the future won't ruin the day.
## 1 Nov 2014, version 0.13.2
- fix `EPERM`-related crashes on windows (issue [#67](https://github.com/rlidwka/sinopia/issues/67))
## 22 Oct 2014, version 0.13.0
- web interface:
- web page layout improved (issue [#141](https://github.com/rlidwka/sinopia/pull/141))
- latest version is now displayed correctly (issues [#120](https://github.com/rlidwka/sinopia/issues/120), [#123](https://github.com/rlidwka/sinopia/issues/123), [#143](https://github.com/rlidwka/sinopia/pull/143))
- fixed web interface working behind reverse proxy (issues [#145](https://github.com/rlidwka/sinopia/issues/145), [#147](https://github.com/rlidwka/sinopia/issues/147))
## 2 Oct 2014, version 0.12.1
- web interface:
- update markdown CSS (issue [#137](https://github.com/rlidwka/sinopia/pull/137))
- jquery is now served locally (issue [#133](https://github.com/rlidwka/sinopia/pull/133))
- bugfixes:
- fix "offset out of bounds" issues (issue [sinopia-htpasswd/#2](https://github.com/rlidwka/sinopia-htpasswd/issues/2))
- "max_users" in htpasswd plugin now work correctly (issue [sinopia-htpasswd/#3](https://github.com/rlidwka/sinopia-htpasswd/issues/3))
- fix `ENOTDIR, open '.sinopia-db.json'` error in npm search (issue [#122](https://github.com/rlidwka/sinopia/issues/122))
## 25 Sep 2014, version 0.12.0
- set process title to `sinopia`
- web interface bugfixes:
- save README data for each package (issue [#100](https://github.com/rlidwka/sinopia/issues/100))
- fix crashes related to READMEs (issue [#128](https://github.com/rlidwka/sinopia/issues/128))
## 18 Sep 2014, version 0.11.3
- fix 500 error in adduser function in sinopia-htpasswd (issue [#121](https://github.com/rlidwka/sinopia/issues/121))
- fix fd leak in authenticate function in sinopia-htpasswd (issue [#116](https://github.com/rlidwka/sinopia/issues/116))
## 15 Sep 2014, version 0.11.1
- mark crypt3 as optional (issue [#119](https://github.com/rlidwka/sinopia/issues/119))
## 15 Sep 2014, version 0.11.0
- Added auth plugins (issue [#99](https://github.com/rlidwka/sinopia/pull/99))
Now you can create your own auth plugin based on [sinopia-htpasswd](https://github.com/rlidwka/sinopia-htpasswd) package.
- WIP: web interface (issue [#73](https://github.com/rlidwka/sinopia/pull/73))
It is disabled by default, and not ready for production yet. Use at your own risk. We will enable it in the next major release.
- Some modules are now bundled by default, so users won't have to install stuff from git. We'll see what issues it causes, maybe all modules will be bundled in the future like in npm.
## 14 Sep 2014, version 0.10.x
*A bunch of development releases that are broken in various ways. Please use 0.11.x instead.*
## 7 Sep 2014, version 0.9.3
- fix several bugs that could cause "can't set headers" exception
## 3 Sep 2014, version 0.9.2
- allow "pretty" format for logging into files (issue [#88](https://github.com/rlidwka/sinopia/pull/88))
- remove outdated user existence check (issue [#115](https://github.com/rlidwka/sinopia/pull/115))
## 11 Aug 2014, version 0.9.1
- filter falsey _npmUser values (issue [#95](https://github.com/rlidwka/sinopia/pull/95))
- option not to cache third-party files (issue [#85](https://github.com/rlidwka/sinopia/issues/85))
## 26 Jul 2014, version 0.9.0
- new features:
- add search functionality (issue [#65](https://github.com/rlidwka/sinopia/pull/65))
- allow users to authenticate using .htpasswd (issue [#44](https://github.com/rlidwka/sinopia/issues/44))
- allow user registration with "npm adduser" (issue [#44](https://github.com/rlidwka/sinopia/issues/44))
- bugfixes:
- avoid crashing when res.socket is null (issue [#89](https://github.com/rlidwka/sinopia/issues/89))
## 20 Jun 2014, version 0.8.2
- allow '@' in package/tarball names (issue [#75](https://github.com/rlidwka/sinopia/issues/75))
- other minor fixes (issues [#77](https://github.com/rlidwka/sinopia/issues/77), [#80](https://github.com/rlidwka/sinopia/issues/80))
## 14 Apr 2014, version 0.8.1
- "latest" tag is now always present in any package (issue [#63](https://github.com/rlidwka/sinopia/issues/63))
- tags created with new npm versions (>= 1.3.19) can now be published correctly
## 1 Apr 2014, version 0.8.0
- use gzip compression whenever possible (issue [#54](https://github.com/rlidwka/sinopia/issues/54))
- set `ignore_latest_tag` to false, it should now be more compatible with npm registry
- make `fs-ext` optional (issue [#61](https://github.com/rlidwka/sinopia/issues/61))
## 29 Mar 2014, version 0.7.1
- added `ignore_latest_tag` config param (issues [#55](https://github.com/rlidwka/sinopia/issues/55), [#59](https://github.com/rlidwka/sinopia/issues/59))
- reverted PR [#56](https://github.com/rlidwka/sinopia/issues/56) (see discussion in [#57](https://github.com/rlidwka/sinopia/issues/57))
## 13 Mar 2014, version 0.7.0
- config changes:
- breaking change: all time intervals are now specified in *seconds* instead of *milliseconds* for the sake of consistency. Change `timeout` if you have one!
- all time intervals now can be specified in [nginx notation](http://wiki.nginx.org/ConfigNotation), for example `1m 30s` will specify a 90 seconds timeout
- added `maxage` option to avoid asking public registry for the same data too often (issue [#47](https://github.com/rlidwka/sinopia/issues/47))
- added `max_fails` and `fail_timeout` options to reduce amount of requests to public registry when it's down (issue [#7](https://github.com/rlidwka/sinopia/issues/7))
- bug fixes:
- fix crash when headers are sent twice (issue [#52](https://github.com/rlidwka/sinopia/issues/52))
- all tarballs are returned with `Content-Length`, which allows [yapm](https://github.com/rlidwka/yapm) to estimate download time
- when connection to public registry is interrupted when downloading a tarball, we no longer save incomplete tarball to the disk
- other changes:
- 404 errors are returned in couchdb-like manner (issue [#56](https://github.com/rlidwka/sinopia/issues/56))
## 5 Mar 2014, version 0.6.7
- pin down express@3 version, since sinopia doesn't yet work with express@4
## 28 Feb 2014, version 0.6.5
- old SSL keys for npm are removed, solves `SELF_SIGNED_CERT_IN_CHAIN` error
## 3 Feb 2014, version 0.6.3
- validate tags and versions (issue [#40](https://github.com/rlidwka/sinopia/issues/40))
- don't crash when process.getuid doesn't exist (issue [#41](https://github.com/rlidwka/sinopia/issues/41))
## 18 Jan 2014, version 0.6.2
- adding config param to specify upload limits (issue [#39](https://github.com/rlidwka/sinopia/issues/39))
- making loose semver versions work (issue [#38](https://github.com/rlidwka/sinopia/issues/38))
## 13 Jan 2014, version 0.6.1
- support setting different storage paths for different packages (issue [#35](https://github.com/rlidwka/sinopia/issues/35))
## 30 Dec 2013, version 0.6.0
- tag support (issue [#8](https://github.com/rlidwka/sinopia/issues/8))
- adding support for npm 1.3.19+ behaviour (issue [#31](https://github.com/rlidwka/sinopia/issues/31))
- removing all support for proxying publish requests to uplink (too complex)
## 26 Dec 2013, version 0.5.9
- fixing bug with bad Accept header (issue [#32](https://github.com/rlidwka/sinopia/issues/32))
## 20 Dec 2013, version 0.5.8
- fixed a warning from js-yaml
- don't color multiline strings in logs output
- better error messages in various cases
- test format changed
## 15 Dec 2013, version 0.5.7
- try to fetch package from uplinks if user requested a tarball we don't know about (issue [#29](https://github.com/rlidwka/sinopia/issues/29))
- security fix: set express.js to production mode so we won't return stack traces to the user in case of errors
## 11 Dec 2013, version 0.5.6
- fixing a few crashes related to tags
## 8 Dec 2013, version 0.5.4
- latest tag always shows highest version available (issue [#8](https://github.com/rlidwka/sinopia/issues/8))
- added a configurable timeout for requests to uplinks (issue [#18](https://github.com/rlidwka/sinopia/issues/18))
- users with bad authentication header are considered not logged in (issue [#17](https://github.com/rlidwka/sinopia/issues/17))
## 24 Nov 2013, version 0.5.3
- added proxy support for requests to uplinks (issue [#13](https://github.com/rlidwka/sinopia/issues/13))
- changed license from default BSD to WTFPL
## 26 Oct 2013, version 0.5.2
- server now supports unpublishing local packages
- added fs-ext dependency (flock)
- fixed a few face conditions
## 20 Oct 2013, version 0.5.1
- fixed a few errors related to logging
## 12 Oct 2013, version 0.5.0
- using bunyan as a log engine
- pretty-formatting colored logs to stdout by default
- ask user before creating any config files
## 5 Oct 2013, version 0.4.3
- basic tags support for npm (read-only)
- npm star/unstar calls now return proper error
## 29 Sep 2013, version 0.4.2
## 28 Sep 2013, version 0.4.1
- using mocha for tests now
- making use of streams2 api, doesn't work on 0.8 anymore
- basic support for uploading packages to other registries
## 27 Sep 2013, version 0.4.0
- basic test suite
- storage path in config is now relative to config file location, not cwd
- proper cleanup for temporary files
## 12 Jul 2013, version 0.3.2
## 4 Jul 2013, version 0.3.1
- using ETag header for all json output, based on md5
## 20 Jun 2013, version 0.3.0
- compression for http responses
- requests for files to uplinks are now streams (no buffering)
- tarballs are now cached locally
## 19 Jun 2013, version 0.2.0
- config file changed, packages is now specified with minimatch
- ability to retrieve all packages from another registry (i.e. npmjs)
## 14 Jun 2013, version 0.1.1
- config is now autogenerated
- tarballs are now read/written from fs using streams (no buffering)
## 9 Jun 2013, version 0.1.0
- first npm version
- ability to publish packages and retrieve them locally
- basic authentication/access control
## 22 May 2013, version 0.0.0
- first commits

8
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,8 @@
# Contributing to Verdaccio
## Before submit a new issue
* Check if there's a simple solution in the wiki.
* Search for similar issues.
* [A quick look on Stackoverflow.](http://stackoverflow.com/questions/tagged/sinopia)
* [Check if there is a legacy sinopia plugin for the feature that you need](https://www.npmjs.com/search?q=sinopia)

13
Dockerfile.rpi Normal file
View File

@ -0,0 +1,13 @@
FROM hypriot/rpi-node:6-onbuild
RUN mkdir -p /verdaccio/storage /verdaccio/conf
WORKDIR /verdaccio
ADD conf/docker.yaml /verdaccio/conf/config.yaml
EXPOSE 4873
VOLUME ["/verdaccio/conf", "/verdaccio/storage"]
CMD ["/usr/src/app/bin/verdaccio", "--config", "/verdaccio/conf/config.yaml", "--listen", "0.0.0.0:4873"]

View File

@ -1,319 +0,0 @@
7 Jun 2015, version 1.4.0
- avoid sending X-Forwarded-For through proxies (issues [#19](https://github.com/rlidwka/sinopia/issues/19), [#254](https://github.com/rlidwka/sinopia/issues/254))
- fix multiple issues in search (issues [#239](https://github.com/rlidwka/sinopia/issues/239), [#253](https://github.com/rlidwka/sinopia/pull/253))
- fix "maximum stack trace exceeded" errors in auth (issue [#258](https://github.com/rlidwka/sinopia/issues/258))
10 May 2015, version 1.3.0
- add dist-tags endpoints (issue [#211](https://github.com/rlidwka/sinopia/issues/211))
22 Apr 2015, version 1.2.2
- fix access control regression in `1.2.1` (issue [#238](https://github.com/rlidwka/sinopia/issues/238))
- add a possibility to bind on unix sockets (issue [#237](https://github.com/rlidwka/sinopia/issues/237))
11 Apr 2015, version 1.2.1
- added more precise authorization control to auth plugins (issue [#207](https://github.com/rlidwka/sinopia/pull/207))
29 Mar 2015, version 1.1.0
- add a possibility to listen on multiple ports (issue [#172](https://github.com/rlidwka/sinopia/issues/172))
- added https support (issues [#71](https://github.com/rlidwka/sinopia/issues/71), [#166](https://github.com/rlidwka/sinopia/issues/166))
- added an option to use a custom template for web UI (issue [#208](https://github.com/rlidwka/sinopia/pull/208))
- remove "from" and "resolved" fields from shrinkwrap (issue [#204](https://github.com/rlidwka/sinopia/issues/204))
- fix hanging when rendering readme (issue [#206](https://github.com/rlidwka/sinopia/issues/206))
- fix logger-related crash when using sinopia as a library
- all requests to uplinks should now have proper headers
12 Feb 2015, version 1.0.1
- fixed issue with `max_users` option (issue [#184](https://github.com/rlidwka/sinopia/issues/184))
- fixed issue with not being able to disable the web interface (issue [#195](https://github.com/rlidwka/sinopia/pull/195))
- fixed 500 error while logging in with npm (issue [#200](https://github.com/rlidwka/sinopia/pull/200))
26 Jan 2015, version 1.0.0
- switch markdown parser from `remarkable` to `markdown-it`
- update `npm-shrinkwrap.json`
- now downloading tarballs from upstream using the same protocol as for metadata (issue [#166](https://github.com/rlidwka/sinopia/issues/166))
22 Dec 2014, version 1.0.0-beta.2
- fix windows behavior when `$HOME` isn't set (issue [#177](https://github.com/rlidwka/sinopia/issues/177))
- fix sanitization for highlighted code blocks in readme (issue [render-readme/#1](https://github.com/rlidwka/render-readme/issues/1))
15 Dec 2014, version 1.0.0-beta
- Markdown rendering is now a lot safer (switched to remarkable+sanitizer).
- Header in web interface is now static instead of fixed.
- `GET /-/all?local` now returns list of all local packages (issue [#179](https://github.com/rlidwka/sinopia/pull/179))
5 Dec 2014, version 1.0.0-alpha.3
- Fixed an issue with scoped packages in tarballs
25 Nov 2014, version 1.0.0-alpha
- Config file is now created in `$XDG_CONFIG_HOME` instead of current directory.
It is printed to stdout each time sinopia starts, so you hopefully won't have any trouble locating it.
The change is made so sinopia will pick up the same config no matter which directory it is started from.
- Default config file is now a lot shorter, and it is very permissive by default. You could use sinopia without modifying it on your own computer, but definitely should change it on production.
- Added auth tokens. For now, auth token is just a username+password encrypted for security reasons, so it isn't much different from basic auth, but allows to avoid "always-auth" npm setting.
- Added scoped packages.
Please note that default `*` mask won't apply to them. You have to use masks like `@scope/*` to match scoped packages, or `**` to match everything.
- Enabled web interface by default. Wow, it looks almost ready now!
- All dependencies are bundled now, so uncompatible changes in 3rd party stuff in the future won't ruin the day.
1 Nov 2014, version 0.13.2
- fix `EPERM`-related crashes on windows (issue [#67](https://github.com/rlidwka/sinopia/issues/67))
22 Oct 2014, version 0.13.0
- web interface:
- web page layout improved (issue [#141](https://github.com/rlidwka/sinopia/pull/141))
- latest version is now displayed correctly (issues [#120](https://github.com/rlidwka/sinopia/issues/120), [#123](https://github.com/rlidwka/sinopia/issues/123), [#143](https://github.com/rlidwka/sinopia/pull/143))
- fixed web interface working behind reverse proxy (issues [#145](https://github.com/rlidwka/sinopia/issues/145), [#147](https://github.com/rlidwka/sinopia/issues/147))
2 Oct 2014, version 0.12.1
- web interface:
- update markdown CSS (issue [#137](https://github.com/rlidwka/sinopia/pull/137))
- jquery is now served locally (issue [#133](https://github.com/rlidwka/sinopia/pull/133))
- bugfixes:
- fix "offset out of bounds" issues (issue [sinopia-htpasswd/#2](https://github.com/rlidwka/sinopia-htpasswd/issues/2))
- "max_users" in htpasswd plugin now work correctly (issue [sinopia-htpasswd/#3](https://github.com/rlidwka/sinopia-htpasswd/issues/3))
- fix `ENOTDIR, open '.sinopia-db.json'` error in npm search (issue [#122](https://github.com/rlidwka/sinopia/issues/122))
25 Sep 2014, version 0.12.0
- set process title to `sinopia`
- web interface bugfixes:
- save README data for each package (issue [#100](https://github.com/rlidwka/sinopia/issues/100))
- fix crashes related to READMEs (issue [#128](https://github.com/rlidwka/sinopia/issues/128))
18 Sep 2014, version 0.11.3
- fix 500 error in adduser function in sinopia-htpasswd (issue [#121](https://github.com/rlidwka/sinopia/issues/121))
- fix fd leak in authenticate function in sinopia-htpasswd (issue [#116](https://github.com/rlidwka/sinopia/issues/116))
15 Sep 2014, version 0.11.1
- mark crypt3 as optional (issue [#119](https://github.com/rlidwka/sinopia/issues/119))
15 Sep 2014, version 0.11.0
- Added auth plugins (issue [#99](https://github.com/rlidwka/sinopia/pull/99))
Now you can create your own auth plugin based on [sinopia-htpasswd](https://github.com/rlidwka/sinopia-htpasswd) package.
- WIP: web interface (issue [#73](https://github.com/rlidwka/sinopia/pull/73))
It is disabled by default, and not ready for production yet. Use at your own risk. We will enable it in the next major release.
- Some modules are now bundled by default, so users won't have to install stuff from git. We'll see what issues it causes, maybe all modules will be bundled in the future like in npm.
14 Sep 2014, version 0.10.x
*A bunch of development releases that are broken in various ways. Please use 0.11.x instead.*
7 Sep 2014, version 0.9.3
- fix several bugs that could cause "can't set headers" exception
3 Sep 2014, version 0.9.2
- allow "pretty" format for logging into files (issue [#88](https://github.com/rlidwka/sinopia/pull/88))
- remove outdated user existence check (issue [#115](https://github.com/rlidwka/sinopia/pull/115))
11 Aug 2014, version 0.9.1
- filter falsey _npmUser values (issue [#95](https://github.com/rlidwka/sinopia/pull/95))
- option not to cache third-party files (issue [#85](https://github.com/rlidwka/sinopia/issues/85))
26 Jul 2014, version 0.9.0
- new features:
- add search functionality (issue [#65](https://github.com/rlidwka/sinopia/pull/65))
- allow users to authenticate using .htpasswd (issue [#44](https://github.com/rlidwka/sinopia/issues/44))
- allow user registration with "npm adduser" (issue [#44](https://github.com/rlidwka/sinopia/issues/44))
- bugfixes:
- avoid crashing when res.socket is null (issue [#89](https://github.com/rlidwka/sinopia/issues/89))
20 Jun 2014, version 0.8.2
- allow '@' in package/tarball names (issue [#75](https://github.com/rlidwka/sinopia/issues/75))
- other minor fixes (issues [#77](https://github.com/rlidwka/sinopia/issues/77), [#80](https://github.com/rlidwka/sinopia/issues/80))
14 Apr 2014, version 0.8.1
- "latest" tag is now always present in any package (issue [#63](https://github.com/rlidwka/sinopia/issues/63))
- tags created with new npm versions (>= 1.3.19) can now be published correctly
1 Apr 2014, version 0.8.0
- use gzip compression whenever possible (issue [#54](https://github.com/rlidwka/sinopia/issues/54))
- set `ignore_latest_tag` to false, it should now be more compatible with npm registry
- make `fs-ext` optional (issue [#61](https://github.com/rlidwka/sinopia/issues/61))
29 Mar 2014, version 0.7.1
- added `ignore_latest_tag` config param (issues [#55](https://github.com/rlidwka/sinopia/issues/55), [#59](https://github.com/rlidwka/sinopia/issues/59))
- reverted PR [#56](https://github.com/rlidwka/sinopia/issues/56) (see discussion in [#57](https://github.com/rlidwka/sinopia/issues/57))
13 Mar 2014, version 0.7.0
- config changes:
- breaking change: all time intervals are now specified in *seconds* instead of *milliseconds* for the sake of consistency. Change `timeout` if you have one!
- all time intervals now can be specified in [nginx notation](http://wiki.nginx.org/ConfigNotation), for example `1m 30s` will specify a 90 seconds timeout
- added `maxage` option to avoid asking public registry for the same data too often (issue [#47](https://github.com/rlidwka/sinopia/issues/47))
- added `max_fails` and `fail_timeout` options to reduce amount of requests to public registry when it's down (issue [#7](https://github.com/rlidwka/sinopia/issues/7))
- bug fixes:
- fix crash when headers are sent twice (issue [#52](https://github.com/rlidwka/sinopia/issues/52))
- all tarballs are returned with `Content-Length`, which allows [yapm](https://github.com/rlidwka/yapm) to estimate download time
- when connection to public registry is interrupted when downloading a tarball, we no longer save incomplete tarball to the disk
- other changes:
- 404 errors are returned in couchdb-like manner (issue [#56](https://github.com/rlidwka/sinopia/issues/56))
5 Mar 2014, version 0.6.7
- pin down express@3 version, since sinopia doesn't yet work with express@4
28 Feb 2014, version 0.6.5
- old SSL keys for npm are removed, solves `SELF_SIGNED_CERT_IN_CHAIN` error
3 Feb 2014, version 0.6.3
- validate tags and versions (issue [#40](https://github.com/rlidwka/sinopia/issues/40))
- don't crash when process.getuid doesn't exist (issue [#41](https://github.com/rlidwka/sinopia/issues/41))
18 Jan 2014, version 0.6.2
- adding config param to specify upload limits (issue [#39](https://github.com/rlidwka/sinopia/issues/39))
- making loose semver versions work (issue [#38](https://github.com/rlidwka/sinopia/issues/38))
13 Jan 2014, version 0.6.1
- support setting different storage paths for different packages (issue [#35](https://github.com/rlidwka/sinopia/issues/35))
30 Dec 2013, version 0.6.0
- tag support (issue [#8](https://github.com/rlidwka/sinopia/issues/8))
- adding support for npm 1.3.19+ behaviour (issue [#31](https://github.com/rlidwka/sinopia/issues/31))
- removing all support for proxying publish requests to uplink (too complex)
26 Dec 2013, version 0.5.9
- fixing bug with bad Accept header (issue [#32](https://github.com/rlidwka/sinopia/issues/32))
20 Dec 2013, version 0.5.8
- fixed a warning from js-yaml
- don't color multiline strings in logs output
- better error messages in various cases
- test format changed
15 Dec 2013, version 0.5.7
- try to fetch package from uplinks if user requested a tarball we don't know about (issue [#29](https://github.com/rlidwka/sinopia/issues/29))
- security fix: set express.js to production mode so we won't return stack traces to the user in case of errors
11 Dec 2013, version 0.5.6
- fixing a few crashes related to tags
8 Dec 2013, version 0.5.4
- latest tag always shows highest version available (issue [#8](https://github.com/rlidwka/sinopia/issues/8))
- added a configurable timeout for requests to uplinks (issue [#18](https://github.com/rlidwka/sinopia/issues/18))
- users with bad authentication header are considered not logged in (issue [#17](https://github.com/rlidwka/sinopia/issues/17))
24 Nov 2013, version 0.5.3
- added proxy support for requests to uplinks (issue [#13](https://github.com/rlidwka/sinopia/issues/13))
- changed license from default BSD to WTFPL
26 Oct 2013, version 0.5.2
- server now supports unpublishing local packages
- added fs-ext dependency (flock)
- fixed a few face conditions
20 Oct 2013, version 0.5.1
- fixed a few errors related to logging
12 Oct 2013, version 0.5.0
- using bunyan as a log engine
- pretty-formatting colored logs to stdout by default
- ask user before creating any config files
5 Oct 2013, version 0.4.3
- basic tags support for npm (read-only)
- npm star/unstar calls now return proper error
29 Sep 2013, version 0.4.2
28 Sep 2013, version 0.4.1
- using mocha for tests now
- making use of streams2 api, doesn't work on 0.8 anymore
- basic support for uploading packages to other registries
27 Sep 2013, version 0.4.0
- basic test suite
- storage path in config is now relative to config file location, not cwd
- proper cleanup for temporary files
12 Jul 2013, version 0.3.2
4 Jul 2013, version 0.3.1
- using ETag header for all json output, based on md5
20 Jun 2013, version 0.3.0
- compression for http responses
- requests for files to uplinks are now streams (no buffering)
- tarballs are now cached locally
19 Jun 2013, version 0.2.0
- config file changed, packages is now specified with minimatch
- ability to retrieve all packages from another registry (i.e. npmjs)
14 Jun 2013, version 0.1.1
- config is now autogenerated
- tarballs are now read/written from fs using streams (no buffering)
9 Jun 2013, version 0.1.0
- first npm version
- ability to publish packages and retrieve them locally
- basic authentication/access control
22 May 2013, version 0.0.0
- first commits

View File

@ -1,12 +1,14 @@
`verdaccio` is a fork of `sinopia`. It aims to keep backwards compatibility with `sinopia`, while keeping up with npm changes.
`sinopia` - a private/caching npm repository server
`verdaccio` - a private/caching npm repository server
[![travis badge](http://img.shields.io/travis/verdaccio/verdaccio.svg)](https://travis-ci.org/verdaccio/verdaccio)
[![npm version badge](https://img.shields.io/npm/v/verdaccio.svg)](https://www.npmjs.org/package/verdaccio)
[![downloads badge](http://img.shields.io/npm/dm/verdaccio.svg)](https://www.npmjs.org/package/verdaccio)
It allows you to have a local npm registry with zero configuration. You don't have to install and replicate an entire CouchDB database. Verdaccio keeps its own small database and, if a package doesn't exist there, it asks npmjs.org for it keeping only those packages you use.
<p align="center"><img src="https://f.cloud.github.com/assets/999113/1795553/680177b2-6a1d-11e3-82e1-02193aa4e32e.png"></p>
<p align="center"><img src="https://firebasestorage.googleapis.com/v0/b/jotadeveloper-8d2f3.appspot.com/o/verdaccio2-compressor.png?alt=media&token=c9b01824-26f2-4cba-bd6f-f352e08cb8ff"></p>
## Use cases
@ -49,7 +51,7 @@ Now you can navigate to [http://localhost:4873/](http://localhost:4873/) where y
### Docker
To use the pre-built docker image:
To use the pre-built [docker image](https://hub.docker.com/r/verdaccio/verdaccio/):
`docker pull verdaccio/verdaccio`
@ -57,6 +59,15 @@ To build your own image:
`docker build -t verdaccio .`
There is also an npm script for building the docker image, so you can also do:
`npm run build-docker`
If you want to use the docker image on a rpi or a compatible device there is also a dockerfile available.
To build the docker image for raspberry pi execute:
`npm run build-docker:rpi`
To run the docker container:
```
@ -67,13 +78,19 @@ docker run -it --rm --name verdaccio -p 4873:4873 \
verdaccio
```
Please note that for any of the above docker commands you need to have docker installed on your machine and the docker executable should be available on your `$PATH`.
### Ansible
A Verdaccio playbook [is available at galaxy](https://galaxy.ansible.com/030/verdaccio) source: https://github.com/030/ansible-verdaccio
### Chef
A Sinopia Chef cookbook [is available at Opscode community](http://community.opscode.com/cookbooks/sinopia) source: https://github.com/BarthV/sinopia-cookbook
The Verdaccio Chef cookbook [is available via the chef supermarket](https://supermarket.chef.io/cookbooks/verdaccio). source: https://github.com/kgrubb/verdaccio-cookbook
### Puppet
A Sinopia puppet module [is available at puppet forge](http://forge.puppetlabs.com/saheba/sinopia) source: https://github.com/saheba/puppet-sinopia
The original Sinopia puppet module [is available at puppet forge](http://forge.puppetlabs.com/saheba/sinopia) source: https://github.com/saheba/puppet-sinopia
## Configuration
@ -85,7 +102,7 @@ When you start a server, it auto-creates a config file.
npm adduser --registry http://localhost:4873/
```
This will prompt you for user credentials which will be saved on the Verdaccio server.
This will prompt you for user credentials which will be saved on the `verdaccio` server.
## Using private packages
@ -121,23 +138,23 @@ Verdaccio aims to support all features of a standard npm client that make sense
Basic features:
- Installing packages (npm install, npm upgrade, etc.) - supported
- Publishing packages (npm publish) - supported
- Installing packages (npm install, npm upgrade, etc.) - **supported**
- Publishing packages (npm publish) - **supported**
Advanced package control:
- Unpublishing packages (npm unpublish) - supported
- Tagging (npm tag) - not yet supported, should be soon
- Unpublishing packages (npm unpublish) - **supported**
- Tagging (npm tag) - supported
- Deprecation (npm deprecate) - not supported
User management:
- Registering new users (npm adduser {newuser}) - supported
- Registering new users (npm adduser {newuser}) - **supported**
- Transferring ownership (npm owner add {user} {pkg}) - not supported, verdaccio uses its own acl management system
Misc stuff:
- Searching (npm search) - supported in the browser client but not command line
- Searching (npm search) - **supported** (cli / browser)
- Starring (npm star, npm unstar) - not supported, doesn't make sense in private registry
## Storage
@ -146,6 +163,8 @@ No CouchDB here. This application is supposed to work with zero configuration, s
If you want to use a database instead, ask for it, we'll come up with some kind of a plugin system.
About the storage there is a running discussion [here](https://github.com/verdaccio/verdaccio/issues?q=is%3Aissue+is%3Aopen+label%3Astorage).
## Similar existing things
- npm + git (I mean, using git+ssh:// dependencies) - most people seem to use this, but it's a terrible idea... *npm update* doesn't work, can't use git subdirectories this way, etc.
@ -153,5 +172,6 @@ If you want to use a database instead, ask for it, we'll come up with some kind
- [shadow-npm](https://github.com/dominictarr/shadow-npm), [public service](http://shadow-npm.net/) - it uses the same code as npmjs.org + service is dead
- [gemfury](http://www.gemfury.com/l/npm-registry) and others - those are closed-source cloud services, and I'm not in a mood to trust my private code to somebody (security through obscurity yeah!)
- npm-registry-proxy, npm-delegate, npm-proxy - those are just proxies...
- [nexus-repository-oss](https://www.sonatype.com/nexus-repository-oss) - Repository manager that handles more then just NPM dependencies
- Is there something else?
- [codebox-npm](https://github.com/craftship/codebox-npm) - Serverless private npm registry using

1
_config.yml Normal file
View File

@ -0,0 +1 @@
theme: jekyll-theme-cayman

View File

@ -3,7 +3,7 @@
# so don't use it on production systems.
#
# Look here for more config file examples:
# https://github.com/rlidwka/sinopia/tree/master/conf
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# path to a directory with all packages
@ -46,5 +46,4 @@ packages:
# log settings
logs:
- {type: stdout, format: pretty, level: http}
#- {type: file, path: sinopia.log, level: info}
#- {type: file, path: verdaccio.log, level: info}

View File

@ -20,6 +20,9 @@ web:
title: Verdaccio
# logo: logo.png
# template: custom.hbs
# tagline: "Some <b>HTML</b> enabled tagline that sits between the actual \
#header and the list of packages. You can even add <a \
#href=\"https://github.com\">links</a>!"
auth:
htpasswd:

View File

@ -2,7 +2,7 @@ require('es6-shim')
module.exports = require('./lib')
/**package
{ "name": "sinopia",
{ "name": "verdaccio",
"version": "0.0.0",
"dependencies": {"js-yaml": "*"},
"scripts": {"postinstall": "js-yaml package.yaml > package.json ; npm install"}

View File

@ -27,7 +27,7 @@
.npm-logo {
width: 79px;
height: @mainHeaderHeight;
// https://example.org/sinopia/-/static/../../-/logo
// https://example.org/verdaccio/-/static/../../-/logo
background-image: url( ../../-/logo );
background-repeat: no-repeat;
background-position: center center;

View File

@ -59,6 +59,13 @@
<code class="white no-bg">{{ baseUrl }}</code><br>
</header>
<header class="packages-header container">
{{#if tagline}}
<div class="row">
<div class="col-md-12">
{{{tagline}}}
</div>
</div>
{{/if}}
<div class="row">
<div class="col-md-5 hidden-xs hidden-sm">
<h2 class="title">Available Packages</h2>

View File

@ -30,7 +30,7 @@ function Auth(config) {
})
self.plugins.unshift({
sinopia_version: '1.1.0',
verdaccio_version: '1.1.0',
authenticate: function(user, password, cb) {
if (config.users != null
@ -377,4 +377,3 @@ function AuthenticatedUser(name, groups) {
real_groups: groups,
}
}

View File

@ -3,7 +3,7 @@
/*eslint no-sync:0*/
if (process.getuid && process.getuid() === 0) {
global.console.error("Sinopia doesn't need superuser privileges. Don't run it under root.")
global.console.error("Verdaccio doesn't need superuser privileges. Don't run it under root.")
}
process.title = 'verdaccio'
@ -39,7 +39,7 @@ commander
.parse(process.argv)
if (commander.args.length == 1 && !commander.config) {
// handling "sinopia [config]" case if "-c" is missing in commandline
// handling "verdaccio [config]" case if "-c" is missing in commandline
commander.config = commander.args.pop()
}
@ -115,14 +115,14 @@ function afterConfigLoad() {
'',
// commands are borrowed from node.js docs
'To quickly create self-signed certificate, use:',
' $ openssl genrsa -out ' + conf_path('sinopia-key.pem') + ' 2048',
' $ openssl req -new -sha256 -key ' + conf_path('sinopia-key.pem') + ' -out ' + conf_path('sinopia-csr.pem'),
' $ openssl x509 -req -in ' + conf_path('sinopia-csr.pem') + ' -signkey ' + conf_path('sinopia-key.pem') + ' -out ' + conf_path('sinopia-cert.pem'),
' $ openssl genrsa -out ' + conf_path('verdaccio-key.pem') + ' 2048',
' $ openssl req -new -sha256 -key ' + conf_path('verdaccio-key.pem') + ' -out ' + conf_path('verdaccio-csr.pem'),
' $ openssl x509 -req -in ' + conf_path('verdaccio-csr.pem') + ' -signkey ' + conf_path('verdaccio-key.pem') + ' -out ' + conf_path('verdaccio-cert.pem'),
'',
'And then add to config file (' + conf_path() + '):',
' https:',
' key: sinopia-key.pem',
' cert: sinopia-cert.pem',
' key: verdaccio-key.pem',
' cert: verdaccio-cert.pem',
].join('\n'))
process.exit(2)
}
@ -168,7 +168,7 @@ function afterConfigLoad() {
// undocumented stuff for tests
if (typeof(process.send) === 'function') {
process.send({ sinopia_started: true })
process.send({ verdaccio_started: true })
}
}
@ -177,4 +177,3 @@ process.on('uncaughtException', function(err) {
, 'uncaught exception, please report this\n@{err.stack}' )
process.exit(255)
})

View File

@ -193,4 +193,3 @@ module.exports.parse_interval = function(interval) {
})
return result
}

View File

@ -72,6 +72,7 @@ module.exports = function(config, auth, storage) {
next(template({
name: config.web && config.web.title ? config.web.title : 'Verdaccio',
tagline: config.web && config.web.tagline ? config.web.tagline : '',
packages: packages,
baseUrl: base,
username: req.remote_user.name,
@ -150,8 +151,10 @@ module.exports = function(config, auth, storage) {
}
})
app.get('/-/readme/:package/:version?', can('access'), function(req, res, next) {
storage.get_package(req.params.package, {req: req}, function(err, info) {
app.get('/-/readme(/@:scope?)?/:package/:version?', can('access'), function(req, res, next) {
var packageName = req.params.package;
if (req.params.scope) packageName = "@"+ req.params.scope + "/" + packageName;
storage.get_package(packageName, {req: req}, function(err, info) {
if (err) return next(err)
next( renderReadme(info.readme || 'ERROR: No README data found!') )
})

View File

@ -158,16 +158,16 @@ Storage.prototype.update_versions = function(name, newdata, callback) {
sha: verdata.dist.shasum,
}
if (verdata._sinopia_uplink) {
if (verdata._verdaccio_uplink) {
// if we got this information from a known registry,
// use the same protocol for the tarball
//
// see https://github.com/rlidwka/sinopia/issues/166
var tarball_url = URL.parse(hash.url)
var uplink_url = URL.parse(self.config.uplinks[verdata._sinopia_uplink].url)
var uplink_url = URL.parse(self.config.uplinks[verdata._verdaccio_uplink].url)
if (uplink_url.host === tarball_url.host) {
tarball_url.protocol = uplink_url.protocol
hash.registry = verdata._sinopia_uplink
hash.registry = verdata._verdaccio_uplink
hash.url = URL.format(tarball_url)
}
}
@ -695,4 +695,3 @@ var Path_Wrapper = (function() {
})()
module.exports = Storage

View File

@ -67,7 +67,7 @@ module.exports.setup = function(logs) {
})
var logger = new Logger({
name: 'sinopia',
name: 'verdaccio',
streams: streams,
serializers: {
err: Logger.stdSerializers.err,
@ -155,4 +155,3 @@ function print(type, msg, obj, colors) {
return ' ' + (pad(type)) + ' ' + sub + ' ' + finalmsg
}
}

View File

@ -110,7 +110,7 @@ module.exports.final = function(body, req, res, next) {
if (typeof(body) === 'object' && body != null) {
if (typeof(body.error) === 'string') {
res._sinopia_error = body.error
res._verdaccio_error = body.error
}
body = JSON.stringify(body, undefined, ' ') + '\n'
}
@ -123,7 +123,7 @@ module.exports.final = function(body, req, res, next) {
// send(null), send(204), etc.
}
} catch(err) {
// if sinopia sends headers first, and then calls res.send()
// if verdaccio sends headers first, and then calls res.send()
// as an error handler, we can't report error properly,
// and should just close socket
if (err.message.match(/set headers after they are sent/)) {
@ -168,7 +168,7 @@ module.exports.log = function(req, res, next) {
function log() {
var message = "@{status}, user: @{user}, req: '@{request.method} @{request.url}'"
if (res._sinopia_error) {
if (res._verdaccio_error) {
message += ', error: @{!error}'
} else {
message += ', bytes: @{bytes.in}/@{bytes.out}'
@ -180,7 +180,7 @@ module.exports.log = function(req, res, next) {
level : 35, // http
user : req.remote_user && req.remote_user.name,
status : res.statusCode,
error : res._sinopia_error,
error : res._verdaccio_error,
bytes : {
in : bytesin,
out : bytesout,
@ -201,4 +201,3 @@ module.exports.log = function(req, res, next) {
}
next()
}

View File

@ -1,5 +1,6 @@
var Handlebars = require('handlebars')
var request = require('request')
var Logger = require('./logger')
var handleNotify = function(metadata, notifyEntry) {
var regex
@ -17,9 +18,20 @@ var handleNotify = function(metadata, notifyEntry) {
body: content
}
if ( notifyEntry.headers ) {
options.headers = notifyEntry.headers
}
// provides fallback support, it's accept an Object {} and Array of {}
if ( config.notify.headers && Array.isArray(config.notify.headers) ) {
var header = {};
config.notify.headers.map(function(item) {
if (Object.is(item, item)) {
for (var key in item) {
header[key] = item[key];
}
}
});
options.headers = header;
} else if (Object.is(config.notify.headers, config.notify.headers)) {
options.headers = config.notify.headers;
}
options.method = notifyEntry.method
@ -27,7 +39,16 @@ var handleNotify = function(metadata, notifyEntry) {
options.url = notifyEntry.endpoint
}
request(options)
request(options, function(err, response, body) {
if (err) {
Logger.logger.error( { err: err }, ' notify error: @{err.message}' );
} else {
Logger.logger.info({ content: content}, 'A notification has been shipped: @{content}')
if (body) {
Logger.logger.debug( { body: body }, ' body: @{body}' );
}
}
});
}
module.exports.notify = function(metadata, config) {

View File

@ -20,7 +20,11 @@ function load_plugins(config, plugin_configs, params, sanity_check) {
// npm package
if (plugin === null && p.match(/^[^\.\/]/)) {
plugin = try_load('sinopia-' + p)
plugin = try_load('verdaccio-' + p)
// compatibility for old sinopia plugins
if(!plugin) {
plugin = try_load('sinopia-' + p)
}
}
if (plugin === null) {
@ -33,7 +37,7 @@ function load_plugins(config, plugin_configs, params, sanity_check) {
}
if (plugin === null) {
throw Error('"' + p + '" plugin not found\ntry "npm install sinopia-' + p + '"')
throw Error('"' + p + '" plugin not found\ntry "npm install verdaccio-' + p + '"')
}
if (typeof(plugin) !== 'function')

View File

@ -11,23 +11,23 @@ function HTPasswd(config, stuff) {
// config for this module
self._config = config
// sinopia logger
// verdaccio logger
self._logger = stuff.logger
// sinopia main config object
self._sinopia_config = stuff.config
// verdaccio main config object
self._verdaccio_config = stuff.config
// all this "sinopia_config" stuff is for b/w compatibility only
// all this "verdaccio_config" stuff is for b/w compatibility only
self._maxusers = self._config.max_users
if (!self._maxusers) self._maxusers = self._sinopia_config.max_users
if (!self._maxusers) self._maxusers = self._verdaccio_config.max_users
// set maxusers to Infinity if not specified
if (!self._maxusers) self._maxusers = Infinity
self._last_time = null
var file = self._config.file
if (!file) file = self._sinopia_config.users_file
if (!file) file = self._verdaccio_config.users_file
if (!file) throw new Error('should specify "file" in config')
self._path = Path.resolve(Path.dirname(self._sinopia_config.self_path), file)
self._path = Path.resolve(Path.dirname(self._verdaccio_config.self_path), file)
return self
}

View File

@ -1,5 +1,6 @@
var crypto = require('crypto')
var crypt3 = require('./crypt3')
var md5 = require('apache-md5')
var locker = require('../../file-locking')
// this function neither unlocks file nor closes it
@ -32,10 +33,12 @@ function verify_password(user, passwd, hash) {
return passwd === hash.substr(7)
} else if (hash.indexOf('{SHA}') === 0) {
return crypto.createHash('sha1').update(passwd, 'binary').digest('base64') === hash.substr(5)
} else if (crypt3) {
return crypt3(passwd, hash) === hash
} else {
return false
return (
// for backwards compatibility, first check md5 then check crypt3
md5(passwd, hash) === hash ||
crypt3(passwd, hash) === hash
)
}
}

View File

@ -12,7 +12,9 @@ function Search() {
}
Search.prototype.query = function(q) {
return this.index.search(q)
return q === '*'
? this.storage.config.localList.get().map( function( package ){ return { ref: package, score: 1 }; } )
: this.index.search(q);
}
Search.prototype.add = function(package) {
@ -45,4 +47,3 @@ Search.prototype.configureStorage = function(storage) {
}
module.exports = Search()

View File

@ -458,7 +458,7 @@ Storage.prototype._sync_package_with_uplinks = function(name, pkginfo, options,
for (var i in up_res.versions) {
// this won't be serialized to json,
// kinda like an ES6 Symbol
Object.defineProperty(up_res.versions[i], '_sinopia_uplink', {
Object.defineProperty(up_res.versions[i], '_verdaccio_uplink', {
value : up.upname,
enumerable : false,
configurable : false,
@ -519,4 +519,3 @@ Storage._merge_versions = function(local, up, config) {
}
}
}

View File

@ -199,7 +199,7 @@ Storage.prototype.request = function(options, cb) {
var status_called = false
req.on('response', function(res) {
if (!req._sinopia_aborted && !status_called) {
if (!req._verdaccio_aborted && !status_called) {
status_called = true
self.status_check(true)
}
@ -216,7 +216,7 @@ Storage.prototype.request = function(options, cb) {
}
})
req.on('error', function(_err) {
if (!req._sinopia_aborted && !status_called) {
if (!req._verdaccio_aborted && !status_called) {
status_called = true
self.status_check(false)
}
@ -390,6 +390,5 @@ Storage.prototype._add_proxy_headers = function(req, headers) {
? req.headers['via'] + ', '
: ''
headers['Via'] += '1.1 ' + this.server_id + ' (Sinopia)'
headers['Via'] += '1.1 ' + this.server_id + ' (Verdaccio)'
}

View File

@ -73,7 +73,7 @@ module.exports.filter_tarball_urls = function(pkg, req, config) {
for (var ver in pkg.versions) {
var dist = pkg.versions[ver].dist
if (dist != null && dist.tarball != null) {
//dist.__sinopia_orig_tarball = dist.tarball
//dist.__verdaccio_orig_tarball = dist.tarball
dist.tarball = filter(dist.tarball)
}
}

View File

@ -1,6 +1,6 @@
{
"name": "verdaccio",
"version": "2.1.0",
"version": "2.1.4",
"description": "Private npm repository server",
"author": {
"name": "Alex Kocharin",
@ -16,6 +16,7 @@
},
"dependencies": {
"JSONStream": "^1.1.1",
"apache-md5": "^1.1.2",
"async": "^2.0.1",
"body-parser": "^1.15.0",
"bunyan": "^1.8.0",
@ -38,24 +39,24 @@
"render-readme": "^1.3.1",
"request": "^2.72.0",
"semver": "^5.1.0",
"symbol": "^0.2.1",
"unix-crypt-td-js": "^1.0.0"
},
"devDependencies": {
"rimraf": "^2.5.2",
"bluebird": "^3.3.5",
"mocha": "^2.4.5",
"eslint": "^2.9.0",
"browserify": "^13.0.0",
"browserify-handlebars": "^1.0.0",
"eslint": "^2.9.0",
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0",
"grunt-browserify": "^5.0.0",
"grunt-cli": "^1.2.0",
"grunt-contrib-less": "^1.3.0",
"grunt-contrib-watch": "^1.0.0",
"unopinionate": "^0.0.4",
"mocha": "^2.4.5",
"nyc": "^10.1.2",
"onclick": "^0.1.0",
"transition-complete": "^0.0.2"
"rimraf": "^2.5.2",
"transition-complete": "^0.0.2",
"unopinionate": "^0.0.4"
},
"keywords": [
"private",
@ -68,12 +69,15 @@
],
"scripts": {
"test": "eslint . && mocha ./test/functional ./test/unit",
"test-travis": "eslint . && mocha -R spec ./test/functional ./test/unit",
"test:coverage": "nyc --reporter=html --reporter=text mocha -R spec ./test/functional ./test/unit",
"test-travis": "eslint . && npm run test:coverage",
"test-only": "mocha ./test/functional ./test/unit",
"lint": "eslint ."
"lint": "eslint .",
"build-docker": "docker build -t verdaccio .",
"build-docker:rpi": "docker build -f Dockerfile.rpi -t verdaccio:rpi ."
},
"engines": {
"node": ">=0.10"
"node": ">=4"
},
"preferGlobal": true,
"publishConfig": {

6
scripts/generate_authors.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
git shortlog -se \
| perl -spe 's/^\s+\d+\s+//' \
| sed -e '/^CommitSyncScript.*$/d' \
> AUTHORS

12
systemd/verdaccio.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=verdaccio Service
[Service]
Type=simple
User=verdaccio
WorkingDirectory=/home/verdaccio
ExecStart=/usr/local/lib/npm/bin/verdaccio
ExecStop=/usr/bin/bash -c "kill $(ps -ef | grep ^verdacc+ | awk {'print $2'})"
[Install]
WantedBy=multi-user.target

View File

@ -1,7 +1,7 @@
All tests are split in three folders:
- `unit` - Tests that cover functions that transform data in an non-trivial way. These tests simply `require()` a few files and run code in there, so they are very fast.
- `functional` - Tests that launch a sinopia instance and perform a series of requests to it over http. They are slower than unit tests.
- `integration` - Tests that launch a sinopia instance and do requests to it using npm. They are really slow and can hit a real npm registry.
- `functional` - Tests that launch a verdaccio instance and perform a series of requests to it over http. They are slower than unit tests.
- `integration` - Tests that launch a verdaccio instance and do requests to it using npm. They are really slow and can hit a real npm registry.
Unit and functional tests are executed automatically by running `npm test` from the project's root directory. Integration tests are supposed to be executed manually from time to time.

View File

@ -1,4 +1,6 @@
var Server = require('./lib/server')
var fs = require('fs')
var path = require('path')
module.exports = function() {
var server = new Server('http://localhost:55551/')
@ -26,4 +28,20 @@ module.exports = function() {
.body_error(/maximum amount of users reached/)
})
})
describe('adduser created with htpasswd', function() {
var user = 'preexisting'
var pass = 'preexisting'
before(function () {
return fs.appendFileSync(
path.join(__dirname, 'test-storage', '.htpasswd'),
'preexisting:$apr1$4YSboUa9$yVKjE7.PxIOuK3M4D7VjX.'
)
})
it('should log in', function () {
return server.auth(user, pass)
.status(201)
.body_ok(/you are authenticated as/)
})
})
}

View File

@ -2,7 +2,6 @@
var assert = require('assert')
var request = require('request')
var Promise = require('bluebird')
var Symbol = require('symbol')
var sym = Symbol('smart_request_data')
function smart_request(options) {

View File

@ -23,7 +23,7 @@ module.exports.start = function start(dir, conf, cb) {
)
forks.push(f)
f.on('message', function(msg) {
if ('sinopia_started' in msg) {
if ('verdaccio_started' in msg) {
cb(), cb = function(){}
}
})
@ -38,4 +38,3 @@ process.on('exit', function() {
if (forks[0]) forks[0].kill()
if (forks[1]) forks[1].kill()
})

View File

@ -8,7 +8,7 @@ function Plugin(config, stuff) {
}
// plugin is expected to be compatible with...
Plugin.prototype.sinopia_version = '1.1.0'
Plugin.prototype.verdaccio_version = '1.1.0'
Plugin.prototype.authenticate = function(user, password, cb) {
var self = this
@ -23,4 +23,3 @@ Plugin.prototype.authenticate = function(user, password, cb) {
}
return cb(null, [ user ])
}

View File

@ -8,7 +8,7 @@ function Plugin(config, stuff) {
}
// plugin is expected to be compatible with...
Plugin.prototype.sinopia_version = '1.1.0'
Plugin.prototype.verdaccio_version = '1.1.0'
Plugin.prototype.allow_access = function(user, package, cb) {
var self = this
@ -28,4 +28,3 @@ Plugin.prototype.allow_access = function(user, package, cb) {
}
return cb(null, true)
}

View File

@ -1,4 +1,4 @@
storage: ./.sinopia_test_env/test-storage
storage: ./.verdaccio_test_env/test-storage
users:
test:
@ -22,4 +22,3 @@ packages:
allow_publish: all
listen: 55501

View File

@ -6,8 +6,8 @@ use strict;
# setting up working environment && chdir there
use Cwd 'abs_path';
use File::Basename;
$ENV{HOME} = dirname(abs_path( __FILE__ )) . '/.sinopia_test_env';
system('rm -rf .sinopia_test_env ; mkdir .sinopia_test_env') and quit('fail');
$ENV{HOME} = dirname(abs_path( __FILE__ )) . '/.verdaccio_test_env';
system('rm -rf .verdaccio_test_env ; mkdir .verdaccio_test_env') and quit('fail');
chdir $ENV{HOME};
use Data::Dumper;
@ -18,16 +18,16 @@ sub quit {
exec("kill $pid ; exit 1");
}
# run sinopia in a child process
# run verdaccio in a child process
if (($pid = fork()) == 0) {
exec "../../../bin/sinopia ../config.yaml";
exec "../../../bin/verdaccio ../config.yaml";
die "exec failed";
}
system('mkdir node_modules') and quit('fail');
system('npm set sinopia_test_config 12345') and quit('fail');
system('npm set verdaccio_test_config 12345') and quit('fail');
if (`cat .npmrc` !~ /sinopia_test_config/) {
if (`cat .npmrc` !~ /verdaccio_test_config/) {
quit "npm is using wrong config";
}
@ -37,14 +37,13 @@ system(q{/bin/echo -e 'test\ntest\ns@s.s\n' | npm adduser}) and quit('fail');
system('npm install jju') and quit('fail');
(`node -e 'console.log(require("jju").parse("{qwerty:123}").qwerty+456)'` =~ /579/) or quit('fail');
system('npm publish ../sinopia-test-1.2.3.tgz') and quit('fail');
system('npm tag sinopia-test@1.2.3 meow') and quit('fail');
system('npm install sinopia-test@meow') and quit('fail');
system('npm publish ../verdaccio-test-1.2.3.tgz') and quit('fail');
system('npm tag verdaccio-test@1.2.3 meow') and quit('fail');
system('npm install verdaccio-test@meow') and quit('fail');
(`node -e 'require("sinopia-test")'` =~ /w==w/) or quit('fail');
(`node -e 'require("verdaccio-test")'` =~ /w==w/) or quit('fail');
quit("
==================================================================
All tests seem to be executed successfully, nothing is broken yet.
==================================================================");

View File

@ -0,0 +1,13 @@
var config = {
storage: __dirname + '/test-storage',
packages: {
'*': {
allow_access: '$all',
},
},
logs: [
{type: 'stdout', format: 'pretty', level: 'fatal'}
],
}
module.exports = config;

66
test/unit/search.js Normal file
View File

@ -0,0 +1,66 @@
var assert = require('assert');
var Search = require('../../lib/search');
var Storage = require('../../lib/storage');
var config_hash = require('./partials/config');
var Config = require('../../lib/config');
require('../../lib/logger').setup([]);
var packages = [
{
name: 'test1',
description: 'description',
_npmUser: {
name: 'test_user',
}
},
{
name: 'test2',
description: 'description',
_npmUser: {
name: 'test_user',
}
},
{
name: 'test3',
description: 'description',
_npmUser: {
name: 'test_user',
}
},
]
describe('search', function() {
before(function() {
var config = Config(config_hash);
this.storage = new Storage(config);
Search.configureStorage(this.storage);
packages.map(function(item) {
Search.add(item);
});
});
it('search query item', function() {
var result = Search.query('t');
assert(result.length === 3);
})
it('search remove item', function() {
var item = {
name: 'test6',
description: 'description',
_npmUser: {
name: 'test_user',
}
};
Search.add(item);
var result = Search.query('test6');
assert(result.length === 1);
Search.remove(item.name);
var result = Search.query('test6');
assert(result.length === 0);
})
})

View File

@ -2,19 +2,8 @@ var assert = require('assert')
var express = require('express')
var request = require('request')
var rimraf = require('rimraf')
var sinopia = require('../../')
var config = {
storage: __dirname + '/test-storage',
packages: {
'*': {
allow_access: '$all',
},
},
logs: [
{type: 'stdout', format: 'pretty', level: 'fatal'}
],
}
var verdaccio = require('../../')
var config = require('./partials/config');
describe('toplevel', function() {
var port
@ -25,7 +14,7 @@ describe('toplevel', function() {
before(function(done) {
var app = express()
app.use(sinopia(config))
app.use(verdaccio(config))
var server = require('http').createServer(app)
server.listen(0, function() {

View File

@ -3,7 +3,7 @@ var validate = require('../../lib/utils').validate_name
describe('Validate', function() {
it('good ones', function() {
assert( validate('sinopia') )
assert( validate('verdaccio') )
assert( validate('some.weird.package-zzz') )
assert( validate('old-package@0.1.2.tgz') )
})