SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
How to customize Zentyal
(hooks, templates and LDAP)

Zentyal Summit 2011

12th November
Carlos Pérez-Aradros <cperez@zentyal.com>

   Linux small business server
Linux small business server




Zentyal...
     Easy to use
     Good integration
     Versatile



...but sometimes you need
     Some specific customization
     Integration with external apps




       www.zentyal.com                      © eBox Technologies S.L. 2011
Linux small business server




Customization options
   Modify source code
      Add new logic or functionality
      Breaks on upgrade      Upstream!

   Templates
      Change configuration files written by Zentyal
   Hooks
      Define custom actions (scripts) on module events
   LDAP
      Integrate external applications



       www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




Customization options
   Modify source code
      Add new logic or functionality
      Breaks on upgrade
   Templates
      Change configuration files written by Zentyal
   Hooks
      Define custom actions (scripts) on module events
   LDAP
      Integrate external applications



       www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




Templates (I)


   Zentyal uses templates to write system configurations files



   Modify templates to:

      Adjust parameters to adapt Zentyal to your requirements

      Add/remove configuration options




       www.zentyal.com                                  © eBox Technologies S.L. 2011
Linux small business server




Templates (II)
   Mason as template processor




       www.zentyal.com                 © eBox Technologies S.L. 2011
Linux small business server




Templates (III)



   Default templates location:
      /usr/share/zentyal/stubs/<module>/<template>.mas
   Custom templates:
      /etc/zentyal/stubs/<module>/<template>.mas




       www.zentyal.com                             © eBox Technologies S.L. 2011
Linux small business server




Templates (IV)
Default stub
/usr/share/zentyal/stubs/network/resolv.conf.mas

        T


                                                         Conf file
                                                         /etc/resolv.conf
        T



Custom stub
/etc/zentyal/stubs/network/resolv.conf.mas


            www.zentyal.com                              © eBox Technologies S.L. 2011
Linux small business server




Templates example: Samba hidden folders
   We want to add a hidden folder in File Sharing module (samba)
   Zentyal GUI doesn't allow this:




       www.zentyal.com                                 © eBox Technologies S.L. 2011
Linux small business server




Templates example: Samba hidden folders
   Copy and edit default template:

   mkdir -p /etc/zentyal/stubs/samba/

   cp /usr/share/zentyal/stubs/samba/smb.conf.mas /etc/zentyal/stubs/samba/




   Write custom configuration



        www.zentyal.com                                         © eBox Technologies S.L. 2011
Linux small business server




Customization options
   Modify source code
      Add new logic or functionality
      Breaks on upgrade
   Templates
      Change configuration files written by Zentyal
   Hooks
      Define custom actions (scripts) on module events
   LDAP
      Integrate external applications



       www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




Hooks (I)
   Execute actions (scripts) during Zentyal save changes process



   Create hook scripts to:

      Watch for changes in any module

      Add custom scripts before/after module actions




       www.zentyal.com                                  © eBox Technologies S.L. 2011
Linux small business server




Hooks (II): paths

   Before saving changes     /etc/zentyal/pre-save/


   After saving changes    /etc/zentyal/post-save/




   /etc/zentyal/hooks/

      Before saving module configuration <module>.presetconf
      After saving module configuration <module>.postsetconf
      Before restarting the service       <module>.preservice


      After restarting the service <module>.postservice



       www.zentyal.com                                                © eBox Technologies S.L. 2011
Linux small business server



                           one time     for each module
Hooks (III)
                           pre-save
                                             .presetconf

                                           Write conf files

                                             .postsetconf


                                             .preservice

                                         Restart daemons

                                             .postservice
       hook
                           post-save

   Zentyal action

         www.zentyal.com                     © eBox Technologies S.L. 2011
Linux small business server




Hooks Example: Firewall


   We want to block traffic from a specific country (using GeoIP)
   Zentyal GUI does not allow this kind of rules


   If we add the rule by hand:
      Firewall module restart will delete it


   Solution:
      Add the rule after firewall restart (postservice hook)


       www.zentyal.com                                   © eBox Technologies S.L. 2011
Linux small business server




Hooks Example: Firewall
   Setup GeoIP
   sudo apt-get install module-assistant

   sudo module-assistant a-i xtables-addons



   wget http://sourceforge.net/projects/xtables-
   addons/files/Xtables-addons/1.38/xtables-addons-1.38.tar.xz



   sudo ./xt_geoip_dl

   sudo ./xt_geoip_build *.csv

   sudo mkdir /var/geoip && sudo cp -r LE /var/geoip




       www.zentyal.com                                   © eBox Technologies S.L. 2011
Linux small business server




Hooks Example: Firewall
   Create the hook


                 /etc/zentyal/hooks/firewall.postservice
   #!/bin/sh
   sudo iptables -I INPUT -m geoip --src-cc KP -j ACCEPT




   Don't forget to make it executable!
      chmod +x /etc/zentyal/hooks/firewall.postservice




        www.zentyal.com                                 © eBox Technologies S.L. 2011
Linux small business server




Hooks: Future (3.0)
   Users operations hooks
      create
      modify
      delete


   Backup
      pre-backup
      post-backup




       www.zentyal.com            © eBox Technologies S.L. 2011
Linux small business server




Customization options
   Modify source code
      Add new logic or functionality
      Breaks on upgrade
   Templates
      Change configuration files written by Zentyal
   Hooks
      Define custom actions (scripts) on module events
   LDAP
      Integrate external applications



       www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration (I)

   Zentyal provides great Users and Groups management



   LDAP integration:

      Central point for users management

      Centralized authentication

      Distributed: master / slave architecture




       www.zentyal.com                                   © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration (II)
   Integrate third apps with Zentyal Users and Groups




       www.zentyal.com                                        © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration (II): settings
   Users and Groups → LDAP Settings




   Server: ldap://localhost:389/ (port 1389 in slaves)
   Users DN: ou=Users,<basedn>
   Groups DN: ou=Groups,<basedn>

        www.zentyal.com                                        © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration (III): filters
uid=cperez,ou=Users,dc=zentyal,dc=com
uid: cperez
                                        Base DN: ou=Users,dc=zentyal,dc=com
loginShell: /usr/sbin/nologin
uidNumber: 2002
                                        Filter: (uid=*)
gidNumber: 1901
homeDirectory: /home/cperez
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: passwordHolder                cn=developers,ou=Groups,dc=zentyal,dc=com
givenName: Carlos                          cn: developers
userPassword: {SHA}...                     gidNumber: 2005
eboxSha1Password: {SHA}...                 objectClass: posixGroup

eboxMd5Password: {MD5}...                  memberUid: cperez

eboxDigestPassword: {MD5}...               memberUid: jsalamero

eboxRealmPassword: {MD5}...                memberUid: ejhernandez

cn:; Carlos Pérez-Aradros Herce            memberUid: jacalvo
                                           memberUid: jamor
sn:; Pérez-Aradros Herce
                                           ...

              www.zentyal.com                                           © eBox Technologies S.L. 2011
                                                                           c
Linux small business server




LDAP Integration example: Wordpress




      www.zentyal.com                   © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration example: Wordpress
   Look for a LDAP Auth backend




       www.zentyal.com                  © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration example: Wordpress




      www.zentyal.com                   © eBox Technologies S.L. 2011
Linux small business server




In summary
   Modify source code
      Add new logic or functionality
      Breaks on upgrade      Upstream!

   Templates
      Change configuration files written by Zentyal
   Hooks
      Define custom actions (scripts) on module events
   LDAP
      Integrate external applications



       www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




Get help
  Zentyal Support Forum
        http://forum.zentyal.org
  Users and Developers mailing lists
        https://lists.zentyal.com/cgi-bin/mailman/listinfo/zentyal-devel
        https://lists.zentyal.com/cgi-bin/mailman/listinfo/zentyal-users
  IRC
        #zentyal at freenode.net
  Official support and training
        http://www.zentyal.com/en/services/              Contribute!


           www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




Further reading...
   Zentyal Documentation - Advanced Service Customisation
      http://doc.zentyal.org/en/develop.html
   Mason Documentation (Templates)
      http://www.masonhq.com/docs/manual/Devel.html
   xtables addons
      http://xtables-addons.sourceforge.net/
   Openldap filters doc
      http://www.zytrax.com/books/ldap/apa/search.html




       www.zentyal.com                               © eBox Technologies S.L. 2011
Linux small business server




www.zentyal.com
                  ?         © eBox Technologies S.L. 2011

Contenu connexe

Tendances

Jetpack Compose a new way to implement UI on Android
Jetpack Compose a new way to implement UI on AndroidJetpack Compose a new way to implement UI on Android
Jetpack Compose a new way to implement UI on AndroidNelson Glauber Leal
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Tom Brander
 
Hibernate Basic Concepts - Presentation
Hibernate Basic Concepts - PresentationHibernate Basic Concepts - Presentation
Hibernate Basic Concepts - PresentationKhoa Nguyen
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation FrameworkCaserta
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...Edureka!
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
Entity Framework Core
Entity Framework CoreEntity Framework Core
Entity Framework CoreKiran Shahi
 
간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기Kyoung Up Jung
 
ADF Demo_ppt.pptx
ADF Demo_ppt.pptxADF Demo_ppt.pptx
ADF Demo_ppt.pptxvamsytaurus
 
Using Xcore with Xtext
Using Xcore with XtextUsing Xcore with Xtext
Using Xcore with XtextHolger Schill
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpcasestudyhelp
 
좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012Daum DNA
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event HandlingWebStackAcademy
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Hatem Mahmoud
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Expressjguerrero999
 
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Domenic Denicola
 

Tendances (20)

Jetpack Compose a new way to implement UI on Android
Jetpack Compose a new way to implement UI on AndroidJetpack Compose a new way to implement UI on Android
Jetpack Compose a new way to implement UI on Android
 
Django, What is it, Why is it cool?
Django, What is it, Why is it cool?Django, What is it, Why is it cool?
Django, What is it, Why is it cool?
 
Hibernate Basic Concepts - Presentation
Hibernate Basic Concepts - PresentationHibernate Basic Concepts - Presentation
Hibernate Basic Concepts - Presentation
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Entity Framework Core
Entity Framework CoreEntity Framework Core
Entity Framework Core
 
간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기간단한 블로그를 만들며 Django 이해하기
간단한 블로그를 만들며 Django 이해하기
 
ADF Demo_ppt.pptx
ADF Demo_ppt.pptxADF Demo_ppt.pptx
ADF Demo_ppt.pptx
 
Using Xcore with Xtext
Using Xcore with XtextUsing Xcore with Xtext
Using Xcore with Xtext
 
SOA Resume
SOA ResumeSOA Resume
SOA Resume
 
Angular Seminar-js
Angular Seminar-jsAngular Seminar-js
Angular Seminar-js
 
Nodejs vatsal shah
Nodejs vatsal shahNodejs vatsal shah
Nodejs vatsal shah
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012좌충우돌 ORM 개발기 | Devon 2012
좌충우돌 ORM 개발기 | Devon 2012
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 
Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01Cascading Style Sheets - Part 01
Cascading Style Sheets - Part 01
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
 
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
 

Similaire à Zentyal Customization (templates, hooks, LDAP)

Zararfa SummerCamp 2012 - HA, multi-tenancy and SSO in Zentyal 2 and 3.pdf
Zararfa SummerCamp 2012 - HA, multi-tenancy and SSO in Zentyal 2 and 3.pdfZararfa SummerCamp 2012 - HA, multi-tenancy and SSO in Zentyal 2 and 3.pdf
Zararfa SummerCamp 2012 - HA, multi-tenancy and SSO in Zentyal 2 and 3.pdfZarafa
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to KubernetesSamuel Dratwa
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to AnsibleCoreStack
 
the NML project
the NML projectthe NML project
the NML projectLei Yang
 
How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?Zend by Rogue Wave Software
 
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...Novell
 
Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012EneaSoftware
 
Deploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and HelmDeploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and HelmJessica Deen
 
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at KiratechMoby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at KiratechKiratech
 
Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning Jim Dowling
 
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...Zarafa
 
DockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker EngineDockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker EngineDocker, Inc.
 
CoreOS and cloud provider integration: simple cloud-init example at Exoscale
CoreOS and cloud provider integration: simple cloud-init example at ExoscaleCoreOS and cloud provider integration: simple cloud-init example at Exoscale
CoreOS and cloud provider integration: simple cloud-init example at ExoscaleAntoine COETSIER
 
Containerday17 Moby-linuxkit-DockerCon-2017-announcements
Containerday17 Moby-linuxkit-DockerCon-2017-announcementsContainerday17 Moby-linuxkit-DockerCon-2017-announcements
Containerday17 Moby-linuxkit-DockerCon-2017-announcementsKiratech
 
DockerCon EU 2015 - The Latest on Docker Engine
DockerCon EU 2015 - The Latest on Docker EngineDockerCon EU 2015 - The Latest on Docker Engine
DockerCon EU 2015 - The Latest on Docker EngineArnaud Porterie
 
Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015Filipe Miranda
 

Similaire à Zentyal Customization (templates, hooks, LDAP) (20)

Zararfa SummerCamp 2012 - HA, multi-tenancy and SSO in Zentyal 2 and 3.pdf
Zararfa SummerCamp 2012 - HA, multi-tenancy and SSO in Zentyal 2 and 3.pdfZararfa SummerCamp 2012 - HA, multi-tenancy and SSO in Zentyal 2 and 3.pdf
Zararfa SummerCamp 2012 - HA, multi-tenancy and SSO in Zentyal 2 and 3.pdf
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
the NML project
the NML projectthe NML project
the NML project
 
How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?
 
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
 
korot_haim_en
korot_haim_enkorot_haim_en
korot_haim_en
 
Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012
 
OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training
 
Deploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and HelmDeploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and Helm
 
2011 04 zentyal_cork
2011 04 zentyal_cork2011 04 zentyal_cork
2011 04 zentyal_cork
 
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at KiratechMoby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
 
Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning
 
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...
 
DockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker EngineDockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker Engine
 
CoreOS and cloud provider integration: simple cloud-init example at Exoscale
CoreOS and cloud provider integration: simple cloud-init example at ExoscaleCoreOS and cloud provider integration: simple cloud-init example at Exoscale
CoreOS and cloud provider integration: simple cloud-init example at Exoscale
 
Containerday17 Moby-linuxkit-DockerCon-2017-announcements
Containerday17 Moby-linuxkit-DockerCon-2017-announcementsContainerday17 Moby-linuxkit-DockerCon-2017-announcements
Containerday17 Moby-linuxkit-DockerCon-2017-announcements
 
Rhel7 vs rhel6
Rhel7 vs rhel6Rhel7 vs rhel6
Rhel7 vs rhel6
 
DockerCon EU 2015 - The Latest on Docker Engine
DockerCon EU 2015 - The Latest on Docker EngineDockerCon EU 2015 - The Latest on Docker Engine
DockerCon EU 2015 - The Latest on Docker Engine
 
Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015
 

Dernier

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Dernier (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 

Zentyal Customization (templates, hooks, LDAP)

  • 1. How to customize Zentyal (hooks, templates and LDAP) Zentyal Summit 2011 12th November Carlos Pérez-Aradros <cperez@zentyal.com> Linux small business server
  • 2. Linux small business server Zentyal... Easy to use Good integration Versatile ...but sometimes you need Some specific customization Integration with external apps www.zentyal.com © eBox Technologies S.L. 2011
  • 3. Linux small business server Customization options Modify source code Add new logic or functionality Breaks on upgrade Upstream! Templates Change configuration files written by Zentyal Hooks Define custom actions (scripts) on module events LDAP Integrate external applications www.zentyal.com © eBox Technologies S.L. 2011
  • 4. Linux small business server Customization options Modify source code Add new logic or functionality Breaks on upgrade Templates Change configuration files written by Zentyal Hooks Define custom actions (scripts) on module events LDAP Integrate external applications www.zentyal.com © eBox Technologies S.L. 2011
  • 5. Linux small business server Templates (I) Zentyal uses templates to write system configurations files Modify templates to: Adjust parameters to adapt Zentyal to your requirements Add/remove configuration options www.zentyal.com © eBox Technologies S.L. 2011
  • 6. Linux small business server Templates (II) Mason as template processor www.zentyal.com © eBox Technologies S.L. 2011
  • 7. Linux small business server Templates (III) Default templates location: /usr/share/zentyal/stubs/<module>/<template>.mas Custom templates: /etc/zentyal/stubs/<module>/<template>.mas www.zentyal.com © eBox Technologies S.L. 2011
  • 8. Linux small business server Templates (IV) Default stub /usr/share/zentyal/stubs/network/resolv.conf.mas T Conf file /etc/resolv.conf T Custom stub /etc/zentyal/stubs/network/resolv.conf.mas www.zentyal.com © eBox Technologies S.L. 2011
  • 9. Linux small business server Templates example: Samba hidden folders We want to add a hidden folder in File Sharing module (samba) Zentyal GUI doesn't allow this: www.zentyal.com © eBox Technologies S.L. 2011
  • 10. Linux small business server Templates example: Samba hidden folders Copy and edit default template: mkdir -p /etc/zentyal/stubs/samba/ cp /usr/share/zentyal/stubs/samba/smb.conf.mas /etc/zentyal/stubs/samba/ Write custom configuration www.zentyal.com © eBox Technologies S.L. 2011
  • 11. Linux small business server Customization options Modify source code Add new logic or functionality Breaks on upgrade Templates Change configuration files written by Zentyal Hooks Define custom actions (scripts) on module events LDAP Integrate external applications www.zentyal.com © eBox Technologies S.L. 2011
  • 12. Linux small business server Hooks (I) Execute actions (scripts) during Zentyal save changes process Create hook scripts to: Watch for changes in any module Add custom scripts before/after module actions www.zentyal.com © eBox Technologies S.L. 2011
  • 13. Linux small business server Hooks (II): paths Before saving changes /etc/zentyal/pre-save/ After saving changes /etc/zentyal/post-save/ /etc/zentyal/hooks/ Before saving module configuration <module>.presetconf After saving module configuration <module>.postsetconf Before restarting the service <module>.preservice After restarting the service <module>.postservice www.zentyal.com © eBox Technologies S.L. 2011
  • 14. Linux small business server one time for each module Hooks (III) pre-save .presetconf Write conf files .postsetconf .preservice Restart daemons .postservice hook post-save Zentyal action www.zentyal.com © eBox Technologies S.L. 2011
  • 15. Linux small business server Hooks Example: Firewall We want to block traffic from a specific country (using GeoIP) Zentyal GUI does not allow this kind of rules If we add the rule by hand: Firewall module restart will delete it Solution: Add the rule after firewall restart (postservice hook) www.zentyal.com © eBox Technologies S.L. 2011
  • 16. Linux small business server Hooks Example: Firewall Setup GeoIP sudo apt-get install module-assistant sudo module-assistant a-i xtables-addons wget http://sourceforge.net/projects/xtables- addons/files/Xtables-addons/1.38/xtables-addons-1.38.tar.xz sudo ./xt_geoip_dl sudo ./xt_geoip_build *.csv sudo mkdir /var/geoip && sudo cp -r LE /var/geoip www.zentyal.com © eBox Technologies S.L. 2011
  • 17. Linux small business server Hooks Example: Firewall Create the hook /etc/zentyal/hooks/firewall.postservice #!/bin/sh sudo iptables -I INPUT -m geoip --src-cc KP -j ACCEPT Don't forget to make it executable! chmod +x /etc/zentyal/hooks/firewall.postservice www.zentyal.com © eBox Technologies S.L. 2011
  • 18. Linux small business server Hooks: Future (3.0) Users operations hooks create modify delete Backup pre-backup post-backup www.zentyal.com © eBox Technologies S.L. 2011
  • 19. Linux small business server Customization options Modify source code Add new logic or functionality Breaks on upgrade Templates Change configuration files written by Zentyal Hooks Define custom actions (scripts) on module events LDAP Integrate external applications www.zentyal.com © eBox Technologies S.L. 2011
  • 20. Linux small business server LDAP Integration (I) Zentyal provides great Users and Groups management LDAP integration: Central point for users management Centralized authentication Distributed: master / slave architecture www.zentyal.com © eBox Technologies S.L. 2011
  • 21. Linux small business server LDAP Integration (II) Integrate third apps with Zentyal Users and Groups www.zentyal.com © eBox Technologies S.L. 2011
  • 22. Linux small business server LDAP Integration (II): settings Users and Groups → LDAP Settings Server: ldap://localhost:389/ (port 1389 in slaves) Users DN: ou=Users,<basedn> Groups DN: ou=Groups,<basedn> www.zentyal.com © eBox Technologies S.L. 2011
  • 23. Linux small business server LDAP Integration (III): filters uid=cperez,ou=Users,dc=zentyal,dc=com uid: cperez Base DN: ou=Users,dc=zentyal,dc=com loginShell: /usr/sbin/nologin uidNumber: 2002 Filter: (uid=*) gidNumber: 1901 homeDirectory: /home/cperez objectClass: inetOrgPerson objectClass: posixAccount objectClass: passwordHolder cn=developers,ou=Groups,dc=zentyal,dc=com givenName: Carlos cn: developers userPassword: {SHA}... gidNumber: 2005 eboxSha1Password: {SHA}... objectClass: posixGroup eboxMd5Password: {MD5}... memberUid: cperez eboxDigestPassword: {MD5}... memberUid: jsalamero eboxRealmPassword: {MD5}... memberUid: ejhernandez cn:; Carlos Pérez-Aradros Herce memberUid: jacalvo memberUid: jamor sn:; Pérez-Aradros Herce ... www.zentyal.com © eBox Technologies S.L. 2011 c
  • 24. Linux small business server LDAP Integration example: Wordpress www.zentyal.com © eBox Technologies S.L. 2011
  • 25. Linux small business server LDAP Integration example: Wordpress Look for a LDAP Auth backend www.zentyal.com © eBox Technologies S.L. 2011
  • 26. Linux small business server LDAP Integration example: Wordpress www.zentyal.com © eBox Technologies S.L. 2011
  • 27. Linux small business server In summary Modify source code Add new logic or functionality Breaks on upgrade Upstream! Templates Change configuration files written by Zentyal Hooks Define custom actions (scripts) on module events LDAP Integrate external applications www.zentyal.com © eBox Technologies S.L. 2011
  • 28. Linux small business server Get help Zentyal Support Forum http://forum.zentyal.org Users and Developers mailing lists https://lists.zentyal.com/cgi-bin/mailman/listinfo/zentyal-devel https://lists.zentyal.com/cgi-bin/mailman/listinfo/zentyal-users IRC #zentyal at freenode.net Official support and training http://www.zentyal.com/en/services/ Contribute! www.zentyal.com © eBox Technologies S.L. 2011
  • 29. Linux small business server Further reading... Zentyal Documentation - Advanced Service Customisation http://doc.zentyal.org/en/develop.html Mason Documentation (Templates) http://www.masonhq.com/docs/manual/Devel.html xtables addons http://xtables-addons.sourceforge.net/ Openldap filters doc http://www.zytrax.com/books/ldap/apa/search.html www.zentyal.com © eBox Technologies S.L. 2011
  • 30. Linux small business server www.zentyal.com ? © eBox Technologies S.L. 2011