index.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <html>
  2. <head>
  3. <title> Cloudron LAMP app </title>
  4. <style>
  5. body {
  6. width: 50%;
  7. min-width: 640px;
  8. margin: auto;
  9. font-family: Helvetica;
  10. color: #333;
  11. }
  12. pre {
  13. font-family: monospace;
  14. background: #333;
  15. color: white;
  16. border: none;
  17. width: 99%;
  18. padding: 10px;
  19. text-align: left;
  20. font-size: 13px;
  21. border-radius: 5px;
  22. margin-bottom: 15px;
  23. box-shadow: 0px 1px 12px rgba(0, 0, 0, 0.176);
  24. }
  25. h1 {
  26. text-align: center;
  27. }
  28. .center > table {
  29. width: 100%;
  30. }
  31. .table {
  32. border-style: solid;
  33. border-width: 1px;
  34. }
  35. .h, .e {
  36. background-color: white !important;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <br/>
  42. <h1>Cloudron LAMP App</h1>
  43. <br/>
  44. <h2>Overview</h2>
  45. <p>
  46. <div>
  47. This page is a placeholder showing information on how to use the LAMP stack.
  48. This page will get overwritten, when an index.php or index.html is uploaded. You can always
  49. access the database credentials from the file <code>credentials.txt</code> with <a target="_blank" href="https://cloudron.io/documentation/apps/#ftp-access">SFTP</a>.
  50. <div>
  51. <br/>
  52. <b>The credentials shown here can only be used from within your app. They will not work from outside the Cloudron.</b>
  53. </p>
  54. <br/>
  55. <h2>MySQL Credentials</h2>
  56. <p>Use the following environment variables in the PHP code to access MySQL:</p>
  57. <table>
  58. <tr>
  59. <td>MYSQL_HOST</td>
  60. <td><?php echo getenv("MYSQL_HOST") ?></td>
  61. </tr>
  62. <tr>
  63. <td>MYSQL_PORT</td>
  64. <td><?php echo getenv("MYSQL_PORT") ?></td>
  65. </tr>
  66. <tr>
  67. <td>MYSQL_USERNAME</td>
  68. <td><?php echo getenv("MYSQL_USERNAME") ?></td>
  69. </tr>
  70. <tr>
  71. <td>MYSQL_PASSWORD</td>
  72. <td><?php echo getenv("MYSQL_PASSWORD") ?></td>
  73. </tr>
  74. <tr>
  75. <td>MYSQL_DATABASE</td>
  76. <td><?php echo getenv("MYSQL_DATABASE") ?></td>
  77. </tr>
  78. </table>
  79. <br/>
  80. <h2>phpMyAdmin Access</h2>
  81. <p>
  82. It is installed <a href="/phpmyadmin" target="_blank">here</a>. For login credentials see phpmyadmin_login.txt via SFTP.
  83. </p>
  84. <br/>
  85. <h2>Cron</h2>
  86. <p>
  87. Put a file called <code>crontab</code> into the directory <code>/app/data</code> and it will picked up at next app restart.
  88. It has to be in the cron syntax without username and must end with a newline.
  89. For example, the following crontab updates feeds every hour:
  90. </p>
  91. <pre>
  92. 0 * * * * php /app/code/update.php --feeds
  93. </pre>
  94. <p>
  95. Commands are executed as the user www-data. Generate cron patterns via <a href="http://www.crontabgenerator.com/">crontabgenerator</a>.
  96. </p>
  97. <br/>
  98. <h2>Sendmail Credentials</h2>
  99. <p>Use the following environment variables in the PHP code to send email:</p>
  100. <table>
  101. <tr>
  102. <td>MAIL_SMTP_SERVER</td>
  103. <td><?php echo getenv("MAIL_SMTP_SERVER") ?></td>
  104. </tr>
  105. <tr>
  106. <td>MAIL_SMTP_PORT</td>
  107. <td><?php echo getenv("MAIL_SMTP_PORT") ?></td>
  108. </tr>
  109. <tr>
  110. <td>MAIL_SMTPS_PORT</td>
  111. <td><?php echo getenv("MAIL_SMTPS_PORT") ?></td>
  112. </tr>
  113. <tr>
  114. <td>MAIL_SMTP_USERNAME</td>
  115. <td><?php echo getenv("MAIL_SMTP_USERNAME") ?></td>
  116. </tr>
  117. <tr>
  118. <td>MAIL_SMTP_PASSWORD</td>
  119. <td><?php echo getenv("MAIL_SMTP_PASSWORD") ?></td>
  120. </tr>
  121. <tr>
  122. <td>MAIL_FROM</td>
  123. <td><?php echo getenv("MAIL_FROM") ?></td>
  124. </tr>
  125. <tr>
  126. <td>MAIL_DOMAIN</td>
  127. <td><?php echo getenv("MAIL_DOMAIN") ?></td>
  128. </tr>
  129. </table>
  130. <br/>
  131. <h2>Redis Credentials</h2>
  132. <p>Use the following environment variables in the PHP code to connect to Redis:</p>
  133. <table>
  134. <tr>
  135. <td>REDIS_URL</td>
  136. <td><?php echo getenv("REDIS_URL") ?></td>
  137. </tr>
  138. <tr>
  139. <td>REDIS_HOST</td>
  140. <td><?php echo getenv("REDIS_HOST") ?></td>
  141. </tr>
  142. <tr>
  143. <td>REDIS_PORT</td>
  144. <td><?php echo getenv("REDIS_PORT") ?></td>
  145. </tr>
  146. <tr>
  147. <td>REDIS_PASSWORD</td>
  148. <td><?php echo getenv("REDIS_PASSWORD") ?></td>
  149. </tr>
  150. </table>
  151. <br/>
  152. </body>
  153. </html>