fujin-cli 0.1.0__tar.gz → 0.2.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.
Potentially problematic release.
This version of fujin-cli might be problematic. Click here for more details.
- fujin_cli-0.2.0/.github/workflows/publish.yml +36 -0
- fujin_cli-0.2.0/.gitignore +150 -0
- fujin_cli-0.2.0/Dockerfile +39 -0
- fujin_cli-0.2.0/PKG-INFO +52 -0
- {fujin_cli-0.1.0 → fujin_cli-0.2.0}/README.md +3 -3
- fujin_cli-0.2.0/examples/django/bookstore/README.md +0 -0
- fujin_cli-0.2.0/examples/django/bookstore/bookstore/__init__.py +0 -0
- fujin_cli-0.2.0/examples/django/bookstore/bookstore/__main__.py +22 -0
- fujin_cli-0.2.0/examples/django/bookstore/bookstore/asgi.py +16 -0
- fujin_cli-0.2.0/examples/django/bookstore/bookstore/settings.py +123 -0
- fujin_cli-0.2.0/examples/django/bookstore/bookstore/urls.py +23 -0
- fujin_cli-0.2.0/examples/django/bookstore/bookstore/wsgi.py +16 -0
- fujin_cli-0.2.0/examples/django/bookstore/fujin.toml +29 -0
- fujin_cli-0.2.0/examples/django/bookstore/manage.py +0 -0
- fujin_cli-0.2.0/examples/django/bookstore/pyproject.toml +16 -0
- fujin_cli-0.2.0/examples/django/bookstore/requirements.txt +8 -0
- fujin_cli-0.2.0/justfile +73 -0
- fujin_cli-0.2.0/pyproject.toml +132 -0
- fujin_cli-0.2.0/src/fujin/__init__.py +0 -0
- fujin_cli-0.2.0/src/fujin/__main__.py +53 -0
- fujin_cli-0.2.0/src/fujin/commands/__init__.py +3 -0
- fujin_cli-0.2.0/src/fujin/commands/_base.py +83 -0
- fujin_cli-0.2.0/src/fujin/commands/app.py +70 -0
- fujin_cli-0.2.0/src/fujin/commands/config.py +174 -0
- fujin_cli-0.2.0/src/fujin/commands/deploy.py +54 -0
- fujin_cli-0.2.0/src/fujin/commands/down.py +30 -0
- fujin_cli-0.2.0/src/fujin/commands/redeploy.py +19 -0
- fujin_cli-0.2.0/src/fujin/commands/server.py +57 -0
- fujin_cli-0.2.0/src/fujin/commands/up.py +16 -0
- fujin_cli-0.2.0/src/fujin/config.py +131 -0
- fujin_cli-0.2.0/src/fujin/errors.py +5 -0
- fujin_cli-0.2.0/src/fujin/hooks.py +15 -0
- fujin_cli-0.2.0/src/fujin/host.py +85 -0
- fujin_cli-0.2.0/src/fujin/process_managers/__init__.py +29 -0
- fujin_cli-0.2.0/src/fujin/process_managers/systemd.py +105 -0
- fujin_cli-0.2.0/src/fujin/proxies/__init__.py +18 -0
- fujin_cli-0.2.0/src/fujin/proxies/caddy.py +52 -0
- fujin_cli-0.2.0/src/fujin/proxies/dummy.py +16 -0
- fujin_cli-0.2.0/src/fujin/proxies/nginx.py +59 -0
- fujin_cli-0.2.0/src/fujin/templates/other.service +15 -0
- fujin_cli-0.2.0/src/fujin/templates/web.service +24 -0
- fujin_cli-0.2.0/src/fujin/templates/web.socket +11 -0
- fujin_cli-0.2.0/uv.lock +1031 -0
- fujin_cli-0.1.0/.gitignore +0 -10
- fujin_cli-0.1.0/.python-version +0 -1
- fujin_cli-0.1.0/PKG-INFO +0 -41
- fujin_cli-0.1.0/pyproject.toml +0 -26
- fujin_cli-0.1.0/src/fujin/__init__.py +0 -2
- fujin_cli-0.1.0/src/fujin/fabfile.py +0 -202
- fujin_cli-0.1.0/src/fujin/utils.py +0 -60
- {fujin_cli-0.1.0 → fujin_cli-0.2.0}/LICENSE.txt +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Publish package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
name: Publish to pypi
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Install uv
|
|
14
|
+
uses: astral-sh/setup-uv@v3
|
|
15
|
+
- name: Build Wheel
|
|
16
|
+
run: uv build
|
|
17
|
+
- name: Publish
|
|
18
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
19
|
+
|
|
20
|
+
release:
|
|
21
|
+
name: Create a GitHub release
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
permissions:
|
|
24
|
+
contents: write
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout code
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
- name: Generate Changelog
|
|
29
|
+
run: |
|
|
30
|
+
awk '/^## /{if (p) exit; p=1; next} p' ${{ github.workspace }}/CHANGELOG.md | tee ${{ github.workspace }}-CHANGELOG.txt
|
|
31
|
+
- name: Release
|
|
32
|
+
uses: softprops/action-gh-release@v2
|
|
33
|
+
with:
|
|
34
|
+
body_path: ${{ github.workspace }}-CHANGELOG.txt
|
|
35
|
+
files: dist/*
|
|
36
|
+
fail_on_unmatched_files: true
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
*.sqlite3
|
|
62
|
+
*.sqlite3-journal
|
|
63
|
+
*.sqlite3-shm
|
|
64
|
+
*.sqlite3-wal
|
|
65
|
+
*.db
|
|
66
|
+
*.db-journal
|
|
67
|
+
*.db-shm
|
|
68
|
+
*.db-wal
|
|
69
|
+
*staticfiles/
|
|
70
|
+
*media
|
|
71
|
+
|
|
72
|
+
# db dumps
|
|
73
|
+
*.dump
|
|
74
|
+
|
|
75
|
+
# Flask stuff:
|
|
76
|
+
instance/
|
|
77
|
+
.webassets-cache
|
|
78
|
+
|
|
79
|
+
# Scrapy stuff:
|
|
80
|
+
.scrapy
|
|
81
|
+
|
|
82
|
+
# Sphinx documentation
|
|
83
|
+
docs/_build/
|
|
84
|
+
|
|
85
|
+
# PyBuilder
|
|
86
|
+
target/
|
|
87
|
+
|
|
88
|
+
# Jupyter Notebook
|
|
89
|
+
.ipynb_checkpoints
|
|
90
|
+
|
|
91
|
+
# IPython
|
|
92
|
+
profile_default/
|
|
93
|
+
ipython_config.py
|
|
94
|
+
|
|
95
|
+
# pyenv
|
|
96
|
+
.python-version
|
|
97
|
+
|
|
98
|
+
# pipenv
|
|
99
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
100
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
101
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
102
|
+
# install all needed dependencies.
|
|
103
|
+
#Pipfile.lock
|
|
104
|
+
|
|
105
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
106
|
+
__pypackages__/
|
|
107
|
+
|
|
108
|
+
# Celery stuff
|
|
109
|
+
celerybeat-schedule
|
|
110
|
+
celerybeat.pid
|
|
111
|
+
|
|
112
|
+
# SageMath parsed files
|
|
113
|
+
*.sage.py
|
|
114
|
+
|
|
115
|
+
# Environments
|
|
116
|
+
.env
|
|
117
|
+
examples/django/bookstore/.env.prod
|
|
118
|
+
.venv
|
|
119
|
+
env/
|
|
120
|
+
venv/
|
|
121
|
+
ENV/
|
|
122
|
+
env.bak/
|
|
123
|
+
venv.bak/
|
|
124
|
+
|
|
125
|
+
# Spyder project settings
|
|
126
|
+
.spyderproject
|
|
127
|
+
.spyproject
|
|
128
|
+
|
|
129
|
+
# Rope project settings
|
|
130
|
+
.ropeproject
|
|
131
|
+
|
|
132
|
+
# mkdocs documentation
|
|
133
|
+
/site
|
|
134
|
+
|
|
135
|
+
# mypy
|
|
136
|
+
.mypy_cache/
|
|
137
|
+
.dmypy.json
|
|
138
|
+
dmypy.json
|
|
139
|
+
|
|
140
|
+
# Pyre type checker
|
|
141
|
+
.pyre/
|
|
142
|
+
|
|
143
|
+
# Pycharm
|
|
144
|
+
.idea/
|
|
145
|
+
|
|
146
|
+
# MacOs
|
|
147
|
+
.DS_Store
|
|
148
|
+
|
|
149
|
+
id_rsa
|
|
150
|
+
id_rsa.pub
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
FROM ubuntu:latest
|
|
2
|
+
|
|
3
|
+
# Update and install necessary packages
|
|
4
|
+
RUN apt update && apt install -y openssh-server sudo
|
|
5
|
+
|
|
6
|
+
# Create the user 'test' and passwordless sudo
|
|
7
|
+
RUN useradd -rm -d /home/test -s /bin/bash -g root -G sudo -u 2000 test && \
|
|
8
|
+
echo 'test:test' | chpasswd && \
|
|
9
|
+
echo 'test ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
|
10
|
+
|
|
11
|
+
# Set up SSH server
|
|
12
|
+
RUN mkdir /var/run/sshd
|
|
13
|
+
|
|
14
|
+
# Copy the public key and set correct permissions for SSH
|
|
15
|
+
COPY id_rsa.pub /tmp/id_rsa.pub
|
|
16
|
+
RUN mkdir -p /home/test/.ssh && \
|
|
17
|
+
cat /tmp/id_rsa.pub >> /home/test/.ssh/authorized_keys && \
|
|
18
|
+
chown -R 2000:root /home/test/.ssh && \
|
|
19
|
+
chmod 700 /home/test/.ssh && \
|
|
20
|
+
chmod 600 /home/test/.ssh/authorized_keys
|
|
21
|
+
|
|
22
|
+
# Ensure SSH is configured to accept key-based login
|
|
23
|
+
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config && \
|
|
24
|
+
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin no/' /etc/ssh/sshd_config && \
|
|
25
|
+
sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config && \
|
|
26
|
+
echo AllowUsers test >> /etc/ssh/sshd_config
|
|
27
|
+
|
|
28
|
+
# Start SSH service
|
|
29
|
+
RUN service ssh start
|
|
30
|
+
|
|
31
|
+
# Expose the SSH port
|
|
32
|
+
EXPOSE 22
|
|
33
|
+
|
|
34
|
+
# Run the SSH server
|
|
35
|
+
CMD ["/usr/sbin/sshd", "-D"]
|
|
36
|
+
#VOLUME [ "/sys/fs/cgroup" ]
|
|
37
|
+
#CMD ["/lib/systemd/systemd"]
|
|
38
|
+
#VOLUME [ "/sys/fs/cgroup" ]
|
|
39
|
+
#CMD ["/lib/systemd/systemd"]
|
fujin_cli-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: fujin-cli
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Project-URL: Documentation, https://github.com/falcopackages/fujin#readme
|
|
6
|
+
Project-URL: Issues, https://github.com/falcopackages/fujin/issues
|
|
7
|
+
Project-URL: Source, https://github.com/falcopackages/fujin
|
|
8
|
+
Author-email: Tobi DEGNON <tobidegnon@proton.me>
|
|
9
|
+
License-File: LICENSE.txt
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
19
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Requires-Dist: cappa>=0.24.0
|
|
22
|
+
Requires-Dist: fabric>=3.2.2
|
|
23
|
+
Requires-Dist: msgspec[toml]>=0.18.6
|
|
24
|
+
Requires-Dist: rich>=13.9.2
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# fujin
|
|
28
|
+
|
|
29
|
+
[](https://pypi.org/project/fujin-cli)
|
|
30
|
+
[](https://pypi.org/project/fujin-cli)
|
|
31
|
+
|
|
32
|
+
-----
|
|
33
|
+
|
|
34
|
+
> [!IMPORTANT]
|
|
35
|
+
> This package currently contains no features and is a work-in-progress
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
**Table of Contents**
|
|
39
|
+
|
|
40
|
+
- [fujin](#fujin)
|
|
41
|
+
- [Installation](#installation)
|
|
42
|
+
- [License](#license)
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```console
|
|
47
|
+
pip install fujin-cli
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
`fujin` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# fujin
|
|
2
2
|
|
|
3
|
-
[](https://pypi.org/project/fujin)
|
|
4
|
-
[](https://pypi.org/project/fujin)
|
|
3
|
+
[](https://pypi.org/project/fujin-cli)
|
|
4
|
+
[](https://pypi.org/project/fujin-cli)
|
|
5
5
|
|
|
6
6
|
-----
|
|
7
7
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
20
|
```console
|
|
21
|
-
pip install fujin
|
|
21
|
+
pip install fujin-cli
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## License
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""Django's command-line utility for administrative tasks."""
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def main():
|
|
8
|
+
"""Run administrative tasks."""
|
|
9
|
+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookstore.settings")
|
|
10
|
+
try:
|
|
11
|
+
from django.core.management import execute_from_command_line
|
|
12
|
+
except ImportError as exc:
|
|
13
|
+
raise ImportError(
|
|
14
|
+
"Couldn't import Django. Are you sure it's installed and "
|
|
15
|
+
"available on your PYTHONPATH environment variable? Did you "
|
|
16
|
+
"forget to activate a virtual environment?"
|
|
17
|
+
) from exc
|
|
18
|
+
execute_from_command_line(sys.argv)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if __name__ == "__main__":
|
|
22
|
+
main()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ASGI config for bookstore project.
|
|
3
|
+
|
|
4
|
+
It exposes the ASGI callable as a module-level variable named ``application``.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
from django.core.asgi import get_asgi_application
|
|
13
|
+
|
|
14
|
+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookstore.settings")
|
|
15
|
+
|
|
16
|
+
application = get_asgi_application()
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Django settings for bookstore project.
|
|
3
|
+
|
|
4
|
+
Generated by 'django-admin startproject' using Django 4.2.7.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/4.2/topics/settings/
|
|
8
|
+
|
|
9
|
+
For the full list of settings and their values, see
|
|
10
|
+
https://docs.djangoproject.com/en/4.2/ref/settings/
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
|
16
|
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Quick-start development settings - unsuitable for production
|
|
20
|
+
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
|
|
21
|
+
|
|
22
|
+
# SECURITY WARNING: keep the secret key used in production secret!
|
|
23
|
+
SECRET_KEY = "django-insecure-ln^v=)@o0%ix09*f47+d7n)0&3@ut1gc8e9)p@rd@ex#e#qg^j"
|
|
24
|
+
|
|
25
|
+
# SECURITY WARNING: don't run with debug turned on in production!
|
|
26
|
+
DEBUG = True
|
|
27
|
+
|
|
28
|
+
ALLOWED_HOSTS = []
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Application definition
|
|
32
|
+
|
|
33
|
+
INSTALLED_APPS = [
|
|
34
|
+
"django.contrib.admin",
|
|
35
|
+
"django.contrib.auth",
|
|
36
|
+
"django.contrib.contenttypes",
|
|
37
|
+
"django.contrib.sessions",
|
|
38
|
+
"django.contrib.messages",
|
|
39
|
+
"django.contrib.staticfiles",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
MIDDLEWARE = [
|
|
43
|
+
"django.middleware.security.SecurityMiddleware",
|
|
44
|
+
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
45
|
+
"django.middleware.common.CommonMiddleware",
|
|
46
|
+
"django.middleware.csrf.CsrfViewMiddleware",
|
|
47
|
+
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
48
|
+
"django.contrib.messages.middleware.MessageMiddleware",
|
|
49
|
+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
ROOT_URLCONF = "bookstore.urls"
|
|
53
|
+
|
|
54
|
+
TEMPLATES = [
|
|
55
|
+
{
|
|
56
|
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
57
|
+
"DIRS": [],
|
|
58
|
+
"APP_DIRS": True,
|
|
59
|
+
"OPTIONS": {
|
|
60
|
+
"context_processors": [
|
|
61
|
+
"django.template.context_processors.debug",
|
|
62
|
+
"django.template.context_processors.request",
|
|
63
|
+
"django.contrib.auth.context_processors.auth",
|
|
64
|
+
"django.contrib.messages.context_processors.messages",
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
WSGI_APPLICATION = "bookstore.wsgi.application"
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# Database
|
|
74
|
+
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
|
|
75
|
+
|
|
76
|
+
DATABASES = {
|
|
77
|
+
"default": {
|
|
78
|
+
"ENGINE": "django.db.backends.sqlite3",
|
|
79
|
+
"NAME": BASE_DIR / "db.sqlite3",
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# Password validation
|
|
85
|
+
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
|
|
86
|
+
|
|
87
|
+
AUTH_PASSWORD_VALIDATORS = [
|
|
88
|
+
{
|
|
89
|
+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
|
99
|
+
},
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# Internationalization
|
|
104
|
+
# https://docs.djangoproject.com/en/4.2/topics/i18n/
|
|
105
|
+
|
|
106
|
+
LANGUAGE_CODE = "en-us"
|
|
107
|
+
|
|
108
|
+
TIME_ZONE = "UTC"
|
|
109
|
+
|
|
110
|
+
USE_I18N = True
|
|
111
|
+
|
|
112
|
+
USE_TZ = True
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# Static files (CSS, JavaScript, Images)
|
|
116
|
+
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
|
117
|
+
|
|
118
|
+
STATIC_URL = "static/"
|
|
119
|
+
|
|
120
|
+
# Default primary key field type
|
|
121
|
+
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
|
122
|
+
|
|
123
|
+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""
|
|
2
|
+
URL configuration for bookstore project.
|
|
3
|
+
|
|
4
|
+
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
5
|
+
https://docs.djangoproject.com/en/4.2/topics/http/urls/
|
|
6
|
+
Examples:
|
|
7
|
+
Function views
|
|
8
|
+
1. Add an import: from my_app import views
|
|
9
|
+
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
|
10
|
+
Class-based views
|
|
11
|
+
1. Add an import: from other_app.views import Home
|
|
12
|
+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
|
13
|
+
Including another URLconf
|
|
14
|
+
1. Import the include() function: from django.urls import include, path
|
|
15
|
+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from django.contrib import admin
|
|
19
|
+
from django.urls import path
|
|
20
|
+
|
|
21
|
+
urlpatterns = [
|
|
22
|
+
path("admin/", admin.site.urls),
|
|
23
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
WSGI config for bookstore project.
|
|
3
|
+
|
|
4
|
+
It exposes the WSGI callable as a module-level variable named ``application``.
|
|
5
|
+
|
|
6
|
+
For more information on this file, see
|
|
7
|
+
https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
from django.core.wsgi import get_wsgi_application
|
|
13
|
+
|
|
14
|
+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookstore.settings")
|
|
15
|
+
|
|
16
|
+
application = get_wsgi_application()
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
app = "bookstore"
|
|
2
|
+
#version = "0.1.0" infer from the pyproject.toml file
|
|
3
|
+
requirements = "requirements.txt"
|
|
4
|
+
build_command = "uv build"
|
|
5
|
+
distfile = "./../../../dist/bookstore-{version}-py3-none-any.whl"
|
|
6
|
+
webserver = { upstream = "localhost:8000" } # or "unix:/run/bookstore.sock"
|
|
7
|
+
|
|
8
|
+
[hooks]
|
|
9
|
+
pre_deploy = ".venv/bin/bookstore migrate"
|
|
10
|
+
|
|
11
|
+
[aliases]
|
|
12
|
+
console = "app exec -i shell"
|
|
13
|
+
dbshell = "app exec -i dbshell"
|
|
14
|
+
shell = "server exec -i bash"
|
|
15
|
+
|
|
16
|
+
[processes]
|
|
17
|
+
web = ".venv/bin/bookstore prodserver"
|
|
18
|
+
worker = ".venv/bin/bookstore qcluster"
|
|
19
|
+
|
|
20
|
+
[hosts.primary]
|
|
21
|
+
default = true
|
|
22
|
+
ip = "127.0.0.1"
|
|
23
|
+
domain_name = "mybookstore.com"
|
|
24
|
+
envfile = ".env.prod"
|
|
25
|
+
user = "test"
|
|
26
|
+
password_env = "TEST_PASSWORD"
|
|
27
|
+
key_filename = "./../../../id_rsa"
|
|
28
|
+
ssh_port = 2222
|
|
29
|
+
# projects_dir = ".local/share/fujin" # relative to user home
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "bookstore"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Add your description here"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"django>=5.1.2",
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
[project.scripts]
|
|
12
|
+
bookstore = "bookstore.__main__:main"
|
|
13
|
+
|
|
14
|
+
[build-system]
|
|
15
|
+
requires = ["hatchling"]
|
|
16
|
+
build-backend = "hatchling.build"
|
fujin_cli-0.2.0/justfile
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
set dotenv-load := true
|
|
2
|
+
|
|
3
|
+
# List all available commands
|
|
4
|
+
_default:
|
|
5
|
+
@just --list --unsorted
|
|
6
|
+
|
|
7
|
+
# Run a command in the environment
|
|
8
|
+
run *ARGS:
|
|
9
|
+
uv run {{ ARGS }}
|
|
10
|
+
|
|
11
|
+
# Create test ubuntu container
|
|
12
|
+
create-test-container:
|
|
13
|
+
rm id_rsa && rm id_rsa.pub > /dev/null 2>&1 || true
|
|
14
|
+
ssh-keygen -t rsa -N "" -f id_rsa
|
|
15
|
+
docker stop sshserver && docker rm sshserver > /dev/null 2>&1 || true
|
|
16
|
+
docker build -t sshserver .
|
|
17
|
+
docker run -d -p 2222:22 -p 8000:80 --name sshserver sshserver
|
|
18
|
+
# docker run --privileged \
|
|
19
|
+
# -v /run/systemd/system:/run/systemd/system \
|
|
20
|
+
# -v /lib/systemd:/lib/systemd \
|
|
21
|
+
# -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket \
|
|
22
|
+
# -p 2222:22 \
|
|
23
|
+
# -p 8000:80 \
|
|
24
|
+
# --name sshserver \
|
|
25
|
+
# -it sshserver \
|
|
26
|
+
# bash -c "ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5 && bash"
|
|
27
|
+
|
|
28
|
+
# SSH into test container
|
|
29
|
+
ssh:
|
|
30
|
+
ssh -i id_rsa test@localhost -p 2222
|
|
31
|
+
|
|
32
|
+
# Run uv command in the django example project
|
|
33
|
+
djuv *ARGS:
|
|
34
|
+
#!/usr/bin/env bash
|
|
35
|
+
cd examples/django/bookstore
|
|
36
|
+
uv --project bookstore {{ ARGS }}
|
|
37
|
+
|
|
38
|
+
# Generate django project requirements:
|
|
39
|
+
dj-requirements:
|
|
40
|
+
just djuv pip compile pyproject.toml -o requirements.txt
|
|
41
|
+
|
|
42
|
+
# Run fujin command in the django example project
|
|
43
|
+
fujin *ARGS:
|
|
44
|
+
#!/usr/bin/env bash
|
|
45
|
+
cd examples/django/bookstore
|
|
46
|
+
../../../.venv/bin/python -m fujin {{ ARGS }}
|
|
47
|
+
|
|
48
|
+
# -------------------------------------------------------------------------
|
|
49
|
+
# RELEASE UTILITIES
|
|
50
|
+
#---------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
# Generate changelog, useful to update the unreleased section
|
|
53
|
+
logchange:
|
|
54
|
+
just run git-cliff --output CHANGELOG.md
|
|
55
|
+
|
|
56
|
+
# Bump project version and update changelog
|
|
57
|
+
bumpver VERSION:
|
|
58
|
+
#!/usr/bin/env bash
|
|
59
|
+
set -euo pipefail
|
|
60
|
+
just run bump-my-version bump {{ VERSION }}
|
|
61
|
+
just run git-cliff --output CHANGELOG.md
|
|
62
|
+
|
|
63
|
+
if [ -z "$(git status --porcelain)" ]; then
|
|
64
|
+
echo "No changes to commit."
|
|
65
|
+
git push && git push --tags
|
|
66
|
+
exit 0
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
version="$(hatch version)"
|
|
70
|
+
git add CHANGELOG.md
|
|
71
|
+
git commit -m "Generate changelog for version ${version}"
|
|
72
|
+
git tag -f "v${version}"
|
|
73
|
+
git push && git push --tags
|