2019-04-09 22:26:40 +02:00
<!DOCTYPE html>
< html lang = "en" dir = "ltr" >
< head >
< meta charset = "utf-8" / >
< title > documentation:2.0:contribute< / title >
< meta name = "generator" content = "DokuWiki" / >
2019-05-12 16:33:56 +02:00
< meta name = "robots" content = "index,follow" / >
2019-04-09 22:26:40 +02:00
< meta name = "keywords" content = "documentation,2.0,contribute" / >
< link rel = "search" type = "application/opensearchdescription+xml" href = "lib/exe/opensearch.html" title = "LemonLDAP::NG" / >
< link rel = "start" href = "contribute.html" / >
< link rel = "contents" href = "contribute.html" title = "Sitemap" / >
< link rel = "stylesheet" type = "text/css" href = "lib/exe/css.php.t.bootstrap3.css" / >
<!-- //if:usedebianlibs
< link rel = "stylesheet" type = "text/css" href = "/javascript/bootstrap/css/bootstrap.min.css" / >
//elsif:useexternallibs
< link rel = "stylesheet" type = "text/css" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" > < / script >
//elsif:cssminified
< link rel = "stylesheet" type = "text/css" href = "/static/bwr/bootstrap/dist/css/bootstrap.min.css" / >
//else -->
< link rel = "stylesheet" type = "text/css" href = "/static/bwr/bootstrap/dist/css/bootstrap.css" / >
<!-- //endif -->
< script type = "text/javascript" > / * < ! [ C D A T A [ * / v a r N S = ' d o c u m e n t a t i o n : 2 . 0 ' ; v a r J S I N F O = { " i d " : " d o c u m e n t a t i o n : 2 . 0 : c o n t r i b u t e " , " n a m e s p a c e " : " d o c u m e n t a t i o n : 2 . 0 " } ;
/*!]]>*/< / script >
< script type = "text/javascript" charset = "utf-8" src = "lib/exe/js.php.t.bootstrap3.js" > < / script >
<!-- //if:usedebianlibs
< script type = "text/javascript" src = "/javascript/jquery/jquery.min.js" > < / script >
//elsif:useexternallibs
< script type = "text/javascript" src = "http://code.jquery.com/jquery-2.2.0.min.js" > < / script >
//elsif:jsminified
< script type = "text/javascript" src = "/static/bwr/jquery/dist/jquery.min.js" > < / script >
//else -->
< script type = "text/javascript" src = "/static/bwr/jquery/dist/jquery.js" > < / script >
<!-- //endif -->
<!-- //if:usedebianlibs
< script type = "text/javascript" src = "/javascript/jquery-ui/jquery-ui.min.js" > < / script >
//elsif:useexternallibs
< script type = "text/javascript" src = "http://code.jquery.com/ui/1.10.4/jquery-ui.min.js" > < / script >
//elsif:jsminified
< script type = "text/javascript" src = "/static/bwr/jquery-ui/jquery-ui.min.js" > < / script >
//else -->
< script type = "text/javascript" src = "/static/bwr/jquery-ui/jquery-ui.js" > < / script >
<!-- //endif -->
< / head >
< body >
< div class = "dokuwiki export container" >
<!-- TOC START -->
< div id = "dw__toc" >
< h3 class = "toggle" > Table of Contents< / h3 >
< div >
< ul class = "toc" >
< li class = "level1" > < div class = "li" > < a href = "#configure_ssh" > Configure SSH< / a > < / div > < / li >
< li class = "level1" > < div class = "li" > < a href = "#install_basic_tools" > Install basic tools< / a > < / div >
< ul class = "toc" >
< li class = "clear" >
< ul class = "toc" >
< li class = "level3" > < div class = "li" > < a href = "#debian" > Debian< / a > < / div > < / li >
< li class = "level3" > < div class = "li" > < a href = "#configure_git" > Configure Git< / a > < / div > < / li >
< / ul >
< / li >
2019-04-10 20:46:02 +02:00
< li class = "level2" > < div class = "li" > < a href = "#import_project_and_using_git" > Import Project and using Git< / a > < / div > < / li >
2019-04-09 22:26:40 +02:00
< / ul >
< / li >
< li class = "level1" > < div class = "li" > < a href = "#install_dependencies" > Install dependencies< / a > < / div > < / li >
2019-12-21 16:54:57 +01:00
< li class = "level1" > < div class = "li" > < a href = "#working_project" > Working Project< / a > < / div >
< ul class = "toc" >
< li class = "level2" > < div class = "li" > < a href = "#unit_tests" > Unit tests< / a > < / div > < / li >
< li class = "level2" > < div class = "li" > < a href = "#other_commands" > Other commands< / a > < / div > < / li >
< / ul > < / li >
2019-04-09 22:26:40 +02:00
< / ul >
< / div >
< / div >
<!-- TOC END -->
< p >
< strong > Do you want to contribute to LemonLdap::NG project ?< / strong >
< / p >
< h1 class = "sectionedit1" id = "contribute_to_project" > Contribute to Project< / h1 >
< div class = "level1" >
2019-09-23 22:41:16 +02:00
< p >
LemonLDAP::NG is mostly written in Perl and Javascript. Community applies the following rules:
< / p >
< ul >
< li class = "level1" > < div class = "li" > Perl:< / div >
< ul >
< li class = "level2" > < div class = "li" > code must be written in modern object-oriented code (using < a href = "https://metacpan.org/pod/Mouse" class = "urlextern" title = "https://metacpan.org/pod/Mouse" rel = "nofollow" > Mouse< / a > ) < em > (except handler and Apache::Session inheritance)< / em > < / div >
< / li >
< li class = "level2" > < div class = "li" > code must be formatted using < a href = "https://metacpan.org/pod/distribution/Perl-Tidy/bin/perltidy" class = "urlextern" title = "https://metacpan.org/pod/distribution/Perl-Tidy/bin/perltidy" rel = "nofollow" > perltidy< / a > version 20181120 < em > (from Debian/buster)< / em > < / div >
< / li >
< / ul >
< / li >
< li class = "level1" > < div class = "li" > Javascript:< / div >
< ul >
< li class = "level2" > < div class = "li" > code must be written in < a href = "http://coffeescript.org/" class = "urlextern" title = "http://coffeescript.org/" rel = "nofollow" > CoffeeScript< / a > < em > (in < code > < component> /site/coffee< / code > )< / em > : < code > make minify< / code > will generate JS files< / div >
< / li >
< / ul >
< / li >
< / ul >
2019-04-09 22:26:40 +02:00
< / div >
2019-09-23 22:41:16 +02:00
<!-- EDIT1 SECTION "Contribute to Project" [59 - 677] -->
2019-04-09 22:26:40 +02:00
< h2 class = "sectionedit2" id = "configure_ssh" > Configure SSH< / h2 >
< div class = "level2" >
< p >
< em > On Debian developper station :< / em >
< / p >
< pre class = "code" > ssh-keygen -o -t rsa -b 4096 -C " your@email" < / pre >
< p >
Go to your gitlab account :
< a href = "https://gitlab.ow2.org/profile/keys" class = "urlextern" title = "https://gitlab.ow2.org/profile/keys" rel = "nofollow" > https://gitlab.ow2.org/profile/keys< / a >
< / p >
< pre class = "code" > cat ~/.ssh/id_rsa.pub< / pre >
< p >
2019-09-23 22:41:16 +02:00
copy id_rsa.pub content to key section and enter a name into " Title" tans " Add key" button
2019-04-09 22:26:40 +02:00
Test ssh connexion :
< / p >
< pre class = "code" > ssh -T git@gitlab.com< / pre >
< p >
accept messages
< / p >
< / div >
2019-09-23 22:41:16 +02:00
<!-- EDIT2 SECTION "Configure SSH" [678 - 1029] -->
2019-04-09 22:26:40 +02:00
< h2 class = "sectionedit3" id = "install_basic_tools" > Install basic tools< / h2 >
< div class = "level2" >
< / div >
< h4 id = "debian" > Debian< / h4 >
< div class = "level4" >
< p >
< em > root :< / em >
< / p >
< pre class = "code" > apt install aptitude
2019-09-23 22:41:16 +02:00
aptitude install vim make devscripts yui-compressor git git-gui libjs-uglify coffeescript cpanminus autopkgtest pkg-perl-autopkgtest
2019-04-09 22:26:40 +02:00
aptitude install libauth-yubikey-webclient-perl libnet-smtp-server-perl
cpanm Authen::U2F Authen::U2F::Tester Crypt::U2F::Server::Simple
2019-06-28 16:53:45 +02:00
curl -sL https://deb.nodesource.com/setup_9.x | bash -
apt-get install -y nodejs
2019-04-09 22:26:40 +02:00
npm install -g protractor # end-2-end tests
webdriver-manager update # install/update selenium driver< / pre >
< / div >
< h4 id = "configure_git" > Configure Git< / h4 >
< div class = "level4" >
< p >
< em > user :< / em >
< / p >
< pre class = "code" > git config --global user.name " Name Surname"
git config --global user.email " your@mail"
git config --global core.editor vim
git config --global merge.tool vimdiff
git config --global color.ui true
git config --list< / pre >
< / div >
2019-09-23 22:41:16 +02:00
<!-- EDIT3 SECTION "Install basic tools" [1030 - 1854] -->
2019-04-10 20:46:02 +02:00
< h3 class = "sectionedit4" id = "import_project_and_using_git" > Import Project and using Git< / h3 >
2019-04-09 22:26:40 +02:00
< div class = "level3" >
< p >
< em > user :< / em >
create directory
in directory :
< / p >
< pre class = "code" > git clone git@gitlab.ow2.org://user///lemonldap-ng.git
cd lemonldap-ng/
git log
git checkout master # go to master branch
git remote add upstream https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng.git # to connect to remote branch
git fetch upstream # import branch
git checkout v2.0 # to change branch
git fetch upstream< / pre >
2019-04-10 20:46:02 +02:00
< p >
< em > import version branch< / em >
< em > on linux station :< / em >
< / p >
< pre class = "code" > git checkout v2.0
2019-06-28 16:53:45 +02:00
git fetch upstream
git rebase upstream/v2.0 # to align to parent project remote branch< / pre >
2019-04-10 20:46:02 +02:00
2019-04-09 22:26:40 +02:00
< p >
< em > on gitlab, create working branch, one per thematic< / em >
< em > on linux station :< / em >
< / p >
< pre class = "code" > git checkout workingbranch
git log
git status
git commit -am " explanations (#number gitlab ticket)"
git commit --amend file(s) # to modify a commit
2019-04-10 20:46:02 +02:00
git rebase v2.0 # align local working branch to local 2.0
2019-04-09 22:26:40 +02:00
git checkout -- file(s) # revert
2019-06-28 16:53:45 +02:00
git push # to send on remote working branch ! Only after doing some commits !< / pre >
2019-04-09 22:26:40 +02:00
< p >
On gitlab, submit merge request when tests are corrects.
< / p >
< / div >
2019-09-23 22:41:16 +02:00
<!-- EDIT4 SECTION "Import Project and using Git" [1855 - 2905] -->
2019-04-09 22:26:40 +02:00
< h2 class = "sectionedit5" id = "install_dependencies" > Install dependencies< / h2 >
< div class = "level2" >
2019-12-21 16:54:57 +01:00
< pre class = "code" > aptitude install libapache-session-perl libcache-cache-perl libclone-perl libconfig-inifiles-perl libconvert-pem-perl libcrypt-openssl-bignum-perl libcrypt-openssl-rsa-perl libcrypt-openssl-x509-perl libcrypt-rijndael-perl libdbi-perl libdigest-hmac-perl libemail-sender-perl libgd-securityimage-perl libhtml-template-perl libio-string-perl libjson-perl libmime-tools-perl libmouse-perl libnet-ldap-perl libplack-perl libregexp-assemble-perl libregexp-common-perl libsoap-lite-perl libstring-random-perl libtext-unidecode-perl libunicode-string-perl liburi-perl libwww-perl libxml-simple-perl libxml-libxslt-perl libcrypt-urandom-perl libconvert-base32-perl cpanminus
2019-04-09 22:26:40 +02:00
aptitude install apache2 libapache2-mod-fcgid libapache2-mod-perl2 # install Apache
aptitude install nginx nginx-extras # install Nginx
2019-09-23 22:41:16 +02:00
cpanm perltidy@20181120< / pre >
2019-04-09 22:26:40 +02:00
2019-04-10 20:29:24 +02:00
< p >
< abbr title = "Security Assertion Markup Language" > SAML< / abbr > :
< / p >
< pre class = "code" > aptitude install liblasso-perl libglib-perl < / pre >
2019-04-09 22:26:40 +02:00
< / div >
2019-12-21 16:54:57 +01:00
<!-- EDIT5 SECTION "Install dependencies" [2906 - 3838] -->
2019-04-09 22:26:40 +02:00
< h2 class = "sectionedit6" id = "working_project" > Working Project< / h2 >
< div class = "level2" >
< / div >
2019-12-21 16:54:57 +01:00
<!-- EDIT6 SECTION "Working Project" [3839 - 3868] -->
< h3 class = "sectionedit7" id = "unit_tests" > Unit tests< / h3 >
< div class = "level3" >
< p >
Launch unit tests:
< / p >
< pre class = "code" > make test # or manager_test, portal_test, ... to launch unit tests< / pre >
< p >
Same tests launched on a simulated install
< / p >
< pre class = "code" > make autopkgtest # or autopkg_portal, autopkg_manager, ... to launch unit tests< / pre >
< p >
Execute an unit test :
< / p >
< pre class = "code" > # Building project
cd ~/lemonldap-ng/; make
# Go to parent test directory
cd ~/lemonldap-ng/lemonldap-ng-portal
# and execute the unit test:
prove -v t/67-CheckUser.t< / pre >
< p >
Launch tests with LDAP backend, for example with OpenLDAP LTB package:
< / p >
< pre class = "code" > make LLNGTESTLDAP=1 LLNGTESTLDAP_SLAPD_BIN=/usr/local/openldap/libexec/slapd LLNGTESTLDAP_SLAPADD_BIN=/usr/local/openldap/sbin/slapadd LLNGTESTLDAP_SCHEMA_DIR=/usr/local/openldap/etc/openldap/schema/ test< / pre >
< / div >
<!-- EDIT7 SECTION "Unit tests" [3869 - 4647] -->
< h3 class = "sectionedit8" id = "other_commands" > Other commands< / h3 >
< div class = "level3" >
< pre class = "code" > make start_web_server # TESTUSESSL=1 to enable SSL engine (only available for Apache)
make start_web_server TESTWEBSERVER=nginx # to use Nginx web server
make stop_web_server
make reload_web_server # to reload LL:NG conf
make clean # to clean test files
make minify # to minify and compile coffeescript
make json # to build conf and manager tree
make manifest # to update manifest
make tidy # to magnify perl files (perl best pratices)< / pre >
< / div >
<!-- EDIT8 SECTION "Other commands" [4648 - ] --> < / div >
2019-04-09 22:26:40 +02:00
< / body >
< / html >