Compare commits
6
Commits
master
..
120e04ce2a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
120e04ce2a | ||
|
|
42cea0b61f | ||
|
|
b60da93e95 | ||
|
|
0be96fc105 | ||
|
|
8758bd2d7f | ||
|
|
9cffee90fd |
No files matched your search
Binary file not shown.
File renamed without changes.
File renamed without changes.
BIN
Binary file not shown.
File renamed without changes.
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
ASGI config for Contentserver project.
|
ASGI config for drm_server project.
|
||||||
|
|
||||||
It exposes the ASGI callable as a module-level variable named ``application``.
|
It exposes the ASGI callable as a module-level variable named ``application``.
|
||||||
|
|
||||||
@@ -11,6 +11,6 @@ import os
|
|||||||
|
|
||||||
from django.core.asgi import get_asgi_application
|
from django.core.asgi import get_asgi_application
|
||||||
|
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Contentserver.settings')
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'drm_server.settings')
|
||||||
|
|
||||||
application = get_asgi_application()
|
application = get_asgi_application()
|
||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Django settings for Contentserver project.
|
Django settings for drm_server project.
|
||||||
|
|
||||||
Generated by 'django-admin startproject' using Django 3.1.4.
|
Generated by 'django-admin startproject' using Django 3.1.4.
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ MIDDLEWARE = [
|
|||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
]
|
]
|
||||||
|
|
||||||
ROOT_URLCONF = 'Contentserver.urls'
|
ROOT_URLCONF = 'drm_server.urls'
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
@@ -84,7 +84,7 @@ TEMPLATES = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
WSGI_APPLICATION = 'Contentserver.wsgi.application'
|
WSGI_APPLICATION = 'drm_server.wsgi.application'
|
||||||
|
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
File renamed without changes.
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
WSGI config for Contentserver project.
|
WSGI config for drm_server project.
|
||||||
|
|
||||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||||
|
|
||||||
@@ -11,6 +11,6 @@ import os
|
|||||||
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Contentserver.settings')
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'drm_server.settings')
|
||||||
|
|
||||||
application = get_wsgi_application()
|
application = get_wsgi_application()
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"presets": [
|
||||||
|
"@babel/preset-env", "@babel/preset-react"
|
||||||
|
]
|
||||||
|
}
|
||||||
File renamed without changes.
@@ -0,0 +1,22 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
from .models import FolderInfo, FolderPart, JustifiedKey, FolderPart_Name
|
||||||
|
|
||||||
|
admin.site.register(FolderInfo)
|
||||||
|
admin.site.register(FolderPart)
|
||||||
|
admin.site.register(FolderPart_Name)
|
||||||
|
admin.site.register(JustifiedKey)
|
||||||
|
|
||||||
|
#@admin.register(BookInstance)
|
||||||
|
#class BookInstanceAdmin(admin.ModelAdmin):
|
||||||
|
# list_display = ('book', 'status', 'borrower', 'due_back', 'id')
|
||||||
|
# list_filter = ('status', 'due_back')#
|
||||||
|
#
|
||||||
|
# fieldsets = (
|
||||||
|
# (None, {
|
||||||
|
# 'fields': ('book','imprint', 'id')
|
||||||
|
# }),
|
||||||
|
# ('Availability', {
|
||||||
|
# 'fields': ('status', 'due_back','borrower')
|
||||||
|
# }),
|
||||||
|
# )
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+4159
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"name": "frontend",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"dev": "webpack --mode development ./src/index.js --output-path ./static/frontend/",
|
||||||
|
"build": "webpack --mode production ./src/index.js --output-path ./static/frontend/"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.12.10",
|
||||||
|
"@babel/plugin-transform-runtime": "^7.12.10",
|
||||||
|
"@babel/preset-env": "^7.12.11",
|
||||||
|
"@babel/preset-react": "^7.12.10",
|
||||||
|
"@babel/runtime": "^7.12.5",
|
||||||
|
"babel-loader": "^8.2.2",
|
||||||
|
"babelify": "^10.0.0",
|
||||||
|
"react": "^17.0.1",
|
||||||
|
"react-dom": "^17.0.1",
|
||||||
|
"webpack": "^5.11.0",
|
||||||
|
"webpack-cli": "^4.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"assert": "^2.0.0",
|
||||||
|
"browserify": "^17.0.0",
|
||||||
|
"buffer": "^6.0.3",
|
||||||
|
"buffer-browserify": "^0.2.5",
|
||||||
|
"create-react-class": "^15.7.0",
|
||||||
|
"crypto": "^1.0.1",
|
||||||
|
"crypto-browserify": "^3.12.0",
|
||||||
|
"jquery": "^3.5.1",
|
||||||
|
"process": "^0.11.10",
|
||||||
|
"stream-browserify": "^3.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,30 @@
|
|||||||
|
const webpack = require('webpack');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
resolve:{fallback: { "crypto": require.resolve("crypto-browserify"),
|
||||||
|
"stream": require.resolve("stream-browserify"),
|
||||||
|
"buffer": require.resolve("buffer-browserify"),
|
||||||
|
"path": require.resolve("path-browserify"),
|
||||||
|
"assert": require.resolve("assert/")}},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: {
|
||||||
|
loader: "babel-loader",
|
||||||
|
options: {
|
||||||
|
presets: ["@babel/preset-env", "@babel/preset-react"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.ProvidePlugin({
|
||||||
|
process: 'process/browser',
|
||||||
|
'process.env.POUCHDB_NAME': JSON.stringify(process.env.POUCHDB_NAME || 'mydb'),
|
||||||
|
})
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
from .models import FolderInfo, FolderPart, JustifiedKey, FolderPart_Name
|
|
||||||
|
|
||||||
admin.site.register(FolderInfo)
|
|
||||||
admin.site.register(FolderPart)
|
|
||||||
admin.site.register(FolderPart_Name)
|
|
||||||
admin.site.register(JustifiedKey)
|
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,53 +1,51 @@
|
|||||||
from health_view.models import *
|
from health_view.models import *
|
||||||
import health_view.views
|
from health_view.views import check_expiration_date
|
||||||
|
from datetime import datetime
|
||||||
from health_view.crypto_functions import *
|
from health_view.crypto_functions import *
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
loginname_restapi = 'gabi'
|
#logindata for admin acc on Contentserver
|
||||||
passwort_restapi = 'Lolo7138'
|
loginname_restapi = ''
|
||||||
|
passwort_restapi = ''
|
||||||
|
|
||||||
|
|
||||||
def check_exp_date():
|
def check_exp_date():
|
||||||
licenses = License.objects.all()
|
licenses = License.objects.all()
|
||||||
print("did it")
|
date_now = datetime.now()
|
||||||
for lic in licenses:
|
for lic in licenses:
|
||||||
if health_view.views.check_expiration_date(lic):
|
if check_expiration_date(lic):
|
||||||
continue
|
continue
|
||||||
filter_license_and_delete(lic)
|
licenses_same_owner = License.objects.filter(justified=lic.justified, patient=lic.patient).exclude(id=lic.id)
|
||||||
|
folderparts = lic.folder_parts.all().values_list()
|
||||||
|
parts_to_delete = list()
|
||||||
def filter_license_and_delete(lic):
|
for part in folderparts:
|
||||||
print(lic.justified)
|
delete = True
|
||||||
licenses_same_owner = License.objects.filter(justified=lic.justified, patient=lic.patient).exclude(id=lic.id)
|
for license in licenses_same_owner:
|
||||||
folderparts = lic.folder_parts.all().values_list()
|
if not check_expiration_date(license):
|
||||||
parts_to_delete = list()
|
continue
|
||||||
for part in folderparts:
|
for check_part in license.folder_parts.all().values_list():
|
||||||
delete = True
|
if check_part == part:
|
||||||
for license in licenses_same_owner:
|
delete = False
|
||||||
if not health_view.views.check_expiration_date(license):
|
if delete is True:
|
||||||
continue
|
parts_to_delete.append(part[2])
|
||||||
for check_part in license.folder_parts.all().values_list():
|
if not parts_to_delete:
|
||||||
if check_part == part:
|
lic.delete()
|
||||||
delete = False
|
continue
|
||||||
if delete is True:
|
new_total_key = make_encrypted_key_content_server()
|
||||||
parts_to_delete.append(part[2])
|
post_content = {
|
||||||
if not parts_to_delete:
|
'patient': lic.patient.username,
|
||||||
|
'justified': lic.justified.username,
|
||||||
|
'new_total_key': new_total_key,
|
||||||
|
'old_total_key': lic.patient.folderinfo.content_key,
|
||||||
|
'folder_parts': parts_to_delete,
|
||||||
|
}
|
||||||
|
lic.patient.folderinfo.content_key = new_total_key
|
||||||
|
lic.patient.folderinfo.save()
|
||||||
lic.delete()
|
lic.delete()
|
||||||
return
|
request = requests.post('http://192.168.192.75:8000/manage/delete/', json=post_content, auth=(loginname_restapi, passwort_restapi))
|
||||||
new_total_key = make_encrypted_key_content_server()
|
|
||||||
post_content = {
|
|
||||||
'patient': lic.patient.username,
|
|
||||||
'justified': lic.justified.username,
|
|
||||||
'new_total_key': new_total_key,
|
|
||||||
'old_total_key': lic.patient.folderinfo.content_key,
|
|
||||||
'folder_parts': parts_to_delete,
|
|
||||||
}
|
|
||||||
lic.patient.folderinfo.content_key = new_total_key
|
|
||||||
lic.patient.folderinfo.save()
|
|
||||||
lic.delete()
|
|
||||||
request = requests.post('http://192.168.192.75:8000/manage/delete/', json=post_content, auth=(loginname_restapi, passwort_restapi))
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
@@ -8,5 +8,4 @@ urlpatterns = [
|
|||||||
path('license/<int:fid>/create/', views.create_license, name='create-license'),
|
path('license/<int:fid>/create/', views.create_license, name='create-license'),
|
||||||
path('license/show/<int:pk>/own/', views.get_license_details, name='license-detail-own'),
|
path('license/show/<int:pk>/own/', views.get_license_details, name='license-detail-own'),
|
||||||
path('license/show/<int:pk>/given/', views.get_license_details, name='license-detail-given'),
|
path('license/show/<int:pk>/given/', views.get_license_details, name='license-detail-given'),
|
||||||
path('delete_license/<int:id>', views.delete_license, name='delete_license')
|
|
||||||
]
|
]
|
||||||
@@ -179,8 +179,3 @@ def create_license(request, fid):
|
|||||||
context = {'form': form}
|
context = {'form': form}
|
||||||
return render(request, 'health_view/create_license.html', context)
|
return render(request, 'health_view/create_license.html', context)
|
||||||
|
|
||||||
|
|
||||||
def delete_license(request, id):
|
|
||||||
license = get_object_or_404(License, id=id)
|
|
||||||
health_view.cron.filter_license_and_delete(license)
|
|
||||||
return HttpResponseRedirect('/health_view/givenlicenses/')
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
appdirs==1.4.4
|
|
||||||
apturl==0.5.2
|
|
||||||
asgiref==3.3.1
|
|
||||||
bcrypt==3.1.7
|
|
||||||
blinker==1.4
|
|
||||||
Brlapi==0.7.0
|
|
||||||
certifi==2019.11.28
|
|
||||||
chardet==3.0.4
|
|
||||||
Click==7.0
|
|
||||||
colorama==0.4.3
|
|
||||||
command-not-found==0.3
|
|
||||||
crypto==1.4.1
|
|
||||||
cryptography==2.8
|
|
||||||
cupshelpers==1.0
|
|
||||||
dbus-python==1.2.16
|
|
||||||
defer==1.0.6
|
|
||||||
distlib==0.3.1
|
|
||||||
distro==1.4.0
|
|
||||||
distro-info===0.23ubuntu1
|
|
||||||
Django==3.1.4
|
|
||||||
django-crontab==0.7.1
|
|
||||||
duplicity==0.8.12.0
|
|
||||||
ecdsa==0.16.1
|
|
||||||
entrypoints==0.3
|
|
||||||
fasteners==0.14.1
|
|
||||||
filelock==3.0.12
|
|
||||||
future==0.18.2
|
|
||||||
httplib2==0.14.0
|
|
||||||
idna==2.8
|
|
||||||
keyring==18.0.1
|
|
||||||
language-selector==0.1
|
|
||||||
launchpadlib==1.10.13
|
|
||||||
lazr.restfulclient==0.14.2
|
|
||||||
lazr.uri==1.0.3
|
|
||||||
lockfile==0.12.2
|
|
||||||
louis==3.12.0
|
|
||||||
macaroonbakery==1.3.1
|
|
||||||
Mako==1.1.0
|
|
||||||
MarkupSafe==1.1.0
|
|
||||||
monotonic==1.5
|
|
||||||
Naked==0.1.31
|
|
||||||
netifaces==0.10.4
|
|
||||||
oauthlib==3.1.0
|
|
||||||
olefile==0.46
|
|
||||||
paramiko==2.6.0
|
|
||||||
pexpect==4.6.0
|
|
||||||
Pillow==7.0.0
|
|
||||||
protobuf==3.6.1
|
|
||||||
pycairo==1.16.2
|
|
||||||
pycrypto==2.6.1
|
|
||||||
pycryptodome==3.9.9
|
|
||||||
pycups==1.9.73
|
|
||||||
Pygments==2.3.1
|
|
||||||
PyGObject==3.36.0
|
|
||||||
PyJWT==1.7.1
|
|
||||||
pymacaroons==0.13.0
|
|
||||||
PyNaCl==1.3.0
|
|
||||||
PyQt5==5.15.1
|
|
||||||
PyQt5-sip==12.8.1
|
|
||||||
pyqt5-tools==5.15.1.1.7.4
|
|
||||||
pyRFC3339==1.1
|
|
||||||
python-apt==2.0.0+ubuntu0.20.4.3
|
|
||||||
python-dateutil==2.7.3
|
|
||||||
python-debian===0.1.36ubuntu1
|
|
||||||
python-dotenv==0.14.0
|
|
||||||
pytz==2019.3
|
|
||||||
pyxdg==0.26
|
|
||||||
PyYAML==5.3.1
|
|
||||||
reportlab==3.5.34
|
|
||||||
requests==2.22.0
|
|
||||||
requests-unixsocket==0.2.0
|
|
||||||
SecretStorage==2.3.1
|
|
||||||
shellescape==3.8.1
|
|
||||||
simplejson==3.16.0
|
|
||||||
six==1.14.0
|
|
||||||
sqlparse==0.4.1
|
|
||||||
systemd-python==234
|
|
||||||
ubuntu-advantage-tools==20.3
|
|
||||||
ubuntu-drivers-common==0.0.0
|
|
||||||
ufw==0.36
|
|
||||||
unattended-upgrades==0.1
|
|
||||||
urllib3==1.25.8
|
|
||||||
usb-creator==0.3.7
|
|
||||||
virtualenv==20.2.2
|
|
||||||
wadllib==1.3.3
|
|
||||||
xkit==0.0.0
|
|
||||||
File renamed without changes.
Reference in new issue
Block a user