fujin-cli 0.6.0__tar.gz → 0.7.1__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.

Potentially problematic release.


This version of fujin-cli might be problematic. Click here for more details.

Files changed (88) hide show
  1. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/.pre-commit-config.yaml +7 -0
  2. fujin_cli-0.7.1/CHANGELOG.md +24 -0
  3. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/PKG-INFO +26 -14
  4. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/README.md +23 -13
  5. fujin_cli-0.7.1/docs/changelog.rst +2 -0
  6. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/deploy.rst +12 -11
  7. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/index.rst +1 -1
  8. fujin_cli-0.7.1/docs/commands/printenv.rst +7 -0
  9. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/conf.py +1 -1
  10. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/configuration.rst +8 -4
  11. fujin_cli-0.7.1/docs/index.rst +30 -0
  12. fujin_cli-0.7.1/docs/installation.rst +23 -0
  13. fujin_cli-0.7.1/docs/requirements.txt +100 -0
  14. fujin_cli-0.7.1/docs/secrets.rst +50 -0
  15. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/justfile +1 -1
  16. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/pyproject.toml +6 -4
  17. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/__main__.py +6 -0
  18. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/__init__.py +0 -1
  19. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/_base.py +2 -1
  20. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/deploy.py +23 -12
  21. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/init.py +2 -1
  22. fujin_cli-0.7.1/src/fujin/commands/printenv.py +18 -0
  23. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/redeploy.py +6 -2
  24. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/rollback.py +2 -1
  25. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/config.py +33 -1
  26. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/connection.py +3 -5
  27. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/hooks.py +2 -1
  28. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/proxies/nginx.py +4 -5
  29. fujin_cli-0.7.1/src/fujin/secrets/__init__.py +34 -0
  30. fujin_cli-0.7.1/src/fujin/secrets/bitwarden.py +73 -0
  31. fujin_cli-0.7.1/src/fujin/secrets/onepassword.py +27 -0
  32. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/uv.lock +480 -967
  33. fujin_cli-0.6.0/CHANGELOG.md +0 -7
  34. fujin_cli-0.6.0/docs/changelog.rst +0 -2
  35. fujin_cli-0.6.0/docs/commands/secrets.rst +0 -7
  36. fujin_cli-0.6.0/docs/index.rst +0 -52
  37. fujin_cli-0.6.0/docs/installation.rst +0 -16
  38. fujin_cli-0.6.0/docs/requirements.txt +0 -1090
  39. fujin_cli-0.6.0/src/fujin/commands/secrets.py +0 -11
  40. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/.github/workflows/publish.yml +0 -0
  41. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/.gitignore +0 -0
  42. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/.readthedocs.yaml +0 -0
  43. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/LICENSE.txt +0 -0
  44. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/Vagrantfile +0 -0
  45. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/app.rst +0 -0
  46. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/config.rst +0 -0
  47. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/docs.rst +0 -0
  48. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/down.rst +0 -0
  49. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/init.rst +0 -0
  50. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/proxy.rst +0 -0
  51. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/prune.rst +0 -0
  52. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/redeploy.rst +0 -0
  53. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/rollback.rst +0 -0
  54. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/server.rst +0 -0
  55. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/commands/up.rst +0 -0
  56. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/hooks.rst +0 -0
  57. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/docs/tutorial.rst +0 -0
  58. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/README.md +0 -0
  59. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/bookstore/__init__.py +0 -0
  60. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/bookstore/__main__.py +0 -0
  61. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/bookstore/asgi.py +0 -0
  62. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/bookstore/settings.py +0 -0
  63. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/bookstore/urls.py +0 -0
  64. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/bookstore/wsgi.py +0 -0
  65. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/fujin.toml +0 -0
  66. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/manage.py +0 -0
  67. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/pyproject.toml +0 -0
  68. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/django/bookstore/requirements.txt +0 -0
  69. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/golang/pocketbase/.env.prod +0 -0
  70. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/examples/golang/pocketbase/fujin.toml +0 -0
  71. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/__init__.py +0 -0
  72. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/app.py +0 -0
  73. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/config.py +0 -0
  74. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/docs.py +0 -0
  75. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/down.py +0 -0
  76. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/proxy.py +0 -0
  77. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/prune.py +0 -0
  78. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/server.py +0 -0
  79. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/commands/up.py +1 -1
  80. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/errors.py +0 -0
  81. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/process_managers/__init__.py +0 -0
  82. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/process_managers/systemd.py +0 -0
  83. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/proxies/__init__.py +0 -0
  84. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/proxies/caddy.py +0 -0
  85. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/proxies/dummy.py +0 -0
  86. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/templates/simple.service +0 -0
  87. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/templates/web.service +0 -0
  88. {fujin_cli-0.6.0 → fujin_cli-0.7.1}/src/fujin/templates/web.socket +0 -0
@@ -34,3 +34,10 @@ repos:
34
34
  - id: pyproject-fmt
35
35
  args: [ "pyproject.toml" ]
36
36
  exclude: ^(examples/)
37
+
38
+ # - repo: https://github.com/asottile/reorder_python_imports
39
+ # rev: v3.13.0
40
+ # hooks:
41
+ # - id: reorder-python-imports
42
+ # args:
43
+ # - "--application-directories=src"
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.7.1] - 2024-11-23
8
+
9
+ ### 🐛 Bug Fixes
10
+
11
+ - Broken .venv folder can fail deploy
12
+
13
+ ## [0.7.0] - 2024-11-22
14
+
15
+ ### 🚀 Features
16
+
17
+ - Inject secrets via bitwarden and 1password (#29)
18
+ - Add certbot_email configuration for nginx
19
+
20
+ ### 🚜 Refactor
21
+
22
+ - Move requirements copy to transfer_files
23
+
24
+ <!-- generated by git-cliff -->
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: fujin-cli
3
- Version: 0.6.0
3
+ Version: 0.7.1
4
4
  Summary: Get your project up and running in a few minutes on your own vps.
5
5
  Project-URL: Documentation, https://github.com/falcopackages/fujin#readme
6
6
  Project-URL: Issues, https://github.com/falcopackages/fujin/issues
@@ -21,36 +21,48 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
21
21
  Requires-Python: >=3.10
22
22
  Requires-Dist: cappa>=0.24
23
23
  Requires-Dist: fabric>=3.2.2
24
+ Requires-Dist: gevent[recommended]>=24.11.1
24
25
  Requires-Dist: msgspec[toml]>=0.18.6
26
+ Requires-Dist: python-dotenv>=1.0.1
25
27
  Requires-Dist: rich>=13.9.2
26
28
  Description-Content-Type: text/markdown
27
29
 
28
30
  # fujin
29
31
 
32
+ > [!IMPORTANT]
33
+ > This tool is currently contains minimal features and is a work-in-progress
34
+
35
+ <!-- content:start -->
36
+
37
+ `fujin` is a simple deployment tool that helps you get your project up and running on a VPS in minutes. It manages your app processes using [systemd](https://systemd.io) and runs your apps behind [caddy](https://caddyserver.com).
38
+
39
+ [![Publish Package](https://github.com/falcopackages/fujin/actions/workflows/publish.yml/badge.svg)](https://github.com/falcopackages/fujin/actions/workflows/publish.yml)
30
40
  [![PyPI - Version](https://img.shields.io/pypi/v/fujin-cli.svg)](https://pypi.org/project/fujin-cli)
31
41
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fujin-cli.svg)](https://pypi.org/project/fujin-cli)
32
42
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/falcopackages/fujin/blob/main/LICENSE.txt)
33
43
  [![Status](https://img.shields.io/pypi/status/fujin-cli.svg)](https://pypi.org/project/fujin-cli)
34
- -----
35
44
 
36
- > [!IMPORTANT]
37
- > This package currently contains minimal features and is a work-in-progress
38
-
39
- <!-- content:start -->
45
+ ## Features
40
46
 
41
- `fujin` is a simple deployment tool that helps you get your project up and running on a VPS in a few minutes. It manages your app processes using `systemd` and runs your apps behind [caddy](https://caddyserver.com/). For Python projects,
42
- it expects your app to be a packaged Python application ideally with a CLI entry point defined. For other languages, you need to provide a self-contained single executable file with all necessary dependencies.
43
- The main job of `fujin` is to bootstrap your server (installing caddy, etc.), copy the files onto the server with a structure that supports rollback, and automatically generate configs for systemd and caddy that you can manually edit if needed.
47
+ - 🚀 One-command server bootstrap
48
+ - 🔄 Rollback broken deployments
49
+ - 🔐 Zero configuration SSL certificates
50
+ - 🔁 Swappable proxy ([caddy](https://caddyserver.com), [nginx](https://nginx.org/en/) and `dummy` to disable proxy)
51
+ - 🛠️ Secrets injection from password managers ([Bitwarden](https://bitwarden.com/), [1Password](https://1password.com), etc.)
52
+ - 📝 Easily customizable `systemd` and `proxy` configurations
53
+ - 👨‍💻 Remote application management and log streaming
54
+ - 🐍 Supports packaged python apps and self-contained binaries
44
55
 
45
- Check out the [documentation📚](https://fujin.oluwatobi.dev/en/latest/) for installation, features, and usage guides.
56
+ For more details, check out the [documentation📚](https://fujin.oluwatobi.dev/en/latest/).
46
57
 
47
58
  ## Why?
48
59
 
49
60
  I wanted [kamal](https://kamal-deploy.org/) but without Docker, and I thought the idea was fun. At its core, this project automates versions of this [tutorial](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu). If you've been a Django beginner
50
- trying to get your app in production, you probably went through this. I'm using caddy instead of nginx because it's configurable via an API and it's is a no-brainer for SSL certificates. Systemd is the default on most Linux distributions and does a good enough job.
61
+ trying to get your app in production, you probably went through this.
62
+
63
+ I'm using `caddy` here by default instead of `nginx` because it's configurable via an API and it's is a no-brainer for SSL certificates. `Systemd` is the default on most Linux distributions and does a good enough job.
51
64
 
52
- Fujin was initially planned to be a Python-only project, but the core concepts can be applied to any language that can produce a single distributable file (e.g., Go, Rust). I wanted to recreate kamal's nice local-to-remote app management API, but I'm skipping Docker to keep things simple.
53
- I'm currently rocking SQLite in production for my side projects and ths setup is enough for my use case.
65
+ Fujin was initially planned to be a Python-only project, but the core concepts can be applied to any language that can produce a single distributable file (e.g., Go, Rust).
54
66
 
55
67
  The goal is to automate deployment while leaving you in full control of your Linux box. It's not a CLI PaaS - it's simple and expects you to be able to SSH into your server and troubleshoot if necessary. For beginners, it makes the initial deployment easier while you get your hands dirty with Linux.
56
68
  If you need a never-break, worry-free, set-it-and-forget-it setup that auto-scales and does all the magic, fujin probably isn't for you.
@@ -66,4 +78,4 @@ Fujin draws inspiration from the following tools for their developer experience.
66
78
 
67
79
  `fujin` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
68
80
 
69
- <!-- content:end -->
81
+ <!-- content:end -->
@@ -1,29 +1,39 @@
1
1
  # fujin
2
2
 
3
+ > [!IMPORTANT]
4
+ > This tool is currently contains minimal features and is a work-in-progress
5
+
6
+ <!-- content:start -->
7
+
8
+ `fujin` is a simple deployment tool that helps you get your project up and running on a VPS in minutes. It manages your app processes using [systemd](https://systemd.io) and runs your apps behind [caddy](https://caddyserver.com).
9
+
10
+ [![Publish Package](https://github.com/falcopackages/fujin/actions/workflows/publish.yml/badge.svg)](https://github.com/falcopackages/fujin/actions/workflows/publish.yml)
3
11
  [![PyPI - Version](https://img.shields.io/pypi/v/fujin-cli.svg)](https://pypi.org/project/fujin-cli)
4
12
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/fujin-cli.svg)](https://pypi.org/project/fujin-cli)
5
13
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/falcopackages/fujin/blob/main/LICENSE.txt)
6
14
  [![Status](https://img.shields.io/pypi/status/fujin-cli.svg)](https://pypi.org/project/fujin-cli)
7
- -----
8
15
 
9
- > [!IMPORTANT]
10
- > This package currently contains minimal features and is a work-in-progress
11
-
12
- <!-- content:start -->
16
+ ## Features
13
17
 
14
- `fujin` is a simple deployment tool that helps you get your project up and running on a VPS in a few minutes. It manages your app processes using `systemd` and runs your apps behind [caddy](https://caddyserver.com/). For Python projects,
15
- it expects your app to be a packaged Python application ideally with a CLI entry point defined. For other languages, you need to provide a self-contained single executable file with all necessary dependencies.
16
- The main job of `fujin` is to bootstrap your server (installing caddy, etc.), copy the files onto the server with a structure that supports rollback, and automatically generate configs for systemd and caddy that you can manually edit if needed.
18
+ - 🚀 One-command server bootstrap
19
+ - 🔄 Rollback broken deployments
20
+ - 🔐 Zero configuration SSL certificates
21
+ - 🔁 Swappable proxy ([caddy](https://caddyserver.com), [nginx](https://nginx.org/en/) and `dummy` to disable proxy)
22
+ - 🛠️ Secrets injection from password managers ([Bitwarden](https://bitwarden.com/), [1Password](https://1password.com), etc.)
23
+ - 📝 Easily customizable `systemd` and `proxy` configurations
24
+ - 👨‍💻 Remote application management and log streaming
25
+ - 🐍 Supports packaged python apps and self-contained binaries
17
26
 
18
- Check out the [documentation📚](https://fujin.oluwatobi.dev/en/latest/) for installation, features, and usage guides.
27
+ For more details, check out the [documentation📚](https://fujin.oluwatobi.dev/en/latest/).
19
28
 
20
29
  ## Why?
21
30
 
22
31
  I wanted [kamal](https://kamal-deploy.org/) but without Docker, and I thought the idea was fun. At its core, this project automates versions of this [tutorial](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu). If you've been a Django beginner
23
- trying to get your app in production, you probably went through this. I'm using caddy instead of nginx because it's configurable via an API and it's is a no-brainer for SSL certificates. Systemd is the default on most Linux distributions and does a good enough job.
32
+ trying to get your app in production, you probably went through this.
33
+
34
+ I'm using `caddy` here by default instead of `nginx` because it's configurable via an API and it's is a no-brainer for SSL certificates. `Systemd` is the default on most Linux distributions and does a good enough job.
24
35
 
25
- Fujin was initially planned to be a Python-only project, but the core concepts can be applied to any language that can produce a single distributable file (e.g., Go, Rust). I wanted to recreate kamal's nice local-to-remote app management API, but I'm skipping Docker to keep things simple.
26
- I'm currently rocking SQLite in production for my side projects and ths setup is enough for my use case.
36
+ Fujin was initially planned to be a Python-only project, but the core concepts can be applied to any language that can produce a single distributable file (e.g., Go, Rust).
27
37
 
28
38
  The goal is to automate deployment while leaving you in full control of your Linux box. It's not a CLI PaaS - it's simple and expects you to be able to SSH into your server and troubleshoot if necessary. For beginners, it makes the initial deployment easier while you get your hands dirty with Linux.
29
39
  If you need a never-break, worry-free, set-it-and-forget-it setup that auto-scales and does all the magic, fujin probably isn't for you.
@@ -39,4 +49,4 @@ Fujin draws inspiration from the following tools for their developer experience.
39
49
 
40
50
  `fujin` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
41
51
 
42
- <!-- content:end -->
52
+ <!-- content:end -->
@@ -0,0 +1,2 @@
1
+ .. include:: ../CHANGELOG.md
2
+ :parser: myst_parser.sphinx_
@@ -12,23 +12,25 @@ How it works
12
12
 
13
13
  Here's a high-level overview of what happens when you run the ``deploy`` command:
14
14
 
15
- 1. **Build the Application**: Your application is built using the ``build_command`` specified in your configuration.
15
+ 1. **Resolve secrets**: If you have defined a ``secrets`` configuration, it will be used to retrieve pull the ``secrets`` defined in your ``envfile``.
16
16
 
17
- 2. **Transfer Files**: The environment variables file (``.env``) and the distribution file are transferred to the remote server. Optionally transfers ``requirements`` file (if specified).
17
+ 2. **Build the Application**: Your application is built using the ``build_command`` specified in your configuration.
18
18
 
19
- 3. **Install the Project**: Depending on the installation mode (Python package or binary), the project is installed on the remote server. For a Python package, a virtual environment is set up, dependencies are installed, and the distribution file (the wheel file) is then installed. For a binary, the binary file for the latest version is linked to the root of the application directory.
19
+ 3. **Transfer Files**: The environment variables file (``.env``) and the distribution file are transferred to the remote server. Optionally transfers ``requirements`` file (if specified).
20
20
 
21
- 4. **Application Release**: If a ``release_command`` is specified in the configuration, it is executed at this stage.
21
+ 4. **Install the Project**: Depending on the installation mode (Python package or binary), the project is installed on the remote server. For a Python package, a virtual environment is set up, dependencies are installed, and the distribution file (the wheel file) is then installed. For a binary, the binary file for the latest version is linked to the root of the application directory.
22
22
 
23
- 5. **Configure and Start Services**: Configuration files for both ``systemd`` and the ``proxy`` (e.g., Caddy, by default) are generated or copied if previously exported. These configuration files are moved to their appropriate directories. A configuration reload is performed, and all relevant services are restarted.
23
+ 5. **Application Release**: If a ``release_command`` is specified in the configuration, it is executed at this stage.
24
24
 
25
- 6. **Update Version History**: The deployed version is recorded in the ``.versions`` file on the remote server.
25
+ 6. **Configure and Start Services**: Configuration files for both ``systemd`` and the ``proxy`` (e.g., Caddy, by default) are generated or copied if previously exported. These configuration files are moved to their appropriate directories. A configuration reload is performed, and all relevant services are restarted.
26
26
 
27
- 7. **Prune Old Assets**: Old versions of the application are removed based on the ``versions_to_keep`` configuration.
27
+ 7. **Update Version History**: The deployed version is recorded in the ``.versions`` file on the remote server.
28
28
 
29
- 8. **Completion**: A success message is displayed, and the URL to access the deployed project is provided.
29
+ 8. **Prune Old Assets**: Old versions of the application are removed based on the ``versions_to_keep`` configuration.
30
30
 
31
- Below is an example file layout and structure of the deployed application:
31
+ 9. **Completion**: A success message is displayed, and the URL to access the deployed project is provided.
32
+
33
+ Below is an example of the layout and structure of a deployed application:
32
34
 
33
35
  .. tab-set::
34
36
 
@@ -63,5 +65,4 @@ Below is an example file layout and structure of the deployed application:
63
65
  ├── v1.2.2/
64
66
  │ └── ...
65
67
  └── v1.2.1/
66
- └── ...
67
-
68
+ └── ...
@@ -15,10 +15,10 @@ Commands
15
15
  docs
16
16
  down
17
17
  init
18
+ printenv
18
19
  prune
19
20
  proxy
20
21
  redeploy
21
22
  rollback
22
- secrets
23
23
  server
24
24
  up
@@ -0,0 +1,7 @@
1
+ printenv
2
+ =======
3
+
4
+ .. cappa:: fujin.commands.printenv.Printenv
5
+ :style: terminal
6
+ :terminal-width: 0
7
+
@@ -20,7 +20,7 @@ extensions = [
20
20
  "sphinx.ext.autodoc",
21
21
  "sphinx_design",
22
22
  "sphinx_copybutton",
23
- "jupyter_sphinx",
23
+ "sphinx_exec_code",
24
24
  "sphinx_togglebutton",
25
25
  ]
26
26
 
@@ -13,20 +13,24 @@ This is a minimal working example.
13
13
 
14
14
  .. tab-item:: python package
15
15
 
16
- .. jupyter-execute::
17
- :hide-code:
16
+ .. exec_code::
17
+ :language_output: toml
18
18
 
19
+ # --- hide: start ---
19
20
  from fujin.commands.init import simple_config
20
21
  from tomli_w import dumps
21
22
 
22
23
  print(dumps(simple_config("bookstore")))
24
+ #hide:toggle
23
25
 
24
26
  .. tab-item:: binary mode
25
27
 
26
- .. jupyter-execute::
27
- :hide-code:
28
+ .. exec_code::
29
+ :language_output: toml
28
30
 
31
+ # --- hide: start ---
29
32
  from fujin.commands.init import binary_config
30
33
  from tomli_w import dumps
31
34
 
32
35
  print(dumps(binary_config("bookstore")))
36
+ #hide:toggle
@@ -0,0 +1,30 @@
1
+ fujin documentation
2
+ ===================
3
+
4
+
5
+ .. important::
6
+
7
+ This a work in progress, not ready for production use yet.
8
+
9
+ .. raw:: html
10
+
11
+ <script src="https://asciinema.org/a/687274.js" id="asciicast-687274" async="true"></script>
12
+
13
+ .. include:: ../README.md
14
+ :parser: myst_parser.sphinx_
15
+ :start-after: <!-- content:start -->
16
+ :end-before: <!-- content:end -->
17
+
18
+ .. toctree::
19
+ :maxdepth: 2
20
+ :caption: Contents:
21
+ :hidden:
22
+
23
+ installation
24
+ tutorial
25
+ configuration
26
+ commands/index
27
+ secrets
28
+ hooks
29
+ changelog
30
+
@@ -0,0 +1,23 @@
1
+ Installation
2
+ ============
3
+
4
+ If you have `uv <https://docs.astral.sh/uv/getting-started/installation/>`_ installed, run:
5
+
6
+ .. code-block:: shell
7
+
8
+ uv tool install fujin-cli
9
+
10
+ If not, download a binary version from the GitHub `releases page <https://github.com/falcopackages/fujin/releases>`_ and move the downloaded file
11
+ to a directory in your PATH.
12
+
13
+ Here is an example of how to install the binary on x86 macOS:
14
+
15
+ .. code-block:: shell
16
+
17
+ curl -LsSfO https://github.com/falcopackages/fujin/releases/download/v0.6.0/fujin_cli-x86_64-osx
18
+ chmod +x fujin_cli-x86_64-osx
19
+ mv fujin_cli-x86_64-osx /usr/local/bin/fujin
20
+
21
+ .. note::
22
+
23
+ If you install ``fujin`` via the GitHub release, you can keep it up to date with ``fujin self update``.
@@ -0,0 +1,100 @@
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv export --no-hashes --group docs --format requirements-txt
3
+ -e .
4
+ alabaster==1.0.0
5
+ annotated-types==0.7.0
6
+ anyio==4.6.2.post1
7
+ asgiref==3.8.1
8
+ astroid==3.3.5
9
+ babel==2.16.0
10
+ bcrypt==4.2.1
11
+ bracex==2.5.post1
12
+ bump-my-version==0.28.1
13
+ cappa==0.25.1
14
+ certifi==2024.8.30
15
+ cffi==1.17.1
16
+ charset-normalizer==3.4.0
17
+ click==8.1.7
18
+ colorama==0.4.6
19
+ cryptography==43.0.3
20
+ decorator==5.1.1
21
+ deprecated==1.2.15
22
+ django==5.1.3
23
+ docutils==0.21.2
24
+ exceptiongroup==1.2.2 ; python_full_version < '3.11'
25
+ fabric==3.2.2
26
+ faker==33.0.0
27
+ fastapi==0.115.5
28
+ gevent==24.11.1
29
+ git-cliff==2.7.0
30
+ greenlet==3.1.1 ; platform_python_implementation == 'CPython'
31
+ h11==0.14.0
32
+ httpcore==1.0.7
33
+ httpx==0.27.2
34
+ idna==3.10
35
+ imagesize==1.4.1
36
+ invoke==2.2.0
37
+ jinja2==3.1.4
38
+ litestar==2.13.0
39
+ litestar-htmx==0.3.0
40
+ markdown-it-py==3.0.0
41
+ markupsafe==3.0.2
42
+ mdit-py-plugins==0.4.2
43
+ mdurl==0.1.2
44
+ msgspec==0.18.6
45
+ multidict==6.1.0
46
+ myst-parser==4.0.0
47
+ packaging==24.2
48
+ paramiko==3.5.0
49
+ polyfactory==2.18.0
50
+ prompt-toolkit==3.0.48
51
+ psutil==6.1.0 ; sys_platform != 'win32' or platform_python_implementation == 'CPython'
52
+ pycparser==2.22
53
+ pydantic==2.10.1
54
+ pydantic-core==2.27.1
55
+ pydantic-settings==2.6.1
56
+ pygments==2.18.0
57
+ pynacl==1.5.0
58
+ python-dateutil==2.9.0.post0
59
+ python-dotenv==1.0.1
60
+ pyyaml==6.0.2
61
+ questionary==1.10.0
62
+ requests==2.32.3
63
+ rich==13.9.4
64
+ rich-click==1.8.4
65
+ setuptools==75.6.0
66
+ shibuya==2024.10.15
67
+ six==1.16.0
68
+ sniffio==1.3.1
69
+ snowballstemmer==2.2.0
70
+ sphinx==8.1.3
71
+ sphinx-autobuild==2024.10.3
72
+ sphinx-autodoc2==0.5.0
73
+ sphinx-copybutton==0.5.2
74
+ sphinx-design==0.6.1
75
+ sphinx-exec-code==0.14
76
+ sphinx-togglebutton==0.3.2
77
+ sphinxcontrib-applehelp==2.0.0
78
+ sphinxcontrib-devhelp==2.0.0
79
+ sphinxcontrib-htmlhelp==2.1.0
80
+ sphinxcontrib-jsmath==1.0.1
81
+ sphinxcontrib-qthelp==2.0.0
82
+ sphinxcontrib-serializinghtml==2.0.0
83
+ sqlparse==0.5.2
84
+ starlette==0.41.3
85
+ tomli==2.1.0 ; python_full_version < '3.11'
86
+ tomli-w==1.1.0
87
+ tomlkit==0.13.2
88
+ type-lens==0.2.3
89
+ typing-extensions==4.12.2
90
+ tzdata==2024.2 ; sys_platform == 'win32'
91
+ urllib3==2.2.3
92
+ uvicorn==0.32.1
93
+ watchfiles==0.24.0
94
+ wcmatch==10.0
95
+ wcwidth==0.2.13
96
+ websockets==14.1
97
+ wheel==0.45.1
98
+ wrapt==1.17.0
99
+ zope-event==5.0
100
+ zope-interface==7.1.1
@@ -0,0 +1,50 @@
1
+ Secrets
2
+ =======
3
+
4
+ Bitwarden
5
+ ---------
6
+
7
+ First, download and install the `Bitwarden CLI <https://bitwarden.com/help/cli/#download-and-install>`_. Make sure to log in to your account.
8
+ You should be able to run ``bw get password <name_of_secret>`` and get the value for the secret. This is the command that will be executed when pulling your secrets.
9
+
10
+ Add the following to your ``fujin.toml`` file:
11
+
12
+ .. code-block:: toml
13
+
14
+ [secrets]
15
+ adapter = "bitwarden"
16
+ password_env = "BW_PASSWORD"
17
+
18
+ To unlock the Bitwarden vault, the password is required. You can set the ``BW_PASSWORD`` environment variable in your shell, which will be used to unlock the vault.
19
+ When Fujin signs in, it will always sync the vault first.
20
+
21
+ Alternatively, you can set the ``BW_SESSION`` environment variable. If ``BW_SESSION`` is present, Fujin will use it directly without signing in or syncing the vault. In this case, the ``password_env`` configuration is not required.
22
+
23
+ .. code-block:: text
24
+ :caption: Example of an environment file with Bitwarden secrets
25
+
26
+ DEBUG=False
27
+ AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
28
+ AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
29
+
30
+ Note the ``$`` sign, which indicates to ``fujin`` that it is a secret.
31
+
32
+ 1Password
33
+ ---------
34
+
35
+ Download and install the `1Password CLI <https://developer.1password.com/docs/cli>`_, and sign in to your account.
36
+ You need to be actively signed in for Fujin to work with 1Password.
37
+
38
+ Update your ``fujin.toml`` file with the following configuration:
39
+
40
+ .. code-block:: toml
41
+
42
+ [secrets]
43
+ adapter = "1password"
44
+
45
+ .. code-block:: text
46
+ :caption: Example of an environment file with 1Password secrets
47
+
48
+ DEBUG=False
49
+ AWS_ACCESS_KEY_ID=$op://personal/aws-access-key-id/password
50
+ AWS_SECRET_ACCESS_KEY=$op://personal/aws-secret-access-key/password
@@ -49,7 +49,7 @@ fujin *ARGS:
49
49
  uv run --group docs sphinx-autobuild docs docs/_build/html --port 8002 --watch src/fujin
50
50
 
51
51
  @docs-requirements:
52
- uv export --group docs --format requirements-txt > docs/requirements.txt
52
+ uv export --no-hashes --group docs --format requirements-txt > docs/requirements.txt
53
53
 
54
54
  # -------------------------------------------------------------------------
55
55
  # RELEASE UTILITIES
@@ -7,7 +7,7 @@ requires = [
7
7
 
8
8
  [project]
9
9
  name = "fujin-cli"
10
- version = "0.6.0"
10
+ version = "0.7.1"
11
11
  description = "Get your project up and running in a few minutes on your own vps."
12
12
  readme = "README.md"
13
13
  keywords = [
@@ -40,7 +40,9 @@ classifiers = [
40
40
  dependencies = [
41
41
  "cappa>=0.24",
42
42
  "fabric>=3.2.2",
43
+ "gevent[recommended]>=24.11.1",
43
44
  "msgspec[toml]>=0.18.6",
45
+ "python-dotenv>=1.0.1",
44
46
  "rich>=13.9.2",
45
47
  ]
46
48
 
@@ -59,13 +61,13 @@ dev = [
59
61
  "litestar>=2.12.1",
60
62
  ]
61
63
  docs = [
62
- "jupyter-sphinx>=0.5.3",
63
64
  "myst-parser",
64
65
  "shibuya",
65
66
  "sphinx-autobuild",
66
67
  "sphinx-autodoc2>=0.5",
67
68
  "sphinx-copybutton",
68
69
  "sphinx-design",
70
+ "sphinx-exec-code>=0.14",
69
71
  "sphinx-togglebutton>=0.3.2",
70
72
  ]
71
73
 
@@ -114,12 +116,12 @@ lint.select = [
114
116
  "B", # flake8-bugbear
115
117
  "E", # Pycodestyle
116
118
  "F", # Pyflakes
117
- "I", # isort
118
119
  "UP", # pyupgrade
119
120
  ]
120
121
  lint.ignore = [
121
122
  "E501",
122
123
  "E741",
124
+ "I", # isort
123
125
  ] # temporary
124
126
  # Tests can use magic values, assertions, and relative imports
125
127
  lint.per-file-ignores."tests/**/*" = [
@@ -152,7 +154,7 @@ lint.isort.required-imports = [
152
154
  lint.pyupgrade.keep-runtime-typing = true
153
155
 
154
156
  [tool.bumpversion]
155
- current_version = "0.6.0"
157
+ current_version = "0.7.1"
156
158
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
157
159
  serialize = [
158
160
  "{major}.{minor}.{patch}",
@@ -1,3 +1,7 @@
1
+ from gevent import monkey
2
+
3
+ monkey.patch_all()
4
+
1
5
  import shlex
2
6
  import sys
3
7
  from pathlib import Path
@@ -16,6 +20,7 @@ from fujin.commands.redeploy import Redeploy
16
20
  from fujin.commands.rollback import Rollback
17
21
  from fujin.commands.server import Server
18
22
  from fujin.commands.up import Up
23
+ from fujin.commands.printenv import Printenv
19
24
 
20
25
  if sys.version_info >= (3, 11):
21
26
  import tomllib
@@ -38,6 +43,7 @@ class Fujin:
38
43
  | Down
39
44
  | Rollback
40
45
  | Prune
46
+ | Printenv
41
47
  ]
42
48
 
43
49
 
@@ -1,2 +1 @@
1
1
  from ._base import BaseCommand # noqa
2
- from ._base import BaseCommand # noqa
@@ -6,7 +6,8 @@ from functools import cached_property
6
6
  import cappa
7
7
 
8
8
  from fujin.config import Config
9
- from fujin.connection import host_connection, Connection
9
+ from fujin.connection import Connection
10
+ from fujin.connection import host_connection
10
11
  from fujin.errors import ImproperlyConfiguredError
11
12
  from fujin.hooks import HookManager
12
13
  from fujin.process_managers import ProcessManager