Removed Python indentation
This commit is contained in:
62
install.sh
62
install.sh
@@ -10,16 +10,16 @@ else
|
||||
pip install pycrypto
|
||||
|
||||
cat <<EOF > index.py
|
||||
from Crypto.Hash import SHA, SHA256
|
||||
from Crypto.Signature import PKCS1_v1_5
|
||||
from Crypto.PublicKey import RSA
|
||||
from shutil import copyfile
|
||||
import json
|
||||
import codecs
|
||||
from Crypto.Hash import SHA, SHA256
|
||||
from Crypto.Signature import PKCS1_v1_5
|
||||
from Crypto.PublicKey import RSA
|
||||
from shutil import copyfile
|
||||
import json
|
||||
import codecs
|
||||
|
||||
hexlify = codecs.getencoder('hex')
|
||||
hexlify = codecs.getencoder('hex')
|
||||
|
||||
licenseFile = {
|
||||
licenseFile = {
|
||||
"branding": False,
|
||||
"connections": 9999,
|
||||
"customization": False,
|
||||
@@ -39,41 +39,41 @@ else
|
||||
"start_date": "2020-01-01T00:00:00.000Z",
|
||||
"users": [],
|
||||
"version": 2
|
||||
}
|
||||
}
|
||||
|
||||
jsonLicenseFile = codecs.encode(json.dumps(licenseFile, separators=(',', ':')), encoding='utf-8')
|
||||
jsonLicenseFile = codecs.encode(json.dumps(licenseFile, separators=(',', ':')), encoding='utf-8')
|
||||
|
||||
privKey = RSA.generate(1024)
|
||||
publKey = privKey.publickey().exportKey('PEM')
|
||||
privKey = RSA.generate(1024)
|
||||
publKey = privKey.publickey().exportKey('PEM')
|
||||
|
||||
digest = SHA.new(jsonLicenseFile)
|
||||
signer = PKCS1_v1_5.new(privKey)
|
||||
signature = signer.sign(digest)
|
||||
digest = SHA.new(jsonLicenseFile)
|
||||
signer = PKCS1_v1_5.new(privKey)
|
||||
signature = signer.sign(digest)
|
||||
|
||||
finalSignature = signature.hex()
|
||||
finalSignature = signature.hex()
|
||||
|
||||
licenseFile['signature'] = finalSignature
|
||||
licenseFile['signature'] = finalSignature
|
||||
|
||||
f = open("OO_License", "w+")
|
||||
f.write(json.dumps(licenseFile))
|
||||
f.close
|
||||
f = open("OO_License", "w+")
|
||||
f.write(json.dumps(licenseFile))
|
||||
f.close
|
||||
|
||||
f = open("OO_PubKey", "w+")
|
||||
f.write(publKey.decode('utf-8'))
|
||||
f.close()
|
||||
f = open("OO_PubKey", "w+")
|
||||
f.write(publKey.decode('utf-8'))
|
||||
f.close()
|
||||
|
||||
print("The license file has been saved to OO_License. Here's the content :")
|
||||
print(json.dumps(licenseFile))
|
||||
print("It will be placed automatically in the Data directory of OnlyOffice")
|
||||
print("The license file has been saved to OO_License. Here's the content :")
|
||||
print(json.dumps(licenseFile))
|
||||
print("It will be placed automatically in the Data directory of OnlyOffice")
|
||||
|
||||
copyfile("OO_License", "/var/www/onlyoffice/Data/license.lic")
|
||||
copyfile("OO_License", "/var/www/onlyoffice/Data/license.lic")
|
||||
|
||||
print("Patching docservice and convert...")
|
||||
print("Patching docservice and convert...")
|
||||
|
||||
basePath = "/var/www/onlyoffice/documentserver/server/"
|
||||
files = ["DocService/docservice", "FileConverter/converter"]
|
||||
basePath = "/var/www/onlyoffice/documentserver/server/"
|
||||
files = ["DocService/docservice", "FileConverter/converter"]
|
||||
|
||||
for file in files:
|
||||
for file in files:
|
||||
f = open(basePath+file, 'rb')
|
||||
data = f.read()
|
||||
f.close()
|
||||
|
||||
Reference in New Issue
Block a user