User Tools

Site Tools


evenements:log:20200606

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
evenements:log:20200606 [2020-06-06 21:03] – [Log] Lomanicevenements:log:20200606 [2020-10-17 19:15] – [Log] minor change to systemd unit Lomanic
Line 1: Line 1:
 ====== Online Fuzturday #1 ====== ====== Online Fuzturday #1 ======
  
-First proposal of a [[https://matrix.to/#/#telemake:matrix.fuz.re|Telemake]] event, the theme for this one is to migrate https://presence-button.glitch.me to sonic (at https://presence.fuz.re). Event will  take place 2020-06-06 15:00 (approx) Paris time, on Jitsi meet https://talk.fdn.fr/onlinefuzturday1+First proposal of a [[https://matrix.to/#/#telemake:matrix.fuz.re|Telemake]] event, the theme for this one is to migrate [[projets:fuz:presence button]]'s API from https://presence-button.glitch.me to sonic (at https://presence.fuz.re). Event will  take place 2020-06-06 15:00 (approx) Paris time, on Jitsi meet https://talk.fdn.fr/onlinefuzturday1
 ===== Proposed plan ===== ===== Proposed plan =====
  
Line 23: Line 23:
   * ''sudo adduser presence''   * ''sudo adduser presence''
   * ''<nowiki>sudo -u presence -i; curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash; nvm install node --lts</nowiki>''   * ''<nowiki>sudo -u presence -i; curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash; nvm install node --lts</nowiki>''
-  * ''<nowiki>git clone https://git.interhacker.space/Lomanic/presence-button-web</nowiki>'', add .env file and append ''echo "PORT=3000" >> .env'', otherwise the listening port would be dynamic (useless for reverse proxy)+  * ''<nowiki>git clone https://git.interhacker.space/Lomanic/presence-button-web</nowiki>'', add .env file and append ''<nowiki>echo "PORT=3000" >> .env</nowiki>'', otherwise the listening port would be dynamic (useless for reverse proxy)
   * following https://doc.ubuntu-fr.org/creer_un_service_avec_systemd#exemple_de_service_de_type_simple <code>   * following https://doc.ubuntu-fr.org/creer_un_service_avec_systemd#exemple_de_service_de_type_simple <code>
-cat << EOF > /etc/systemd/system/presence-button-web.service +sudo cat << EOF > /etc/systemd/system/presence-button-web.service 
-[Unit]  +[Unit]
 Description=Presence button web Description=Presence button web
 After=network-online.target After=network-online.target
Line 50: Line 50:
         server.document-root = "/var/www/fuz.re/presence/site"         server.document-root = "/var/www/fuz.re/presence/site"
                 $HTTP["url"] !~ "^/.well-known/acme-challenge/" {                 $HTTP["url"] !~ "^/.well-known/acme-challenge/" {
-                        proxy.server = ( "" => (("host" => "127.0.0.1", "port" => 3000)) )+                        proxy.server = ( "" => (("host" => "127.0.0.1", "port" => 3000)) ) # the nodejs server handles the HTTPS redirect by itself as historically ESP couldn't talk SSL (and Glitch doesn't auto-redirect), so was not redirecting /api
                 }                 }
         }         }
Line 62: Line 62:
 } }
 </code>''mkdir -p /var/www/fuz.re/presence/site'' </code>''mkdir -p /var/www/fuz.re/presence/site''
-  * letsencrypt +  * oh letsencrypt, what a nice WTF moment. You have to edit some random ''/etc/letsencrypt/autorenew.sh'' to include your new domain (and of course, this script is only manually called right?) while everything can be done inside certbot already (you can call commands after a successful renewal). For the curious as it's not documented anywhere (found this script almost by mistake in fact):<code> 
-  * add ssl to vhost +sudo letsencrypt certonly -n --agree-tos -d presence.fuz.re --webroot --webroot-path /var/www/fuz.re/presence/site/ 
-  * test+sudo cat /etc/letsencrypt/live/presence.fuz.re/{privkey,cert}.pem | sudo tee /etc/lighttpd/certs/presence.fuz.re.pem >/dev/null 
 +</code> 
 +  * uncomment the SSL part in ''/etc/lighttpd/lighttpd.conf'' above 
 +  * http://presence.fuz.re -> https://presence.fuz.re everything looks OK (didn'test with an ESP but it would post a message in #toctoctoc), though there are many unsatisfactory things remaining (the lighttpd/frankenletsencrypt duo is maddening of course, but the presence-button-web code is bad in many ways), this will be for another day
  
  
evenements/log/20200606.txt · Last modified: 2023-02-02 22:06 by 127.0.0.1