Permalink
Browse files

working auth tokens and form tokens, authtokens checked but not enfor…

…ced for now, fixes from max for mac and boost 1.35
  • Loading branch information...
1 parent da2e7f8 commit 18fb4d038e57bd770893253db14fd787b4cc07dc @RJ committed Mar 11, 2009
@@ -14,9 +14,9 @@ SET(CMAKE_INSTALL_PREFIX "/usr/local")
FIND_PACKAGE(Taglib 1.5.0 REQUIRED)
FIND_PACKAGE(Boost 1.35 REQUIRED COMPONENTS filesystem system regex thread program_options)
-FIND_PACKAGE(OsspUuid)
-FIND_PACKAGE(Uriparser 0.7.0)
-FIND_PACKAGE(Sqlite3)
+FIND_PACKAGE(OsspUuid REQUIRED)
+FIND_PACKAGE(Uriparser 0.7.0 REQUIRED)
+FIND_PACKAGE(Sqlite3 REQUIRED)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/includes # playdar includes
@@ -8,7 +8,12 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Uriparser DEFAULT_MSG URIPARSER_LIBRARIES URIP
IF (URIPARSER_FOUND)
INCLUDE(CheckLibraryExists)
- CHECK_LIBRARY_EXISTS(${URIPARSER_LIBRARIES} uriUnescapeInPlaceA "" URIPARSER_NEED_PREFIX)
+ CHECK_LIBRARY_EXISTS(${URIPARSER_LIBRARIES} uriDissectQueryMallocA "" URIPARSER_NEED_PREFIX)
+
+ IF (!URIPARSER_FOUND_SYMBOL)
+ MESSAGE( FATAL_ERROR "Your liburiparser is too old" )
+ SET (URIPARSER_FOUND FALSE)
+ ENDIF (!URIPARSER_FOUND_SYMBOL)
ENDIF (URIPARSER_FOUND)
MARK_AS_ADVANCED (URIPARSER_FOUND_INCLUDE_DIR URIPARSER_FOUND_LIBRARIES)
View
@@ -19,9 +19,6 @@ Assuming debian/ubuntu. Otherwise find similarly named packages:
NB: "libossp-uuid" is different to "libuuid" in debian.
make sure you install the correct uuid package.
- NB: if you defined LAME_UUIDS_PLEASE you don't need the uuid library.
- (it creates them using the cstdlib rand() function)
-
2) Need boost, but also boost::asio, which was only added to boost "recently".
If your distro has >= boost 1.35 then install all the 1.35 boost packages
you can find, including -dev versions, and it will work. Deb/Lenny has it.
@@ -36,9 +33,10 @@ Assuming debian/ubuntu. Otherwise find similarly named packages:
| sed 's/-gcc43-mt//'`; echo $L; ln -s $f $L; done
-3) You need liburiparser 0.7.0 or higher. If you're running Ubuntu Hardy,
- you'll have to install from source, Ibex has it in apt.
-
+3) You need liburiparser 0.7.0 or higher.
+ The version in ubuntu Ibex is too old - build from source.
+ http://uriparser.sourceforge.net/
+
Mac Dependencies
----------------
@@ -52,44 +50,46 @@ Using Leopard MacPorts:
Windows Dependenceies
---------------------
Good luck! Just install everything listed and hope for the best.
+It is known to work.
Compile it:
-----------
-0) Look in CMakeLists.txt at the include/library paths and make changes if
- you've installed boost/something in unusual places.
+If you've installed something in non-standard locations, look in CMakeLists.txt
+at the include/library paths and make changes if need be.
+
+ $ cd playdar-daemon
+ $ cd build
+ $ cmake ..
+
+Build the daemon with built-in local library resolver:
+
+ $ make playdar
-1)
- $ mkdir build
- $ cd build
- $ cmake ..
-2)
- $ make
+Build the other plugins:
-This will build the daemon with built-in local library resolver.
-To build other plugins:
- $ make lan_udp
- $ make gateway_script
- $ make darknet
+ $ make lan_udp
+ $ make gateway_script # NB: requires boost >=1.37
+ $ make darknet
-Or to just build all additional resolver plugins:
- $ make all
+Or to just build everything at once:
+ $ make
First Run and Scanning
----------------------
Make the empty database:
- $ sqlite3 ./collection.db < etc/schema.sql #>
+ $ sqlite3 ./collection.db < etc/schema.sql
Now run the scanner to index your music:
- $ ./scanner ./collection.db /your/mp3/dir
+ $ ./scanner ./collection.db /your/mp3/dir
Running Playdar
---------------
-Edit etc/playdar.conf and specify your name, private ip etc.
+Edit etc/playdar.conf and specify your name etc.
Run playdar from the playdar-daemon directory:
$ ./bin/playdar -c ./etc/playdar.conf
@@ -75,6 +75,14 @@ CREATE TABLE IF NOT EXISTS file_join (
album INTEGER REFERENCES album(id) ON DELETE CASCADE ON UPDATE CASCADE
);
---
+-- HTTP Authentication
+
+CREATE TABLE IF NOT EXISTS playdar_auth (
+ token TEXT NOT NULL PRIMARY KEY,
+ website TEXT NOT NULL,
+ name TEXT NOT NULL,
+ mtime INTEGER NOT NULL,
+ permissions TEXT NOT NULL
+);
@@ -13,7 +13,7 @@ lan_udp::init(playdar::Config * c, Resolver * r)
( boost::asio::ip::address::from_string
(conf()->get<string> ("plugins.lan_udp.multicast")),
conf()->get<int>("plugins.lan_udp.port"));
- boost::thread m_responder_thread(&lan_udp::run, this);
+ boost::thread m_responder_thread(boost::bind(&lan_udp::run, this));
}
lan_udp::~lan_udp() throw()
@@ -97,11 +97,10 @@ int main(int ac, char *av[])
// start http server:
string ip = "0.0.0.0";
- boost::thread http_thread(&start_http_server, ip,
- app->conf()->get<int>("http_port"),
- 1,
- app);
-
+ boost::thread http_thread(
+ boost::bind(&start_http_server,
+ ip, app->conf()->get<int>("http_port"), 1, app));
+
// Lame interactive mode for debugging:
/*
RS_darknet * dnet = static_cast<RS_darknet *>( app->resolver()->get_darknet());
Oops, something went wrong.

0 comments on commit 18fb4d0

Please sign in to comment.