# install Node.js as described in nodeondigitalocean.sh
# install nginx as described in nginxondigitalcoean.sh
npm install -g sinopia
replace /etc/nginx/sites-available/default with this content
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://localhost:4873;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
sudo service nginx restart
add your user from your local npm:
npm adduser --registry http://<publicip>
change the config.yml on your sinopia box
disable registration for new anon users:
max_users: -1
restrict access to everthing for authenticated users only:
packages:
'@*/*':
# scoped packages
access: $authenticated
publish: $authenticated
'*':
# allow all users (including non-authenticated users) to read and
# publish all packages
#
# you can specify usernames/groupnames (depending on your auth plugin)
# and three keywords: "$all", "$anonymous", "$authenticated"
access: $authenticated
# allow all known users to publish packages
# (anyone can register by default, remember?)
publish: $authenticated
# if package is not available locally, proxy requests to 'npmjs' registry
proxy: npmjs
'prefixed-*':
access: $authenticated
publish: $authenticated
access the registry on your local machine:
npm set registry <publicip>
npm login
npm install something
npm publish something
Make your registry run forever:
npm install -g pm2
pm2 startup ubuntu
which sinopia
/root/.nvm/versions/node/v0.12.7/bin/sinopia
pm2 start /root/.nvm/versions/node/v0.12.7/bin/sinopia