Merge branch 'develop' into feature/jwtHistoryFiles

This commit is contained in:
Andrey
2021-12-22 17:13:10 +03:00
committed by GitHub
81 changed files with 469 additions and 225 deletions

View File

@ -1,6 +1,6 @@
import os
VERSION = '1.0.0'
VERSION = '1.1.0'
FILE_SIZE_MAX = 5242880
STORAGE_PATH = 'app_data'

View File

@ -45,13 +45,14 @@ See the detailed guide to learn how to install Document Server [for Windows](htt
nano config.py
```
Edit the following line:
Edit the following lines:
```
STORAGE_PATH = 'app_data'
DOC_SERV_SITE_URL = 'https://documentserver/'
```
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed.
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **STORAGE_PATH** is the path where files will be created and stored. You can set an absolute path. For example, *D:\\\\folder*. Please note that on Windows OS the double backslash must be used as a separator.
6. Run the **Python** server:

View File

@ -164,7 +164,7 @@ def getRootFolder(req):
else:
curAdr = req.META['REMOTE_ADDR']
directory = os.path.join(config.STORAGE_PATH, curAdr)
directory = config.STORAGE_PATH if os.path.isabs(config.STORAGE_PATH) else os.path.join(config.STORAGE_PATH, curAdr)
if not os.path.exists(directory): # if such a directory does not exist, make it
os.makedirs(directory)

View File

@ -79,7 +79,7 @@ descr_user_0 = [
USERS = [
User('uid-1', 'John Smith', 'smith@example.com',
None, None, {},
'', None, {},
None, [], descr_user_1, True),
User('uid-2', 'Mark Pottato', 'pottato@example.com',
'group-2', ['group-2', ''], {
@ -96,7 +96,7 @@ USERS = [
},
False, ["copy", "download", "print"], descr_user_3, False),
User('uid-0', None, None,
None, None, {},
'', None, {},
None, [], descr_user_0, False)
]

View File

@ -154,7 +154,7 @@ def edit(request):
ext = fileUtils.getFileExt(filename)
fileUri = docManager.getFileUri(filename, True, request)
fileUriUser = docManager.getFileUri(filename, False, request)
fileUriUser = docManager.getDownloadUrl(filename, request) + "&dmode=emb" if os.path.isabs(config.STORAGE_PATH) else docManager.getFileUri(filename, False, request)
docKey = docManager.generateFileKey(filename, request)
fileType = fileUtils.getFileType(filename)
user = users.getUserFromReq(request) # get user
@ -361,8 +361,9 @@ def download(request):
try:
fileName = fileUtils.getFileName(request.GET['fileName']) # get the file name
userAddress = request.GET.get('userAddress') if request.GET.get('userAddress') else request
isEmbedded = request.GET.get('dmode')
if (jwtManager.isEnabled()):
if (jwtManager.isEnabled() and isEmbedded == None):
jwtHeader = 'Authorization' if config.DOC_SERV_JWT_HEADER is None or config.DOC_SERV_JWT_HEADER == '' else config.DOC_SERV_JWT_HEADER
token = request.headers.get(jwtHeader)
if token:

View File

@ -87,10 +87,6 @@
}
@media (max-width: 1008px) {
#portal-info {
width: 65vw;
}
.left-panel {
margin-left: 0;
}
@ -312,6 +308,10 @@
.tableRow td:first-child {
max-width: 17%;
}
#portal-info {
max-width: 60vw;
}
}
.downloadContentCellShift:after {

View File

@ -30,6 +30,7 @@ html {
}
body {
display: inline-table;
background: #FFFFFF;
color: #333333;
font-family: Open Sans;
@ -79,6 +80,7 @@ header img {
}
.main{
display: table;
height: calc(100% - 112px);
min-height: 536px;
}
@ -105,6 +107,10 @@ header img {
width: 896px;
}
#portal-info {
max-width: 65vw;
}
.portal-name {
color: #FF6F3D;
font-size: 24px;

View File

@ -113,7 +113,7 @@
{% if files %}
<div id="portal-info" style="display: none">
{% else %}
<div id="portal-info" style="display: block">
<div id="portal-info" style="display: table-cell">
{% endif %}
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
@ -185,9 +185,6 @@
</a>
</td>
{% endif %}
{% if file.type == 'slide' %}
<td class="contentCells contentCells-icon contentCellsEmpty"></td>
{% endif %}
{% if file.type == 'word' %}
<td class="contentCells contentCells-icon">
<a href="edit?filename={{ file.title }}&type=desktop&mode=blockcontent" target="_blank">