Permalink
Browse files

tigase service

  • Loading branch information...
1 parent 5c37c74 commit e7ee6939ca7c598d8969ec666ff4fdf3d4ed831a @duck1123 duck1123 committed Mar 8, 2012
@@ -0,0 +1,10 @@
+(defproject ciste/ciste-service-tigase "0.3.0-SNAPSHOT"
+ :description "Tigase Connector Service for Ciste Applications"
+ :url "http://github.com/duck1123/ciste"
+ :author "Daniel E. Renfer <duck@kronkltd.net>"
+ :dependencies [
+
+ [ciste/ciste-core "0.3.0-SNAPSHOT"]
+ [clj-tigase "0.1.0-SNAPSHOT"]
+
+ ])
@@ -0,0 +1,55 @@
+(ns ciste.service.tigase
+ (:use (ciste [config :only [config describe-config]]
+ [debug :only [spy]])
+ clj-tigase.core)
+ (:require (clojure [string :as string])))
+
+
+;; TODO: Pull this list from a UserRole collection
+(describe-config [:admins] :list
+ "A list of usernames that are considered admins of the system.")
+
+(describe-config [:xmpp :auth-db] :string
+ "The name of a class implementing the auth repository")
+
+(describe-config [:xmpp :c2s] :number
+ "The client to server port for the xmpp service")
+
+(describe-config [:xmpp :s2s] :number
+ "The server to server port for the xmpp service")
+
+(describe-config [:xmpp :user-db] :string
+ "The name of a class implementing the user repository")
+
+(def ^:dynamic *initial-config* "")
+
+(defn tigase-options
+ []
+ (into-array
+ String
+ (concat ["--admins" (->> (config :admins)
+ (map (fn [username]
+ ;; TODO: ensure user created
+ (str username "@" (config :domain))))
+ (string/join "," ))
+ "--auth-db" (config :xmpp :auth-db)
+ "--user-db" (config :xmpp :user-db)
+ "--debug" "server"
+ "--sm-plugins" (string/join "," (config :xmpp :plugins))
+ "--c2s-ports" (str (config :xmpp :c2s))
+ "--s2s" (str (config :xmpp :s2s))
+ ;; TODO: should we support multiple virtual domains here?
+ "--virt-hosts" (config :domain)]
+ (flatten
+ (map-indexed
+ (fn [n component]
+ [(str "--comp-name-" (inc n))
+ (:name component)
+ (str "--comp-class-" (inc n))
+ (:class component)])
+ (config :xmpp :components))))))
+
+(defn start
+ []
+ (let [tigase-config (get-config *initial-config* (tigase-options))]
+ (start-router! tigase-options tigase-config)))
@@ -0,0 +1,2 @@
+(ns ciste.service.tigase-test)
+
View
@@ -2,16 +2,20 @@
:description "MVC platform for Clojure applications"
:url "http://github.com/duck1123/ciste"
:author "Daniel E. Renfer <duck@kronkltd.net>"
- :dependencies [[ciste/ciste-core "0.3.0-SNAPSHOT"]
+ :dependencies [
+ [ciste/ciste-core "0.3.0-SNAPSHOT"]
[ciste/ciste-service-aleph "0.3.0-SNAPSHOT"]
[ciste/ciste-service-slacker "0.3.0-SNAPSHOT"]
- [ciste/ciste-service-swank "0.3.0-SNAPSHOT"]]
+ [ciste/ciste-service-swank "0.3.0-SNAPSHOT"]
+ [ciste/ciste-service-tigase "0.3.0-SNAPSHOT"]
+ ]
:dev-dependencies [[lein-sub "0.1.2"]]
:sub [
"ciste-core"
"ciste-service-aleph"
"ciste-service-slacker"
"ciste-service-swank"
+ "ciste-service-tigase"
]
:autodoc {:name "Ciste"
:copyright "2012 KRONK Ltd."}

0 comments on commit e7ee693

Please sign in to comment.