Compare commits
39
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ff4f98841 | ||
|
|
0a8c337b1e | ||
|
|
2dac0d1f53 | ||
|
|
73b627214d | ||
|
|
c79168453b | ||
|
|
299f72abca | ||
|
|
058125f0b1 | ||
|
|
130b0af8d8 | ||
|
|
6f7542ef27 | ||
|
|
919d1a3a28 | ||
|
|
3c4c32e72d | ||
|
|
3294e70b3f | ||
|
|
5908d8d282 | ||
|
|
32f8251a90 | ||
|
|
a3fec86eae | ||
|
|
672edccd70 | ||
|
|
f188e25453 | ||
|
|
d4a72ebf5d | ||
|
|
4492db4185 | ||
|
|
015edcd63d | ||
|
|
aaad6b2b7e | ||
|
|
3b6eccba80 | ||
|
|
44b730dbfc | ||
|
|
ea4ebb0de0 | ||
|
|
3b3e82f16a | ||
|
|
1430afe600 | ||
|
|
e3f01da175 | ||
|
|
7a5c7b6de9 | ||
|
|
c880172aa5 | ||
|
|
6b631fb3e3 | ||
|
|
712f3d50b5 | ||
|
|
f6875b498b | ||
|
|
2e728d4698 | ||
|
|
98a969fa04 | ||
|
|
154717aca7 | ||
|
|
cc0eb74090 | ||
|
|
e2f49a5b1f | ||
|
|
c8ceaab950 | ||
|
|
3fbf333d3d |
@@ -15,9 +15,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RUNNER_TOOL_CACHE: /toolcache
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
DEBUG: True
|
DEBUG: True
|
||||||
ALLOWED_HOSTS: "django.tryton.geeraert.eu"
|
ALLOWED_HOSTS: "django.geeraert.eu"
|
||||||
container:
|
container:
|
||||||
image: gitea.tryton.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:1.0.6
|
image: gitea.geeraert.eu/pi-ux-ce/custom-runner-debian-slim:1.0.6
|
||||||
volumes:
|
volumes:
|
||||||
- act-toolcache:/opt/hostedtoolcache # this is where Runner store their cache default
|
- act-toolcache:/opt/hostedtoolcache # this is where Runner store their cache default
|
||||||
runs-on: host-runner
|
runs-on: host-runner
|
||||||
@@ -59,7 +59,7 @@ jobs:
|
|||||||
- name: Login to gitea
|
- name: Login to gitea
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: gitea.tryton.geeraert.eu
|
registry: gitea.geeraert.eu
|
||||||
username: ${{ secrets.USERNAME_GITEA }}
|
username: ${{ secrets.USERNAME_GITEA }}
|
||||||
password: ${{ secrets.PASSWORD_GITEA }}
|
password: ${{ secrets.PASSWORD_GITEA }}
|
||||||
|
|
||||||
@@ -67,16 +67,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker build \
|
docker build \
|
||||||
-f infra/production/dockerfile \
|
-f infra/production/dockerfile \
|
||||||
--build-arg ALLOWED_HOSTS='django.tryton.geeraert.eu' \
|
--build-arg ALLOWED_HOSTS='django.geeraert.eu' \
|
||||||
--build-arg DEBUG='True' \
|
--build-arg DEBUG='True' \
|
||||||
-t gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest \
|
-t gitea.geeraert.eu/pi-ux-ce/django-python:latest \
|
||||||
-t gitea.tryton.geeraert.eu/pi-ux-ce/django-python:${{ env.next_version }} \
|
-t gitea.geeraert.eu/pi-ux-ce/django-python:${{ env.next_version }} \
|
||||||
.
|
.
|
||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
run: |
|
||||||
docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest
|
docker push gitea.geeraert.eu/pi-ux-ce/django-python:latest
|
||||||
docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-python:${{ env.next_version }}
|
docker push gitea.geeraert.eu/pi-ux-ce/django-python:${{ env.next_version }}
|
||||||
|
|
||||||
- name: Rollout Django to force pulling the new image
|
- name: Rollout Django to force pulling the new image
|
||||||
uses: actions-hub/kubectl@master
|
uses: actions-hub/kubectl@master
|
||||||
@@ -91,7 +91,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
curl -X PUT -H "Content-Type: application/json" \
|
curl -X PUT -H "Content-Type: application/json" \
|
||||||
--user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
--user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||||
https://gitea.tryton.geeraert.eu/api/v1/repos/pi-ux-ce/${{ github.event.repository.name }}/actions/variables/VERSION \
|
https://gitea.geeraert.eu/api/v1/repos/pi-ux-ce/${{ github.event.repository.name }}/actions/variables/VERSION \
|
||||||
-d "{\"Value\":\"$next_version\"}"
|
-d "{\"Value\":\"$next_version\"}"
|
||||||
|
|
||||||
- name: backup git for future use
|
- name: backup git for future use
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
- name: Login to gitea
|
- name: Login to gitea
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: gitea.tryton.geeraert.eu
|
registry: gitea.geeraert.eu
|
||||||
username: ${{ secrets.USERNAME_GITEA }}
|
username: ${{ secrets.USERNAME_GITEA }}
|
||||||
password: ${{ secrets.PASSWORD_GITEA }}
|
password: ${{ secrets.PASSWORD_GITEA }}
|
||||||
|
|
||||||
@@ -44,23 +44,23 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker build \
|
docker build \
|
||||||
-f infra/testing/dockerfile \
|
-f infra/testing/dockerfile \
|
||||||
--build-arg ALLOWED_HOSTS='django-testing.tryton.geeraert.eu' \
|
--build-arg ALLOWED_HOSTS='django-testing.geeraert.eu' \
|
||||||
--build-arg DEBUG='True' \
|
--build-arg DEBUG='True' \
|
||||||
--build-arg CACHE_BUST=${{ env.next_version }} \
|
--build-arg CACHE_BUST=${{ env.next_version }} \
|
||||||
-t gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:latest \
|
-t gitea.geeraert.eu/pi-ux-ce/django-testing:latest \
|
||||||
-t gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:${{ env.next_version }} \
|
-t gitea.geeraert.eu/pi-ux-ce/django-testing:${{ env.next_version }} \
|
||||||
.
|
.
|
||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
run: |
|
||||||
docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:latest
|
docker push gitea.geeraert.eu/pi-ux-ce/django-testing:latest
|
||||||
docker push gitea.tryton.geeraert.eu/pi-ux-ce/django-testing:${{ env.next_version }}
|
docker push gitea.geeraert.eu/pi-ux-ce/django-testing:${{ env.next_version }}
|
||||||
|
|
||||||
- name: update version in the variable
|
- name: update version in the variable
|
||||||
run: |
|
run: |
|
||||||
curl -X PUT -H "Content-Type: application/json" \
|
curl -X PUT -H "Content-Type: application/json" \
|
||||||
--user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
--user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||||
https://gitea.tryton.geeraert.eu/api/v1/repos/pi-ux-ce/${{ github.event.repository.name }}/actions/variables/VERSION_TESTING \
|
https://gitea.geeraert.eu/api/v1/repos/pi-ux-ce/${{ github.event.repository.name }}/actions/variables/VERSION_TESTING \
|
||||||
-d "{\"Value\":\"$next_version\"}"
|
-d "{\"Value\":\"$next_version\"}"
|
||||||
|
|
||||||
- name: Rollout Django to force pulling the new image
|
- name: Rollout Django to force pulling the new image
|
||||||
|
|||||||
@@ -72,14 +72,14 @@ export bitwarden_organization_id=""
|
|||||||
|
|
||||||
```
|
```
|
||||||
cd existing_repo
|
cd existing_repo
|
||||||
git remote add origin https://gitlab.tryton.geeraert.eu/pierre/django_kube.git
|
git remote add origin https://gitea.geeraert.eu/pi-ux-ce/Django_kube.git
|
||||||
git branch -M main
|
git branch -M main
|
||||||
git push -uf origin main
|
git push -uf origin main
|
||||||
```
|
```
|
||||||
|
|
||||||
## Integrate with your tools
|
## Integrate with your tools
|
||||||
|
|
||||||
- [ ] [Set up project integrations](https://gitlab.tryton.geeraert.eu/pierre/django_kube/-/settings/integrations)
|
- [ ] [Set up project integrations](https://gitlab.geeraert.eu/pierre/django_kube/-/settings/integrations)
|
||||||
|
|
||||||
## Collaborate with your team
|
## Collaborate with your team
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,25 @@ class betaserieUtils():
|
|||||||
show_id = response.json()['shows'][0]['id']
|
show_id = response.json()['shows'][0]['id']
|
||||||
|
|
||||||
return show_id
|
return show_id
|
||||||
|
|
||||||
|
def poster_serie(self,serie_name,verbose=False):
|
||||||
|
#
|
||||||
|
# Usage
|
||||||
|
# poster_url = beta.poster_serie("The simpsons")
|
||||||
|
# poster_url = beta.poster_serie("The simpsons",verbose=True)
|
||||||
|
#
|
||||||
|
url = "https://api.betaseries.com/shows/search?title="+serie_name
|
||||||
|
|
||||||
|
response = requests.request("GET", url, headers=self.headers, data=self.payload)
|
||||||
|
if verbose:
|
||||||
|
print("Url request: "+str(url))
|
||||||
|
print(response.text)
|
||||||
|
|
||||||
|
poster_url = response.json()['shows'][0]['images']['show']
|
||||||
|
|
||||||
|
return poster_url
|
||||||
|
|
||||||
|
|
||||||
def identify_episode(self,show_id,episode_number,verbose=False):
|
def identify_episode(self,show_id,episode_number,verbose=False):
|
||||||
#
|
#
|
||||||
# Usage
|
# Usage
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ class bitwardenUtils():
|
|||||||
client = BitwardenClient(
|
client = BitwardenClient(
|
||||||
client_settings_from_dict(
|
client_settings_from_dict(
|
||||||
{
|
{
|
||||||
"apiUrl": os.getenv("API_URL", "https://bitwarden.tryton.geeraert.eu/api"),
|
"apiUrl": os.getenv("API_URL", "https://bitwarden.geeraert.eu/api"),
|
||||||
"deviceType": DeviceType.SDK,
|
"deviceType": DeviceType.SDK,
|
||||||
"identityUrl": os.getenv("IDENTITY_URL", "https://bitwarden.tryton.geeraert.eu/identity"),
|
"identityUrl": os.getenv("IDENTITY_URL", "https://bitwarden.geeraert.eu/identity"),
|
||||||
"userAgent": "Python",
|
"userAgent": "Python",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
from django.contrib import admin,messages
|
from django.contrib import admin,messages
|
||||||
from django.utils.translation import ngettext
|
from django.utils.translation import ngettext
|
||||||
from .models import Deployment_Data,Schedule_Day_Data,Schedule_Week_Data,Namespace_Data
|
from .models import Deployment_Data,Schedule_Day_Data,Schedule_Week_Data,Namespace_Data,Ingress_Data
|
||||||
from .utils import import_namespace,import_deployment,generate_default_day_schedule,generate_default_week_schedule,Check_server_supposed_XXX,retrieve_and_apply
|
from .utils import import_namespace,import_deployment,generate_default_day_schedule,generate_default_week_schedule,Check_server_supposed_XXX,retrieve_and_apply
|
||||||
from apps.kubernetes_connection.utils import scale_up,scale_down
|
from apps.kubernetes_connection.utils import scale_up,scale_down
|
||||||
from admin_extra_buttons.api import ExtraButtonsMixin, button
|
from admin_extra_buttons.api import button
|
||||||
from import_export.admin import ImportExportModelAdmin
|
from core.admin import UniversalModelAdmin
|
||||||
|
|
||||||
|
|
||||||
DB = 'cloudmanager_db'
|
|
||||||
|
|
||||||
|
|
||||||
@admin.action(description="scale up")
|
@admin.action(description="scale up")
|
||||||
def scale_up_deploy(modeladmin, request, queryset):
|
def scale_up_deploy(modeladmin, request, queryset):
|
||||||
@@ -68,28 +66,12 @@ class ActiveAtHourFilter(admin.SimpleListFilter):
|
|||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
|
|
||||||
class MultiDBModelAdmin(admin.ModelAdmin):
|
|
||||||
"""Base class that pins all admin operations to DB."""
|
|
||||||
db = DB
|
|
||||||
|
|
||||||
def get_queryset(self, request):
|
|
||||||
return super().get_queryset(request).using(self.db)
|
|
||||||
|
|
||||||
def save_model(self, request, obj, form, change):
|
|
||||||
obj.save(using=self.db)
|
|
||||||
|
|
||||||
def delete_model(self, request, obj):
|
|
||||||
obj.delete(using=self.db)
|
|
||||||
|
|
||||||
def delete_queryset(self, request, queryset):
|
|
||||||
queryset.using(self.db).delete()
|
|
||||||
|
|
||||||
|
|
||||||
@admin.register(Deployment_Data)
|
@admin.register(Deployment_Data)
|
||||||
class DeploymentDataAdmin(ImportExportModelAdmin,ExtraButtonsMixin, MultiDBModelAdmin):
|
class DeploymentDataAdmin(UniversalModelAdmin):
|
||||||
list_display = ('name', 'namespace', 'schedule_week', 'schedule_day', 'replicas')
|
list_display = ('name', 'namespace', 'schedule_week', 'schedule_day', 'replicas')
|
||||||
list_filter = (ActiveAtHourFilter,)
|
list_filter = (ActiveAtHourFilter,)
|
||||||
actions = [Check_server_supposed_False,Check_server_supposed_true,scale_up_deploy,scale_down_deploy]
|
actions = [Check_server_supposed_False,Check_server_supposed_true,scale_up_deploy,scale_down_deploy]
|
||||||
|
ordering = ('name',)
|
||||||
@button()
|
@button()
|
||||||
def retrieve_and_apply(self, request):
|
def retrieve_and_apply(self, request):
|
||||||
# your business logic here
|
# your business logic here
|
||||||
@@ -103,7 +85,7 @@ class DeploymentDataAdmin(ImportExportModelAdmin,ExtraButtonsMixin, MultiDBModel
|
|||||||
self.message_user(request, 'Deployments imported')
|
self.message_user(request, 'Deployments imported')
|
||||||
|
|
||||||
@admin.register(Schedule_Day_Data)
|
@admin.register(Schedule_Day_Data)
|
||||||
class ScheduleDayAdmin(ImportExportModelAdmin,ExtraButtonsMixin,MultiDBModelAdmin):
|
class ScheduleDayAdmin(UniversalModelAdmin):
|
||||||
list_display = ['name_schedule'] + [f'state_at_{h}' for h in range(24)]
|
list_display = ['name_schedule'] + [f'state_at_{h}' for h in range(24)]
|
||||||
@button()
|
@button()
|
||||||
def generate_default_day_schedule_admin(self, request):
|
def generate_default_day_schedule_admin(self, request):
|
||||||
@@ -112,7 +94,7 @@ class ScheduleDayAdmin(ImportExportModelAdmin,ExtraButtonsMixin,MultiDBModelAdmi
|
|||||||
self.message_user(request, 'Created default schedules')
|
self.message_user(request, 'Created default schedules')
|
||||||
|
|
||||||
@admin.register(Schedule_Week_Data)
|
@admin.register(Schedule_Week_Data)
|
||||||
class ScheduleWeekAdmin(ImportExportModelAdmin,ExtraButtonsMixin,MultiDBModelAdmin):
|
class ScheduleWeekAdmin(UniversalModelAdmin):
|
||||||
list_display = (
|
list_display = (
|
||||||
'name_schedule',
|
'name_schedule',
|
||||||
'state_Monday', 'state_Tuesday', 'state_Wednesday',
|
'state_Monday', 'state_Tuesday', 'state_Wednesday',
|
||||||
@@ -126,7 +108,7 @@ class ScheduleWeekAdmin(ImportExportModelAdmin,ExtraButtonsMixin,MultiDBModelAdm
|
|||||||
|
|
||||||
|
|
||||||
@admin.register(Namespace_Data)
|
@admin.register(Namespace_Data)
|
||||||
class NamespaceAdmin(ImportExportModelAdmin,ExtraButtonsMixin, MultiDBModelAdmin):
|
class NamespaceAdmin(UniversalModelAdmin):
|
||||||
list_display = ('namespace',)
|
list_display = ('namespace',)
|
||||||
|
|
||||||
|
|
||||||
@@ -135,3 +117,7 @@ class NamespaceAdmin(ImportExportModelAdmin,ExtraButtonsMixin, MultiDBModelAdmin
|
|||||||
# your business logic here
|
# your business logic here
|
||||||
import_namespace()
|
import_namespace()
|
||||||
self.message_user(request, 'Namespaces imported')
|
self.message_user(request, 'Namespaces imported')
|
||||||
|
|
||||||
|
@admin.register(Ingress_Data)
|
||||||
|
class IngressAdmin(UniversalModelAdmin):
|
||||||
|
list_display = ('url','namespace')
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.29 on 2026-09-13 15:38
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0002_deployment_data_actual_replica'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='deployment_data',
|
||||||
|
name='do_not_touch_until',
|
||||||
|
field=models.DateField(blank=True, null=True, verbose_name='do_not_touch_until'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-14 13:59
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0003_deployment_data_do_not_touch_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='deployment_data',
|
||||||
|
name='do_not_touch_until',
|
||||||
|
field=models.DateTimeField(auto_now_add=True, null=True, verbose_name='do_not_touch_until'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-14 14:14
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0004_alter_deployment_data_do_not_touch_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='deployment_data',
|
||||||
|
name='do_not_touch_until',
|
||||||
|
field=models.DateTimeField(default=datetime.datetime(2026, 9, 14, 14, 14, 29, 566084, tzinfo=datetime.timezone.utc), verbose_name='do_not_touch_until'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-14 14:14
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0005_alter_deployment_data_do_not_touch_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='deployment_data',
|
||||||
|
name='do_not_touch_until',
|
||||||
|
field=models.DateTimeField(default=datetime.datetime(2026, 9, 14, 14, 14, 33, 642627, tzinfo=datetime.timezone.utc), verbose_name='do_not_touch_until'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-14 14:35
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0006_alter_deployment_data_do_not_touch_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='deployment_data',
|
||||||
|
name='do_not_touch_until',
|
||||||
|
field=models.DateTimeField(default=datetime.datetime(2026, 9, 14, 14, 35, 47, 473312, tzinfo=datetime.timezone.utc), verbose_name='do_not_touch_until'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-14 14:35
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0007_alter_deployment_data_do_not_touch_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='deployment_data',
|
||||||
|
name='do_not_touch_until',
|
||||||
|
field=models.DateTimeField(default=datetime.datetime(2026, 9, 14, 14, 35, 51, 657797, tzinfo=datetime.timezone.utc), verbose_name='do_not_touch_until'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-14 14:43
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0008_alter_deployment_data_do_not_touch_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='deployment_data',
|
||||||
|
name='do_not_touch_until',
|
||||||
|
field=models.DateTimeField(default=datetime.datetime(2026, 9, 14, 14, 43, 26, 985719, tzinfo=datetime.timezone.utc), verbose_name='do_not_touch_until'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-14 14:43
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0009_alter_deployment_data_do_not_touch_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='deployment_data',
|
||||||
|
name='do_not_touch_until',
|
||||||
|
field=models.DateTimeField(default=datetime.datetime(2026, 9, 14, 14, 43, 31, 55115, tzinfo=datetime.timezone.utc), verbose_name='do_not_touch_until'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-14 14:46
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0010_alter_deployment_data_do_not_touch_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='deployment_data',
|
||||||
|
name='do_not_touch_until',
|
||||||
|
field=models.DateTimeField(auto_now_add=True, null=True, verbose_name='do_not_touch_until'),
|
||||||
|
),
|
||||||
|
]
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-14 15:13
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.utils.timezone
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0011_alter_deployment_data_do_not_touch_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='deployment_data',
|
||||||
|
name='do_not_touch_until',
|
||||||
|
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='do_not_touch_until'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-21 16:14
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0012_alter_deployment_data_do_not_touch_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Ingress_Data',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('url', models.CharField(max_length=100)),
|
||||||
|
('namespace', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='cloudmanager.namespace_data')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-21 21:06
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('cloudmanager', '0013_ingress_data'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='ingress_data',
|
||||||
|
name='namespace',
|
||||||
|
field=models.CharField(blank=True, max_length=100, null=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.utils import timezone
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Schedule_Week_Data(models.Model):
|
class Schedule_Week_Data(models.Model):
|
||||||
name_schedule = models.CharField(max_length=100,unique=True)
|
name_schedule = models.CharField(max_length=100,unique=True)
|
||||||
@@ -55,6 +53,7 @@ class Deployment_Data(models.Model):
|
|||||||
schedule_day = models.ForeignKey(Schedule_Day_Data,null=True, blank=True, on_delete=models.SET_NULL)
|
schedule_day = models.ForeignKey(Schedule_Day_Data,null=True, blank=True, on_delete=models.SET_NULL)
|
||||||
replicas = models.IntegerField()
|
replicas = models.IntegerField()
|
||||||
actual_replica = models.IntegerField()
|
actual_replica = models.IntegerField()
|
||||||
|
do_not_touch_until = models.DateTimeField('do_not_touch_until', default=timezone.now)
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'machine'
|
db_table = 'machine'
|
||||||
|
|
||||||
@@ -63,3 +62,9 @@ class Namespace_Data(models.Model):
|
|||||||
#deployments = models.ForeignKey(Schedule_Week_Data,null=True, blank=True, on_delete=models.SET_NULL)
|
#deployments = models.ForeignKey(Schedule_Week_Data,null=True, blank=True, on_delete=models.SET_NULL)
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'namespace'
|
db_table = 'namespace'
|
||||||
|
def __str__(self):
|
||||||
|
return self.namespace
|
||||||
|
|
||||||
|
class Ingress_Data(models.Model):
|
||||||
|
url = models.CharField(max_length=100)
|
||||||
|
namespace = models.CharField(max_length=100,null=True, blank=True)
|
||||||
|
|||||||
@@ -16,15 +16,18 @@ Including another URLconf
|
|||||||
"""
|
"""
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
|
||||||
from .views import coucou,display,hello,import_namespace_view,retrieve_and_apply_view
|
from .views import hello,import_namespace_view,retrieve_and_apply_view,scale_up_gui,scale_down_gui,add_ingress,delete_ingress
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
################### cloudmanager ###################
|
################### cloudmanager ###################
|
||||||
path('', hello, name='hello'),
|
path('', hello, name='hello'),
|
||||||
path('coucou', coucou, name='coucou'),
|
|
||||||
path('display', display, name='display'),
|
|
||||||
path('import_namespace', import_namespace_view, name='import_namespace'),
|
path('import_namespace', import_namespace_view, name='import_namespace'),
|
||||||
path('retrieve_and_apply_view', retrieve_and_apply_view, name='retrieve_and_apply_view'),
|
path('retrieve_and_apply_view', retrieve_and_apply_view, name='retrieve_and_apply_view'),
|
||||||
|
path('scale_up/<str:namespace_name>/<str:deploy_name>', scale_up_gui),
|
||||||
|
path('scale_down/<str:namespace_name>/<str:deploy_name>', scale_down_gui),
|
||||||
|
path('add_ingress', add_ingress),
|
||||||
|
path('delete_ingress', delete_ingress),
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import datetime
|
from django.utils import timezone
|
||||||
|
import datetime
|
||||||
from apps.kubernetes_connection.utils import get_namespace,get_deployments,scale_up,scale_down
|
from apps.kubernetes_connection.utils import get_namespace,get_deployments,scale_up,scale_down
|
||||||
from apps.cloudmanager.models import Schedule_Day_Data,Schedule_Week_Data,Namespace_Data,Deployment_Data
|
from apps.cloudmanager.models import Schedule_Day_Data,Schedule_Week_Data,Namespace_Data,Deployment_Data
|
||||||
|
|
||||||
@@ -113,6 +113,8 @@ def retrieve_and_apply(verbose=False):
|
|||||||
#check if the expected replica (server[2]) match the current replica of the deployment (server[3].actual_replica)
|
#check if the expected replica (server[2]) match the current replica of the deployment (server[3].actual_replica)
|
||||||
if server[3].actual_replica == server[2]:
|
if server[3].actual_replica == server[2]:
|
||||||
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" already UP")
|
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" already UP")
|
||||||
|
elif server[3].do_not_touch_until > timezone.now():
|
||||||
|
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" is in freeze period")
|
||||||
else:
|
else:
|
||||||
echo = "Starting -> name: "+str(server[1])+" namespace: "+str(server[0])+" replicas: "+str(server[2])
|
echo = "Starting -> name: "+str(server[1])+" namespace: "+str(server[0])+" replicas: "+str(server[2])
|
||||||
output += str(echo)
|
output += str(echo)
|
||||||
@@ -129,6 +131,8 @@ def retrieve_and_apply(verbose=False):
|
|||||||
#check if the current replica of the deployment (server[3].actual_replica) is already 0 meaning the server is already down
|
#check if the current replica of the deployment (server[3].actual_replica) is already 0 meaning the server is already down
|
||||||
if server[3].actual_replica == 0:
|
if server[3].actual_replica == 0:
|
||||||
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" already DOWN")
|
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" already DOWN")
|
||||||
|
elif server[3].do_not_touch_until > timezone.now():
|
||||||
|
if verbose : print("name: "+str(server[1])+" namespace: "+str(server[0])+" is in freeze period")
|
||||||
else:
|
else:
|
||||||
|
|
||||||
echo = "Shutting down -> name: "+str(server[1])+" namespace: "+str(server[0])+" replicas: "+str(server[2])
|
echo = "Shutting down -> name: "+str(server[1])+" namespace: "+str(server[0])+" replicas: "+str(server[2])
|
||||||
@@ -136,5 +140,5 @@ def retrieve_and_apply(verbose=False):
|
|||||||
output += str("\n")
|
output += str("\n")
|
||||||
print(echo)
|
print(echo)
|
||||||
scale_down(namespace_name=server[1],deploy_name=server[0])
|
scale_down(namespace_name=server[1],deploy_name=server[0])
|
||||||
|
print("------------------------------------------")
|
||||||
return output
|
return output
|
||||||
@@ -1,30 +1,15 @@
|
|||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
from datetime import timedelta
|
||||||
|
from django.utils import timezone
|
||||||
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
|
from django.http import JsonResponse
|
||||||
|
|
||||||
|
from apps.import_aggregator.import_rest_framework import api_view, authentication_classes, permission_classes,TokenAuthentication,IsAuthenticated,Response,status
|
||||||
|
|
||||||
# IMPORT AT THE TOP HERE: This is completely safe!
|
|
||||||
from .models import Deployment_Data,Schedule_Week_Data
|
|
||||||
from .db_interaction import DB_generation,Check_server_supposed_XXX,Give_current_weekday,Give_current_hour
|
|
||||||
from .utils import import_namespace,retrieve_and_apply
|
from .utils import import_namespace,retrieve_and_apply
|
||||||
|
from apps.kubernetes_connection.utils import scale_up,scale_down
|
||||||
def coucou(request):
|
from .models import Deployment_Data,Ingress_Data
|
||||||
# 1. Prepare the data inside the function
|
|
||||||
data = CmmData(
|
|
||||||
name="test",
|
|
||||||
namespace="testspace",
|
|
||||||
schedule_hour="1",
|
|
||||||
schedule_day="deux",
|
|
||||||
replicas=3
|
|
||||||
)
|
|
||||||
|
|
||||||
# 2. This line actually pushes the data into your cloudmanager_db!
|
|
||||||
data.save()
|
|
||||||
|
|
||||||
return HttpResponse('<h1>Hello cmm! Data saved successfully!</h1>')
|
|
||||||
|
|
||||||
def display(request):
|
|
||||||
data = CmmData.objects.all()
|
|
||||||
print(data[0].namespace)
|
|
||||||
return HttpResponse(data)
|
|
||||||
|
|
||||||
def hello(request):
|
def hello(request):
|
||||||
list_schedule = ['schedule1','schedule2']
|
list_schedule = ['schedule1','schedule2']
|
||||||
@@ -40,18 +25,53 @@ def retrieve_and_apply_view(request):
|
|||||||
output = retrieve_and_apply()
|
output = retrieve_and_apply()
|
||||||
return HttpResponse('<h1>'+output+'</h1>')
|
return HttpResponse('<h1>'+output+'</h1>')
|
||||||
|
|
||||||
def redirect(request):
|
def scale_up_gui(request,namespace_name,deploy_name,replicas=1):
|
||||||
db_host = os.environ.get('DB_HOST')
|
Deployment_Data.objects.filter(namespace=namespace_name,name=deploy_name).update(do_not_touch_until=timezone.now() + timedelta(hours=1))
|
||||||
db_port = os.environ.get('DB_PORT')
|
scale_up(namespace_name=namespace_name,deploy_name=deploy_name,replicas=replicas)
|
||||||
db_user = os.environ.get('DB_USERNAME')
|
return render(request, 'dashboard/start.html', {'namespace':namespace_name,'deployment': deploy_name, 'url': 'https://namespace.com'})
|
||||||
db_password = os.environ.get('DB_PASSWORD')
|
|
||||||
db_name = os.environ.get('CUSTOM_DB_DATABASE',os.environ.get('DB_DATABASE'))
|
|
||||||
|
|
||||||
generated_db = DB_generation(db_host, db_port, db_user, db_password,db_name)
|
|
||||||
##operation:
|
|
||||||
## Server(s) supposed to be UP
|
|
||||||
|
|
||||||
list_servers_up = Check_server_supposed_XXX(generated_db, "up", Give_current_hour(),Give_current_weekday())
|
def scale_down_gui(request,namespace_name,deploy_name):
|
||||||
print(list_servers_up)
|
Deployment_Data.objects.filter(namespace=namespace_name,name=deploy_name).update(do_not_touch_until=timezone.now() + timedelta(hours=1))
|
||||||
return render(request, 'cloudmanager/cmm_blank_page.html', {'list_servers_up':list_servers_up})
|
scale_down(namespace_name=namespace_name,deploy_name=deploy_name)
|
||||||
|
return render(request, 'dashboard/shutdown.html',
|
||||||
|
{'namespace': namespace_name, 'deployment': deploy_name, 'url': 'https://namespace.com'})
|
||||||
|
|
||||||
|
|
||||||
|
@api_view(['POST'])
|
||||||
|
@authentication_classes([TokenAuthentication])
|
||||||
|
@permission_classes([IsAuthenticated])
|
||||||
|
def add_ingress(request):
|
||||||
|
url = request.POST.get('url')
|
||||||
|
namespace = request.POST.get('namespace')
|
||||||
|
print("URL: "+str(url))
|
||||||
|
print("NS: "+str(namespace))
|
||||||
|
|
||||||
|
try:
|
||||||
|
Ingress_Data.objects.update_or_create(url=url,namespace=namespace)
|
||||||
|
except Exception as exception:
|
||||||
|
return JsonResponse({"status": "error","reason":str(exception)})
|
||||||
|
|
||||||
|
return JsonResponse({"status": "added","url":str(url),"namespace":str(namespace)})
|
||||||
|
|
||||||
|
@api_view(['POST'])
|
||||||
|
@authentication_classes([TokenAuthentication])
|
||||||
|
@permission_classes([IsAuthenticated])
|
||||||
|
def delete_ingress(request):
|
||||||
|
url = request.POST.get('url')
|
||||||
|
namespace = request.POST.get('namespace')
|
||||||
|
print("URL: "+str(url))
|
||||||
|
print("NS: "+str(namespace))
|
||||||
|
|
||||||
|
try:
|
||||||
|
ingress_object = Ingress_Data.objects.filter(url=url,namespace=namespace)
|
||||||
|
except Exception as exception:
|
||||||
|
return JsonResponse({"status": "error","reason":str(exception)})
|
||||||
|
|
||||||
|
try:
|
||||||
|
ingress_object.delete()
|
||||||
|
except Exception as exception:
|
||||||
|
return JsonResponse({"status": "error","reason":str(exception)})
|
||||||
|
|
||||||
|
return JsonResponse({"status": "deleted","url":str(url),"namespace":str(namespace)})
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
# Register your models here.
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
from django.apps import AppConfig
|
|
||||||
from django.http import HttpResponse
|
|
||||||
from django.shortcuts import render
|
|
||||||
import requests
|
|
||||||
from proxmoxer import ProxmoxAPI
|
|
||||||
import docker
|
|
||||||
|
|
||||||
class BackofficeConfig(AppConfig):
|
|
||||||
default_auto_field = 'django.db.models.BigAutoField'
|
|
||||||
name = 'backoffice'
|
|
||||||
|
|
||||||
def hello(request):
|
|
||||||
return HttpResponse('<h1>Start bookstack!</h1>')
|
|
||||||
|
|
||||||
def http_call_test(request):
|
|
||||||
url = 'http://portainer.zeus.geeraert.eu/api/auth/'
|
|
||||||
myobj = {'Username': 'admin','Password':'Xtm78*CX3mJ54g'}
|
|
||||||
|
|
||||||
x = requests.post(url, json = myobj)
|
|
||||||
|
|
||||||
print(x.text)
|
|
||||||
return HttpResponse(x.text)
|
|
||||||
|
|
||||||
def proxmox(request):
|
|
||||||
proxmox = ProxmoxAPI("proxmox.zeus.geeraert.eu", user="root@pam", password="dinner_sl@v3", verify_ssl=False)
|
|
||||||
return HttpResponse(proxmox)
|
|
||||||
|
|
||||||
def docker_call(request,action,id_docker):
|
|
||||||
print(action)
|
|
||||||
print(id_docker)
|
|
||||||
client = docker.from_env()
|
|
||||||
if action == "start":
|
|
||||||
print("nous allons start")
|
|
||||||
client.containers.get(id_docker).start()
|
|
||||||
if action == "stop":
|
|
||||||
print("nous allons stop")
|
|
||||||
client.containers.get(id_docker).stop()
|
|
||||||
|
|
||||||
return HttpResponse(client.containers.get(id_docker).status)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.db import models
|
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.test import TestCase
|
|
||||||
|
|
||||||
# Create your tests here.
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
# Create your views here.
|
|
||||||
from django.http import HttpResponse
|
|
||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
def hello(request):
|
|
||||||
return HttpResponse('<h1>Hello Django!</h1>')
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
from rest_framework.decorators import api_view, authentication_classes, permission_classes
|
||||||
|
from rest_framework.authentication import TokenAuthentication
|
||||||
|
from rest_framework.permissions import IsAuthenticated
|
||||||
|
from rest_framework.response import Response
|
||||||
|
from rest_framework import status
|
||||||
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from import_export.admin import ImportExportModelAdmin
|
|
||||||
from import_export import resources
|
from import_export import resources
|
||||||
from import_export.fields import Field
|
from import_export.fields import Field
|
||||||
from .models import JobData
|
from .models import JobData
|
||||||
from django.utils.text import Truncator
|
from django.utils.text import Truncator
|
||||||
|
from core.admin import UniversalModelAdmin
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ class JobResource(resources.ModelResource):
|
|||||||
|
|
||||||
|
|
||||||
@admin.register(JobData)
|
@admin.register(JobData)
|
||||||
class JobAdmin(ImportExportModelAdmin):
|
class JobAdmin(UniversalModelAdmin):
|
||||||
list_display = ('job_position','company','URL','status','date_saved','date_applied','type','resume','location','short_description','salary','contact','source')
|
list_display = ('job_position','company','URL','status','date_saved','date_applied','type','resume','location','short_description','salary','contact','source')
|
||||||
#fields = ['job_position','company','URL','status','date_saved','date_applied','type','resume','cover_letter','location','job_description','salary ','contact','source']
|
#fields = ['job_position','company','URL','status','date_saved','date_applied','type','resume','cover_letter','location','job_description','salary ','contact','source']
|
||||||
resource_classes = [JobResource]
|
resource_classes = [JobResource]
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ def nodes(request):
|
|||||||
'spec': {
|
'spec': {
|
||||||
|
|
||||||
'containers': [{
|
'containers': [{
|
||||||
'image': 'gitea.tryton.geeraert.eu/pi-ux-ce/bitwarden_cli:1.0.1',
|
'image': 'gitea.geeraert.eu/pi-ux-ce/bitwarden_cli:1.0.1',
|
||||||
# 'pod-running-timeout': '5m0s',
|
# 'pod-running-timeout': '5m0s',
|
||||||
'name': 'testpython',
|
'name': 'testpython',
|
||||||
'env': [
|
'env': [
|
||||||
@@ -96,7 +96,7 @@ def backup_job(request):
|
|||||||
'spec': {
|
'spec': {
|
||||||
|
|
||||||
'containers': [{
|
'containers': [{
|
||||||
'image': 'gitea.tryton.geeraert.eu/pi-ux-ce/bitwarden_cli:1.0.1',
|
'image': 'gitea.geeraert.eu/pi-ux-ce/bitwarden_cli:1.0.1',
|
||||||
'name': 'testpython',
|
'name': 'testpython',
|
||||||
'command': ['/bin/sh -c /config/export_bitwarden.sh'],
|
'command': ['/bin/sh -c /config/export_bitwarden.sh'],
|
||||||
'env': [
|
'env': [
|
||||||
@@ -124,8 +124,8 @@ def backup_job_yaml(request,sync_target):
|
|||||||
v1 = client.BatchV1Api()
|
v1 = client.BatchV1Api()
|
||||||
|
|
||||||
yaml_location = {
|
yaml_location = {
|
||||||
"synology" : "https://gitea.tryton.geeraert.eu/pi-ux-ce/Backup_kube/raw/branch/main/Infrequent_access/synology_pod.yaml",
|
"synology" : "https://gitea.geeraert.eu/pi-ux-ce/Backup_kube/raw/branch/main/Infrequent_access/synology_pod.yaml",
|
||||||
"openmediavault":"https://gitea.tryton.geeraert.eu/pi-ux-ce/Backup_kube/raw/branch/main/Infrequent_access/openmediavault_pod.yaml"
|
"openmediavault":"https://gitea.geeraert.eu/pi-ux-ce/Backup_kube/raw/branch/main/Infrequent_access/openmediavault_pod.yaml"
|
||||||
}
|
}
|
||||||
print(yaml_location[sync_target])
|
print(yaml_location[sync_target])
|
||||||
url_to_select=yaml_location[sync_target]
|
url_to_select=yaml_location[sync_target]
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from import_export.admin import ImportExportModelAdmin
|
|
||||||
from import_export import resources
|
from import_export import resources
|
||||||
from django.utils.html import format_html
|
from django.utils.html import format_html
|
||||||
from .models import podcastData
|
from .models import podcastData
|
||||||
|
from core.admin import UniversalModelAdmin
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
@admin.register(podcastData)
|
@admin.register(podcastData)
|
||||||
class JobAdmin(ImportExportModelAdmin):
|
class PodcastAdmin(UniversalModelAdmin):
|
||||||
list_display = ('podcast_name','clickable_links','enabled')
|
list_display = ('podcast_name','clickable_links','enabled')
|
||||||
|
|
||||||
def clickable_links(self, obj):
|
link_field = 'podcast_url'
|
||||||
return format_html('<a href="{}">{}</a>', obj.podcast_url,obj.podcast_url)
|
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
from django.contrib import admin,messages
|
from django.contrib import admin,messages
|
||||||
from django.utils.translation import ngettext
|
from django.utils.translation import ngettext
|
||||||
from django.utils.html import format_html
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from djangoql.admin import DjangoQLSearchMixin
|
|
||||||
from prompt_toolkit.shortcuts import print_container
|
from prompt_toolkit.shortcuts import print_container
|
||||||
from import_export.admin import ImportExportModelAdmin
|
|
||||||
from import_export import resources
|
from import_export import resources
|
||||||
from .models import SimpsonsData,simpsons_data_object,urlData
|
from .models import SimpsonsData,urlData
|
||||||
from .utils import mark_episode_watched,unwatch_all_episodes,generate_new_urls_for_episode
|
from .utils import mark_episode_watched,unwatch_all_episodes,generate_new_urls_for_episode
|
||||||
|
from core.admin import UniversalModelAdmin
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
|
||||||
@@ -65,19 +63,15 @@ def generate_new_urls(modeladmin, request, queryset):
|
|||||||
|
|
||||||
|
|
||||||
@admin.register(SimpsonsData)
|
@admin.register(SimpsonsData)
|
||||||
class EpisodeAdmin(DjangoQLSearchMixin,ImportExportModelAdmin):
|
class EpisodeAdmin(UniversalModelAdmin):
|
||||||
list_display = [field.name for field in SimpsonsData._meta.fields if field.name != 'id']
|
list_display = [field.name for field in SimpsonsData._meta.fields if field.name != 'id']
|
||||||
|
list_display += ['clickable_links']
|
||||||
list_filter = ['seen','modified_at']
|
list_filter = ['seen','modified_at']
|
||||||
#list_filter = ['seen']
|
#list_filter = ['seen']
|
||||||
fields = ['season', 'episode', 'url', 'seen']
|
fields = ['season', 'episode', 'url', 'seen']
|
||||||
actions = [make_seen,make_unseen,unseen_betaserie,generate_new_urls]
|
actions = [make_seen,make_unseen,unseen_betaserie,generate_new_urls]
|
||||||
search_fields = ['season', 'episode', 'url', 'seen']
|
search_fields = ['season', 'episode', 'url', 'seen']
|
||||||
djangoql_completion_enabled_by_default = False
|
|
||||||
|
|
||||||
def clickable_links(self, obj):
|
|
||||||
return format_html('<a href="{}">{}</a>', obj.url,obj.url)
|
|
||||||
|
|
||||||
|
|
||||||
def get_queryset(self, request):
|
def get_queryset(self, request):
|
||||||
return super().get_queryset(request).using(DB)
|
return super().get_queryset(request).using(DB)
|
||||||
|
|
||||||
@@ -91,7 +85,7 @@ class EpisodeAdmin(DjangoQLSearchMixin,ImportExportModelAdmin):
|
|||||||
queryset.using(DB).delete()
|
queryset.using(DB).delete()
|
||||||
|
|
||||||
@admin.register(urlData)
|
@admin.register(urlData)
|
||||||
class urldataAdmin(ImportExportModelAdmin):
|
class urldataAdmin(UniversalModelAdmin):
|
||||||
list_display = ('url_example', 'prefix', 'infix', 'suffix','addedDate')
|
list_display = ('url_example', 'prefix', 'infix', 'suffix','addedDate')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-17 21:26
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('simpsons', '0008_alter_simpsonsdata_modified_at_alter_urldata_infix_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='simpsonsdata',
|
||||||
|
name='modified_at',
|
||||||
|
field=models.DateTimeField(default=datetime.datetime(1969, 12, 31, 23, 0, tzinfo=datetime.timezone.utc)),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -1,12 +1,26 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.utils.html import format_html
|
from django.utils.html import format_html
|
||||||
from import_export.admin import ImportExportModelAdmin
|
|
||||||
from .models import StreamingSiteTestingData,StreamingRedirectData
|
from .models import StreamingSiteTestingData,StreamingRedirectData
|
||||||
from .utils import full_testing
|
from .utils import full_testing
|
||||||
|
from apps.website_redirection.utils import redirect_method
|
||||||
from urllib.parse import urlsplit, urlunsplit
|
from urllib.parse import urlsplit, urlunsplit
|
||||||
|
from core.admin import UniversalModelAdmin
|
||||||
|
|
||||||
|
|
||||||
|
@admin.action(description="Add this show to streaming")
|
||||||
|
def re_redirect(modeladmin, request, queryset):
|
||||||
|
output_generated = ""
|
||||||
|
for query in queryset.values():
|
||||||
|
print(query)
|
||||||
|
key = "streaming"
|
||||||
|
value = query.get('url_display')
|
||||||
|
output_generated = output_generated + redirect_method(key,value)+";"
|
||||||
|
|
||||||
|
modeladmin.message_user(
|
||||||
|
request,
|
||||||
|
output_generated
|
||||||
|
)
|
||||||
|
|
||||||
@admin.action(description="check the URLs")
|
@admin.action(description="check the URLs")
|
||||||
def check(modeladmin, request, queryset):
|
def check(modeladmin, request, queryset):
|
||||||
for query in queryset:
|
for query in queryset:
|
||||||
@@ -34,14 +48,11 @@ def urlcleaning(modeladmin, request, queryset):
|
|||||||
|
|
||||||
return 0
|
return 0
|
||||||
@admin.register(StreamingSiteTestingData)
|
@admin.register(StreamingSiteTestingData)
|
||||||
class streamingAdmin(ImportExportModelAdmin):
|
class streamingAdmin(UniversalModelAdmin):
|
||||||
list_display = ['clickable_links','result_colored','newstatus']
|
list_display = ['clickable_links','result_colored','newstatus']
|
||||||
fields = ['url']
|
fields = ['url']
|
||||||
actions = [check,urlcleaning]
|
actions = [check,urlcleaning]
|
||||||
|
|
||||||
def clickable_links(self, obj):
|
|
||||||
return format_html('<a href="{}">{}</a>', obj.url,obj.url)
|
|
||||||
|
|
||||||
def result_colored(self, obj):
|
def result_colored(self, obj):
|
||||||
colors = {
|
colors = {
|
||||||
'REACHABLE': 'green',
|
'REACHABLE': 'green',
|
||||||
@@ -60,9 +71,12 @@ class streamingAdmin(ImportExportModelAdmin):
|
|||||||
#return obj.status
|
#return obj.status
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@admin.register(StreamingRedirectData)
|
@admin.register(StreamingRedirectData)
|
||||||
class StreamingRedirectAdmin(ImportExportModelAdmin):
|
class StreamingRedirectAdmin(UniversalModelAdmin):
|
||||||
list_display = ['name','season','episode','randomViewing','clickable_links','addedDate','alias']
|
list_display = ['name','image_tag','season','episode','randomViewing','clickable_links','addedDate','alias']
|
||||||
|
actions = [re_redirect]
|
||||||
|
|
||||||
#fields = ['name','season','episode','url_example','prefix','infix','suffix','alias','randomViewing','seasonInformation']
|
#fields = ['name','season','episode','url_example','prefix','infix','suffix','alias','randomViewing','seasonInformation']
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
(
|
(
|
||||||
@@ -77,8 +91,10 @@ class StreamingRedirectAdmin(ImportExportModelAdmin):
|
|||||||
(
|
(
|
||||||
'Information', {
|
'Information', {
|
||||||
"classes": ["collapse"],
|
"classes": ["collapse"],
|
||||||
'fields': ('seasonInformation','alias','betaserieShowId','maximumNumberSeason')
|
'fields': ('seasonInformation','alias','betaserieShowId','maximumNumberSeason','poster_url')
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
def clickable_links(self, obj):
|
link_field = 'url_display'
|
||||||
return format_html('<a href="{}">{}</a>', obj.url_display,obj.url_display)
|
|
||||||
|
def image_tag(self,obj):
|
||||||
|
return format_html('<img src="{0}" style="width: 355px; height:200px;" />'.format(obj.poster_url))
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.30 on 2026-09-17 21:26
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('streaming', '0014_remove_streamingredirectdata_url_example_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='streamingredirectdata',
|
||||||
|
name='poster_url',
|
||||||
|
field=models.CharField(blank=True, help_text='poster URL', max_length=1000, null=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -21,7 +21,7 @@ class StreamingRedirectData(models.Model):
|
|||||||
name = models.CharField(primary_key=True,max_length=1000, help_text="Name of the show")
|
name = models.CharField(primary_key=True,max_length=1000, help_text="Name of the show")
|
||||||
season = models.IntegerField(null=False,default=1)
|
season = models.IntegerField(null=False,default=1)
|
||||||
episode = models.IntegerField(null=False,default=0)
|
episode = models.IntegerField(null=False,default=0)
|
||||||
url_display = models.CharField(max_length=1000, help_text="https://www.1shows.org/tv/456-the-simpsons?streaming=true&season=18&episode=5",blank=True, null=True)
|
url_display = models.CharField(max_length=1000, help_text="https://streaming.geeraert.eu/office",blank=True, null=True)
|
||||||
prefix = models.CharField(max_length=1000, help_text="https://www.1shows.org/tv/456-the-simpsons?streaming=true&season=",blank=True, null=True)
|
prefix = models.CharField(max_length=1000, help_text="https://www.1shows.org/tv/456-the-simpsons?streaming=true&season=",blank=True, null=True)
|
||||||
infix = models.CharField(max_length=1000, help_text="&episode=",blank=True, null=True)
|
infix = models.CharField(max_length=1000, help_text="&episode=",blank=True, null=True)
|
||||||
suffix = models.CharField(max_length=1000, help_text="" ,blank=True, null=True)
|
suffix = models.CharField(max_length=1000, help_text="" ,blank=True, null=True)
|
||||||
@@ -31,28 +31,27 @@ class StreamingRedirectData(models.Model):
|
|||||||
betaserieShowId = models.IntegerField(null=True,blank=True)
|
betaserieShowId = models.IntegerField(null=True,blank=True)
|
||||||
maximumNumberSeason = models.IntegerField(null=True,blank=True)
|
maximumNumberSeason = models.IntegerField(null=True,blank=True)
|
||||||
randomViewing = models.BooleanField(default=False)
|
randomViewing = models.BooleanField(default=False)
|
||||||
|
poster_url = models.CharField(max_length=1000, help_text="poster URL",blank=True, null=True)
|
||||||
|
|
||||||
def sanitize(self, name):
|
def sanitize(self, name):
|
||||||
return name.replace(" ", "")
|
return name.replace(" ", "").lower()
|
||||||
|
|
||||||
def season_information(self, serie_name):
|
def season_information(self, serie_name):
|
||||||
betaserie = betaserieUtils()
|
betaserie = betaserieUtils()
|
||||||
print(serie_name)
|
|
||||||
print(betaserie.identify_serie(serie_name,True))
|
|
||||||
return betaserie.series_information(betaserie.identify_serie(serie_name))[0]
|
return betaserie.series_information(betaserie.identify_serie(serie_name))[0]
|
||||||
|
|
||||||
def maximum_Number_Season(self, serie_name):
|
def maximum_Number_Season(self, serie_name):
|
||||||
betaserie = betaserieUtils()
|
betaserie = betaserieUtils()
|
||||||
print(serie_name)
|
|
||||||
print(betaserie.identify_serie(serie_name))
|
|
||||||
return betaserie.series_information(betaserie.identify_serie(serie_name))[1]
|
return betaserie.series_information(betaserie.identify_serie(serie_name))[1]
|
||||||
|
|
||||||
def betaserie_show_id(self,serie_name):
|
def betaserie_show_id(self,serie_name):
|
||||||
betaserie = betaserieUtils()
|
betaserie = betaserieUtils()
|
||||||
print(serie_name)
|
|
||||||
print(betaserie.identify_serie(serie_name))
|
|
||||||
return betaserie.identify_serie(serie_name)
|
return betaserie.identify_serie(serie_name)
|
||||||
|
|
||||||
|
def betaserie_poster_url(self,serie_name):
|
||||||
|
betaserie = betaserieUtils()
|
||||||
|
return betaserie.poster_serie(serie_name)
|
||||||
|
|
||||||
def url_display_set(self,alias):
|
def url_display_set(self,alias):
|
||||||
if ENVIRONMENT == "PRODUCTION":
|
if ENVIRONMENT == "PRODUCTION":
|
||||||
url = "https://streaming.geeraert.eu/"
|
url = "https://streaming.geeraert.eu/"
|
||||||
@@ -73,6 +72,8 @@ class StreamingRedirectData(models.Model):
|
|||||||
self.maximumNumberSeason = self.maximum_Number_Season(self.name)
|
self.maximumNumberSeason = self.maximum_Number_Season(self.name)
|
||||||
if not self.url_display:
|
if not self.url_display:
|
||||||
self.url_display = self.url_display_set(self.alias)
|
self.url_display = self.url_display_set(self.alias)
|
||||||
|
if not self.poster_url:
|
||||||
|
self.poster_url = self.betaserie_poster_url(self.name)
|
||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ def hello(request):
|
|||||||
|
|
||||||
|
|
||||||
def streamingRedirect(request,alias):
|
def streamingRedirect(request,alias):
|
||||||
|
#sanitize
|
||||||
|
alias = alias.lower()
|
||||||
|
|
||||||
streaming_object = StreamingRedirectData.objects.filter(alias=alias)
|
streaming_object = StreamingRedirectData.objects.filter(alias=alias)
|
||||||
|
|
||||||
episode = streaming_object.values('episode')[0]['episode']
|
episode = streaming_object.values('episode')[0]['episode']
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from import_export.admin import ImportExportModelAdmin
|
|
||||||
from .models import TelegramData
|
from .models import TelegramData
|
||||||
from .utils import telegramUtils
|
from .utils import telegramUtils
|
||||||
|
from core.admin import UniversalModelAdmin
|
||||||
|
|
||||||
@admin.action(description="Clear all expired messages")
|
@admin.action(description="Clear all expired messages")
|
||||||
def messages_cleaning(modeladmin, request, queryset):
|
def messages_cleaning(modeladmin, request, queryset):
|
||||||
@@ -10,7 +10,7 @@ def messages_cleaning(modeladmin, request, queryset):
|
|||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
@admin.register(TelegramData)
|
@admin.register(TelegramData)
|
||||||
class JobAdmin(ImportExportModelAdmin):
|
class JobAdmin(UniversalModelAdmin):
|
||||||
list_display = ('message_id','chat_id','description','creation_date','expiration_date')
|
list_display = ('message_id','chat_id','description','creation_date','expiration_date')
|
||||||
actions = [messages_cleaning]
|
actions = [messages_cleaning]
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from .models import historicalData,redirectData
|
from .models import historicalData,redirectData
|
||||||
from .utils import redirect_method
|
from .utils import redirect_method
|
||||||
from import_export.admin import ImportExportModelAdmin
|
from core.admin import UniversalModelAdmin
|
||||||
from django.utils.html import format_html
|
|
||||||
|
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
|
||||||
@@ -21,16 +19,13 @@ def re_redirect(modeladmin, request, queryset):
|
|||||||
output_generated
|
output_generated
|
||||||
)
|
)
|
||||||
@admin.register(historicalData)
|
@admin.register(historicalData)
|
||||||
class historicalAdmin(ImportExportModelAdmin):
|
class historicalAdmin(UniversalModelAdmin):
|
||||||
list_input = (field.name for field in historicalData._meta.fields if field.name != 'id' or field.name != 'url')
|
list_input = (field.name for field in historicalData._meta.fields if field.name != 'id' or field.name != 'url')
|
||||||
list_display = ["clickable_links"]
|
list_display = ["clickable_links"]
|
||||||
list_display.extend(list_input)
|
list_display.extend(list_input)
|
||||||
actions = [re_redirect]
|
actions = [re_redirect]
|
||||||
|
|
||||||
|
|
||||||
def clickable_links(self, obj):
|
|
||||||
return format_html('<a href="{}">{}</a>', obj.url,obj.url)
|
|
||||||
|
|
||||||
@admin.register(redirectData)
|
@admin.register(redirectData)
|
||||||
class redirectAdmin(ImportExportModelAdmin):
|
class redirectAdmin(UniversalModelAdmin):
|
||||||
list_display = [field.name for field in redirectData._meta.fields if field.name != 'id']
|
list_display = [field.name for field in redirectData._meta.fields if field.name != 'id']
|
||||||
|
list_display += ['clickable_links']
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.utils.html import format_html
|
|
||||||
|
|
||||||
class historicalData(models.Model):
|
class historicalData(models.Model):
|
||||||
url = models.CharField(max_length=1000)
|
url = models.CharField(max_length=1000)
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
from import_export.admin import ImportExportModelAdmin
|
||||||
|
from admin_extra_buttons.api import ExtraButtonsMixin
|
||||||
|
from django.contrib import admin
|
||||||
|
from djangoql.admin import DjangoQLSearchMixin
|
||||||
|
from django.utils.html import format_html
|
||||||
|
|
||||||
|
class UniversalModelAdmin(DjangoQLSearchMixin,ImportExportModelAdmin,ExtraButtonsMixin,admin.ModelAdmin):
|
||||||
|
djangoql_completion_enabled_by_default = True
|
||||||
|
|
||||||
|
#Add search fields if you want to have the toggle on/off
|
||||||
|
# example:
|
||||||
|
# search_fields = ['season', 'episode', 'url', 'seen']
|
||||||
|
|
||||||
|
link_field = 'url'
|
||||||
|
|
||||||
|
|
||||||
|
def clickable_links(self, obj):
|
||||||
|
url = getattr(obj, self.link_field, None)
|
||||||
|
return format_html('<a href="{}">{}</a>', url,url)
|
||||||
|
|
||||||
@@ -54,6 +54,9 @@ INSTALLED_APPS = [
|
|||||||
'import_export',
|
'import_export',
|
||||||
'djangoql',
|
'djangoql',
|
||||||
'admin_extra_buttons',
|
'admin_extra_buttons',
|
||||||
|
'rest_framework',
|
||||||
|
'rest_framework.authtoken',
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
@@ -199,7 +202,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
|
|
||||||
LANGUAGE_CODE = 'en-us'
|
LANGUAGE_CODE = 'en-us'
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
TIME_ZONE = 'Europe/London'
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
@@ -252,3 +255,4 @@ PROXIES = {
|
|||||||
"http" : PROXY_URL,
|
"http" : PROXY_URL,
|
||||||
"https" : PROXY_URL
|
"https" : PROXY_URL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
FROM python:3.12
|
FROM python:3.12
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
#ENV ALLOWED_HOSTS 'django.tryton.geeraert.eu'
|
#ENV ALLOWED_HOSTS 'django.geeraert.eu'
|
||||||
#ENV DEBUG 'True'
|
#ENV DEBUG 'True'
|
||||||
|
|
||||||
ARG ALLOWED_HOSTS
|
ARG ALLOWED_HOSTS
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ FROM python:3.12
|
|||||||
MAINTAINER pi-ux-ce
|
MAINTAINER pi-ux-ce
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
ENV ALLOWED_HOSTS 'django-testing.tryton.geeraert.eu'
|
ENV ALLOWED_HOSTS 'django-testing.geeraert.eu'
|
||||||
ENV DEBUG 'True'
|
ENV DEBUG 'True'
|
||||||
|
|
||||||
WORKDIR /code/
|
WORKDIR /code/
|
||||||
@@ -20,7 +20,7 @@ RUN apt-get update && \
|
|||||||
# image silently keeps stale code.
|
# image silently keeps stale code.
|
||||||
ARG CACHE_BUST=1
|
ARG CACHE_BUST=1
|
||||||
RUN echo "cache bust: ${CACHE_BUST}" && \
|
RUN echo "cache bust: ${CACHE_BUST}" && \
|
||||||
git clone --depth 1 -b testing https://gitea.tryton.geeraert.eu/pi-ux-ce/Django_kube.git .
|
git clone --depth 1 -b testing https://gitea.geeraert.eu/pi-ux-ce/Django_kube.git .
|
||||||
|
|
||||||
RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade pip
|
RUN pip install --cache-dir=/opt/hostedtoolcache/pip --upgrade pip
|
||||||
RUN pip list --cache-dir=/opt/hostedtoolcache/pip --outdated
|
RUN pip list --cache-dir=/opt/hostedtoolcache/pip --outdated
|
||||||
|
|||||||
@@ -17,3 +17,4 @@ xmltodict
|
|||||||
whitenoise
|
whitenoise
|
||||||
djangoql
|
djangoql
|
||||||
django-admin-extra-buttons
|
django-admin-extra-buttons
|
||||||
|
djangorestframework
|
||||||
|
|||||||
Reference in New Issue
Block a user