= How to use the ywesee user Server (yus) If you want to know why this software exists, please read the README file of ch.oddb.org at scm.ywesee.com yus is only running on Ruby1.8 If you do not yet have a private key you will have to create one with ssh-keygen -t rsa do _not_ set a password for the key otherwise yus-server will always ask you for a password at startup-time. The password you set will be with the sha256.rb. Install the following packages with gem: needle (1.3.0) pg (0.9.0) postgres (0.7.9.2008.01.28) Install from source ruby-password (0.5.3) Make sure you got the directory /etc/yus/ /etc/yus/data/ with the files /etc/yus/data/yus.crt /etc/yus/data/yus.key and also /etc/yus/yus.yml the content of the yaml-file should be --- root_name: email@domain.com root_pass: 7322we3asalkasdfkjl9234kjljasd234234ljsdlfkasjw23235lajsdfwr3scv [the SHA2-hash of your password] log_level: DEBUG ssl_key: /etc/yus/data/yus.key [path to an rsa private key] ssl_cert: /etc/yus/data/yus.crt [path to a ssl x509 certificate] session_timeout: 3600 To create root_pass do == Contents of the file cat sha256.rb require 'digest/sha2' print "password: ", ARGV[0], "\n" print "SHA256 encoding: ",Digest::SHA256.hexdigest(ARGV[0]),"\n" == For better understanding ruby sha256.rb hatakeyama [sha256.rb is in the source you can use that]. password: hatakeyama SHA256 encoding: 48714061119f3bb753a0c63dd4230f641ab79e58eb603fc263925c53580acdf1 == Note It seems that the yus server can work without the enconding password string, but yus admin tools (yus_add_user etc.) do not work without the password in my local environment. root_pass is used when yus admin tools (yus_show, yus_add_user, etc.) are called. ssl_key and ssl_cert files are used when yusd starts. If you set a password when you generate the rsa private key, the password is required when yusd starts. root_pass and ssl_key are independent from each other. The password does not have to be the same. Then you should paste the enconding password in 'root-pass' of /etc/yus/yus.yml for the yus server setup. When you start the yus server or you use yus admin commands, the server asks you for the password. for id_rsa.crt * openssl req -new -x509 -key .ssh/id_rsa -out .ssh/id_rsa.crt Create a new user with yus_add_user email@domain.com login org.oddb.RootUser == NOTE > This 'org.oddb.RootUser' is refered to in > http://scm.ywesee.com/?p=oddb.org/.git;a=blob;f=src/state/admin/login.rb;h=1d910af359a224036fc761187bcf960a0d734b80;hb=HEAD#l45 > > oddb.org/state/admin/login.rb > def viral_modules(user) > [ > ['org.oddb.RootUser', State::Admin::Root], > ['org.oddb.AdminUser', State::Admin::Admin], > ['org.oddb.PowerUser', State::Admin::PowerUser], > ['org.oddb.CompanyUser', State::Admin::CompanyUser], > ['org.oddb.PowerLinkUser', State::Admin::PowerLinkUser], > ].each { |key, mod| > if(user.allowed?("login", key)) > yield mod > end > } > end If you create a new user you have to make sure that bin/yusd is running. Then you have to grant yus_grant zdavatz@ywesee.com edit yus.entities like this you will get the Benutzer menu in ch.oddb.org == Extensive user privileges For installing extensive user privileges for ch.oddb.org you need to do the following: > 1. create RootUser group by > > yus_add RootUser > > 2. create mhatakeyama@ywesee.com > > yus_add_user mhatakeyama@ywesee.com login org.oddb.RootUser > > 3. add some privileges to RootUser > > yus_grant RootUser edit yus.entities > yus_grant RootUser login org.oddb.RootUser > yus_grant RootUser edit org.oddb.drugs > > 4. check the RootUser group > > Admin > Benutzer > mhatakeyama@ywesee.com > > check the RootUser box > > 5. see the mhatakeyama@ywesee.com > > Then > > edit yus.entities > login org.oddb.RootUser > edit org.oddb.drugs > > become gray. The other box can be checked, but > as a default of RootUser, the three privileges are checked. To run the tests you are gonna need flexmock (0.8.6) == IMPORTANT You should NOT install dbd-pg-0.3.x for the postgreSQL driver and dbi-0.4.x, because it has already been known that the dbd-pg-0.3.x depends on the library, deprecated-0.2.x, that causes an error. ruby-dbi version via emerge that works is 0.2.0-r1 Install odba (from scm.ywesee.com) == SETUP POSTGRES DB su - postgres createuser yus createdb yus exit cd [yus-git-reposito] ruby bin/yusd