Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. App Packaging & Development
  3. Need help with PHP Server Monitor packaging

Need help with PHP Server Monitor packaging

Scheduled Pinned Locked Moved App Packaging & Development
10 Posts 2 Posters 1.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      M Offline
      msbt
      App Dev
      wrote on last edited by
      #1

      Hi there! I've been using PHP Server Monitor for years to check my (customers) sites for uptime, valid SSL certificates and the likes. The reason why I haven't packaged this for Cloudron was because of the missing LDAP support which was requested and in the works for quite a few years now. But this got resolved now and it would be good to go when merged to master, so I gave it another shot, here's what I got so far:

      https://git.cloudron.io/msbt/phpservermonitor-app

      In theory everything works: You can build and install it, visit the site, create an admin user. Then I ran into two issues:

      1. I can't set the SMTP password through start.sh because it's encrypted in the db. I already got a hint on how it might work and it does encrypt something, but not the whole thing and I don't know how to fix it. So if you want to use it at the moment, you have to manually insert the correct password in the adminpanel
      2. The LDAP fields only show up in the database after activating it in the Config/Authentication tab, so when you want to use LDAP for your users, you can activate it and restart the server, then the information gets written into the db automatically. I've opened another ticket to ask for an unattended installation procedure or some other way to automatically activate it, but no dice so far, but maybe some of you have an idea how to get around that.

      After that extra step with restarting after enabling authentication (and setting the mail password automatically afterwards) it's good to go. You have a nice uptime monitor with a lot of settings and options (like check if a string exists, if not --> mark site as down and send email - using that for WordPress sites that have other issues).

      If anyone has an idea how to fix the password issue (I just lack the experience for that), would be much appreciated.

      Oh yes, at the moment it uses the regular scheduler-addon which does 15 minute intervals, we could easily change this to a manual crontab which then checks whatever interval you like, this was just the easier approach to get it going.

      Cheers

      girishG 1 Reply Last reply
      4
      • M msbt

        Hi there! I've been using PHP Server Monitor for years to check my (customers) sites for uptime, valid SSL certificates and the likes. The reason why I haven't packaged this for Cloudron was because of the missing LDAP support which was requested and in the works for quite a few years now. But this got resolved now and it would be good to go when merged to master, so I gave it another shot, here's what I got so far:

        https://git.cloudron.io/msbt/phpservermonitor-app

        In theory everything works: You can build and install it, visit the site, create an admin user. Then I ran into two issues:

        1. I can't set the SMTP password through start.sh because it's encrypted in the db. I already got a hint on how it might work and it does encrypt something, but not the whole thing and I don't know how to fix it. So if you want to use it at the moment, you have to manually insert the correct password in the adminpanel
        2. The LDAP fields only show up in the database after activating it in the Config/Authentication tab, so when you want to use LDAP for your users, you can activate it and restart the server, then the information gets written into the db automatically. I've opened another ticket to ask for an unattended installation procedure or some other way to automatically activate it, but no dice so far, but maybe some of you have an idea how to get around that.

        After that extra step with restarting after enabling authentication (and setting the mail password automatically afterwards) it's good to go. You have a nice uptime monitor with a lot of settings and options (like check if a string exists, if not --> mark site as down and send email - using that for WordPress sites that have other issues).

        If anyone has an idea how to fix the password issue (I just lack the experience for that), would be much appreciated.

        Oh yes, at the moment it uses the regular scheduler-addon which does 15 minute intervals, we could easily change this to a manual crontab which then checks whatever interval you like, this was just the easier approach to get it going.

        Cheers

        girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #2

        @msbt For the SMTP password issue, a trick we use is to encrypt it using a simple PHP script. For example, see https://git.cloudron.io/cloudron/osticket-app/-/blob/master/encrypt.php , https://git.cloudron.io/cloudron/snipeit-app/-/blob/master/CloudronLdap.php#L51 and https://git.cloudron.io/cloudron/limesurvey-app/-/blob/master/EncryptCommand.php . This script will of course depend on how the app encrypts.

        As for LDAP, maybe we can start out with not having LDAP and then we can add it in the next release (when upstream merges it).

        1 Reply Last reply
        1
        • girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #3

          Looks like https://github.com/phpservermon/phpservermon/blob/b59f62c13925631dc762a53ab347c27c8613e06e/src/psm/Util/Install/Installer.php#L707 is how they encrypt.

          M 1 Reply Last reply
          0
          • girishG girish

            Looks like https://github.com/phpservermon/phpservermon/blob/b59f62c13925631dc762a53ab347c27c8613e06e/src/psm/Util/Install/Installer.php#L707 is how they encrypt.

            M Offline
            M Offline
            msbt
            App Dev
            wrote on last edited by
            #4

            @girish yea I've tried with https://git.cloudron.io/msbt/phpservermonitor-app/-/blob/master/start.sh#L26 from the github recommendation, but that comes out a few characters short 😉

            1 Reply Last reply
            0
            • girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #5

              @msbt I guess we should put this app in App Requests? I can't seem to find it

              M 1 Reply Last reply
              0
              • girishG girish

                @msbt I guess we should put this app in App Requests? I can't seem to find it

                M Offline
                M Offline
                msbt
                App Dev
                wrote on last edited by msbt
                #6

                Hah yea, I wasn't sure where to create that topic - totally your call. I'm a big fan and other people might like it as well.

                Edit: Also wondered why it wasn't there, maybe it's not that popular.

                girishG 2 Replies Last reply
                0
                • M msbt

                  Hah yea, I wasn't sure where to create that topic - totally your call. I'm a big fan and other people might like it as well.

                  Edit: Also wondered why it wasn't there, maybe it's not that popular.

                  girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote on last edited by
                  #7

                  @msbt Added it now https://forum.cloudron.io/topic/3845/php-server-monitor

                  1 Reply Last reply
                  1
                  • M msbt

                    Hah yea, I wasn't sure where to create that topic - totally your call. I'm a big fan and other people might like it as well.

                    Edit: Also wondered why it wasn't there, maybe it's not that popular.

                    girishG Offline
                    girishG Offline
                    girish
                    Staff
                    wrote on last edited by
                    #8

                    @msbt finally got around to this. I managed to automate the initial admin setup 🙂 Will clean things up tomorrow and get it published.

                    1 Reply Last reply
                    4
                    • girishG Offline
                      girishG Offline
                      girish
                      Staff
                      wrote on last edited by
                      #9

                      OK, I have published this now! thanks @msbt . Still a few rough edges, will fix it as I write the tests.

                      M 1 Reply Last reply
                      2
                      • girishG girish

                        OK, I have published this now! thanks @msbt . Still a few rough edges, will fix it as I write the tests.

                        M Offline
                        M Offline
                        msbt
                        App Dev
                        wrote on last edited by
                        #10

                        @girish awesome, works perfectly from what I can see!

                        1 Reply Last reply
                        2
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Bookmarks
                          • Search