h-mdm / remote-control

Remote access to Android mobile devices (server part). This tool doesn't require USB connection! Screen mirroring, remote control by replaying gestures.

Home Page:https://headwind-remote.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ssl renewing

p3im4n opened this issue · comments

hi Mr. @h-mdm
I was wonder how is ssl renewing ?
this command didn't work:
sudo -H ./letsencrypt-auto certonly --standalone --renew-by-default -d abc.com -d www.abc.com

best regard

./install.sh should do the task.

./install.sh should do the task.

thanks for quick response
but there must be better way than to deploy web again
its too risky

thanks again MR. @h-mdm

./install.sh should do the task.

hi MR @h-mdm
it did not
it chacks the SSL availability and pass the task and goes to the next task
which files should I delete to renew SSL?

./install.sh should renew the certificates. But it may fail in case your website is not available through http (Certbot uses port 80 to confirm the domain ownership).

You can attach the output of the install.sh script for analysis.

root@srv127032:~/apuppet-server# ./install.sh
Installing Ansible software to deploy aPuppet ..
Checking if we're using Ubuntu: name="Ubuntu" and version="20.04"
OK, start installing on actual LTS Ubuntu 20.04 ..
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Get:5 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Get:6 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages [10.9 kB]
Fetched 68.6 kB in 1s (50.7 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
ansible is already the newest version (2.9.6+dfsg-1).
Selected version '2.9.6+dfsg-1' (Ubuntu:20.04/focal [all]) for 'ansible'
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Start deploy aPuppet ..
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [Install] *****************************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************
ok: [localhost]

PLAY [Install prerequisites] ***************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************
ok: [localhost]

TASK [Checking Linux distro] ***************************************************************************************************************************
ok: [localhost] => {
"msg": [
"Distro name: Ubuntu Distro version: 20"
]
}

TASK [Install python2 pip] *****************************************************************************************************************************
skipping: [localhost]

TASK [Install dnslookup library for python2] ***********************************************************************************************************
skipping: [localhost]

TASK [Install required Python packages] ****************************************************************************************************************
skipping: [localhost]

TASK [Get Python 3 path] *******************************************************************************************************************************
skipping: [localhost]

TASK [Get Python 3 version] ****************************************************************************************************************************
skipping: [localhost]

TASK [Set Python 3 interpreter for deployment] *********************************************************************************************************
skipping: [localhost]

TASK [Set Python 3 interpreter version] ****************************************************************************************************************
skipping: [localhost]

TASK [Python3 setup tools] *****************************************************************************************************************************
ok: [localhost]

TASK [PIP] *********************************************************************************************************************************************
ok: [localhost]

TASK [Install required system packages] ****************************************************************************************************************
ok: [localhost]

TASK [Install required python packages] ****************************************************************************************************************
ok: [localhost]

TASK [Install SSL tools] *******************************************************************************************************************************
ok: [localhost]

TASK [Add key for docker repository] *******************************************************************************************************************
ok: [localhost]

TASK [Add docker repository] ***************************************************************************************************************************
ok: [localhost]

TASK [Install Docker] **********************************************************************************************************************************
ok: [localhost]

TASK [Install tools] ***********************************************************************************************************************************
skipping: [localhost]

TASK [Install required python packages] ****************************************************************************************************************
skipping: [localhost]

TASK [Add Docker repo] *********************************************************************************************************************************
skipping: [localhost]

TASK [Install Docker] **********************************************************************************************************************************
skipping: [localhost]

TASK [Warning about manual Docker installation] ********************************************************************************************************
skipping: [localhost]

TASK [Ensure Docker is started and enabled at boot] ****************************************************************************************************
ok: [localhost]

TASK [Ensure current user is added to the docker group] ************************************************************************************************
skipping: [localhost]

TASK [Download docker-compose] *************************************************************************************************************************
ok: [localhost]

TASK [Download docker-compose autocompletion (for bash only)] ******************************************************************************************
ok: [localhost]

PLAY [Prepare Nginx] ***********************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************
ok: [localhost]

TASK [Ensure admin email is defined] *******************************************************************************************************************
skipping: [localhost]

TASK [Ensure hostname is defined] **********************************************************************************************************************
skipping: [localhost]

TASK [Try to resolve hostname "topdesk.ir"] ************************************************************************************************************
ok: [localhost]

TASK [Ensure hostname "topdesk.ir" has been resolved] **************************************************************************************************
skipping: [localhost]

TASK [Set "public_ip" to "193.105.234.198" if it empty in config.yaml] *********************************************************************************
ok: [localhost]

TASK [Process SSL availability] ************************************************************************************************************************
ok: [localhost]

TASK [Ensures web-admin dist JS dir exists] ************************************************************************************************************
ok: [localhost]

TASK [Ensures web-admin dist CSS dir exists] ***********************************************************************************************************
ok: [localhost]

TASK [Check that the Diffie-Hellman parameters file is exists] *****************************************************************************************
ok: [localhost]

TASK [Generate Diffie-Hellman parameters file with 2048 bits size. IT MAY TAKE A LONG TIME!] ***********************************************************
skipping: [localhost]

PLAY [Prepare aPuppet] *********************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************
ok: [localhost]

TASK [Install python2 pip] *****************************************************************************************************************************
skipping: [localhost]

TASK [Install dnslookup library for python2] ***********************************************************************************************************
skipping: [localhost]

TASK [Install required Python packages] ****************************************************************************************************************
skipping: [localhost]

TASK [Get Python 3 path] *******************************************************************************************************************************
skipping: [localhost]

TASK [Get Python 3 version] ****************************************************************************************************************************
skipping: [localhost]

TASK [Set Python 3 interpreter for deployment] *********************************************************************************************************
skipping: [localhost]

TASK [Set Python 3 interpreter version] ****************************************************************************************************************
skipping: [localhost]

TASK [Python3 setup tools] *****************************************************************************************************************************
ok: [localhost]

TASK [PIP] *********************************************************************************************************************************************
ok: [localhost]

TASK [Ensure admin email is defined] *******************************************************************************************************************
skipping: [localhost]

TASK [Ensure hostname is defined] **********************************************************************************************************************
skipping: [localhost]

TASK [Try to resolve hostname "topdesk.ir"] ************************************************************************************************************
ok: [localhost]

TASK [Ensure hostname "topdesk.ir" has been resolved] **************************************************************************************************
skipping: [localhost]

TASK [Set "public_ip" to "193.105.234.198" if it empty in config.yaml] *********************************************************************************
skipping: [localhost]

TASK [Process SSL availability] ************************************************************************************************************************
ok: [localhost]

TASK [Ensures web-admin dist JS dir exists] ************************************************************************************************************
ok: [localhost]

TASK [Ensures web-admin dist CSS dir exists] ***********************************************************************************************************
ok: [localhost]

TASK [Process secret for all Janus API requests] *******************************************************************************************************
ok: [localhost]

TASK [Process secret for Janus Admin API requests] *****************************************************************************************************
ok: [localhost]

TASK [Process Nginx configuration] *********************************************************************************************************************
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/nginx/nginx.conf.j2)

TASK [Process Janus configuration files (templated)] ***************************************************************************************************
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.transport.http.jcfg.j2)
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.jcfg.j2)
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.transport.websockets.jcfg.j2)

TASK [Process Janus configuration files] ***************************************************************************************************************
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.eventhandler.wsevh.jcfg)
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.eventhandler.sampleevh.jcfg)
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.plugin.textroom.jcfg)
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.plugin.streaming.jcfg)

TASK [Process web-admin configuration] *****************************************************************************************************************
ok: [localhost]

TASK [Process docker-compose configuration] ************************************************************************************************************
ok: [localhost]

PLAY [Prepare Certbot] *********************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************
ok: [localhost]

TASK [Install python2 pip] *****************************************************************************************************************************
skipping: [localhost]

TASK [Install dnslookup library for python2] ***********************************************************************************************************
skipping: [localhost]

TASK [Install required Python packages] ****************************************************************************************************************
skipping: [localhost]

TASK [Get Python 3 path] *******************************************************************************************************************************
skipping: [localhost]

TASK [Get Python 3 version] ****************************************************************************************************************************
skipping: [localhost]

TASK [Set Python 3 interpreter for deployment] *********************************************************************************************************
skipping: [localhost]

TASK [Set Python 3 interpreter version] ****************************************************************************************************************
skipping: [localhost]

TASK [Python3 setup tools] *****************************************************************************************************************************
ok: [localhost]

TASK [PIP] *********************************************************************************************************************************************
ok: [localhost]

TASK [Ensure admin email is defined] *******************************************************************************************************************
skipping: [localhost]

TASK [Ensure hostname is defined] **********************************************************************************************************************
skipping: [localhost]

TASK [Try to resolve hostname "topdesk.ir"] ************************************************************************************************************
ok: [localhost]

TASK [Ensure hostname "topdesk.ir" has been resolved] **************************************************************************************************
skipping: [localhost]

TASK [Set "public_ip" to "193.105.234.198" if it empty in config.yaml] *********************************************************************************
skipping: [localhost]

TASK [Process SSL availability] ************************************************************************************************************************
ok: [localhost]

TASK [Ensures web-admin dist JS dir exists] ************************************************************************************************************
ok: [localhost]

TASK [Ensures web-admin dist CSS dir exists] ***********************************************************************************************************
ok: [localhost]

TASK [Ensure aPuppet is not running] *******************************************************************************************************************
changed: [localhost]

TASK [Process Nginx configuration for ACME challenge] **************************************************************************************************
changed: [localhost] => (item=/root/apuppet-server/deploy/./templates/nginx-acme/nginx.conf.j2)

TASK [Start Nginx for ACME challenge] ******************************************************************************************************************
changed: [localhost]

TASK [Run certbot] *************************************************************************************************************************************
changed: [localhost]

TASK [Stop services] ***********************************************************************************************************************************
changed: [localhost]

PLAY [Prepare web admin application] *******************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************
ok: [localhost]

TASK [Install python2 pip] *****************************************************************************************************************************
skipping: [localhost]

TASK [Install dnslookup library for python2] ***********************************************************************************************************
skipping: [localhost]

TASK [Install required Python packages] ****************************************************************************************************************
skipping: [localhost]

TASK [Get Python 3 path] *******************************************************************************************************************************
skipping: [localhost]

TASK [Get Python 3 version] ****************************************************************************************************************************
skipping: [localhost]

TASK [Set Python 3 interpreter for deployment] *********************************************************************************************************
skipping: [localhost]

TASK [Set Python 3 interpreter version] ****************************************************************************************************************
skipping: [localhost]

TASK [Python3 setup tools] *****************************************************************************************************************************
ok: [localhost]

TASK [PIP] *********************************************************************************************************************************************
ok: [localhost]

TASK [Get builder image for web-admin] *****************************************************************************************************************
ok: [localhost]

TASK [Start build web-admin] ***************************************************************************************************************************
changed: [localhost]

TASK [Waiting until web-admin is ready] ****************************************************************************************************************
ok: [localhost]

TASK [Remove builder] **********************************************************************************************************************************
changed: [localhost]

TASK [Release web-admin assets] ************************************************************************************************************************
changed: [localhost] => (item={'src': '../web-admin/dist', 'dest': './dist/web-admin/'})
ok: [localhost] => (item={'src': '../web-admin/static', 'dest': './dist/web-admin/'})
changed: [localhost] => (item={'src': '../web-admin/index.html', 'dest': './dist/web-admin/'})

PLAY RECAP *********************************************************************************************************************************************
localhost : ok=55 changed=8 unreachable=0 failed=0 skipped=46 rescued=0 ignored=0

Start aPuppet ..
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [Prepare aPuppet] *********************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************
ok: [localhost]

TASK [Install python2 pip] *****************************************************************************************************************************
skipping: [localhost]

TASK [Install dnslookup library for python2] ***********************************************************************************************************
skipping: [localhost]

TASK [Install required Python packages] ****************************************************************************************************************
skipping: [localhost]

TASK [Get Python 3 path] *******************************************************************************************************************************
skipping: [localhost]

TASK [Get Python 3 version] ****************************************************************************************************************************
skipping: [localhost]

TASK [Set Python 3 interpreter for deployment] *********************************************************************************************************
skipping: [localhost]

TASK [Set Python 3 interpreter version] ****************************************************************************************************************
skipping: [localhost]

TASK [Python3 setup tools] *****************************************************************************************************************************
ok: [localhost]

TASK [PIP] *********************************************************************************************************************************************
ok: [localhost]

TASK [Ensure admin email is defined] *******************************************************************************************************************
skipping: [localhost]

TASK [Ensure hostname is defined] **********************************************************************************************************************
skipping: [localhost]

TASK [Try to resolve hostname "topdesk.ir"] ************************************************************************************************************
ok: [localhost]

TASK [Ensure hostname "topdesk.ir" has been resolved] **************************************************************************************************
skipping: [localhost]

TASK [Set "public_ip" to "193.105.234.198" if it empty in config.yaml] *********************************************************************************
ok: [localhost]

TASK [Process SSL availability] ************************************************************************************************************************
ok: [localhost]

TASK [Ensures web-admin dist JS dir exists] ************************************************************************************************************
ok: [localhost]

TASK [Ensures web-admin dist CSS dir exists] ***********************************************************************************************************
ok: [localhost]

TASK [Process secret for all Janus API requests] *******************************************************************************************************
ok: [localhost]

TASK [Process secret for Janus Admin API requests] *****************************************************************************************************
ok: [localhost]

TASK [Process Nginx configuration] *********************************************************************************************************************
changed: [localhost] => (item=/root/apuppet-server/deploy/./templates/nginx/nginx.conf.j2)

TASK [Process Janus configuration files (templated)] ***************************************************************************************************
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.transport.http.jcfg.j2)
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.jcfg.j2)
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.transport.websockets.jcfg.j2)

TASK [Process Janus configuration files] ***************************************************************************************************************
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.eventhandler.wsevh.jcfg)
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.eventhandler.sampleevh.jcfg)
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.plugin.textroom.jcfg)
ok: [localhost] => (item=/root/apuppet-server/deploy/./templates/janus/janus.plugin.streaming.jcfg)

TASK [Process web-admin configuration] *****************************************************************************************************************
ok: [localhost]

TASK [Process docker-compose configuration] ************************************************************************************************************
ok: [localhost]

PLAY [Start aPuppet] ***********************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************
ok: [localhost]

TASK [set_fact] ****************************************************************************************************************************************
ok: [localhost]

TASK [(Re)Starting aPuppet] ****************************************************************************************************************************
changed: [localhost]

TASK [Welcome!] ****************************************************************************************************************************************
ok: [localhost] => {
"msg": [
"To control your mobile devices remotely, install the aPuppet Android agent and use the following server URL and secret:",
"https://topdesk.ir/web-admin/",
"API Secret: xenSuZ84"
]
}

PLAY RECAP *********************************************************************************************************************************************
localhost : ok=19 changed=2 unreachable=0 failed=0 skipped=10 rescued=0 ignored=0

INSTALL SCRIPT COMPLETED
root@srv127032:~/apuppet-server#

Strange, for some reason certbot is not renewing your certificates...

Try to remove the contents of deploy/dist/ssl folder:

rm -rf deploy/dist/ssl/*

rm -rf deploy/dist/ssl/*
I did this before
it cause Nginx malfunctioning, so there was no web at topdesk.ir address.

After removal, you need to run ./install.sh once again, to re-create the SSL files.

After removal, you need to run ./install.sh once again, to re-create the SSL files.

of course, I did it, and it deployed with no error
there must be the way to renewal without re deploy the server

hi Mr @h-mdm
the problem solved
it was no accessing to /.wellknown/acme-challenge folder after adding server block for SSL
I combined two blocks to one
then let'sencrypte could renewal its certificate

sincerely yours,
peiman sh