hop3-server 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. hop3_server-0.4.0/PKG-INFO +160 -0
  2. hop3_server-0.4.0/README.md +125 -0
  3. hop3_server-0.4.0/pyproject.toml +105 -0
  4. hop3_server-0.4.0/src/hop3/.DS_Store +0 -0
  5. hop3_server-0.4.0/src/hop3/__init__.py +1 -0
  6. hop3_server-0.4.0/src/hop3/alembic/README +1 -0
  7. hop3_server-0.4.0/src/hop3/alembic/env.py +99 -0
  8. hop3_server-0.4.0/src/hop3/alembic/script.py.mako +28 -0
  9. hop3_server-0.4.0/src/hop3/alembic/versions/0d21c362f66d_add_app_state_machine_and_error_message.py +66 -0
  10. hop3_server-0.4.0/src/hop3/alembic/versions/961bfd2ecce5_add_runtime_field_to_app_model.py +40 -0
  11. hop3_server-0.4.0/src/hop3/alembic/versions/d20dd80dafca_initial_schema.py +33 -0
  12. hop3_server-0.4.0/src/hop3/alembic.ini +147 -0
  13. hop3_server-0.4.0/src/hop3/commands/__init__.py +7 -0
  14. hop3_server-0.4.0/src/hop3/commands/_base.py +96 -0
  15. hop3_server-0.4.0/src/hop3/commands/_errors.py +206 -0
  16. hop3_server-0.4.0/src/hop3/commands/_helpers.py +136 -0
  17. hop3_server-0.4.0/src/hop3/commands/_response.py +107 -0
  18. hop3_server-0.4.0/src/hop3/commands/admin.py +635 -0
  19. hop3_server-0.4.0/src/hop3/commands/app.py +1055 -0
  20. hop3_server-0.4.0/src/hop3/commands/apps.py +103 -0
  21. hop3_server-0.4.0/src/hop3/commands/auth.py +310 -0
  22. hop3_server-0.4.0/src/hop3/commands/backup.py +431 -0
  23. hop3_server-0.4.0/src/hop3/commands/config.py +667 -0
  24. hop3_server-0.4.0/src/hop3/commands/git.py +229 -0
  25. hop3_server-0.4.0/src/hop3/commands/help.py +217 -0
  26. hop3_server-0.4.0/src/hop3/commands/misc.py +313 -0
  27. hop3_server-0.4.0/src/hop3/commands/services.py +726 -0
  28. hop3_server-0.4.0/src/hop3/commands/system.py +955 -0
  29. hop3_server-0.4.0/src/hop3/config.py +405 -0
  30. hop3_server-0.4.0/src/hop3/core/__init__.py +10 -0
  31. hop3_server-0.4.0/src/hop3/core/artifacts.py +156 -0
  32. hop3_server-0.4.0/src/hop3/core/backup.py +767 -0
  33. hop3_server-0.4.0/src/hop3/core/credentials.py +122 -0
  34. hop3_server-0.4.0/src/hop3/core/env.py +108 -0
  35. hop3_server-0.4.0/src/hop3/core/events.py +78 -0
  36. hop3_server-0.4.0/src/hop3/core/git.py +159 -0
  37. hop3_server-0.4.0/src/hop3/core/hooks.py +17 -0
  38. hop3_server-0.4.0/src/hop3/core/hookspecs.py +149 -0
  39. hop3_server-0.4.0/src/hop3/core/manifest.py +158 -0
  40. hop3_server-0.4.0/src/hop3/core/plugins.py +540 -0
  41. hop3_server-0.4.0/src/hop3/core/protocols.py +577 -0
  42. hop3_server-0.4.0/src/hop3/deployers/__init__.py +6 -0
  43. hop3_server-0.4.0/src/hop3/deployers/addon_provisioning.py +168 -0
  44. hop3_server-0.4.0/src/hop3/deployers/deployer.py +465 -0
  45. hop3_server-0.4.0/src/hop3/deployers/env_provisioning.py +97 -0
  46. hop3_server-0.4.0/src/hop3/deployers/git_based_deployer.py +204 -0
  47. hop3_server-0.4.0/src/hop3/di/__init__.py +36 -0
  48. hop3_server-0.4.0/src/hop3/di/container.py +120 -0
  49. hop3_server-0.4.0/src/hop3/di/providers.py +167 -0
  50. hop3_server-0.4.0/src/hop3/lib/__init__.py +14 -0
  51. hop3_server-0.4.0/src/hop3/lib/archives.py +188 -0
  52. hop3_server-0.4.0/src/hop3/lib/args.py +203 -0
  53. hop3_server-0.4.0/src/hop3/lib/backports.py +56 -0
  54. hop3_server-0.4.0/src/hop3/lib/config.py +161 -0
  55. hop3_server-0.4.0/src/hop3/lib/console.py +406 -0
  56. hop3_server-0.4.0/src/hop3/lib/datetime.py +16 -0
  57. hop3_server-0.4.0/src/hop3/lib/decision_log.py +244 -0
  58. hop3_server-0.4.0/src/hop3/lib/decorators.py +10 -0
  59. hop3_server-0.4.0/src/hop3/lib/freeze.py +40 -0
  60. hop3_server-0.4.0/src/hop3/lib/logging.py +199 -0
  61. hop3_server-0.4.0/src/hop3/lib/multi_tail.py +136 -0
  62. hop3_server-0.4.0/src/hop3/lib/path.py +37 -0
  63. hop3_server-0.4.0/src/hop3/lib/registry.py +87 -0
  64. hop3_server-0.4.0/src/hop3/lib/scanner.py +39 -0
  65. hop3_server-0.4.0/src/hop3/lib/settings.py +67 -0
  66. hop3_server-0.4.0/src/hop3/lib/sysinfo.py +266 -0
  67. hop3_server-0.4.0/src/hop3/lib/templating.py +29 -0
  68. hop3_server-0.4.0/src/hop3/lib/types.py +12 -0
  69. hop3_server-0.4.0/src/hop3/lib/util.py +461 -0
  70. hop3_server-0.4.0/src/hop3/orm/__init__.py +44 -0
  71. hop3_server-0.4.0/src/hop3/orm/addon_credential.py +86 -0
  72. hop3_server-0.4.0/src/hop3/orm/app.py +1015 -0
  73. hop3_server-0.4.0/src/hop3/orm/backup.py +54 -0
  74. hop3_server-0.4.0/src/hop3/orm/env.py +34 -0
  75. hop3_server-0.4.0/src/hop3/orm/repositories.py +418 -0
  76. hop3_server-0.4.0/src/hop3/orm/revoked_token.py +49 -0
  77. hop3_server-0.4.0/src/hop3/orm/security.py +115 -0
  78. hop3_server-0.4.0/src/hop3/orm/session.py +132 -0
  79. hop3_server-0.4.0/src/hop3/platform/__init__.py +1 -0
  80. hop3_server-0.4.0/src/hop3/platform/certificates.py +303 -0
  81. hop3_server-0.4.0/src/hop3/plugins/__init__.py +1 -0
  82. hop3_server-0.4.0/src/hop3/plugins/addons/__init__.py +21 -0
  83. hop3_server-0.4.0/src/hop3/plugins/addons/cli.py +36 -0
  84. hop3_server-0.4.0/src/hop3/plugins/addons/secrets.py +97 -0
  85. hop3_server-0.4.0/src/hop3/plugins/build/__init__.py +1 -0
  86. hop3_server-0.4.0/src/hop3/plugins/build/language_toolchains/__init__.py +15 -0
  87. hop3_server-0.4.0/src/hop3/plugins/build/language_toolchains/plugin.py +32 -0
  88. hop3_server-0.4.0/src/hop3/plugins/build/local_build/__init__.py +12 -0
  89. hop3_server-0.4.0/src/hop3/plugins/build/local_build/builder.py +258 -0
  90. hop3_server-0.4.0/src/hop3/plugins/build/local_build/plugin.py +25 -0
  91. hop3_server-0.4.0/src/hop3/plugins/deploy/__init__.py +1 -0
  92. hop3_server-0.4.0/src/hop3/plugins/deploy/static/__init__.py +6 -0
  93. hop3_server-0.4.0/src/hop3/plugins/deploy/static/deployer.py +195 -0
  94. hop3_server-0.4.0/src/hop3/plugins/deploy/static/plugin.py +25 -0
  95. hop3_server-0.4.0/src/hop3/plugins/deploy/uwsgi/__init__.py +1 -0
  96. hop3_server-0.4.0/src/hop3/plugins/deploy/uwsgi/deployer.py +222 -0
  97. hop3_server-0.4.0/src/hop3/plugins/deploy/uwsgi/plugin.py +25 -0
  98. hop3_server-0.4.0/src/hop3/plugins/docker/__init__.py +3 -0
  99. hop3_server-0.4.0/src/hop3/plugins/docker/builder.py +351 -0
  100. hop3_server-0.4.0/src/hop3/plugins/docker/deployer.py +881 -0
  101. hop3_server-0.4.0/src/hop3/plugins/docker/dockerfiles/Dockerfile-clojure +40 -0
  102. hop3_server-0.4.0/src/hop3/plugins/docker/dockerfiles/Dockerfile-go +35 -0
  103. hop3_server-0.4.0/src/hop3/plugins/docker/dockerfiles/Dockerfile-gradle +40 -0
  104. hop3_server-0.4.0/src/hop3/plugins/docker/dockerfiles/Dockerfile-maven +40 -0
  105. hop3_server-0.4.0/src/hop3/plugins/docker/dockerfiles/Dockerfile-node +43 -0
  106. hop3_server-0.4.0/src/hop3/plugins/docker/dockerfiles/Dockerfile-php +41 -0
  107. hop3_server-0.4.0/src/hop3/plugins/docker/dockerfiles/Dockerfile-python +58 -0
  108. hop3_server-0.4.0/src/hop3/plugins/docker/dockerfiles/Dockerfile-ruby +44 -0
  109. hop3_server-0.4.0/src/hop3/plugins/docker/dockerfiles/Dockerfile-rust +34 -0
  110. hop3_server-0.4.0/src/hop3/plugins/docker/dockerfiles/readme.md +7 -0
  111. hop3_server-0.4.0/src/hop3/plugins/docker/plugin.py +46 -0
  112. hop3_server-0.4.0/src/hop3/plugins/mysql/__init__.py +3 -0
  113. hop3_server-0.4.0/src/hop3/plugins/mysql/admin.py +197 -0
  114. hop3_server-0.4.0/src/hop3/plugins/mysql/cli.py +375 -0
  115. hop3_server-0.4.0/src/hop3/plugins/mysql/mysql.py +443 -0
  116. hop3_server-0.4.0/src/hop3/plugins/mysql/plugin.py +148 -0
  117. hop3_server-0.4.0/src/hop3/plugins/oses/README.md +336 -0
  118. hop3_server-0.4.0/src/hop3/plugins/oses/__init__.py +11 -0
  119. hop3_server-0.4.0/src/hop3/plugins/oses/arch.py +169 -0
  120. hop3_server-0.4.0/src/hop3/plugins/oses/base.py +168 -0
  121. hop3_server-0.4.0/src/hop3/plugins/oses/bsd.py +198 -0
  122. hop3_server-0.4.0/src/hop3/plugins/oses/debian_base.py +37 -0
  123. hop3_server-0.4.0/src/hop3/plugins/oses/debian_family.py +179 -0
  124. hop3_server-0.4.0/src/hop3/plugins/oses/macos.py +217 -0
  125. hop3_server-0.4.0/src/hop3/plugins/oses/redhat_base.py +42 -0
  126. hop3_server-0.4.0/src/hop3/plugins/oses/redhat_family.py +174 -0
  127. hop3_server-0.4.0/src/hop3/plugins/postgresql/__init__.py +1 -0
  128. hop3_server-0.4.0/src/hop3/plugins/postgresql/admin.py +196 -0
  129. hop3_server-0.4.0/src/hop3/plugins/postgresql/cli.py +435 -0
  130. hop3_server-0.4.0/src/hop3/plugins/postgresql/plugin.py +144 -0
  131. hop3_server-0.4.0/src/hop3/plugins/postgresql/postgres.py +582 -0
  132. hop3_server-0.4.0/src/hop3/plugins/proxy/__init__.py +1 -0
  133. hop3_server-0.4.0/src/hop3/plugins/proxy/caddy/__init__.py +9 -0
  134. hop3_server-0.4.0/src/hop3/plugins/proxy/caddy/_setup.py +321 -0
  135. hop3_server-0.4.0/src/hop3/plugins/proxy/caddy/_templates.py +92 -0
  136. hop3_server-0.4.0/src/hop3/plugins/proxy/caddy/plugin.py +26 -0
  137. hop3_server-0.4.0/src/hop3/plugins/proxy/nginx/__init__.py +10 -0
  138. hop3_server-0.4.0/src/hop3/plugins/proxy/nginx/_setup.py +421 -0
  139. hop3_server-0.4.0/src/hop3/plugins/proxy/nginx/_templates.py +158 -0
  140. hop3_server-0.4.0/src/hop3/plugins/proxy/nginx/plugin.py +26 -0
  141. hop3_server-0.4.0/src/hop3/plugins/proxy/traefik/__init__.py +9 -0
  142. hop3_server-0.4.0/src/hop3/plugins/proxy/traefik/_setup.py +328 -0
  143. hop3_server-0.4.0/src/hop3/plugins/proxy/traefik/_templates.py +137 -0
  144. hop3_server-0.4.0/src/hop3/plugins/proxy/traefik/plugin.py +26 -0
  145. hop3_server-0.4.0/src/hop3/plugins/redis/__init__.py +1 -0
  146. hop3_server-0.4.0/src/hop3/plugins/redis/cli.py +168 -0
  147. hop3_server-0.4.0/src/hop3/plugins/redis/factory.py +103 -0
  148. hop3_server-0.4.0/src/hop3/plugins/redis/plugin.py +133 -0
  149. hop3_server-0.4.0/src/hop3/plugins/redis/redis.py +398 -0
  150. hop3_server-0.4.0/src/hop3/project/__init__.py +3 -0
  151. hop3_server-0.4.0/src/hop3/project/config.py +275 -0
  152. hop3_server-0.4.0/src/hop3/project/hop3_config.py +515 -0
  153. hop3_server-0.4.0/src/hop3/project/procfile.py +132 -0
  154. hop3_server-0.4.0/src/hop3/project/schema.py +350 -0
  155. hop3_server-0.4.0/src/hop3/run/__init__.py +4 -0
  156. hop3_server-0.4.0/src/hop3/run/spawn.py +595 -0
  157. hop3_server-0.4.0/src/hop3/run/uwsgi/__init__.py +7 -0
  158. hop3_server-0.4.0/src/hop3/run/uwsgi/settings.py +70 -0
  159. hop3_server-0.4.0/src/hop3/run/uwsgi/worker.py +417 -0
  160. hop3_server-0.4.0/src/hop3/server/__init__.py +1 -0
  161. hop3_server-0.4.0/src/hop3/server/asgi.py +194 -0
  162. hop3_server-0.4.0/src/hop3/server/cli/__init__.py +7 -0
  163. hop3_server-0.4.0/src/hop3/server/cli/_base.py +25 -0
  164. hop3_server-0.4.0/src/hop3/server/cli/admin.py +458 -0
  165. hop3_server-0.4.0/src/hop3/server/cli/cli.py +202 -0
  166. hop3_server-0.4.0/src/hop3/server/cli/git.py +217 -0
  167. hop3_server-0.4.0/src/hop3/server/cli/help.py +161 -0
  168. hop3_server-0.4.0/src/hop3/server/cli/local.py +240 -0
  169. hop3_server-0.4.0/src/hop3/server/cli/plugins.py +388 -0
  170. hop3_server-0.4.0/src/hop3/server/cli/serve.py +45 -0
  171. hop3_server-0.4.0/src/hop3/server/cli/setup.py +297 -0
  172. hop3_server-0.4.0/src/hop3/server/controllers/__init__.py +37 -0
  173. hop3_server-0.4.0/src/hop3/server/controllers/auth.py +203 -0
  174. hop3_server-0.4.0/src/hop3/server/controllers/dashboard/__init__.py +32 -0
  175. hop3_server-0.4.0/src/hop3/server/controllers/dashboard/addons.py +87 -0
  176. hop3_server-0.4.0/src/hop3/server/controllers/dashboard/apps.py +330 -0
  177. hop3_server-0.4.0/src/hop3/server/controllers/dashboard/backups.py +147 -0
  178. hop3_server-0.4.0/src/hop3/server/controllers/dashboard/env_vars.py +58 -0
  179. hop3_server-0.4.0/src/hop3/server/controllers/dashboard/helpers.py +75 -0
  180. hop3_server-0.4.0/src/hop3/server/controllers/dashboard/index.py +45 -0
  181. hop3_server-0.4.0/src/hop3/server/controllers/dashboard/logs.py +163 -0
  182. hop3_server-0.4.0/src/hop3/server/controllers/marketplace.py +335 -0
  183. hop3_server-0.4.0/src/hop3/server/controllers/root.py +47 -0
  184. hop3_server-0.4.0/src/hop3/server/controllers/rpc.py +541 -0
  185. hop3_server-0.4.0/src/hop3/server/controllers/stream.py +83 -0
  186. hop3_server-0.4.0/src/hop3/server/guards.py +74 -0
  187. hop3_server-0.4.0/src/hop3/server/health.py +106 -0
  188. hop3_server-0.4.0/src/hop3/server/lib/__init__.py +1 -0
  189. hop3_server-0.4.0/src/hop3/server/lib/database.py +30 -0
  190. hop3_server-0.4.0/src/hop3/server/lib/scanner.py +37 -0
  191. hop3_server-0.4.0/src/hop3/server/lib/types.py +6 -0
  192. hop3_server-0.4.0/src/hop3/server/marketplace/__init__.py +18 -0
  193. hop3_server-0.4.0/src/hop3/server/marketplace/loader.py +109 -0
  194. hop3_server-0.4.0/src/hop3/server/marketplace/models.py +138 -0
  195. hop3_server-0.4.0/src/hop3/server/marketplace/service.py +165 -0
  196. hop3_server-0.4.0/src/hop3/server/marketplace/taxonomy.py +160 -0
  197. hop3_server-0.4.0/src/hop3/server/middleware/__init__.py +5 -0
  198. hop3_server-0.4.0/src/hop3/server/security/__init__.py +9 -0
  199. hop3_server-0.4.0/src/hop3/server/security/tokens.py +289 -0
  200. hop3_server-0.4.0/src/hop3/server/state_sync.py +222 -0
  201. hop3_server-0.4.0/src/hop3/server/static/favicon.png +0 -0
  202. hop3_server-0.4.0/src/hop3/server/static/readme.md +1 -0
  203. hop3_server-0.4.0/src/hop3/server/streaming.py +253 -0
  204. hop3_server-0.4.0/src/hop3/server/templates/auth/login.html +87 -0
  205. hop3_server-0.4.0/src/hop3/server/templates/auth/profile.html +86 -0
  206. hop3_server-0.4.0/src/hop3/server/templates/base.html +176 -0
  207. hop3_server-0.4.0/src/hop3/server/templates/dashboard/_app_status.html +88 -0
  208. hop3_server-0.4.0/src/hop3/server/templates/dashboard/addon_detail.html +247 -0
  209. hop3_server-0.4.0/src/hop3/server/templates/dashboard/addons.html +127 -0
  210. hop3_server-0.4.0/src/hop3/server/templates/dashboard/app_create.html +145 -0
  211. hop3_server-0.4.0/src/hop3/server/templates/dashboard/app_create_pending.html +62 -0
  212. hop3_server-0.4.0/src/hop3/server/templates/dashboard/app_detail.html +366 -0
  213. hop3_server-0.4.0/src/hop3/server/templates/dashboard/backup_info.html +278 -0
  214. hop3_server-0.4.0/src/hop3/server/templates/dashboard/backups.html +114 -0
  215. hop3_server-0.4.0/src/hop3/server/templates/dashboard/env_vars.html +288 -0
  216. hop3_server-0.4.0/src/hop3/server/templates/dashboard/index.html +181 -0
  217. hop3_server-0.4.0/src/hop3/server/templates/dashboard/logs.html +235 -0
  218. hop3_server-0.4.0/src/hop3/server/templates/dashboard/marketplace/_app_card.html +49 -0
  219. hop3_server-0.4.0/src/hop3/server/templates/dashboard/marketplace/category.html +102 -0
  220. hop3_server-0.4.0/src/hop3/server/templates/dashboard/marketplace/detail.html +245 -0
  221. hop3_server-0.4.0/src/hop3/server/templates/dashboard/marketplace/index.html +131 -0
  222. hop3_server-0.4.0/src/hop3/server/templates/dashboard/marketplace/list.html +161 -0
  223. hop3_server-0.4.0/src/hop3/server/templates/term-ws.j2 +155 -0
  224. hop3_server-0.4.0/src/hop3/server/templates/term.j2 +49 -0
  225. hop3_server-0.4.0/src/hop3/toolchains/__init__.py +40 -0
  226. hop3_server-0.4.0/src/hop3/toolchains/_base.py +342 -0
  227. hop3_server-0.4.0/src/hop3/toolchains/clojure.py +136 -0
  228. hop3_server-0.4.0/src/hop3/toolchains/dotnet.py +55 -0
  229. hop3_server-0.4.0/src/hop3/toolchains/elixir.py +69 -0
  230. hop3_server-0.4.0/src/hop3/toolchains/generic.py +82 -0
  231. hop3_server-0.4.0/src/hop3/toolchains/go.py +91 -0
  232. hop3_server-0.4.0/src/hop3/toolchains/java.py +75 -0
  233. hop3_server-0.4.0/src/hop3/toolchains/node.py +187 -0
  234. hop3_server-0.4.0/src/hop3/toolchains/php.py +141 -0
  235. hop3_server-0.4.0/src/hop3/toolchains/python.py +325 -0
  236. hop3_server-0.4.0/src/hop3/toolchains/ruby.py +132 -0
  237. hop3_server-0.4.0/src/hop3/toolchains/rust.py +97 -0
  238. hop3_server-0.4.0/src/hop3/toolchains/static.py +85 -0
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.4
2
+ Name: hop3-server
3
+ Version: 0.4.0
4
+ Summary: Simple PaaS - Deploy and manage web applications on a single server
5
+ Author: Stefane Fermigier
6
+ Author-email: Stefane Fermigier <sf@abilian.com>
7
+ License-Expression: Apache-2.0
8
+ Requires-Dist: litestar[standard]>=2.18.0
9
+ Requires-Dist: attrs>=24.2
10
+ Requires-Dist: jinja2
11
+ Requires-Dist: itsdangerous>=2.0.0
12
+ Requires-Dist: pluggy~=1.4
13
+ Requires-Dist: dishka>=1.3.0
14
+ Requires-Dist: sqlalchemy~=2.0
15
+ Requires-Dist: advanced-alchemy>=0.21
16
+ Requires-Dist: alembic~=1.13
17
+ Requires-Dist: termcolor>=2.5.0
18
+ Requires-Dist: markdown>=3.5
19
+ Requires-Dist: cyclonedx-bom>=5.1.1
20
+ Requires-Dist: toml>=0.10.2
21
+ Requires-Dist: pyjwt>=2.8.0
22
+ Requires-Dist: bcrypt>=4.0.0
23
+ Requires-Dist: cryptography>=42.0.0
24
+ Requires-Dist: granian[reload]>=2.2.0
25
+ Requires-Dist: psycopg2-binary>=2.9.10
26
+ Requires-Dist: mysql-connector-python>=9.0.0
27
+ Requires-Dist: redis
28
+ Requires-Dist: pyyaml>=6.0.3
29
+ Requires-Dist: python-multipart>=0.0.20
30
+ Requires-Dist: anyio
31
+ Requires-Dist: sniffio
32
+ Requires-Dist: uwsgi>=2.0.31
33
+ Requires-Dist: pydantic>=2.12.5
34
+ Description-Content-Type: text/markdown
35
+
36
+ # hop3-server
37
+
38
+ Core server for the Hop3 Platform-as-a-Service.
39
+
40
+ ## Overview
41
+
42
+ hop3-server is the central orchestrator that handles application deployments, process management, reverse proxy configuration, and addon services. It provides a JSON-RPC API for communication with hop3-cli and hop3-tui.
43
+
44
+ ## Features
45
+
46
+ - **Git-push deployments**: Deploy applications via `git push`
47
+ - **Automatic build system**: Detects language (Python, Node, Ruby, Go, Rust, etc.) and builds automatically
48
+ - **Process management**: Manages app processes based on Procfile via uWSGI
49
+ - **Reverse proxy**: Nginx/Caddy/Traefik with automatic SSL certificates
50
+ - **Addon services**: PostgreSQL, MySQL, Redis management
51
+ - **Plugin architecture**: Extensible via pluggy-based plugins
52
+ - **JSON-RPC API**: For CLI and TUI communication
53
+
54
+ ## Installation
55
+
56
+ ### Production
57
+
58
+ ```bash
59
+ curl -LsSf https://hop3.cloud/install-server.py | sudo python3 -
60
+ ```
61
+
62
+ ### Development
63
+
64
+ ```bash
65
+ pip install hop3-server
66
+ ```
67
+
68
+ ## Quick Start
69
+
70
+ ```bash
71
+ # Run the server
72
+ hop3-server serve
73
+
74
+ # Run with specific host/port
75
+ hop3-server serve --host 0.0.0.0 --port 8000
76
+ ```
77
+
78
+ ## Configuration
79
+
80
+ Server configuration via environment variables or `/etc/hop3/config.toml`:
81
+
82
+ | Variable | Description | Default |
83
+ |----------|-------------|---------|
84
+ | `HOP3_HOME` | Home directory | `/home/hop3` |
85
+ | `HOP3_DATABASE_URL` | Database URL | `sqlite:///hop3.db` |
86
+ | `HOP3_SECRET_KEY` | JWT signing key | (required) |
87
+
88
+ ## Architecture
89
+
90
+ ```
91
+ hop3-server/
92
+ ├── src/hop3/
93
+ │ ├── server/ # Litestar ASGI application
94
+ │ │ ├── asgi.py # App factory
95
+ │ │ └── controllers/ # API endpoints
96
+ │ ├── commands/ # RPC command handlers
97
+ │ ├── deployers/ # Deployment orchestration
98
+ │ ├── orm/ # SQLAlchemy models
99
+ │ ├── plugins/ # Plugin system
100
+ │ │ ├── build/ # Builders, language toolchains
101
+ │ │ ├── deploy/ # Deployers (uWSGI, static)
102
+ │ │ ├── proxy/ # Nginx, Caddy, Traefik
103
+ │ │ └── addons/ # PostgreSQL, MySQL, Redis
104
+ │ ├── core/ # Core abstractions
105
+ │ │ ├── protocols.py # Plugin protocols
106
+ │ │ └── hookspecs.py # Hook specifications
107
+ │ └── toolchains/ # Language toolchains
108
+ └── tests/
109
+ ├── a_unit/ # Unit tests
110
+ ├── b_integration/ # Integration tests
111
+ ├── c_system/ # System tests
112
+ └── d_e2e/ # End-to-end tests
113
+ ```
114
+
115
+ ### Filesystem Layout
116
+
117
+ ```
118
+ /home/hop3/
119
+ ├── apps/<app_name>/
120
+ │ ├── git/ # Bare git repository
121
+ │ ├── src/ # Checked-out source code
122
+ │ ├── data/ # Persistent data
123
+ │ └── log/ # Log files
124
+ ├── nginx/ # Nginx configs and certs
125
+ ├── uwsgi-available/ # uWSGI configs
126
+ ├── uwsgi-enabled/ # Active uWSGI configs
127
+ └── hop3.db # SQLite database
128
+ ```
129
+
130
+ ## Development
131
+
132
+ ```bash
133
+ # Unit tests
134
+ uv run pytest tests/a_unit/ -v
135
+
136
+ # Integration tests
137
+ uv run pytest tests/b_integration/ -v
138
+
139
+ # System tests (requires Docker)
140
+ uv run pytest tests/c_system/ -v
141
+
142
+ # Lint and format
143
+ uv run ruff check src/
144
+ uv run ruff format src/
145
+ ```
146
+
147
+ ## Documentation
148
+
149
+ - [User Guide](../../docs/src/guide.md)
150
+ - [Plugin Development](../../docs/src/dev/plugin-development.md)
151
+
152
+ ## Related Packages
153
+
154
+ - [hop3-cli](../hop3-cli/) - CLI client for this server
155
+ - [hop3-tui](../hop3-tui/) - TUI client for this server
156
+ - [hop3-installer](../hop3-installer/) - Installation tools
157
+
158
+ ## License
159
+
160
+ Apache-2.0 - Copyright (c) 2024-2026, Abilian SAS
@@ -0,0 +1,125 @@
1
+ # hop3-server
2
+
3
+ Core server for the Hop3 Platform-as-a-Service.
4
+
5
+ ## Overview
6
+
7
+ hop3-server is the central orchestrator that handles application deployments, process management, reverse proxy configuration, and addon services. It provides a JSON-RPC API for communication with hop3-cli and hop3-tui.
8
+
9
+ ## Features
10
+
11
+ - **Git-push deployments**: Deploy applications via `git push`
12
+ - **Automatic build system**: Detects language (Python, Node, Ruby, Go, Rust, etc.) and builds automatically
13
+ - **Process management**: Manages app processes based on Procfile via uWSGI
14
+ - **Reverse proxy**: Nginx/Caddy/Traefik with automatic SSL certificates
15
+ - **Addon services**: PostgreSQL, MySQL, Redis management
16
+ - **Plugin architecture**: Extensible via pluggy-based plugins
17
+ - **JSON-RPC API**: For CLI and TUI communication
18
+
19
+ ## Installation
20
+
21
+ ### Production
22
+
23
+ ```bash
24
+ curl -LsSf https://hop3.cloud/install-server.py | sudo python3 -
25
+ ```
26
+
27
+ ### Development
28
+
29
+ ```bash
30
+ pip install hop3-server
31
+ ```
32
+
33
+ ## Quick Start
34
+
35
+ ```bash
36
+ # Run the server
37
+ hop3-server serve
38
+
39
+ # Run with specific host/port
40
+ hop3-server serve --host 0.0.0.0 --port 8000
41
+ ```
42
+
43
+ ## Configuration
44
+
45
+ Server configuration via environment variables or `/etc/hop3/config.toml`:
46
+
47
+ | Variable | Description | Default |
48
+ |----------|-------------|---------|
49
+ | `HOP3_HOME` | Home directory | `/home/hop3` |
50
+ | `HOP3_DATABASE_URL` | Database URL | `sqlite:///hop3.db` |
51
+ | `HOP3_SECRET_KEY` | JWT signing key | (required) |
52
+
53
+ ## Architecture
54
+
55
+ ```
56
+ hop3-server/
57
+ ├── src/hop3/
58
+ │ ├── server/ # Litestar ASGI application
59
+ │ │ ├── asgi.py # App factory
60
+ │ │ └── controllers/ # API endpoints
61
+ │ ├── commands/ # RPC command handlers
62
+ │ ├── deployers/ # Deployment orchestration
63
+ │ ├── orm/ # SQLAlchemy models
64
+ │ ├── plugins/ # Plugin system
65
+ │ │ ├── build/ # Builders, language toolchains
66
+ │ │ ├── deploy/ # Deployers (uWSGI, static)
67
+ │ │ ├── proxy/ # Nginx, Caddy, Traefik
68
+ │ │ └── addons/ # PostgreSQL, MySQL, Redis
69
+ │ ├── core/ # Core abstractions
70
+ │ │ ├── protocols.py # Plugin protocols
71
+ │ │ └── hookspecs.py # Hook specifications
72
+ │ └── toolchains/ # Language toolchains
73
+ └── tests/
74
+ ├── a_unit/ # Unit tests
75
+ ├── b_integration/ # Integration tests
76
+ ├── c_system/ # System tests
77
+ └── d_e2e/ # End-to-end tests
78
+ ```
79
+
80
+ ### Filesystem Layout
81
+
82
+ ```
83
+ /home/hop3/
84
+ ├── apps/<app_name>/
85
+ │ ├── git/ # Bare git repository
86
+ │ ├── src/ # Checked-out source code
87
+ │ ├── data/ # Persistent data
88
+ │ └── log/ # Log files
89
+ ├── nginx/ # Nginx configs and certs
90
+ ├── uwsgi-available/ # uWSGI configs
91
+ ├── uwsgi-enabled/ # Active uWSGI configs
92
+ └── hop3.db # SQLite database
93
+ ```
94
+
95
+ ## Development
96
+
97
+ ```bash
98
+ # Unit tests
99
+ uv run pytest tests/a_unit/ -v
100
+
101
+ # Integration tests
102
+ uv run pytest tests/b_integration/ -v
103
+
104
+ # System tests (requires Docker)
105
+ uv run pytest tests/c_system/ -v
106
+
107
+ # Lint and format
108
+ uv run ruff check src/
109
+ uv run ruff format src/
110
+ ```
111
+
112
+ ## Documentation
113
+
114
+ - [User Guide](../../docs/src/guide.md)
115
+ - [Plugin Development](../../docs/src/dev/plugin-development.md)
116
+
117
+ ## Related Packages
118
+
119
+ - [hop3-cli](../hop3-cli/) - CLI client for this server
120
+ - [hop3-tui](../hop3-tui/) - TUI client for this server
121
+ - [hop3-installer](../hop3-installer/) - Installation tools
122
+
123
+ ## License
124
+
125
+ Apache-2.0 - Copyright (c) 2024-2026, Abilian SAS
@@ -0,0 +1,105 @@
1
+ [project]
2
+ name = "hop3-server"
3
+ version = "0.4.0"
4
+ description = "Simple PaaS - Deploy and manage web applications on a single server"
5
+ license = "Apache-2.0"
6
+ authors = [
7
+ { name = "Stefane Fermigier", email = "sf@abilian.com" },
8
+ ]
9
+ readme = "README.md"
10
+
11
+ dependencies = [
12
+ # Web / app server
13
+ "litestar[standard]>=2.18.0",
14
+ "attrs >= 24.2",
15
+ "jinja2",
16
+ "itsdangerous>=2.0.0",
17
+ # Plugins and DI
18
+ "pluggy ~= 1.4",
19
+ "dishka >= 1.3.0",
20
+ # Database
21
+ "sqlalchemy ~= 2.0",
22
+ "advanced-alchemy >= 0.21",
23
+ "alembic ~= 1.13",
24
+ # Misc
25
+ "termcolor >= 2.5.0",
26
+ "markdown>=3.5",
27
+ # SBOM
28
+ "cyclonedx-bom >= 5.1.1",
29
+ "toml >= 0.10.2",
30
+ # Security
31
+ "pyjwt>=2.8.0",
32
+ "bcrypt>=4.0.0",
33
+ "cryptography>=42.0.0",
34
+ # ASGI server
35
+ "granian[reload]>=2.2.0",
36
+ # Database connectors
37
+ "psycopg2-binary>=2.9.10",
38
+ "mysql-connector-python>=9.0.0",
39
+ "redis",
40
+ # Config
41
+ "pyyaml>=6.0.3",
42
+ "python-multipart>=0.0.20",
43
+ # Transitive dependencies
44
+ "anyio",
45
+ # Needed for some reason
46
+ "sniffio",
47
+ # Process management (required for running apps)
48
+ "uwsgi>=2.0.31",
49
+ "pydantic>=2.12.5",
50
+ ]
51
+
52
+ [dependency-groups]
53
+ dev = [
54
+ "typing-extensions>=4.12.2",
55
+ "httpx>=0.27.0",
56
+ "pytest-asyncio>=0.23.0",
57
+ "hop3-testing",
58
+ "types-pyyaml>=6.0.12.20250915",
59
+ "types-markdown>=3.10.0.20251106",
60
+ ]
61
+
62
+ [project.scripts]
63
+ hop3-server = "hop3.server.cli:main"
64
+
65
+ # ----------------------------------------
66
+
67
+ [build-system]
68
+ requires = ["uv-build>=0.8.4,<0.9.0"]
69
+ build-backend = "uv_build"
70
+
71
+ [tool.uv.build-backend]
72
+ module-name = "hop3"
73
+ module-root = "src"
74
+
75
+ #[tool.uv.sources]
76
+ #hop3-testing = { path = "../hop3-testing", editable = true }
77
+
78
+ # ----------------------------------------
79
+
80
+ [tool.pyright]
81
+ exclude = [
82
+ "src/hop3/util/templating.py",
83
+ ]
84
+
85
+ # -----------------------------------------------------------------------------
86
+
87
+ # X imported but missing from the dependency definitions
88
+ [tool.deptry.per_rule_ignores]
89
+ DEP001 = [
90
+ "tomli",
91
+ ]
92
+
93
+ # X defined as a dependency but not used in the codebase
94
+ DEP002 = [
95
+ "cyclonedx-bom",
96
+ "jinja2",
97
+ "itsdangerous",
98
+ "python-multipart",
99
+ "sniffio",
100
+ "uwsgi",
101
+ ]
102
+
103
+ #DEP003 = [
104
+ # "snoop",
105
+ #]
Binary file
@@ -0,0 +1 @@
1
+ # Copyright (c) 2023-2025, Abilian SAS
@@ -0,0 +1 @@
1
+ Generic single-database configuration.
@@ -0,0 +1,99 @@
1
+ # Copyright (c) 2025, Abilian SAS
2
+ from __future__ import annotations
3
+
4
+ from logging.config import fileConfig
5
+
6
+ from alembic import context
7
+ from sqlalchemy import engine_from_config, pool
8
+
9
+ # Import Hop3's configuration and models
10
+ from hop3 import config as hop3_config
11
+ from hop3.orm.app import App
12
+
13
+ # this is the Alembic Config object, which provides
14
+ # access to the values within the .ini file in use.
15
+ config = context.config
16
+
17
+ # Get database URL from Hop3 config, falling back to alembic.ini
18
+ database_url = config.get_main_option("sqlalchemy.url")
19
+ if not database_url or database_url == "driver://user:pass@localhost/dbname":
20
+ # Use Hop3's default database path
21
+ database_url = f"sqlite:///{hop3_config.HOP3_ROOT}/hop3.db"
22
+
23
+ # Override the sqlalchemy.url in the config
24
+ config.set_main_option("sqlalchemy.url", database_url)
25
+
26
+ # Interpret the config file for Python logging.
27
+ # This line sets up loggers basically.
28
+ if config.config_file_name is not None:
29
+ fileConfig(config.config_file_name)
30
+
31
+ # add your model's MetaData object here
32
+ # for 'autogenerate' support
33
+ target_metadata = App.metadata
34
+
35
+ # other values from the config, defined by the needs of env.py,
36
+ # can be acquired:
37
+ # my_important_option = config.get_main_option("my_important_option")
38
+ # ... etc.
39
+
40
+
41
+ def run_migrations_offline() -> None:
42
+ """Run migrations in 'offline' mode.
43
+
44
+ This configures the context with just a URL
45
+ and not an Engine, though an Engine is acceptable
46
+ here as well. By skipping the Engine creation
47
+ we don't even need a DBAPI to be available.
48
+
49
+ Calls to context.execute() here emit the given string to the
50
+ script output.
51
+
52
+ """
53
+ url = config.get_main_option("sqlalchemy.url")
54
+ context.configure(
55
+ url=url,
56
+ target_metadata=target_metadata,
57
+ literal_binds=True,
58
+ dialect_opts={"paramstyle": "named"},
59
+ )
60
+
61
+ with context.begin_transaction():
62
+ context.run_migrations()
63
+
64
+
65
+ def run_migrations_online() -> None:
66
+ """Run migrations in 'online' mode.
67
+
68
+ In this scenario we need to create an Engine
69
+ and associate a connection with the context.
70
+
71
+ """
72
+ # Check if we're being called programmatically with a connection
73
+ connectable = config.attributes.get("connection", None)
74
+
75
+ if connectable is None:
76
+ # CLI mode: create engine from config
77
+ connectable = engine_from_config(
78
+ config.get_section(config.config_ini_section, {}),
79
+ prefix="sqlalchemy.",
80
+ poolclass=pool.NullPool,
81
+ )
82
+
83
+ with connectable.connect() as connection:
84
+ context.configure(connection=connection, target_metadata=target_metadata)
85
+
86
+ with context.begin_transaction():
87
+ context.run_migrations()
88
+ else:
89
+ # Programmatic mode: use provided connection
90
+ context.configure(connection=connectable, target_metadata=target_metadata)
91
+
92
+ with context.begin_transaction():
93
+ context.run_migrations()
94
+
95
+
96
+ if context.is_offline_mode():
97
+ run_migrations_offline()
98
+ else:
99
+ run_migrations_online()
@@ -0,0 +1,28 @@
1
+ """${message}
2
+
3
+ Revision ID: ${up_revision}
4
+ Revises: ${down_revision | comma,n}
5
+ Create Date: ${create_date}
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+ ${imports if imports else ""}
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision: str = ${repr(up_revision)}
16
+ down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}
17
+ branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
18
+ depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
19
+
20
+
21
+ def upgrade() -> None:
22
+ """Upgrade schema."""
23
+ ${upgrades if upgrades else "pass"}
24
+
25
+
26
+ def downgrade() -> None:
27
+ """Downgrade schema."""
28
+ ${downgrades if downgrades else "pass"}
@@ -0,0 +1,66 @@
1
+ # Copyright (c) 2025, Abilian SAS
2
+ """add_app_state_machine_and_error_message
3
+
4
+ Revision ID: 0d21c362f66d
5
+ Revises: d20dd80dafca
6
+ Create Date: 2025-11-24 15:20:32.212565
7
+
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ from typing import TYPE_CHECKING
13
+
14
+ import sqlalchemy as sa
15
+ from alembic import op
16
+
17
+ if TYPE_CHECKING:
18
+ from collections.abc import Sequence
19
+
20
+ # revision identifiers, used by Alembic.
21
+ revision: str = "0d21c362f66d"
22
+ down_revision: str | Sequence[str] | None = "d20dd80dafca"
23
+ branch_labels: str | Sequence[str] | None = None
24
+ depends_on: str | Sequence[str] | None = None
25
+
26
+
27
+ def upgrade() -> None:
28
+ """Upgrade schema to add error_message column and update state enum values.
29
+
30
+ Changes:
31
+ - Add error_message column to app table
32
+ - Update run_state enum values (remove PAUSED, add STARTING, STOPPING, FAILED)
33
+ - STOPPED=1, STARTING=2, RUNNING=3, STOPPING=4, FAILED=5
34
+ """
35
+ # Add error_message column
36
+ op.add_column(
37
+ "app",
38
+ sa.Column(
39
+ "error_message", sa.String(length=1024), server_default="", nullable=False
40
+ ),
41
+ )
42
+
43
+ # Note: SQLite doesn't support ALTER TYPE for enums
44
+ # The new state values will work because we're using integers (1-5)
45
+ # Old states: RUNNING=1, STOPPED=2, PAUSED=3
46
+ # New states: STOPPED=1, STARTING=2, RUNNING=3, STOPPING=4, FAILED=5
47
+ # We need to update existing state values:
48
+ # - RUNNING (1) stays as 1, but becomes STOPPED (will be handled by application logic)
49
+ # - STOPPED (2) stays as 2, which becomes STARTING (will fix below)
50
+ # - PAUSED (3) becomes RUNNING (3)
51
+
52
+ # Actually, let's keep it simple for this migration:
53
+ # Old RUNNING (1) -> New RUNNING (3) - needs update
54
+ # Old STOPPED (2) -> New STOPPED (1) - needs update
55
+ # Old PAUSED (3) -> New STOPPED (1) - needs update
56
+
57
+ # For safety, we'll transition all apps to STOPPED state (1)
58
+ op.execute("UPDATE app SET run_state = 1")
59
+
60
+
61
+ def downgrade() -> None:
62
+ """Downgrade schema."""
63
+ # Remove error_message column
64
+ op.drop_column("app", "error_message")
65
+
66
+ # Note: State values will need manual intervention if downgrading
@@ -0,0 +1,40 @@
1
+ # Copyright (c) 2025, Abilian SAS
2
+ """add runtime field to app model
3
+
4
+ Revision ID: 961bfd2ecce5
5
+ Revises: 0d21c362f66d
6
+ Create Date: 2025-11-24 22:19:14.012460
7
+
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ from typing import TYPE_CHECKING
13
+
14
+ import sqlalchemy as sa
15
+ from alembic import op
16
+
17
+ if TYPE_CHECKING:
18
+ from collections.abc import Sequence
19
+
20
+ # revision identifiers, used by Alembic.
21
+ revision: str = "961bfd2ecce5"
22
+ down_revision: str | Sequence[str] | None = "0d21c362f66d"
23
+ branch_labels: str | Sequence[str] | None = None
24
+ depends_on: str | Sequence[str] | None = None
25
+
26
+
27
+ def upgrade() -> None:
28
+ """Upgrade schema to add runtime field."""
29
+ # Add runtime column with default value 'uwsgi' for existing apps
30
+ op.add_column(
31
+ "app",
32
+ sa.Column(
33
+ "runtime", sa.String(length=64), server_default="uwsgi", nullable=False
34
+ ),
35
+ )
36
+
37
+
38
+ def downgrade() -> None:
39
+ """Downgrade schema to remove runtime field."""
40
+ op.drop_column("app", "runtime")
@@ -0,0 +1,33 @@
1
+ # Copyright (c) 2025, Abilian SAS
2
+ """Initial schema
3
+
4
+ Revision ID: d20dd80dafca
5
+ Revises:
6
+ Create Date: 2025-11-13 19:00:17.208093
7
+
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ from typing import TYPE_CHECKING
13
+
14
+ if TYPE_CHECKING:
15
+ from collections.abc import Sequence
16
+
17
+ # revision identifiers, used by Alembic.
18
+ revision: str = "d20dd80dafca"
19
+ down_revision: str | Sequence[str] | None = None
20
+ branch_labels: str | Sequence[str] | None = None
21
+ depends_on: str | Sequence[str] | None = None
22
+
23
+
24
+ def upgrade() -> None:
25
+ """Upgrade schema."""
26
+ # ### commands auto generated by Alembic - please adjust! ###
27
+ # ### end Alembic commands ###
28
+
29
+
30
+ def downgrade() -> None:
31
+ """Downgrade schema."""
32
+ # ### commands auto generated by Alembic - please adjust! ###
33
+ # ### end Alembic commands ###