letsencrypt via api?

Discussion in 'General' started by nhybgtvfr, Nov 30, 2021.

  1. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    is it possible to set the letsencrypt status of a website via the api?

    i've looked through the example files in the 3.2.7 tarball, and there's no mention of letsencrypt as part of the params in sites_web_domain_add.php or sites_web_domain_update.php.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, that should be possible. Basically, you can use almost any column of a database table in dbispconfig in the $params array in the matching API function, except for the primary ID of the table and except the sys_* columns. The table to look at for the websites is web_domain.
     
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    ok, thanks.
    just to make it clear, i'm looking at the sites_web_domain_add.php file at the moment, with all the params in there.
    but basically, if i send a soap request add a web_domain, i can add any params in there, and leave any out, those left out will just take the db default entry? are there any params that are always required to be sent? apart from 'domain'?

    sorry if it all seems basic, but i'm not even close to being a programmer, i'm just looking at the blesta ispconfig module, there's definitely stuff missing out, there's nothing in there to add anything to the domains table, or create any maildomain, mailbox etc, so i'm hoping i can work it all out from what is in the module, and what's in the ispconfig example docs. but i'm basically starting from knowing nothing...
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    That's not so easy to say as leaving out parameters might cause issues. In general, when you use an example from API docs, it's best to keep it as it is and just add missing parameters, not removing any. The API docs are not up to date, so some parameters are missing.
     
    Alex Hammerschmied likes this.
  5. Alex Hammerschmied

    Alex Hammerschmied New Member

    @nhybgtvfr Did you solve this?
    I tried to add letsencrypt via API with the sites_web_domain_add.php.
    In ISPConfig the checkbox is checked after running the command but it is not active. When I click save inside ISPConfig it creates the (at this point still missing) letsencrypt certificate. How can I run the certificate creation without verifying it manually?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

  7. Alex Hammerschmied

    Alex Hammerschmied New Member

    To verify:
    I added the lines:
    'ssl' => 'y',
    'ssl_letsencrypt' => 'y',
    and it shows everything correctly. But there's no certificate made. So I guess the script to create the actual certificate is not startet just by checking the box via the api
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    The script server.sh which does all configuration is run based on changes in the database tables, so if the Let#s encrypt checkbox shows up as checked after using the API, then the script processes these changes, it is run once a minute. Please have a look at the Let's encrypt error FAQ, it also contains a link to the debug instructions at the end.
     
    Alex Hammerschmied likes this.
  9. Alex Hammerschmied

    Alex Hammerschmied New Member

    Thank you Till,
    I got one step closer. Starting to debug now.
     

Share This Page