mirror of
https://github.com/YunoHost/install-app.git
synced 2024-09-03 20:06:19 +02:00
First commit
This commit is contained in:
parent
46b19552ff
commit
7fbc4ef27b
4 changed files with 181 additions and 0 deletions
18
README.md
Normal file
18
README.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
This small webpage helps users install specific apps by redirecting them to the appropriate page of their YunoHost admin panels.
|
||||
|
||||
It is used to create an "Install with YunoHost" badge/link that can be placed on app developers' websites to promote YunoHost. This badge is similar to the badges "deploy to Heroku" etc...
|
||||
|
||||
As YunoHost is not a centralized service, such a badge cannot link directly to users' servers. They are thus redirected to this page in which they have to enter the link to their server. This trick is similar to the one used in the "share to diaspora*" badge, which is also a decentralized service.
|
||||
|
||||
|
||||
# Embed the "Install with YunoHost" button
|
||||
|
||||
Example for the Roundcube app
|
||||
|
||||
*HTML*
|
||||
|
||||
`<a href="http://www.scith.ovh/installynh/?app=roundcube"><img src="http://www.scith.ovh/installynh/install-with-yunohost.png" alt="Install Roundcube with YunoHost" /></a>`
|
||||
|
||||
*Markdown*
|
||||
|
||||
`[![Install Roundcube with YunoHost](http://www.scith.ovh/installynh/install-with-yunohost.png)](http://www.scith.ovh/installynh/?app=roundcube)`
|
129
index.php
Normal file
129
index.php
Normal file
|
@ -0,0 +1,129 @@
|
|||
<?php
|
||||
$app = htmlentities($_GET['app']);
|
||||
if(isset($_POST['server']) AND !empty($_POST['server'])) {
|
||||
$server = preg_replace('#^https?://#', '', $_POST['server']);
|
||||
$url = 'https://'.$server.'/yunohost/admin/#/apps/install/'.$app;
|
||||
header('Location: '.$url);
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1" />
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>Install with YunoHost</title>
|
||||
<style>
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: sans-serif; /* 1 */
|
||||
-ms-text-size-adjust: 100%; /* 2 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
body {
|
||||
background: #41444f;
|
||||
font-family: arial;
|
||||
overflow-y: scroll;
|
||||
font-size: 1em;
|
||||
line-height:1.5;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height :auto;
|
||||
}
|
||||
|
||||
.logo {
|
||||
text-align: center;
|
||||
margin-bottom: 0;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.logo img {
|
||||
margin-top: 4%;
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
width: 90%;
|
||||
margin: 2% 5%;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.form {
|
||||
max-width: 21em;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
input {
|
||||
border:none;
|
||||
box-shadow:none;
|
||||
position: relative;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
input[type="submit"] {
|
||||
width: 100%;
|
||||
padding: 0.8em 1.5em;
|
||||
font-size: 1.1em;
|
||||
background: #999;
|
||||
display: inline-block;
|
||||
padding: 0.5em 1em;
|
||||
line-height: normal;
|
||||
text-decoration: none;
|
||||
color: #FFF;
|
||||
background: #2980b9;
|
||||
cursor: pointer;
|
||||
transition: all 0.1s ease;
|
||||
-webkit-transition: all 0.1s ease;
|
||||
border:0;
|
||||
cursor:pointer;
|
||||
}
|
||||
input[type="submit"]:hover {background: #3498db;}
|
||||
|
||||
input[type="text"] {
|
||||
background: #fff;
|
||||
color: #41444f;
|
||||
width: 100%;
|
||||
padding: 0.8em 0.8em 0.8em 3em;
|
||||
}
|
||||
|
||||
.messages {
|
||||
color: #FFF;
|
||||
margin-bottom: 1em;
|
||||
text-align: center;
|
||||
max-width: 21em;
|
||||
margin: 2% auto 1em auto;
|
||||
padding: 1.5em;
|
||||
}
|
||||
.messages.danger { background: #c0392b; }
|
||||
.messages.warning { background: #e67e22; }
|
||||
.messages.success { background: #27ae60; }
|
||||
.messages.info { background: #2980b9; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="logo" class="logo">
|
||||
<img src="logo-ynh-white.svg"/>
|
||||
</h1>
|
||||
<div class="overlay">
|
||||
<!--<div class="wrapper messages info">Please enter the address of your YunoHost server</div>-->
|
||||
<div class="wrapper">
|
||||
<form class="form" name="input" action="" method="post">
|
||||
<input id="server" type="text" name="server" placeholder="Link to your YunoHost server" autofocus required>
|
||||
<input type="submit" value="Install <?php echo $app; ?>">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
install-with-yunohost.png
Normal file
BIN
install-with-yunohost.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
34
logo-ynh-white.svg
Normal file
34
logo-ynh-white.svg
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
|
||||
]>
|
||||
<svg version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
|
||||
x="0px" y="0px" width="98px" height="85px" viewBox="-0.25 -0.25 98 85"
|
||||
overflow="visible" enable-background="new -0.25 -0.25 98 85" xml:space="preserve">
|
||||
<defs>
|
||||
</defs>
|
||||
<path fill="#FFFFFF" d="M97,51c-2.02,4.98-8.33,5.67-14,7c-0.609,6.29,3.05,10.95-1,16c-6.41-0.26-7.471-5.859-7-13c-1,0-2,0-3,0
|
||||
c-2.09,2.77,0.9,4.52,0,8c-1.12,4.34-7.88,7.91-11,7c-2.18-0.641-5.96-6.63-5-12c2.82-2.71,2.76,3.12,6,3c5.05-7.84-9.63-8.55-8-17
|
||||
c1.24-6.42,11.66-9.66,15-1c1.54,4.21-5.17,0.16-5,3c-0.279,1.62,0.95,1.72,1,3c2.52,0.77,1.68-2.16,3-3c1.859-1.17,3.09-0.75,6-1
|
||||
c2.45-2.55,1.08-8.92,4-11c3.87,0.46,6.08,2.59,6,7C91.01,46.109,94.3,46.05,97,51z"/>
|
||||
<path fill="#FFFFFF" d="M87,13c0.609,3.21,2.32,4.98,2,8c-0.34,3.21-2.9,8.83-4,9c-1.17,0.18-1.34,1.78-2,2
|
||||
c-4.66,1.57-12.391-1.48-14-7c-1.16-3.97,1.9-13.37,4-17c1.3-2.25,1.221-2.99,5-4c2.41-0.65,3.65-2.25,6,0
|
||||
c0.471,0.45,1.3,0.49,1.85,0.89c-0.199,0,2,3.14,2.15,4.11C88.32,11.07,86.77,11.78,87,13z M79,22c1.779-1.89,3.29-4.04,3-8
|
||||
C77.49,12.33,74.67,21.3,79,22z"/>
|
||||
<path fill="#FFFFFF" d="M67,21c-0.07,5.81,2.48,10.7,0,15c-6.73,1.06-7.24-4.1-11-6c-1.939,1.39-1.49,5.18-3,7
|
||||
c-3.78,0.44-4.69-1.97-7-3c2.47-7.81,1.26-18.98,2-26c8.58-0.58,7.68,8.32,12,12c0.52-4.34-0.359-15.52,3-20
|
||||
C70.33,3.29,67.09,12.99,67,21z"/>
|
||||
<path fill="#FFFFFF" d="M52,55c1.93,8.41,0.12,22.689-12,20c-1.59-0.35-8.42-5.22-9-7c-1.62-5,0.34-13.34,3-16
|
||||
C39.03,46.97,45.48,50.359,52,55z M39,66c4.55,0.96,6.3-4.2,4-7C39.37,59.03,38.61,61.939,39,66z"/>
|
||||
<path fill="#FFFFFF" d="M39,8c5.58,0.9,6.4,6.81,5,15c-1.43,8.38-3.02,14.59-9,15c-9.57,0.65-12.25-16.69-9-29
|
||||
c8.32,1.27,6.59,10.36,6,17c2.71,0.83,2.2-0.85,3-2C37.05,21.04,37.82,13.61,39,8z"/>
|
||||
<path fill="#FFFFFF" d="M28,62c0.1,5.67,4.4,11.33,2,17c-4.32-1.01-6.57-4.09-9-7c-3.15-0.48-2.26,3.07-6,2
|
||||
c-0.67,5.061,2.29,7.57-1,10c-4.7-0.63-6.66-4-8-8c-2.61-1.38-5.48-2.52-6-6c0.14-3.53,4.48-2.85,7-4c0.47-5.53-1.41-13.41,2-16
|
||||
c8.31,0.49,8.21,7.13,7,15c4.36,0.29,4.94-4.35,5-7c0.06-2.43-1.82-8.26,2-11c3.06-0.73,2.94,1.73,6,1
|
||||
C32.35,52.7,27.92,57.439,28,62z"/>
|
||||
<path fill="#FFFFFF" d="M24,12c1.07,7.07-3.86,8.14-6,12c0.21,6.88-0.47,12.86-2,18c-5.86-1.32-8.7-10.38-6-17
|
||||
c-0.33-3.52-5.26-4.22-7-8c-0.3-0.66-0.47-4.43-1-7C1.09,5.63,0.55,4.31,3,1c8.16-0.49,7.21,8.13,9,14c5.05,0.39,3.91-5.42,8-6
|
||||
C20.98,10.35,22.67,11,24,12z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
Loading…
Reference in a new issue