my-cloud-devops-consulting 1.1.202504111659__tar.gz → 1.1.202504122220__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 (33) hide show
  1. my-cloud-devops-consulting-1.1.202504122220/PKG-INFO +55 -0
  2. my-cloud-devops-consulting-1.1.202504122220/README.md +37 -0
  3. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/app.py +5 -2
  4. my-cloud-devops-consulting-1.1.202504122220/my_cloud_devops_consulting.egg-info/PKG-INFO +55 -0
  5. my-cloud-devops-consulting-1.1.202504111659/PKG-INFO +0 -43
  6. my-cloud-devops-consulting-1.1.202504111659/README.md +0 -25
  7. my-cloud-devops-consulting-1.1.202504111659/my_cloud_devops_consulting.egg-info/PKG-INFO +0 -43
  8. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/MANIFEST.in +0 -0
  9. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/my_cloud_devops_consulting.egg-info/SOURCES.txt +0 -0
  10. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/my_cloud_devops_consulting.egg-info/dependency_links.txt +0 -0
  11. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/my_cloud_devops_consulting.egg-info/requires.txt +0 -0
  12. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/my_cloud_devops_consulting.egg-info/top_level.txt +0 -0
  13. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/setup.cfg +0 -0
  14. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/setup.py +0 -0
  15. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/css/contact-form.css +0 -0
  16. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/css/index.css +0 -0
  17. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/css/login.css +0 -0
  18. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/css/main.css +0 -0
  19. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/css/register.css +0 -0
  20. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/css/services.css +0 -0
  21. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/images/image.jpg +0 -0
  22. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/js/index.js +0 -0
  23. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/js/login.js +0 -0
  24. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/js/main.js +0 -0
  25. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/js/register.js +0 -0
  26. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/static/js/services.js +0 -0
  27. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/templates/base.html +0 -0
  28. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/templates/contact-form.html +0 -0
  29. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/templates/index.html +0 -0
  30. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/templates/login.html +0 -0
  31. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/templates/private-videos.html +0 -0
  32. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/templates/register.html +0 -0
  33. {my-cloud-devops-consulting-1.1.202504111659 → my-cloud-devops-consulting-1.1.202504122220}/templates/services.html +0 -0
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.1
2
+ Name: my-cloud-devops-consulting
3
+ Version: 1.1.202504122220
4
+ Summary: This is my consulting website for Cloud & DevOps services.
5
+ Home-page: https://github.com/Betrand1999/project-root
6
+ Author: Betrand Mutagha
7
+ Author-email: mmutagha@gmail.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.6
15
+ Description-Content-Type: text/markdown
16
+
17
+ ## 📦 Import‑to‑Usage Cheat‑Sheet
18
+
19
+ Think of the import block as a toolbox: once a name is imported, you can grab it anywhere below that point in the file.
20
+ This table shows exactly which “tool” is used where in **`app.py`**.
21
+
22
+ | Import | Purpose | Where it’s used in `app.py` |
23
+ |--------|---------|-----------------------------|
24
+ | **Flask** | Create the web‑app object | `app = Flask(__name__)` |
25
+ | **render_template** | Render Jinja2 templates | `home`, `login`, `register`, `services`, `contact_form`, `private_videos` |
26
+ | **request** | Access form data & headers | `login()`, `register()`, `contact_form()` |
27
+ | **redirect** / **url_for** | Navigate between routes | After login/logout/register; after contact‑form submit |
28
+ | **session** | Signed cookie for per‑user data | `home()` (`if 'username' in session:`) |
29
+ | **flash** | One‑shot success/error messages | `register()`, `contact_form()`, `logout()` |
30
+ | **jsonify** | Return JSON API responses | `login()` (`return jsonify({...})`) |
31
+ | **MongoClient** | Connect to MongoDB Atlas | `client = MongoClient(decoded_mongo_url)` → all DB calls |
32
+ | **generate_password_hash** / **check_password_hash** | Secure password hashing & verification | Hash in `register()`, verify in `login()` |
33
+ | **quote_plus** | URL‑encode credentials in the Mongo URI | Building `decoded_mongo_url` |
34
+ | **ObjectId** | Convert string → MongoDB primary key | `User.get()` (`ObjectId(user_id)`) |
35
+ | **os** | Env‑vars & file‑paths (future‑proof) | e.g. `os.getenv()`—not shown yet but reserved |
36
+ | **LoginManager** | Central auth manager | `login_manager = LoginManager()` & `login_manager.init_app(app)` |
37
+ | **login_user** | Log a user in | Inside `login()` |
38
+ | **login_required** | Protect private routes | Decorator on `/logout` (and optionally `/videos`) |
39
+ | **logout_user** | Log a user out | `logout()` |
40
+ | **current_user** | Proxy to the logged‑in user | Checks in `login()`, `/videos`, `/logout` |
41
+ | **UserMixin** | Adds default methods to `User` class | Inherits inside your `User` model |
42
+ | **SECRET_KEY** | Signs sessions & CSRF tokens | `app.secret_key = SECRET_KEY` |
43
+ | **MONGO_USERNAME / MONGO_PASSWORD** | Credentials for MongoDB | Interpolated into `decoded_mongo_url` |
44
+
45
+ | **MONGO_URI** | (Optional) pre‑built connection string | *Not used* in this file, but kept for flexibility |
46
+
47
+ | **EMAIL_USER** | “From” address for outgoing mail | Passed to `send_email()` in `contact_form()` |
48
+
49
+ | **send_email** | Helper that sends email via SMTP/API | Two calls in `contact_form()` |
50
+
51
+ | **get_videos** | Fetches private‑video metadata | Used in `private_videos()` |
52
+
53
+ > **Tip:** Linters like *flake8* will warn you if an import never gets referenced (`F401 unused import`). That’s an easy way to keep the toolbox clean.
54
+
55
+
@@ -0,0 +1,37 @@
1
+ ## 📦 Import‑to‑Usage Cheat‑Sheet
2
+
3
+ Think of the import block as a toolbox: once a name is imported, you can grab it anywhere below that point in the file.
4
+ This table shows exactly which “tool” is used where in **`app.py`**.
5
+
6
+ | Import | Purpose | Where it’s used in `app.py` |
7
+ |--------|---------|-----------------------------|
8
+ | **Flask** | Create the web‑app object | `app = Flask(__name__)` |
9
+ | **render_template** | Render Jinja2 templates | `home`, `login`, `register`, `services`, `contact_form`, `private_videos` |
10
+ | **request** | Access form data & headers | `login()`, `register()`, `contact_form()` |
11
+ | **redirect** / **url_for** | Navigate between routes | After login/logout/register; after contact‑form submit |
12
+ | **session** | Signed cookie for per‑user data | `home()` (`if 'username' in session:`) |
13
+ | **flash** | One‑shot success/error messages | `register()`, `contact_form()`, `logout()` |
14
+ | **jsonify** | Return JSON API responses | `login()` (`return jsonify({...})`) |
15
+ | **MongoClient** | Connect to MongoDB Atlas | `client = MongoClient(decoded_mongo_url)` → all DB calls |
16
+ | **generate_password_hash** / **check_password_hash** | Secure password hashing & verification | Hash in `register()`, verify in `login()` |
17
+ | **quote_plus** | URL‑encode credentials in the Mongo URI | Building `decoded_mongo_url` |
18
+ | **ObjectId** | Convert string → MongoDB primary key | `User.get()` (`ObjectId(user_id)`) |
19
+ | **os** | Env‑vars & file‑paths (future‑proof) | e.g. `os.getenv()`—not shown yet but reserved |
20
+ | **LoginManager** | Central auth manager | `login_manager = LoginManager()` & `login_manager.init_app(app)` |
21
+ | **login_user** | Log a user in | Inside `login()` |
22
+ | **login_required** | Protect private routes | Decorator on `/logout` (and optionally `/videos`) |
23
+ | **logout_user** | Log a user out | `logout()` |
24
+ | **current_user** | Proxy to the logged‑in user | Checks in `login()`, `/videos`, `/logout` |
25
+ | **UserMixin** | Adds default methods to `User` class | Inherits inside your `User` model |
26
+ | **SECRET_KEY** | Signs sessions & CSRF tokens | `app.secret_key = SECRET_KEY` |
27
+ | **MONGO_USERNAME / MONGO_PASSWORD** | Credentials for MongoDB | Interpolated into `decoded_mongo_url` |
28
+
29
+ | **MONGO_URI** | (Optional) pre‑built connection string | *Not used* in this file, but kept for flexibility |
30
+
31
+ | **EMAIL_USER** | “From” address for outgoing mail | Passed to `send_email()` in `contact_form()` |
32
+
33
+ | **send_email** | Helper that sends email via SMTP/API | Two calls in `contact_form()` |
34
+
35
+ | **get_videos** | Fetches private‑video metadata | Used in `private_videos()` |
36
+
37
+ > **Tip:** Linters like *flake8* will warn you if an import never gets referenced (`F401 unused import`). That’s an easy way to keep the toolbox clean.
@@ -3,13 +3,16 @@ from pymongo import MongoClient
3
3
  from werkzeug.security import generate_password_hash, check_password_hash
4
4
  from urllib.parse import quote_plus
5
5
  from bson.objectid import ObjectId
6
-
7
6
  import os
8
7
  from flask_login import LoginManager,login_user,UserMixin,login_required,logout_user,current_user
9
8
  from settings import SECRET_KEY,MONGO_URI, EMAIL_USER, MONGO_PASSWORD, MONGO_USERNAME
10
9
  from utils import send_email, get_videos
10
+
11
+
12
+
11
13
  app = Flask(__name__)
12
- app.secret_key = SECRET_KEY # Secure your secret key with an environment variable
14
+ app.secret_key = SECRET_KEY # Secure your secret key with an environment variable
15
+ ### app.secret_key = SECRET_KEY isn’t an import at all—it’s just an assignment
13
16
  login_manager = LoginManager()
14
17
 
15
18
  login_manager.init_app(app)
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.1
2
+ Name: my-cloud-devops-consulting
3
+ Version: 1.1.202504122220
4
+ Summary: This is my consulting website for Cloud & DevOps services.
5
+ Home-page: https://github.com/Betrand1999/project-root
6
+ Author: Betrand Mutagha
7
+ Author-email: mmutagha@gmail.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.6
15
+ Description-Content-Type: text/markdown
16
+
17
+ ## 📦 Import‑to‑Usage Cheat‑Sheet
18
+
19
+ Think of the import block as a toolbox: once a name is imported, you can grab it anywhere below that point in the file.
20
+ This table shows exactly which “tool” is used where in **`app.py`**.
21
+
22
+ | Import | Purpose | Where it’s used in `app.py` |
23
+ |--------|---------|-----------------------------|
24
+ | **Flask** | Create the web‑app object | `app = Flask(__name__)` |
25
+ | **render_template** | Render Jinja2 templates | `home`, `login`, `register`, `services`, `contact_form`, `private_videos` |
26
+ | **request** | Access form data & headers | `login()`, `register()`, `contact_form()` |
27
+ | **redirect** / **url_for** | Navigate between routes | After login/logout/register; after contact‑form submit |
28
+ | **session** | Signed cookie for per‑user data | `home()` (`if 'username' in session:`) |
29
+ | **flash** | One‑shot success/error messages | `register()`, `contact_form()`, `logout()` |
30
+ | **jsonify** | Return JSON API responses | `login()` (`return jsonify({...})`) |
31
+ | **MongoClient** | Connect to MongoDB Atlas | `client = MongoClient(decoded_mongo_url)` → all DB calls |
32
+ | **generate_password_hash** / **check_password_hash** | Secure password hashing & verification | Hash in `register()`, verify in `login()` |
33
+ | **quote_plus** | URL‑encode credentials in the Mongo URI | Building `decoded_mongo_url` |
34
+ | **ObjectId** | Convert string → MongoDB primary key | `User.get()` (`ObjectId(user_id)`) |
35
+ | **os** | Env‑vars & file‑paths (future‑proof) | e.g. `os.getenv()`—not shown yet but reserved |
36
+ | **LoginManager** | Central auth manager | `login_manager = LoginManager()` & `login_manager.init_app(app)` |
37
+ | **login_user** | Log a user in | Inside `login()` |
38
+ | **login_required** | Protect private routes | Decorator on `/logout` (and optionally `/videos`) |
39
+ | **logout_user** | Log a user out | `logout()` |
40
+ | **current_user** | Proxy to the logged‑in user | Checks in `login()`, `/videos`, `/logout` |
41
+ | **UserMixin** | Adds default methods to `User` class | Inherits inside your `User` model |
42
+ | **SECRET_KEY** | Signs sessions & CSRF tokens | `app.secret_key = SECRET_KEY` |
43
+ | **MONGO_USERNAME / MONGO_PASSWORD** | Credentials for MongoDB | Interpolated into `decoded_mongo_url` |
44
+
45
+ | **MONGO_URI** | (Optional) pre‑built connection string | *Not used* in this file, but kept for flexibility |
46
+
47
+ | **EMAIL_USER** | “From” address for outgoing mail | Passed to `send_email()` in `contact_form()` |
48
+
49
+ | **send_email** | Helper that sends email via SMTP/API | Two calls in `contact_form()` |
50
+
51
+ | **get_videos** | Fetches private‑video metadata | Used in `private_videos()` |
52
+
53
+ > **Tip:** Linters like *flake8* will warn you if an import never gets referenced (`F401 unused import`). That’s an easy way to keep the toolbox clean.
54
+
55
+
@@ -1,43 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: my-cloud-devops-consulting
3
- Version: 1.1.202504111659
4
- Summary: This is my consulting website for Cloud & DevOps services.
5
- Home-page: https://github.com/Betrand1999/project-root
6
- Author: Betrand Mutagha
7
- Author-email: mmutagha@gmail.com
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Operating System :: OS Independent
14
- Requires-Python: >=3.6
15
- Description-Content-Type: text/markdown
16
-
17
- sudo systemctl restart sshd
18
- 3.235.142.37:8443 # rancher
19
-
20
- sudo docker run --privileged -d \
21
- --restart=always \
22
- -p 8081:80 -p 8443:443 \
23
- rancher/rancher
24
-
25
- # docker volume prune -f
26
- # untainn the node
27
- kubectl taint nodes local-node node.kubernetes.io/disk-pressure:NoSchedule-
28
-
29
-
30
-
31
- /etc/apache2/sites-available/000-default.conf
32
- sudo systemctl restart apache2
33
- update docker file for container port
34
- update your python app port
35
-
36
-
37
- #
38
- docker rmi -f $(docker images betrand1997/my-static-websites -q)
39
-
40
- ./svc.sh start
41
-
42
-
43
-
@@ -1,25 +0,0 @@
1
- sudo systemctl restart sshd
2
- 3.235.142.37:8443 # rancher
3
-
4
- sudo docker run --privileged -d \
5
- --restart=always \
6
- -p 8081:80 -p 8443:443 \
7
- rancher/rancher
8
-
9
- # docker volume prune -f
10
- # untainn the node
11
- kubectl taint nodes local-node node.kubernetes.io/disk-pressure:NoSchedule-
12
-
13
-
14
-
15
- /etc/apache2/sites-available/000-default.conf
16
- sudo systemctl restart apache2
17
- update docker file for container port
18
- update your python app port
19
-
20
-
21
- #
22
- docker rmi -f $(docker images betrand1997/my-static-websites -q)
23
-
24
- ./svc.sh start
25
-
@@ -1,43 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: my-cloud-devops-consulting
3
- Version: 1.1.202504111659
4
- Summary: This is my consulting website for Cloud & DevOps services.
5
- Home-page: https://github.com/Betrand1999/project-root
6
- Author: Betrand Mutagha
7
- Author-email: mmutagha@gmail.com
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Operating System :: OS Independent
14
- Requires-Python: >=3.6
15
- Description-Content-Type: text/markdown
16
-
17
- sudo systemctl restart sshd
18
- 3.235.142.37:8443 # rancher
19
-
20
- sudo docker run --privileged -d \
21
- --restart=always \
22
- -p 8081:80 -p 8443:443 \
23
- rancher/rancher
24
-
25
- # docker volume prune -f
26
- # untainn the node
27
- kubectl taint nodes local-node node.kubernetes.io/disk-pressure:NoSchedule-
28
-
29
-
30
-
31
- /etc/apache2/sites-available/000-default.conf
32
- sudo systemctl restart apache2
33
- update docker file for container port
34
- update your python app port
35
-
36
-
37
- #
38
- docker rmi -f $(docker images betrand1997/my-static-websites -q)
39
-
40
- ./svc.sh start
41
-
42
-
43
-