aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/landing/Dockerfile3
-rw-r--r--docker/landing/html/.well-known/matrix/client9
-rw-r--r--docker/landing/html/.well-known/matrix/server0
-rw-r--r--docker/landing/html/index.html128
-rw-r--r--docker/landing/html/landing/arobase.pngbin1326 -> 0 bytes
-rw-r--r--docker/landing/html/landing/fonts/texgyreheros-bold.otfbin144464 -> 0 bytes
-rw-r--r--docker/landing/html/landing/fonts/texgyreheros-bolditalic.otfbin146012 -> 0 bytes
-rw-r--r--docker/landing/html/landing/fonts/texgyreheros-italic.otfbin150164 -> 0 bytes
-rw-r--r--docker/landing/html/landing/fonts/texgyreheros-regular.otfbin143912 -> 0 bytes
-rw-r--r--docker/landing/html/landing/fonts/texgyreheroscn-bold.otfbin140124 -> 0 bytes
-rw-r--r--docker/landing/html/landing/fonts/texgyreheroscn-bolditalic.otfbin147024 -> 0 bytes
-rw-r--r--docker/landing/html/landing/fonts/texgyreheroscn-italic.otfbin146948 -> 0 bytes
-rw-r--r--docker/landing/html/landing/fonts/texgyreheroscn-regular.otfbin139992 -> 0 bytes
-rw-r--r--docker/landing/html/landing/img/flower.svg1
-rw-r--r--docker/landing/html/landing/prototype.html131
-rw-r--r--docker/landing/html/robots.txt2
-rw-r--r--docker/webpull/README.md3
-rw-r--r--docker/webpull/main.go80
18 files changed, 83 insertions, 274 deletions
diff --git a/docker/landing/Dockerfile b/docker/landing/Dockerfile
deleted file mode 100644
index b4cbbce..0000000
--- a/docker/landing/Dockerfile
+++ /dev/null
@@ -1,3 +0,0 @@
-FROM superboum/amd64_webserver:v2
-COPY ./html /srv/http
-
diff --git a/docker/landing/html/.well-known/matrix/client b/docker/landing/html/.well-known/matrix/client
deleted file mode 100644
index d34a03a..0000000
--- a/docker/landing/html/.well-known/matrix/client
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "m.homeserver": {
- "base_url": "https://im.deuxfleurs.fr"
- },
- "m.identity_server": {
- "base_url": "https://vector.im"
- }
-}
-
diff --git a/docker/landing/html/.well-known/matrix/server b/docker/landing/html/.well-known/matrix/server
deleted file mode 100644
index e69de29..0000000
--- a/docker/landing/html/.well-known/matrix/server
+++ /dev/null
diff --git a/docker/landing/html/index.html b/docker/landing/html/index.html
deleted file mode 100644
index 239af7a..0000000
--- a/docker/landing/html/index.html
+++ /dev/null
@@ -1,128 +0,0 @@
-<!doctype html>
-<html lang="fr">
- <head>
- <title>💮💮 deuxfleurs.fr</title>
- <meta charset="utf-8"/>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="Description" content="deuxfleurs.fr, communiquer en préservant nos libertés">
-<style>
-* {
- background-color: #fafafa;
- color: #111;
- font-family: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
- font-weight: normal;
- font-size: 20px;
- line-height: 1.4em;
-}
-
-strong {
- font-weight: bold;
-}
-
-header > h1, header > h2 {
- display: inline;
- font-size: 28px;
-}
-
-article > h2::before {
- content: "# ";
-}
-
-article > h2 {
- font-size: 34px;
-}
-
-article > h3 {
- font-size: 28px;
-}
-
-samp {
- font-family: "Courier";
-}
-
-.container {
- display: flex;
- justify-content: center;
-}
-.main.content {
- width: 100%;
- max-width: 1200px;
-}
-</style>
- </head>
-
- <body>
- <div class="container">
- <div class="content main">
- <header>
- <h1>💮💮 deuxfleurs.fr</h1>
- <h2> - préservons nos libertés</h2>
- <hr/>
- </header>
- <article>
- <h2>Notre raison d'ĂŞtre</h2>
- <p>
- Aujourd'hui, de grandes entreprises conçoivent des services numériques qui ont pour objectif de <a href="https://fr.wikipedia.org/wiki/%C3%89conomie_de_l%27attention">maximiser le temps</a> que nous passons dessus, de <a href="https://fr.wikipedia.org/wiki/%C3%89conomie_de_la_surveillance">collecter et recouper des données</a> à notre insu pour nous influencer, de <a href="https://www.april.org/le-parlement-europeen-valide-la-generalisation-de-la-censure-automatisee">limiter nos possibilités d'expression</a> au delà du cadre légal et de <a href="https://fr.wikipedia.org/wiki/Embrace,_extend_and_extinguish">créer de nouveaux monopôles</a>. Ces effets nous montrent que la technologie n'est pas neutre et a un réel impact sur nos vies. En choisissant et en hébergeant nos propres outils de communication, sans but lucratif ni hégémonique, nous espérons nous affranchir de ces nuisances et préserver nos libertés.
- </p>
-
- <p>Pour en savoir plus, rendez-vous sur <a href="https://www.laquadrature.net/">La Quadrature du Net</a> et allez lire le manifeste <a href="https://chatons.org/fr/manifeste">des CHATONS</a>.
- </p>
-
- <h2> Nos services </h2>
- <h3>💬 Communications instantanées</h3>
- <p>Riot est une application de communication instantanée libre, moderne et facile d'utilisation.
- Elle utilise un protocole standard nommé Matrix vous permettant de discuter avec des personnes qui ont des comptes ailleurs que sur deuxfleurs.fr.
- En activant le chiffrement de bout en bout, vos conversations ne seront lisible par aucun tiers (ni les administrateurs de ce service, ni votre fournisseur d'accès).
- L'application propose aussi de la visioconférence, des discussions à plusieurs, une gestion des communautés, etc.
- </p>
- <p>
- Pour vous connecter sur l'application mobile, choisissez paramètres avancés et dans serveur d'accueil changez la valeur par <samp>https://im.deuxfleurs.fr</samp>.
- Ensuite, utilisez votre nom d'utilisateur et votre mot de passe pour vous connecter.
- </p>
- <p>
- <a href="https://riot.deuxfleurs.fr">Accéder à Riot Web</a> -
- <a href="https://play.google.com/store/apps/details?id=im.vector.app">Télécharger Riot pour Android</a> -
- <a href="https://itunes.apple.com/gb/app/vector.im/id1083446067?mt=8">TĂ©lecharger Riot pour iOS</a>
- </p>
- <h3>📨 Email, Contacts, Calendrier </h3>
- <p>
- Nous fournissons des adresses email en <samp>@deuxfleurs.fr</samp>. Sans publicité et sans lire vos emails. Mais aussi un carnet de contact et un calendrier. Le tout synchronisable entre vos différents terminaux (ordinateur, téléphone, tablette...).
- </p>
- <p>
- Pour vous connecter depuis une application email (sur mobile ou ordinateur), définissez les valeurs suivantes pour le serveur de réception. Protocole : <samp>IMAP</samp>, hôte : <samp>imap.deuxfleurs.fr</samp>, chiffrement : <samp>SSL/TLS</samp>, port : <samp>993</samp>, votre identifiant est votre adresse email, utilisez votre mot de passe normal. Pour le serveur d'envoi, utilisez les valeurs suivantes. Protocole : <samp>SMTP</samp>, hôte : <samp>smtp.deuxfleurs.fr</samp>, chiffrement : <samp>SSL/TLS</samp>, port <samp>465</samp>, votre identifiant et mot de passe sont les mêmes que pour le serveur de réception.
- </p>
- <p>
- Si votre application le supporte, vous pouvez Ă©galement vous connecter avec le protocole Exchange/Active-Sync qui synchronisera vos emails, votre calendrier et vos contacts. Dans ce cas, le serveur est <samp>sogo.deuxfleurs.fr</samp>. Utilisez votre email et votre mot de passe normal pour vous identifier.
- </p>
- <p>
- <a href="https://sogo.deuxfleurs.fr">Accéder à Sogo Web</a> -
- <a href="https://www.thunderbird.net/fr/">Télécharger Thunderbird pour ordinateur</a> -
- <a href="https://play.google.com/store/apps/details?id=com.fsck.k9&hl=fr">Télécharger K9 Mail pour Android</a>
- </p>
- <h3>đź“„ Stockage de fichiers</h3>
- <p>Seafile vous permet de créer une sauvegarde de vos fichiers sur nos machines, de les synchroniser entre vos différents terminaux (ordinateur, téléphone, tablette...) et de partager des dossiers à plusieurs pour collaborer.
- </p>
- <p>
- Pour vous connecter sur l'application (mobile ou ordinateur), vous devez renseigner votre email et votre mot de passe ainsi que l'URL de l'instance : <samp>https://cloud.deuxfleurs.fr</samp>.
- </p>
- <p>
- <a href="https://cloud.deuxfleurs.fr">Accéder à Seafile Web</a> -
- <a href="https://www.seafile.com/en/download/">Télécharger Seafile pour ordinateur et mobile</a>
- </p>
-
- <h2> Nos objectifs </h2>
-
- <h3>Des utilisateurs impliqués</h3>
- <p>Que ce soit à l'école, par l'expérimentation, via un forum d'échange, lors d'un atelier, via une publicité à la télévision, un tutoriel, lors d'une discussion avec un ami, il y toujours une phase d'apprentissage en informatique. Malheureusement, dans ces conditions, dur de lutter pour des services libres face à la puissance de frappe d'une entreprise et des logiciels ayant une base d'utilisateurs immense. Nous pensons donc qu'une personne souhaitant s'héberger chez un hébergeur indépendant a besoin d'un accompagnement. C'est pourquoi les inscriptions se font par cooptation. La cooptation permet aussi un lien de confiance et ainsi de se prémunir de bon nombres d'attaques que subissent les hébergeurs.</p>
-
- <h3>Une architecture résiliente</h3>
- <p>Les sites webs, les réseaux sociaux, les emails ne peuvent fonctionner que grâce à des ordinateurs qui restent allumés 24/24h et qui n'attendent que vous. Cependant, ces derniers sont faillibles. Une coupure d'électricité, un disque dur cassé, une mise à jour ratée, un bug dans le logiciel, les raisons ne manquent pas. Heureusement, il est possible de masquer ces pannes avec du logiciel astucieusement conçu. C'est pourquoi vous avez l'impression que Google est toujours disponible, que Dropbox ne perd pas vos données, etc. La gestion de ces pannes, c'est aussi ce qui rend la vie compliquée aux hébergeurs indépendants. Entre incompréhension des utilisateurs quand un service est hors ligne et sueurs froides pour les administrateurs, ça n'a rien de marrant. Et c'est très chronophage. Notre objectif est donc de construire des solutions d'hébergements qui peuvent résister à ces pannes.</p>
-
- <h2>Comment nous rejoindre ?</h2>
- <p>Si vous connaissez un utilisateur du service, contactez-le directement.<br/>
-Sinon, vous pouvez envoyer un email Ă  <samp>coucou</samp><img src="landing/arobase.png" alt="arobase" width="14"><samp>deuxfleurs.fr</samp>.</p>
- </article>
- </div>
- </div>
- </body>
-</html>
diff --git a/docker/landing/html/landing/arobase.png b/docker/landing/html/landing/arobase.png
deleted file mode 100644
index d2a275a..0000000
--- a/docker/landing/html/landing/arobase.png
+++ /dev/null
Binary files differ
diff --git a/docker/landing/html/landing/fonts/texgyreheros-bold.otf b/docker/landing/html/landing/fonts/texgyreheros-bold.otf
deleted file mode 100644
index 2f23b92..0000000
--- a/docker/landing/html/landing/fonts/texgyreheros-bold.otf
+++ /dev/null
Binary files differ
diff --git a/docker/landing/html/landing/fonts/texgyreheros-bolditalic.otf b/docker/landing/html/landing/fonts/texgyreheros-bolditalic.otf
deleted file mode 100644
index 556b8e1..0000000
--- a/docker/landing/html/landing/fonts/texgyreheros-bolditalic.otf
+++ /dev/null
Binary files differ
diff --git a/docker/landing/html/landing/fonts/texgyreheros-italic.otf b/docker/landing/html/landing/fonts/texgyreheros-italic.otf
deleted file mode 100644
index ae50725..0000000
--- a/docker/landing/html/landing/fonts/texgyreheros-italic.otf
+++ /dev/null
Binary files differ
diff --git a/docker/landing/html/landing/fonts/texgyreheros-regular.otf b/docker/landing/html/landing/fonts/texgyreheros-regular.otf
deleted file mode 100644
index ac6c32f..0000000
--- a/docker/landing/html/landing/fonts/texgyreheros-regular.otf
+++ /dev/null
Binary files differ
diff --git a/docker/landing/html/landing/fonts/texgyreheroscn-bold.otf b/docker/landing/html/landing/fonts/texgyreheroscn-bold.otf
deleted file mode 100644
index dc5f63a..0000000
--- a/docker/landing/html/landing/fonts/texgyreheroscn-bold.otf
+++ /dev/null
Binary files differ
diff --git a/docker/landing/html/landing/fonts/texgyreheroscn-bolditalic.otf b/docker/landing/html/landing/fonts/texgyreheroscn-bolditalic.otf
deleted file mode 100644
index 2b46b47..0000000
--- a/docker/landing/html/landing/fonts/texgyreheroscn-bolditalic.otf
+++ /dev/null
Binary files differ
diff --git a/docker/landing/html/landing/fonts/texgyreheroscn-italic.otf b/docker/landing/html/landing/fonts/texgyreheroscn-italic.otf
deleted file mode 100644
index f5159dd..0000000
--- a/docker/landing/html/landing/fonts/texgyreheroscn-italic.otf
+++ /dev/null
Binary files differ
diff --git a/docker/landing/html/landing/fonts/texgyreheroscn-regular.otf b/docker/landing/html/landing/fonts/texgyreheroscn-regular.otf
deleted file mode 100644
index 5630217..0000000
--- a/docker/landing/html/landing/fonts/texgyreheroscn-regular.otf
+++ /dev/null
Binary files differ
diff --git a/docker/landing/html/landing/img/flower.svg b/docker/landing/html/landing/img/flower.svg
deleted file mode 100644
index 869788e..0000000
--- a/docker/landing/html/landing/img/flower.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill-opacity="0.0" fill="#FFF" d="M15.632 34.661c-.799-.597-1.498-1.484-2.035-2.592l-.228-.47-.46.249c-.975.528-1.913.858-2.744.969l-.202-3.756-3.636.968c-.157-.854-.125-1.887.096-3.022l.103-.525-.532-.066c-1.242-.154-2.306-.525-3.104-1.08l1.521-2.917-2.988-1.523c.319-.944.948-1.882 1.834-2.735l.377-.363-.379-.36c-.803-.764-1.408-1.554-1.77-2.311l3.51-1.353-2.045-3.159c.74-.402 1.693-.686 2.789-.832l.519-.068-.091-.514c-.215-1.211-.172-2.338.124-3.288l3.308.523.524-3.308c.988.013 2.08.326 3.164.907l.462.248.226-.473c.479-1.003 1.044-1.824 1.653-2.404L18 4.326l2.372-2.92c.609.58 1.175 1.401 1.653 2.404l.226.473.462-.247c1.085-.581 2.178-.894 3.164-.906l.523 3.308 3.31-.525c.296.951.34 2.078.124 3.288l-.092.515.518.069c1.095.145 2.048.43 2.788.832l-2.046 3.156 3.511 1.355c-.361.757-.966 1.547-1.77 2.311l-.379.36.377.363c.888.854 1.516 1.793 1.835 2.736l-2.984 1.52 1.521 2.984c-.812.574-1.871.964-3.094 1.134l-.518.072.096.514c.201 1.089.226 2.083.073 2.909l-3.634-.97-.204 3.757c-.83-.11-1.768-.44-2.742-.968l-.459-.249-.228.47c-.539 1.107-1.237 1.994-2.036 2.591L18 32.293l-2.368 2.368z"/><path d="M7.092 10.678c-.53-1.489-.698-2.97-.432-4.2l2.368.375.987.156.157-.988.375-2.368c1.261.127 2.613.743 3.862 1.706.118-.337.244-.663.382-.967-1.551-1.135-3.223-1.763-4.73-1.763-.123 0-.245.004-.366.013l-.511 3.223-3.224-.511c-.6 1.487-.565 3.415.085 5.393.335-.037.684-.061 1.047-.069zm14.501-5.319c1.248-.962 2.6-1.578 3.86-1.705l.376 2.368.156.988.987-.157 2.369-.376c.266 1.23.098 2.71-.432 4.2.361.009.711.032 1.046.07.651-1.978.685-3.906.085-5.394l-3.225.512-.511-3.224c-.12-.008-.242-.012-.365-.012-1.507 0-3.179.628-4.73 1.762.14.306.266.631.384.968zM7.368 27h.035c.067 0 .157-.604.26-.947-.098.004-.197.046-.294.046-1.496 0-2.826-.303-3.83-.89l1.089-2.128.454-.887-.891-.452-2.136-1.088c.508-1.151 1.515-2.25 2.818-3.143-.287-.219-.561-.441-.81-.669-1.687 1.217-2.846 2.755-3.235 4.31l2.908 1.483-1.482 2.843C3.475 26.501 5.303 27 7.368 27zm27.806-5.846c-.39-1.555-1.548-3.093-3.234-4.311-.25.228-.523.451-.81.669 1.304.893 2.31 1.992 2.817 3.145l-2.136 1.088-.891.453.454.892 1.089 2.137c-1.004.587-2.332.904-3.828.904-.099 0-.199-.01-.299-.013.103.344.192.683.26 1.011l.039.002c2.066 0 3.892-.563 5.112-1.587l-1.482-2.908 2.909-1.482zm-12.653 9.182c-.447 1.517-1.181 2.812-2.119 3.651l-1.695-1.694-.707-.707-.707.707-1.695 1.694c-.938-.839-1.673-2.136-2.12-3.652-.296.206-.593.397-.886.563.636 1.98 1.741 3.559 3.1 4.409L18 33l2.308 2.308c1.358-.851 2.464-2.428 3.101-4.408-.295-.168-.591-.359-.888-.564z" fill="#FFF"/><path fill="#FFF" d="M20.118 5.683c.426 1.146.748 2.596.841 4.284l.2 3.683 3.564-.946c1.32-.351 2.655-.536 3.86-.536.16 0 .318.003.474.01l-1.827 2.819 3.139 1.211c-.958.759-2.237 1.514-3.814 2.123l-3.441 1.328 2.001 3.099c.918 1.42 1.509 2.782 1.838 3.96l-3.244-.865-.182 3.357c-1.019-.677-2.132-1.66-3.198-2.973L18 23.374l-2.328 2.862c-1.066 1.312-2.179 2.295-3.198 2.972l-.18-3.354-3.248.864c.329-1.178.921-2.54 1.839-3.961l2.004-3.099-3.442-1.328c-1.577-.609-2.856-1.363-3.814-2.122L8.768 15l-1.827-2.823c.155-.006.313-.01.473-.01 1.206 0 2.541.185 3.861.536l3.564.947.202-3.683c.092-1.688.415-3.138.84-4.284L18 8.292l2.118-2.609m.19-4.991L18 3.533 15.692.692c-1.989 1.532-3.421 4.992-3.646 9.112-1.617-.43-3.192-.637-4.632-.637-2.11 0-3.929.445-5.161 1.289l1.989 3.073-3.415 1.316c.842 2.366 3.69 4.797 7.54 6.283-2.241 3.465-3.116 7.106-2.407 9.516l3.537-.941.196 3.654c2.512-.07 5.703-2.027 8.307-5.228 2.603 3.201 5.796 5.158 8.306 5.228l.198-3.655 3.535.943c.71-2.411-.165-6.05-2.404-9.517 3.849-1.485 6.696-3.918 7.538-6.283l-3.415-1.318 1.99-3.07c-1.233-.844-3.053-1.29-5.164-1.29-1.438 0-3.013.207-4.63.636-.225-4.119-1.657-7.579-3.646-9.111z"/></svg>
diff --git a/docker/landing/html/landing/prototype.html b/docker/landing/html/landing/prototype.html
deleted file mode 100644
index e211e7c..0000000
--- a/docker/landing/html/landing/prototype.html
+++ /dev/null
@@ -1,131 +0,0 @@
-<!doctype html>
-<html>
- <head>
- <title>💮💮 deuxfleurs</title>
- <meta charset="utf-8"/>
- <style>
-@font-face {
- font-family: "Heroes";
- src: url('fonts/texgyreheros-regular.otf') format('truetype');
-}
-* {
- font-family: Heroes;
- margin: 0;
- padding: 0;
-}
-
-header {
- background-color: #519c60;
- color: #ffffff;
- padding: 30px 0px 1px 0px;
-}
-
-h1 {
- font-size: 5em;
-}
-
-h2 {
- font-size: 3em;
-}
-
-.spacing {
- margin-top: 1em;
-}
-
-header > .container > h1 {
- margin: 10px 0px -27px 0px;
-}
-
-header > .container > .site-name > img {
- vertical-align: -9px;
-}
-
-header > .container > .site-name > a {
- font-size: 30px;
- color: white;
- text-decoration: none;
-}
-
-.container {
- padding: 0px 40px 0px 40px;
-}
-
-.chapeau {
- font-size: 1.8em;
- font-weight: bold;
- line-height: 1.2;
-}
-
-.service-box {
- color: #000;
- text-decoration: none;
- border: 0.2em solid #000;
- width: 250px;
- text-align:center;
- margin-right: 1em;
-}
-
-.service-box:hover {
- background-color: #000;
- color: #fff;
-}
-
-.list {
- display: flex;
-}
- </style>
- </head>
-
- <body>
- <header>
- <div class="container">
- <div class="site-name" style="float:right">
- <a href="./prototype.html">deuxfleurs</a>
- <img src="img/flower.svg" width="38">
- <img src="img/flower.svg" width="38">
- </div>
- <h1>deuxfleurs</h1>
- </div>
- </header>
-
- <main>
- <div class="container spacing"/>
- <div class="chapeau">⇨ protège votre vie privée</div>
- <div class="chapeau">⇨ défend vos libertés et vos droits</div>
- <div class="chapeau">⇨ ne vous manipule pas</div>
- <div class="chapeau">⇨ promeut l'écologie via la sobriété numérique</div>
-
- <section class="spacing">
- <h2>nos services permettent de</h2>
-
- <div class="list" />
- <a href="" class="service-box spacing">
- <div style="font-size: 80px">đź’¬</div>
- <h3>discuter</h3>
- </a>
- <a href="" class="service-box spacing">
- <div style="font-size: 80px">đź“„</div>
- <h3>sauvegarder vos documents</h3>
- </a>
- <a href="" class="service-box spacing">
- <div style="font-size: 80px">📨</div>
- <h3>envoyer des emails</h3>
- </a>
- </div>
- </section>
-
- <section class="spacing">
- <h2>internet est politique</h2>
- </section>
-
- <section class="spacing">
- <h2>nous sommes une association collégiale</h2>
- </section>
-
- <section class="spacing">
- <h2>nous contacter</h2>
- </section>
- </div>
- </main>
- </body>
-</html>
diff --git a/docker/landing/html/robots.txt b/docker/landing/html/robots.txt
deleted file mode 100644
index c2a49f4..0000000
--- a/docker/landing/html/robots.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-User-agent: *
-Allow: /
diff --git a/docker/webpull/README.md b/docker/webpull/README.md
new file mode 100644
index 0000000..386a7ef
--- /dev/null
+++ b/docker/webpull/README.md
@@ -0,0 +1,3 @@
+# webpull
+
+Webpull allows you to update your live website without deploying a new docker container but by simply calling an URL
diff --git a/docker/webpull/main.go b/docker/webpull/main.go
new file mode 100644
index 0000000..2161256
--- /dev/null
+++ b/docker/webpull/main.go
@@ -0,0 +1,80 @@
+package main
+
+import (
+ "fmt"
+ "io"
+ "os/exec"
+ "os"
+ "log"
+ "net/http"
+ "strings"
+)
+
+func myexec(w io.Writer, main string, params ...string) error {
+ cmd := exec.Command(main, params...)
+ cmd.Stdout = w
+ cmd.Stderr = w
+ err := cmd.Run()
+ if err != nil {
+ fmt.Fprintf(w, "Failed to run: %s %s\n", main, strings.Join(params, " "))
+ }
+ return err
+}
+
+func update(w io.Writer) {
+ fmt.Fprintf(w, "Start update...\n")
+ _, err := os.Stat("./.git")
+ if err != nil {
+ fmt.Fprintf(w, ".git folder does not exist, creating it...\n")
+ err := myexec(w, "git", "init")
+ if err != nil {
+ return
+ }
+ }
+
+ err = myexec(w, "git", "remote", "get-url", "origin")
+ if err != nil {
+ repo, exists := os.LookupEnv("WEBPULL_REPO")
+ if !exists {
+ fmt.Fprintf(w, "You must define WEBPULL_REPO env variable...\n")
+ return
+ }
+ fmt.Fprintf(w, "git remote is not yet set...\n")
+ err := myexec(w, "git", "remote", "add", "origin", repo)
+ if err != nil {
+ return
+ }
+ }
+
+ err = myexec(w, "git", "pull", "origin", "master")
+ if err != nil {
+ fmt.Fprintf(w, "Failed to pull...\n")
+ return
+ }
+
+ _, err = os.Stat("./.webpool")
+ if err != nil {
+ fmt.Fprintf(w, "You must create an executable file named '.webpool' at the root of your repository.\nIf you have nothing to run, just create an empty bash script...\n")
+ return
+ }
+
+ err = myexec(w, "./.webpool")
+ if err != nil {
+ fmt.Fprintf(w, "An error occured during script execution\n")
+ return
+ }
+
+ fmt.Fprintf(w, "Success.\n")
+}
+
+func main() {
+
+ update(os.Stdout)
+ fs := http.FileServer(http.Dir("./static"))
+ http.HandleFunc("/update", func(w http.ResponseWriter, r *http.Request) {
+ update(w)
+ })
+ http.Handle("/", fs)
+
+ log.Fatal(http.ListenAndServe(":8080", nil))
+}