10er10 中文文档教程
10er10 是一个 HTML5 音频自动点唱机。 它适用于 Firefox 4+ 和 Chromium/Chrome。
Install
Install servers
- CouchDB : the safe way is to install CouchDB by downloading the CouchBase Server ( http://www.couchbase.com/ ). You can also try from source ( http://couchdb.apache.org ), or via your package manager.
最低要求版本:1.0.1
- Node.js : install node.js ( http://nodejs.org ) from source or with your package manager.
最低要求版本:0.6.0
不要忘记将节点二进制文件的文件夹添加到将运行 10er10 的 Unix 用户的路径中。
Debian 挤压用户,使用 nodejs deb 包:你应该创建一个从 /usr/lib/nodejs 到 /usr/lib/node 的符号链接,以便连接工作。
- NPM : install the Node package manager ( http://npmjs.org ). As of node.js 0.6.3, NPM is now included: no more need to install it !
提示:curl http://npmjs.org/install.sh | sh
请检查您的 npm 版本(使用命令 npm -v)是 >= 1.0.0 。
Install audio utilities
10er10 网站允许您上传 flac、mp3、m4a 和 ogg 音频文件。 Flac、mp3 和 m4a 文件将即时转换为 ogg。
安装 lame 可执行文件:它肯定可以从你的分发包中获得
安装 oggenc 可执行文件:它肯定可以从你的分发包中
获得当然可以从你的分发包中
安装 vorbiscomment 可执行文件:它肯定可以从你的分发包中
安装 flac 可执行文件:它肯定可以从你的分发包中
安装 faad 可执行文件:它当然可以从您的分发包
Install graphics utilities
中获得 10er10 网站允许您上传与歌曲相关的图像(例如专辑插图)。
- install GraphicsMagick executables : it's certainly available from your distribution packages
About 10er10 running environments
10er10 有两个不同的环境:dev 和 prod。 主要区别在于,在 prod 环境中,所有静态文件都由 node.js 服务器缓存(因此它们只从文件系统中读取一次)。
10er10 dev HTTP 端口是 8888。10er10 prod HTTP 端口是 8124。
Install 10er10 files & required node modules
解压/tar 你的 10er10 下载。
cd 到 10er10 根目录(包含 audio、node 和 views 文件夹的目录)。
节点模块:安装所需的节点包:
npm install
您现在应该有一个新的 node_modules 文件夹,与“音频”、“节点”和“视图”文件夹处于同一级别。
Configure 10er10
从 0.6 开始,调整配置的首选方法是创建一个新文件 node/config.local.js 并放置要覆盖的设置。
示例:如果您需要将音频文件的存储路径设置为/some/where/on/the/disk,打开node/config.local.js并定义里面的变量: like :
exports.audio = { dir: "/some/where/on/the/disk" };
这样做,当你升级你的 10er10 服务器时,你的配置将被保留。
打开node/config.js
- setup your databases configuration
10er10使用4个couchdb数据库。 查看 exports.couchprod 和 exports.couchdev 对象,然后确保将 DSN 指向您的 CouchDB 服务器。 数据库将由安装程序创建。
- configure audio path
10er10 需要两个不同的文件夹来存储音频文件:
- exports.audio.tmpdir : the temporary folder is where the uploaded files are stored
- exports.audio.dir : this is where the ogg files are stored.
当然,这两个文件夹应该可以由将启动节点服务器的 unix 用户写入。
- configure images path
10er10 需要两个不同的文件夹来存储图像:
exports.images.tmpdir :临时文件夹是存储上传文件的地方(可能与 exports.audio.tmpdir 相同)
exports.images.dir :这是存储图像的地方.
关于音频 URI
exports.audioroot 浏览器使用它来了解音频文件的路径。 如果您的 10er10 根是“/”,那么音频根是“/audio”。 如果您的 10er10 根目录是“/somewhere/10er10”,请将 audio_root 设置为“/somewhere/10er10/audio”。 您还可以设置完整的 URL(例如 http://my.domain.com/10er10/audio)。 除非您在反向代理后面并且知道自己在做什么,否则不要更改此设置。
- configure Unix utilities
查看 exports.cmds。
- exports.cmds.lame : the path to the lame executable
- exports.cmds.oggenc : the path to the oggenc executable
- exports.cmds.ogginfo : the path to the ogginfo executable
- exports.cmds.vorbiscomment : the path to the vorbiscomment executable
- exports.cmds.flac : the path to the flac executable
- exports.cmds.faad : the path to the faad executable
还在 ? 让我们去有趣的部分。
Launch the installer
进入 node/install 目录并运行 installer.js 脚本。
设置开发数据库:
cd node/install
node install.js
设置生产数据库:
cd node/install
node install.js -p
Create a 10er10 user
进入 node/admin 目录并运行 d10-createUser.js 脚本。
密码应该足够硬,否则将无法创建帐户。 (至少 8 个字符,至少 4 个不同的字符)。
不起作用:
test
xxxxxxxx
在开发安装上
cd node/admin
node d10-createUser.js login thepassword
创建用户:在生产安装上创建用户:
cd node/admin
node d10-createUser.js login thepassword -p
Launch the server
进入节点目录并运行 server.js 脚本:
启动开发实例:
cd node
node server.js
启动生产实例:
cd node
node server.js -p
你可以解雇你浏览器并转到 http://[your server]:8888/ 如果你启动了开发实例,http://[your server]:8124/ 如果你启动了 prod 服务器。
Bonus: Configure your invites server
您想给一些朋友发一封电子邮件,以便他们可以在您的 10er10 服务器上创建一个帐户并开始使用该应用程序吗? doc 文件夹包含一个文件,可帮助您配置邀请服务器。
What else ?
分叉、修补、发送拉取请求!
关注 10er10 开发:https://plus.google.com/u/0/b/109983204693472020055/
10er10 is an HTML5 audio jukebox. It works on Firefox 4+ and Chromium/Chrome.
Install
Install servers
- CouchDB : the safe way is to install CouchDB by downloading the CouchBase Server ( http://www.couchbase.com/ ). You can also try from source ( http://couchdb.apache.org ), or via your package manager.
Minimum required version : 1.0.1
- Node.js : install node.js ( http://nodejs.org ) from source or with your package manager.
Minimum required version : 0.6.0
Don't forget to add the node binary's folder to the path of the Unix user which will run 10er10.
Debian squeeze users, using the nodejs deb package : you should create a symlink from /usr/lib/nodejs to /usr/lib/node for connect to work.
- NPM : install the Node package manager ( http://npmjs.org ). As of node.js 0.6.3, NPM is now included: no more need to install it !
Hint : curl http://npmjs.org/install.sh | sh
Please check that your npm version (using the command npm -v) is >= 1.0.0 .
Install audio utilities
10er10 website allows you to upload flac, mp3, m4a and ogg audio files. Flac, mp3 and m4a files will be converted on the fly to ogg.
install lame executable : it's certainly is available from your distribution packages
install oggenc executable : it's certainly is available from your distribution packages
install ogginfo executable : it's certainly available from your distribution packages
install vorbiscomment executable : it's certainly available from your distribution packages
install flac executable : it's certainly available from your distribution packages
install faad executable : it's certainly available from your distribution packages
Install graphics utilities
10er10 website allows you to upload images related to songs (eg. album artwork).
- install GraphicsMagick executables : it's certainly available from your distribution packages
About 10er10 running environments
10er10 got two distinct environments : dev and prod. The main difference is that, in the prod environment, all static files are cached by the node.js server (so they are read only once from the filesystem).
10er10 dev HTTP port is 8888. 10er10 prod HTTP port is 8124.
Install 10er10 files & required node modules
Unzip/tar your 10er10 download.
cd to the 10er10 root directory (the one that contains the audio, node and views folders).
node modules : install required node packages :
npm install
You should now have a new node_modules folder at the same level as the "audio", "node" and "views" folders.
Configure 10er10
Beginning from 0.6, the preferred way to tweak the configuration is to create a new file node/config.local.js and put the settings you want to overwrite.
Example : if you need to set the path where audio file are stored to /some/where/on/the/disk, open node/config.local.js and define the variable inside: like :
exports.audio = { dir: "/some/where/on/the/disk" };
Doing this, your configuration will be kept when you upgrade your 10er10 server.
Open node/config.js
- setup your databases configuration
10er10 uses 4 couchdb databases. Look at exports.couchprod and exports.couchdev objects, and be sure to point the DSN to your CouchDB server. Databases will be created by the installer.
- configure audio path
10er10 needs two distinct folders to store audio files:
- exports.audio.tmpdir : the temporary folder is where the uploaded files are stored
- exports.audio.dir : this is where the ogg files are stored.
Of course, those two folders should be writable by the unix user that will launch the node server.
- configure images path
10er10 needs two distinct folders to store images:
exports.images.tmpdir : the temporary folder is where the uploaded files are stored (could be the same than exports.audio.tmpdir)
exports.images.dir : this is where the images are stored.
about audio URI
exports.audioroot is used by the browser to know where is the path to the audio files. If your 10er10 root is "/", then the audioroot is "/audio". If your 10er10 root is "/somewhere/10er10", set audio_root to "/somewhere/10er10/audio". You can also set the complete URL ( eg http://my.domain.com/10er10/audio ). Unless you're behind a reverse proxy and you know what you're doing, don't change this setting.
- configure Unix utilities
Look at exports.cmds.
- exports.cmds.lame : the path to the lame executable
- exports.cmds.oggenc : the path to the oggenc executable
- exports.cmds.ogginfo : the path to the ogginfo executable
- exports.cmds.vorbiscomment : the path to the vorbiscomment executable
- exports.cmds.flac : the path to the flac executable
- exports.cmds.faad : the path to the faad executable
Still here ? Let's go for the fun part.
Launch the installer
go into the node/install directory and run the installer.js script.
To setup dev databases:
cd node/install
node install.js
To setup prod databases:
cd node/install
node install.js -p
Create a 10er10 user
Go into the node/admin directory and run the d10-createUser.js script.
The password should be hard enough, or the account won't be created. (at least 8 characters, at least 4 distinct characters).
Won't work :
test
xxxxxxxx
To create a user on dev install :
cd node/admin
node d10-createUser.js login thepassword
To create a user on prod install :
cd node/admin
node d10-createUser.js login thepassword -p
Launch the server
Go into the node directory and run the server.js script :
To launch the dev instance :
cd node
node server.js
To launch the prod instance :
cd node
node server.js -p
You can fire you browser and go to http://[your server]:8888/ if you launched the dev instance, http://[your server]:8124/ if you launched the prod server.
Bonus: Configure your invites server
You want to send some friends an email so they can create an account on your 10er10 server and start using the application ? The doc folder contains a file to help you configure invites server.
What else ?
Fork, patch, send pull requests !
Follow 10er10 development : https://plus.google.com/u/0/b/109983204693472020055/