diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..de3c62b
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,2 @@
+_archiv/*
+.env/*
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 149b8a2..250c0fb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,6 @@ __pycache__
key.py
*.pyc
*.yaml
-packages/*
\ No newline at end of file
+packages/*
+.eggs/*
+*.pyc
\ No newline at end of file
diff --git a/Dockerfile.theia b/Dockerfile.theia
new file mode 100644
index 0000000..eb060e6
--- /dev/null
+++ b/Dockerfile.theia
@@ -0,0 +1,6 @@
+from theiaide/theia-python:latest
+run apt-get update && apt-get -y install libgs-dev
+COPY ./requirements.txt .
+run pip3 install --upgrade pip && pip3 install -r requirements.txt && pip3 install pytest pylint bandit flake8 black pytest-django six pytest-mock
+COPY . .
+ENTRYPOINT node /home/theia/src-gen/backend/main.js /home/project/.theia-workspace --hostname=0.0.0.0
\ No newline at end of file
diff --git a/build_dev_docker_images b/build_dev_docker_images
new file mode 100755
index 0000000..2bbeb9a
--- /dev/null
+++ b/build_dev_docker_images
@@ -0,0 +1,12 @@
+#/bin/bash
+export REGISTRY="docker.triton2.fet.at"
+
+# Build a development Image with Theia and all content
+docker build -f Dockerfile.theia -t $REGISTRY/andisdev:latest .
+docker push $REGISTRY/andisdev
+
+# Build Solr Server Image
+echo "Building SOLR Server Image Solrfet"
+cd services/solr_server
+docker build -t $REGISTRY/solrfet:latest .
+
diff --git a/data/stuff.txt b/data/stuff.txt
new file mode 100644
index 0000000..9cd8861
--- /dev/null
+++ b/data/stuff.txt
@@ -0,0 +1,4 @@
+asdfwef
+wefweg
+
+advgwegfawegewaf awfewfawefgae fgaergae
\ No newline at end of file
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
new file mode 100644
index 0000000..85f9f1f
--- /dev/null
+++ b/docker-compose.dev.yml
@@ -0,0 +1,75 @@
+version: '3'
+services:
+ solr:
+ image: my_fet_solr
+ build: ./services/solr_server
+ ports:
+ - "8980:8983"
+ volumes:
+ - data:/var/solr
+ command:
+ - solr-precreate
+ - core
+ - /opt/solr/server/solr/configsets/fetconfig
+ solrprotocol:
+ image: my_fet_solr
+ build: ./services/solr_server
+ ports:
+ - "8980:8983"
+ volumes:
+ - data:/var/solr
+ command:
+ - solr-precreate
+ - core
+ - /opt/solr/server/solr/configsets/fetconfig
+ etherpadsql:
+ image: jbergstroem/mariadb-alpine
+ environment:
+ SKIP_INNODB: "no"
+ MYSQL_DATABASE: etherpaddb
+ MYSQL_USER: user
+ MYSQL_PASSWORD: hgu
+ MYSQL_COLLATION: utf8_general_ci
+ MYSQL_CHARSET: utf8
+ volumes:
+ - ep-mysql-volume:/var/lib/mysql
+ etherpad:
+ image: etherpad/etherpad
+ environment:
+ DB_TYPE: mysql
+ DB_HOST: etherpadsql
+ DB_PORT: 3306
+ DB_NAME: etherpaddb
+ DB_USER: user
+ DB_PASS: hgu
+ DB_CHARSET: utf8
+ TRUST_PROXY: "true"
+ REQUIRE_SESSION: "true"
+ depends_on:
+ - etherpadsql
+ volumes:
+ - ./services/etherpad/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt
+ ports:
+ - "9101:9001"
+ nginx:
+ image: nginx:alpine
+ volumes:
+ - ./services/nginx/default.conf:/etc/nginx/conf.d/default.conf
+ ports:
+ - "5000:80"
+# bot:
+# image: bot
+# build: .
+# environment:
+# TARGET: https://andis.2020.fet.at
+# SOLR_HOST: http://solr:8983
+# ports:
+# - "5000:5000"
+ theia:
+ image: theiaide/theia-python:latest
+ volumes:
+ - .:/home/project
+ - ../packages:/home/packages
+volumes:
+ data:
+ ep-mysql-volume:
diff --git a/ep_test.py b/ep_test.py
index 3961352..ed4b5d1 100644
--- a/ep_test.py
+++ b/ep_test.py
@@ -10,7 +10,8 @@ logger.debug("Starting Test ...")
ep=EtherpadLiteLazyAPI(
url="http://etherpad:9101",
- keyfile="etherpad/APIKEY.txt",
+ exturl="https://bot.2020.fet.at/etherpad/",
+ keyfile="services/etherpad/APIKEY.txt",
groupmapper="fetwiki"
)
diff --git a/example1.log b/example1.log
new file mode 100644
index 0000000..8c0b16a
--- /dev/null
+++ b/example1.log
@@ -0,0 +1,14 @@
+INFO:root:sdf
+INFO:sdf:sdf3
+INFO:wiki.api:connecting
+INFO:wiki.api:apikey:
+INFO:wiki.api:Can't get connection to Etherpad Server. Error: HTTP Error 401: Unauthorized
+INFO:wiki.api:connecting
+INFO:wiki.api:apikey:
+INFO:wiki.api:Can't get connection to Etherpad Server. Error: HTTP Error 401: Unauthorized
+INFO:wiki.api:connecting
+INFO:wiki.api:apikey:
+INFO:wiki.api:Can't get connection to Etherpad Server. Error: HTTP Error 401: Unauthorized
+INFO:wiki.api:connecting
+INFO:wiki.api:apikey:
+INFO:wiki.api:Can't get connection to Etherpad Server. Error: HTTP Error 401: Unauthorized
diff --git a/internfiles/__init__.py b/internfiles/__init__.py
index b0dc2ff..396c801 100644
--- a/internfiles/__init__.py
+++ b/internfiles/__init__.py
@@ -5,7 +5,7 @@ import re
from flask import redirect, url_for, send_from_directory
from .pth import pth
import bs4
-
+from urllib.parse import urljoin
bp = Blueprint("internfiles", __name__, url_prefix="/internfiles")
@@ -35,9 +35,10 @@ class Folder:
def load_file_and_folder(path: str = ""):
f, directory = (None, None)
path = pth(path)
- datapath = pth("/mnt/save/daten")
+ datapath = pth("./data")
filepath = datapath + path
-
+ if not os.path.isdir(datapath):
+ return None, None
if not str(path) == "" and not (filepath in datapath):
return None, None
@@ -56,14 +57,17 @@ def load_file_and_folder(path: str = ""):
def web(path=""):
f, d = load_file_and_folder(path)
if not f and not d.p == path:
- return redirect(url_for("internfiles.web", path=d.p), code=302)
+ path=urljoin("https://bot.2020.fet.at",url_for(".web", path=d.p))
+ print(f"url for :{path}")
+ return redirect(path, code=302)
text = None
+ print("Accessing internfiles.web path %s"% path)
if f and f.endswith(".txt"):
text = os.path.abspath(f)
with open(os.path.abspath(f), "r", encoding='utf-8') as fh:
text = (fh.read())
- text = re.sub("\\n\s*\\n", "
", text)
+ text = re.sub(r"\\n\s*\\n", "
", text)
#text=bs4.BeautifulSoup(text).text
elif f:
return send_from_directory(str(f - 1), str(f[-1]))
diff --git a/settings.py b/settings.py
index 27f8658..7b946b0 100644
--- a/settings.py
+++ b/settings.py
@@ -1,20 +1,41 @@
+'''Settings für das interne Experimentierprojekt
+
+ TARGET '2020.fet.at'
+
+ URL_HOSTNAME 'bot.fet.at'
+
+ SOLR_HOST 'solr:8930'
+
+ ETHERPAD_API
+
+ ETHERPAD_EXT
+
+ ETHERPAD_KEYFILE
+
+ ETHERPAD_GROUP
+
+ CHATFILE Speicherpfad für Chats 'chats.yaml'
+
+ USERFILE Speicerpfad für User 'users.yaml'
+'''
+
import environ
-STUFF="sdf"
+
+
env = environ.Env(
- SOLR_HOST=(str, "http://localhost:8980"), TARGET=(str, "https://alpha.2020.fet.at")
+ CHATFILE=(str, "chats.yaml"),
+ USERFILE=(str, "users.yaml"),
+ TARGET=(str, "https://alpha.2020.fet.at"),
+ URL_HOSTNAME=(str, "bot.2020.fet.at"),
+ SOLR_HOST=(str, "http://solr:8983"),
)
+SOLR_HOST = env("SOLR_HOST")
+CHATFILE = env("CHATFILE")
+USERFILE = env("USERFILE")
+TARGET = env("TARGET")
+URL_HOSTNAME = env("URL_HOSTNAME")
-TARGET=env("TARGET")
-SOLR_HOST=env("SOLR_HOST")
-env=environ.Env(
- CHATFILE=(str,"chats.yaml"),
- USERFILE=(str,"users.yaml"),
- TARGET=(str,"https://alpha.2020.fet.at"),
- URL_HOSTNAME=(str, "bot.2020.fet.at" ),
-
-)
-
-CHATFILE= env('CHATFILE')
-USERFILE=env('USERFILE')
-TARGET=env('TARGET')
-URL_HOSTNAME=env('URL_HOSTNAME')
\ No newline at end of file
+ETHERPAD_API = ("http://etherpad:9001",)
+ETHERPAD_EXT = ("https://bot.2020.fet.at/etherpad/",)
+ETHERPAD_KEYFILE = ("services/etherpad/APIKEY.txt",)
+ETHERPAD_GROUP = "fetwiki"
diff --git a/static/icons/fileicon.css b/static/icons/fileicon.css
new file mode 100644
index 0000000..3773bf7
--- /dev/null
+++ b/static/icons/fileicon.css
@@ -0,0 +1,196 @@
+ /*
+ Fileicon icon font: Fileicon
+ Creation date: 30/08/2016 13:13
+ */
+
+@font-face {
+ font-family: "Fileicon";
+ src: url("/static/icons/fileicon.eot");
+ src: url("/static/icons/fileicon.eot?#iefix") format("embedded-opentype"),
+ url("/static/icons/fileicon.woff") format("woff"),
+ url("/static/icons/fileicon.ttf") format("truetype"),
+ url("/static/icons/fileicon.svg#Fileicon") format("svg");
+ font-weight: normal;
+ font-style: normal;
+}
+
+@media screen and (-webkit-min-device-pixel-ratio:0) {
+ @font-face {
+ font-family: "fileicon";
+ src: url("/static/icons/fileicon.svg#Fileicon") format("svg");
+ }
+}
+
+[class^="fileicon-"]:before, [class*=" fileicon-"]:before,
+[class^="fileicon-"]:after, [class*=" fileicon-"]:after {
+ font-family: Fileicon;
+ font-size: 20px;
+font-style: normal;
+margin-left: 20px;
+}
+
+.fileicon-ae:before { content: "\f100"; }
+.fileicon-agenda:before { content: "\f101"; }
+.fileicon-ai:before { content: "\f102"; }
+.fileicon-ai-1:before { content: "\f103"; }
+.fileicon-ai-2:before { content: "\f104"; }
+.fileicon-alignment:before { content: "\f105"; }
+.fileicon-apk:before { content: "\f106"; }
+.fileicon-au:before { content: "\f107"; }
+.fileicon-br:before { content: "\f108"; }
+.fileicon-browser:before { content: "\f109"; }
+.fileicon-browser-1:before { content: "\f10a"; }
+.fileicon-browser-10:before { content: "\f10b"; }
+.fileicon-browser-11:before { content: "\f10c"; }
+.fileicon-browser-12:before { content: "\f10d"; }
+.fileicon-browser-13:before { content: "\f10e"; }
+.fileicon-browser-14:before { content: "\f10f"; }
+.fileicon-browser-15:before { content: "\f110"; }
+.fileicon-browser-16:before { content: "\f111"; }
+.fileicon-browser-17:before { content: "\f112"; }
+.fileicon-browser-18:before { content: "\f113"; }
+.fileicon-browser-19:before { content: "\f114"; }
+.fileicon-browser-2:before { content: "\f115"; }
+.fileicon-browser-20:before { content: "\f116"; }
+.fileicon-browser-21:before { content: "\f117"; }
+.fileicon-browser-22:before { content: "\f118"; }
+.fileicon-browser-23:before { content: "\f119"; }
+.fileicon-browser-24:before { content: "\f11a"; }
+.fileicon-browser-25:before { content: "\f11b"; }
+.fileicon-browser-26:before { content: "\f11c"; }
+.fileicon-browser-27:before { content: "\f11d"; }
+.fileicon-browser-28:before { content: "\f11e"; }
+.fileicon-browser-3:before { content: "\f11f"; }
+.fileicon-browser-4:before { content: "\f120"; }
+.fileicon-browser-5:before { content: "\f121"; }
+.fileicon-browser-6:before { content: "\f122"; }
+.fileicon-browser-7:before { content: "\f123"; }
+.fileicon-browser-8:before { content: "\f124"; }
+.fileicon-browser-9:before { content: "\f125"; }
+.fileicon-card:before { content: "\f126"; }
+.fileicon-certification:before { content: "\f127"; }
+.fileicon-coding:before { content: "\f128"; }
+.fileicon-css:before { content: "\f129"; }
+.fileicon-doc:before { content: "\f12a"; }
+.fileicon-dw:before { content: "\f12b"; }
+.fileicon-fi:before { content: "\f12c"; }
+.fileicon-file:before { content: "\f12d"; }
+.fileicon-file-1:before { content: "\f12e"; }
+.fileicon-file-10:before { content: "\f12f"; }
+.fileicon-file-11:before { content: "\f130"; }
+.fileicon-file-2:before { content: "\f131"; }
+.fileicon-file-3:before { content: "\f132"; }
+.fileicon-file-4:before { content: "\f133"; }
+.fileicon-file-5:before { content: "\f134"; }
+.fileicon-file-6:before { content: "\f135"; }
+.fileicon-file-7:before { content: "\f136"; }
+.fileicon-file-8:before { content: "\f137"; }
+.fileicon-file-9:before { content: "\f138"; }
+.fileicon-files:before { content: "\f139"; }
+.fileicon-files-1:before { content: "\f13a"; }
+.fileicon-files-10:before { content: "\f13b"; }
+.fileicon-files-11:before { content: "\f13c"; }
+.fileicon-files-12:before { content: "\f13d"; }
+.fileicon-files-13:before { content: "\f13e"; }
+.fileicon-files-14:before { content: "\f13f"; }
+.fileicon-files-15:before { content: "\f140"; }
+.fileicon-files-2:before { content: "\f141"; }
+.fileicon-files-3:before { content: "\f142"; }
+.fileicon-files-4:before { content: "\f143"; }
+.fileicon-files-5:before { content: "\f144"; }
+.fileicon-files-6:before { content: "\f145"; }
+.fileicon-files-7:before { content: "\f146"; }
+.fileicon-files-8:before { content: "\f147"; }
+.fileicon-files-9:before { content: "\f148"; }
+.fileicon-folder:before { content: "\f149"; }
+.fileicon-folder-1:before { content: "\f14a"; }
+.fileicon-folder-10:before { content: "\f14b"; }
+.fileicon-folder-11:before { content: "\f14c"; }
+.fileicon-folder-2:before { content: "\f14d"; }
+.fileicon-folder-3:before { content: "\f14e"; }
+.fileicon-folder-4:before { content: "\f14f"; }
+.fileicon-folder-5:before { content: "\f150"; }
+.fileicon-folder-6:before { content: "\f151"; }
+.fileicon-folder-7:before { content: "\f152"; }
+.fileicon-folder-8:before { content: "\f153"; }
+.fileicon-folder-9:before { content: "\f154"; }
+.fileicon-fw:before { content: "\f155"; }
+.fileicon-home:before { content: "\f156"; }
+.fileicon-home-1:before { content: "\f157"; }
+.fileicon-home-2:before { content: "\f158"; }
+.fileicon-house:before { content: "\f159"; }
+.fileicon-house-1:before { content: "\f15a"; }
+.fileicon-house-2:before { content: "\f15b"; }
+.fileicon-house-3:before { content: "\f15c"; }
+.fileicon-house-4:before { content: "\f15d"; }
+.fileicon-house-5:before { content: "\f15e"; }
+.fileicon-house-6:before { content: "\f15f"; }
+.fileicon-house-7:before { content: "\f160"; }
+.fileicon-house-8:before { content: "\f161"; }
+.fileicon-id:before { content: "\f162"; }
+.fileicon-ipa:before { content: "\f163"; }
+.fileicon-jpg:before { content: "\f164"; }
+.fileicon-left-align:before { content: "\f165"; }
+.fileicon-music-file:before { content: "\f166"; }
+.fileicon-newspaper:before { content: "\f167"; }
+.fileicon-pdf:before { content: "\f168"; }
+.fileicon-php:before { content: "\f169"; }
+.fileicon-placeholder:before { content: "\f16a"; }
+.fileicon-placeholder-1:before { content: "\f16b"; }
+.fileicon-placeholder-10:before { content: "\f16c"; }
+.fileicon-placeholder-11:before { content: "\f16d"; }
+.fileicon-placeholder-2:before { content: "\f16e"; }
+.fileicon-placeholder-3:before { content: "\f16f"; }
+.fileicon-placeholder-4:before { content: "\f170"; }
+.fileicon-placeholder-5:before { content: "\f171"; }
+.fileicon-placeholder-6:before { content: "\f172"; }
+.fileicon-placeholder-7:before { content: "\f173"; }
+.fileicon-placeholder-8:before { content: "\f174"; }
+.fileicon-placeholder-9:before { content: "\f175"; }
+.fileicon-png:before { content: "\f176"; }
+.fileicon-ppt:before { content: "\f177"; }
+.fileicon-pr:before { content: "\f178"; }
+.fileicon-ps:before { content: "\f179"; }
+.fileicon-ps-1:before { content: "\f17a"; }
+.fileicon-report:before { content: "\f17b"; }
+.fileicon-report-1:before { content: "\f17c"; }
+.fileicon-report-10:before { content: "\f17d"; }
+.fileicon-report-11:before { content: "\f17e"; }
+.fileicon-report-2:before { content: "\f17f"; }
+.fileicon-report-3:before { content: "\f180"; }
+.fileicon-report-4:before { content: "\f181"; }
+.fileicon-report-5:before { content: "\f182"; }
+.fileicon-report-6:before { content: "\f183"; }
+.fileicon-report-7:before { content: "\f184"; }
+.fileicon-report-8:before { content: "\f185"; }
+.fileicon-report-9:before { content: "\f186"; }
+.fileicon-server:before { content: "\f187"; }
+.fileicon-server-1:before { content: "\f188"; }
+.fileicon-server-2:before { content: "\f189"; }
+.fileicon-server-3:before { content: "\f18a"; }
+.fileicon-server-4:before { content: "\f18b"; }
+.fileicon-server-5:before { content: "\f18c"; }
+.fileicon-server-6:before { content: "\f18d"; }
+.fileicon-server-7:before { content: "\f18e"; }
+.fileicon-server-8:before { content: "\f18f"; }
+.fileicon-sg:before { content: "\f190"; }
+.fileicon-sitemap:before { content: "\f191"; }
+.fileicon-sitemap-1:before { content: "\f192"; }
+.fileicon-sitemap-2:before { content: "\f193"; }
+.fileicon-sitemap-3:before { content: "\f194"; }
+.fileicon-storage:before { content: "\f195"; }
+.fileicon-storage-1:before { content: "\f196"; }
+.fileicon-storage-2:before { content: "\f197"; }
+.fileicon-txt:before { content: "\f198"; }
+.fileicon-video-file:before { content: "\f199"; }
+.fileicon-video-file-1:before { content: "\f19a"; }
+.fileicon-video-file-2:before { content: "\f19b"; }
+.fileicon-video-file-3:before { content: "\f19c"; }
+.fileicon-video-file-4:before { content: "\f19d"; }
+.fileicon-video-file-5:before { content: "\f19e"; }
+.fileicon-video-file-6:before { content: "\f19f"; }
+.fileicon-video-file-7:before { content: "\f1a0"; }
+.fileicon-video-file-8:before { content: "\f1a1"; }
+.fileicon-viewer:before { content: "\f1a2"; }
+.fileicon-xls:before { content: "\f1a3"; }
+.fileicon-zip:before { content: "\f1a4"; }
\ No newline at end of file
diff --git a/static/icons/fileicon.eot b/static/icons/fileicon.eot
new file mode 100644
index 0000000..e783d0f
Binary files /dev/null and b/static/icons/fileicon.eot differ
diff --git a/static/icons/fileicon.html b/static/icons/fileicon.html
new file mode 100644
index 0000000..e529ac1
--- /dev/null
+++ b/static/icons/fileicon.html
@@ -0,0 +1,1280 @@
+
+
+
+
+
+
+
Instructions
+ +
+ <head>
+
...
+
<link rel="stylesheet" type="text/css" href="your_website_domain/css_root/fileicon.css">
+
...
+
</head>
+
+
+ 3Use the icon class on "display: inline" elements:
+
+ Use example: <i class="fileicon-airplane49"></i> or <span class="fileicon-airplane49"></span>
+
Under CC: Retinaicons
+ + <i class="fileicon-ae"></i> +
++ + <i class="fileicon-agenda"></i> +
++ + <i class="fileicon-ai"></i> +
++ + <i class="fileicon-ai-1"></i> +
+