Compare commits

..

16 Commits

Author SHA1 Message Date
e020f98bd2 Fix descriptions variables 2025-11-09 21:11:42 +03:00
17aff09a66 Add builder pypi project long description 2025-11-06 16:36:00 +03:00
40b95455a0 Fix package branding build (#146)
Co-authored-by: Semyon Bezrukov <semen.bezrukov@onlyoffice.com>
Co-committed-by: Semyon Bezrukov <semen.bezrukov@onlyoffice.com>
2025-10-28 15:13:29 +00:00
62ab1f9935 Fix xp build 2025-10-27 18:44:19 +03:00
dd26863a2b Enable agent 2025-10-27 14:25:46 +03:00
c02a387a64 Add support version for v8_89 2025-10-27 14:24:46 +03:00
0fd6852fe8 Merge pull request 'Fix build for mac_64' (#145) from release/v9.1.0 into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/145
2025-10-27 11:01:07 +00:00
44b6d2d64f Fix windows arm64 packages build 2025-10-23 16:19:18 +03:00
b2ce2bbcad Merge pull request 'release/v9.1.0' (#143) from release/v9.1.0 into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/build_tools/pulls/143
2025-10-21 20:20:48 +00:00
4ca5e4bcb5 Merge branch release/v9.1.0 into master 2025-10-14 14:34:05 +00:00
2ffc1b9347 Merge branch hotfix/v9.0.4 into master 2025-09-11 08:38:14 +00:00
5a403cb3ac Merge pull request 'fix/jsdoc' (#107) from fix/jsdoc into master 2025-08-13 14:29:55 +00:00
d435dd496b [jsdoc] Fix typo 2025-08-12 19:05:12 +07:00
252a5c306d [jsdoc] gen plugins events summary file 2025-08-12 19:04:28 +07:00
fc9d060a78 Merge branch hotfix/v9.0.4 into master 2025-08-06 08:26:46 +00:00
6c700fe492 Merge branch hotfix/v9.0.4 into master 2025-08-05 14:06:58 +00:00
8 changed files with 107 additions and 387 deletions

View File

@ -91,6 +91,8 @@ if config.check_option("module", "desktop"):
config.extend_option("config", "updmodule")
base.set_env("DESKTOP_URL_UPDATES_MAIN_CHANNEL", "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcast.json")
base.set_env("DESKTOP_URL_UPDATES_DEV_CHANNEL", "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/appcastdev.json")
base.set_env("DESKTOP_URL_INSTALL_CHANNEL", "https://download.onlyoffice.com/install/desktop/editors/windows/distrib/onlyoffice/<file>")
base.set_env("DESKTOP_URL_INSTALL_DEV_CHANNEL", "https://download.onlyoffice.com/install/desktop/editors/windows/onlyoffice/onlineinstallerdev/<file>")
# build
build_sln.make()

View File

@ -235,8 +235,7 @@ def make_xp():
base.replaceInFile("depot_tools/cipd.ps1", "windows-386", "windows-amd64")
# old variant
#path_to_python2 = "/depot_tools/win_tools-2_7_13_chromium7_bin/python/bin"
path_to_python2 = "/depot_tools/bootstrap-2@3_8_10_chromium_23_bin/python/bin"
path_to_python2 = "/depot_tools/bootstrap-2@3_11_8_chromium_35_bin/python/bin"
os.environ["PATH"] = os.pathsep.join([base_dir + "/depot_tools",
base_dir + path_to_python2,
config.option("vs-path") + "/../Common7/IDE",

View File

@ -7,6 +7,25 @@ import base
import os
import subprocess
def clean():
if base.is_dir("depot_tools"):
base.delete_dir_with_access_error("depot_tools")
base.delete_dir("depot_tools")
if base.is_dir("v8"):
base.delete_dir_with_access_error("v8")
base.delete_dir("v8")
if base.is_exist("./.gclient"):
base.delete_file("./.gclient")
if base.is_exist("./.gclient_entries"):
base.delete_file("./.gclient_entries")
if base.is_exist("./.gclient_previous_sync_commits"):
base.delete_file("./.gclient_previous_sync_commits")
if base.is_exist("./.gcs_entries"):
base.delete_file("./.gcs_entries")
if base.is_exist("./.cipd"):
base.delete_dir("./.cipd")
return
def change_bootstrap():
base.move_file("./depot_tools/bootstrap/manifest.txt", "./depot_tools/bootstrap/manifest.txt.bak")
content = "# changed by build_tools\n\n"
@ -149,6 +168,8 @@ def make():
if not base.is_dir(base_dir):
base.create_dir(base_dir)
base.common_check_version("v8", "1", clean)
if ("mac" == base.host_platform()):
base.cmd("git", ["config", "--global", "http.postBuffer", "157286400"], True)

View File

@ -186,6 +186,8 @@ def make():
base.copy_file(git_dir + "/desktop-apps/win-linux/extras/projicons/" + apps_postfix + "/projicons.exe", root_dir + "/DesktopEditors.exe")
if not isWindowsXP:
base.copy_file(git_dir + "/desktop-apps/win-linux/extras/update-daemon/" + apps_postfix + "/updatesvc.exe", root_dir + "/updatesvc.exe")
else:
base.copy_file(git_dir + "/desktop-apps/win-linux/extras/online-installer/" + apps_postfix + "/online-installer.exe", root_dir + "/online-installer.exe")
base.copy_file(git_dir + "/desktop-apps/win-linux/" + apps_postfix + "/DesktopEditors.exe", root_dir + "/editors.exe")
base.copy_file(git_dir + "/desktop-apps/win-linux/res/icons/desktopeditors.ico", root_dir + "/app.ico")
elif (0 == platform.find("linux")):
@ -242,7 +244,7 @@ def make():
#base.copy_dir(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins/encrypt/ui/engine/database/{9AB4BBA8-A7E5-48D5-B683-ECE76A020BB1}", root_dir + "/editors/sdkjs-plugins/{9AB4BBA8-A7E5-48D5-B683-ECE76A020BB1}")
base.copy_sdkjs_plugin(git_dir + "/desktop-sdk/ChromiumBasedEditors/plugins", root_dir + "/editors/sdkjs-plugins", "sendto", True)
isUseAgent = False
isUseAgent = True
if isWindowsXP:
isUseAgent = False

View File

@ -111,20 +111,9 @@ def check_dependencies():
if (host_platform == 'windows'):
checksResult.append(check_nodejs())
print('\n=== Database Check ===')
sql_type = config.option("sql-type")
print('SQL type: ' + sql_type)
print('Host platform: ' + host_platform)
print('DB host: ' + config.option("db-host"))
print('DB port: ' + config.option("db-port"))
print('DB name: ' + config.option("db-name"))
print('DB user: ' + config.option("db-user"))
if (sql_type == 'mysql' and host_platform == 'windows'):
print('\nCalling check_mysqlServer()...')
if (config.option("sql-type") == 'mysql' and host_platform == 'windows'):
checksResult.append(check_mysqlServer())
else:
print('\nCalling check_postgreSQL()...')
checksResult.append(check_postgreSQL())
server_addons = []
@ -311,88 +300,9 @@ def check_rabbitmq():
print('RabbitMQ is installed')
return dependence
elif (host_platform == 'linux'):
# Try service command first
command_result = base.run_command('service rabbitmq-server status')
result = command_result['stdout']
# Log command results
print('Checking RabbitMQ with service command...')
print('Command: service rabbitmq-server status')
print('stdout: ' + (result if result else '[EMPTY]'))
if command_result['stderr']:
print('stderr: ' + command_result['stderr'])
print('Return code: ' + str(command_result['returncode']))
# If service command failed or returned empty, try systemctl
if (result == '' or command_result['returncode'] != 0):
print('\nTrying systemctl command...')
systemctl_result = base.run_command('systemctl status rabbitmq-server')
print('Command: systemctl status rabbitmq-server')
print('stdout: ' + (systemctl_result['stdout'] if systemctl_result['stdout'] else '[EMPTY]'))
if systemctl_result['stderr']:
print('stderr: ' + systemctl_result['stderr'])
print('Return code: ' + str(systemctl_result['returncode']))
# Update result if systemctl worked
if systemctl_result['stdout']:
result = systemctl_result['stdout']
command_result = systemctl_result
# If still no result, try direct process check
if (result == ''):
print('\nTrying direct process check...')
ps_result = base.run_command('ps aux | grep -i rabbitmq | grep -v grep')
print('Command: ps aux | grep -i rabbitmq | grep -v grep')
print('stdout: ' + (ps_result['stdout'] if ps_result['stdout'] else '[EMPTY]'))
print('Return code: ' + str(ps_result['returncode']))
# Check if rabbitmq process is running
if ps_result['stdout']:
result = ps_result['stdout']
print('RabbitMQ process found: ' + result[:100] + '...' if len(result) > 100 else result)
# Additional diagnostic checks
if (result == ''):
print('\nPerforming additional diagnostic checks...')
# Check current user
whoami_result = base.run_command('whoami')
print('Current user: ' + whoami_result['stdout'])
# Check for RabbitMQ binaries
which_result = base.run_command('which rabbitmqctl')
if which_result['stdout']:
print('RabbitMQ binary found at: ' + which_result['stdout'])
# Try rabbitmqctl status
rabbitmqctl_result = base.run_command('rabbitmqctl status')
print('\nTrying rabbitmqctl status...')
print('stdout: ' + (rabbitmqctl_result['stdout'][:200] + '...' if len(rabbitmqctl_result['stdout']) > 200 else rabbitmqctl_result['stdout']))
if rabbitmqctl_result['stderr']:
print('stderr: ' + rabbitmqctl_result['stderr'])
else:
print('RabbitMQ binary (rabbitmqctl) not found in PATH')
# Check for permission issues
if (command_result['returncode'] == 126):
print('\nPermission denied error (code 126).')
print('You may need to run this script with elevated privileges (sudo).')
elif (command_result['returncode'] == 127):
print('\nCommand not found error (code 127).')
print('The service command may not be available or RabbitMQ may not be installed.')
elif (command_result['returncode'] == 1):
print('\nService command failed (code 1).')
print('This could mean RabbitMQ service is not installed or not running.')
# Check common RabbitMQ installation paths
print('\nChecking common RabbitMQ paths...')
common_paths = ['/usr/lib/rabbitmq', '/opt/rabbitmq', '/etc/rabbitmq', '/var/lib/rabbitmq']
for path in common_paths:
if base.is_dir(path):
print('Found RabbitMQ directory: ' + path)
result = base.run_command('service rabbitmq-server status')['stdout']
if (result != ''):
print('\nInstalled RabbitMQ is valid')
print('Installed RabbitMQ is valid')
return dependence
print('RabbitMQ not found')
@ -602,61 +512,34 @@ def check_mysqlServer():
base.print_info('Check MySQL Server')
dependence = CDependencies()
mysqlLoginSrt = get_mysqlLoginString()
print('MySQL login string: ' + mysqlLoginSrt)
connectionString = mysqlLoginSrt + ' -e "SHOW GLOBAL VARIABLES LIKE ' + r"'PORT';" + '"'
print('Connection string: ' + connectionString)
if (host_platform != 'windows'):
print('\nTesting MySQL connection...')
result = os.system(mysqlLoginSrt + ' -e "exit"')
print('Connection test result code: ' + str(result))
if (result == 0):
connectionResult = base.run_command(connectionString)
print('Port check stdout: ' + connectionResult['stdout'])
if connectionResult['stderr']:
print('Port check stderr: ' + connectionResult['stderr'])
expected_port = config.option("db-port")
print('Expected port: ' + expected_port)
if (connectionResult['stdout'].find('port') != -1 and connectionResult['stdout'].find(expected_port) != -1):
connectionResult = base.run_command(connectionString)['stdout']
if (connectionResult.find('port') != -1 and connectionResult.find(config.option("db-port")) != -1):
print('MySQL configuration is valid')
dependence.sqlPath = 'mysql'
return dependence
else:
print('Port not found or does not match. Found: ' + connectionResult['stdout'])
else:
print('MySQL connection failed with code: ' + str(result))
print('Valid MySQL Server not found')
dependence.append_install('MySQLServer')
dependence.append_uninstall('mysql-server')
return dependence
arrInfo = get_mysqlServersInfo()
print('\nFound MySQL installations: ' + str(len(arrInfo)))
for info in arrInfo:
print('\nChecking MySQL at: ' + info['Location'])
if (base.is_dir(info['Location']) == False):
print('Directory does not exist, skipping...')
continue
mysql_full_name = 'MySQL Server ' + info['Version'] + ' '
mysql_bin_path = get_mysql_path_to_bin(info['Location'])
print('MySQL bin path: ' + mysql_bin_path)
connectionResult = base.run_command_in_dir(mysql_bin_path, connectionString)
print('Connection result stdout: ' + connectionResult['stdout'])
if connectionResult['stderr']:
print('Connection result stderr: ' + connectionResult['stderr'])
print('Return code: ' + str(connectionResult['returncode']))
expected_port = config.option("db-port")
if (connectionResult['stdout'].find('port') != -1 and connectionResult['stdout'].find(expected_port) != -1):
connectionResult = base.run_command_in_dir(get_mysql_path_to_bin(info['Location']), connectionString)['stdout']
if (connectionResult.find('port') != -1 and connectionResult.find(config.option("db-port")) != -1):
print(mysql_full_name + 'configuration is valid')
dependence.sqlPath = info['Location']
return dependence
print(mysql_full_name + 'configuration is not valid. Expected port: ' + expected_port)
print(mysql_full_name + 'configuration is not valid:' + connectionResult)
# if path exists, then further removal and installation fails(according to startup statistics). it is better to fix issue manually.
return dependence
@ -749,9 +632,8 @@ def get_postrgre_path_to_bin(postgrePath = ''):
return postgrePath
def get_postgreLoginSrting(userName):
if (host_platform == 'windows'):
# Note: PGPASSWORD should be set as environment variable on Windows
return 'psql -U ' + userName + ' -h localhost '
return 'PGPASSWORD="' + config.option("db-pass") + '" psql -U ' + userName + ' -h localhost '
return 'psql -U' + userName + ' '
return 'PGPASSWORD="' + config.option("db-pass") + '" psql -U' + userName + ' -hlocalhost '
def get_postgreSQLInfoByFlag(flag):
arrInfo = []
@ -781,25 +663,13 @@ def check_postgreSQL():
dependence = CDependencies()
postgreLoginSrt = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
print('PostgreSQL login string: ' + postgreLoginSrt)
connectionString = postgreLoginSrt + ' -c "SELECT setting FROM pg_settings WHERE name = ' + "'port'" + ';"'
print('Connection string: ' + connectionString)
if (host_platform == 'linux'):
print('\nTesting PostgreSQL connection...')
result = os.system(postgreLoginSrt + ' -c "\q"')
print('Connection test result code: ' + str(result))
connectionResult = base.run_command(connectionString)
print('Port check stdout: ' + connectionResult['stdout'])
if connectionResult['stderr']:
print('Port check stderr: ' + connectionResult['stderr'])
print('Port check return code: ' + str(connectionResult['returncode']))
expected_port = config.option("db-port")
print('Expected port: ' + expected_port)
connectionResult = base.run_command(connectionString)['stdout']
if (result != 0 or connectionResult['stdout'].find(expected_port) == -1):
if (result != 0 or connectionResult.find(config.option("db-port")) == -1):
print('Valid PostgreSQL not found!')
dependence.append_install('PostgreSQL')
dependence.append_uninstall('PostgreSQL')
@ -809,33 +679,19 @@ def check_postgreSQL():
return dependence
arrInfo = get_postgreSQLInfo()
print('\nFound PostgreSQL installations: ' + str(len(arrInfo)))
db_pass = config.option("db-pass")
print('Setting PGPASSWORD environment variable')
base.set_env('PGPASSWORD', db_pass)
base.set_env('PGPASSWORD', config.option("db-pass"))
for info in arrInfo:
print('\nChecking PostgreSQL at: ' + info['Location'])
if (base.is_dir(info['Location']) == False):
print('Directory does not exist, skipping...')
continue
postgre_full_name = 'PostgreSQL ' + info['Version'][:2] + ' '
postgre_bin_path = get_postrgre_path_to_bin(info['Location'])
print('PostgreSQL bin path: ' + postgre_bin_path)
connectionResult = base.run_command_in_dir(postgre_bin_path, connectionString)
print('Connection result stdout: ' + connectionResult['stdout'])
if connectionResult['stderr']:
print('Connection result stderr: ' + connectionResult['stderr'])
print('Return code: ' + str(connectionResult['returncode']))
expected_port = config.option("db-port")
if (connectionResult['stdout'].find(expected_port) != -1):
connectionResult = base.run_command_in_dir(get_postrgre_path_to_bin(info['Location']), connectionString)['stdout']
if (connectionResult.find(config.option("db-port")) != -1):
print(postgre_full_name + 'configuration is valid')
dependence.sqlPath = info['Location']
return dependence
print(postgre_full_name + 'configuration is not valid. Expected port: ' + expected_port)
print(postgre_full_name + 'configuration is not valid')
print('Valid PostgreSQL not found')
@ -848,196 +704,61 @@ def check_postgreSQL():
return dependence
def check_postgreConfig(postgrePath = ''):
result = True
base.print_info('Checking PostgreSQL configuration')
if (host_platform == 'windows'):
print('Setting PGPASSWORD for Windows')
base.set_env('PGPASSWORD', config.option("db-pass"))
rootUser = install_params['PostgreSQL']['root']
dbUser = config.option("db-user")
dbName = config.option("db-name")
dbPass = config.option("db-pass")
print('Configuration:')
print(' Root user: ' + rootUser)
print(' DB user: ' + dbUser)
print(' DB name: ' + dbName)
print(' PostgreSQL path: ' + postgrePath)
postgre_path_to_bin = get_postrgre_path_to_bin(postgrePath)
print(' Bin path: ' + postgre_path_to_bin)
postgreLoginRoot = get_postgreLoginSrting(rootUser)
postgreLoginDbUser = get_postgreLoginSrting(dbUser)
print(' Root login string: ' + postgreLoginRoot)
print(' User login string: ' + postgreLoginDbUser)
creatdb_path = base.get_script_dir() + "/../../server/schema/postgresql/createdb.sql"
print(' CreateDB script path: ' + creatdb_path)
if base.is_file(creatdb_path):
print(' CreateDB script exists: YES')
else:
print(' CreateDB script exists: NO - THIS IS A PROBLEM!')
print('\nChecking if user exists...')
check_user_cmd = postgreLoginRoot + ' -c "\du ' + dbUser + '"'
user_check_result = base.run_command_in_dir(postgre_path_to_bin, check_user_cmd)
print('User check command: ' + check_user_cmd)
print('User check stdout: ' + user_check_result['stdout'])
if user_check_result['stderr']:
print('User check stderr: ' + user_check_result['stderr'])
if (user_check_result['stdout'].find(dbUser) != -1):
print('User ' + dbUser + ' exists')
print('\nTesting user password...')
password_test_result = os.system(postgreLoginDbUser + '-c "\q"')
print('Password test result code: ' + str(password_test_result))
if (password_test_result != 0):
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + ' -c "\du ' + dbUser + '"')['stdout'].find(dbUser) != -1):
print('User ' + dbUser + ' is exist')
if (os.system(postgreLoginDbUser + '-c "\q"') != 0):
print('Invalid user password!')
base.print_info('Changing password...')
result = change_userPass(dbUser, dbPass, postgre_path_to_bin) and result
print('Password change result: ' + str(result))
else:
print('User ' + dbUser + ' not exist!')
base.print_info('Creating ' + dbName + ' user...')
result = create_postgreUser(dbUser, dbPass, postgre_path_to_bin) and result
print('\nChecking if database exists...')
db_check_cmd = postgreLoginRoot + ' -c "SELECT datname FROM pg_database;"'
db_check_result = base.run_command_in_dir(postgre_path_to_bin, db_check_cmd)
print('Database check command: ' + db_check_cmd)
print('Database check stdout: ' + db_check_result['stdout'])
if db_check_result['stderr']:
print('Database check stderr: ' + db_check_result['stderr'])
if (db_check_result['stdout'].find(config.option("db-name")) == -1):
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + ' -c "SELECT datname FROM pg_database;"')['stdout'].find(config.option("db-name")) == -1):
print('Database ' + dbName + ' not found')
base.print_info('Creating ' + dbName + ' database...')
create_result = create_postgreDb(dbName, postgre_path_to_bin)
print('Database creation result: ' + str(create_result))
if create_result:
# Give user rights to database and schema
print('\nGranting database privileges to user ' + dbUser + '...')
db_grant_cmd = postgreLoginRoot + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + dbUser + ';"'
db_grant_result = base.run_command_in_dir(postgre_path_to_bin, db_grant_cmd)
print('Database grant result: ' + str(db_grant_result['returncode']))
print('Granting schema privileges to user ' + dbUser + '...')
schema_cmd = postgreLoginRoot + '-d ' + dbName + ' -c "GRANT ALL ON SCHEMA public TO ' + dbUser + ';"'
schema_result = base.run_command_in_dir(postgre_path_to_bin, schema_cmd)
print('Schema grant result: ' + str(schema_result['returncode']))
print('\nConfiguring database with createdb.sql...')
configure_result = configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
print('Database configuration result: ' + str(configure_result))
result = create_result and configure_result
else:
result = False
result = create_postgreDb(dbName, postgre_path_to_bin) and configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
else:
print('Database ' + dbName + ' exists')
# Simple check: if 0 tables, configure database
print('Checking tables in database...')
table_count_result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "SELECT count(*) FROM information_schema.tables WHERE table_schema = \'public\';"')
print('Table count result: ' + table_count_result['stdout'].strip())
if table_count_result['stdout'].find(' 0') != -1:
print('Database ' + dbName + ' has no tables - configuring...')
else:
print('Database ' + dbName + ' has tables - checking ownership...')
# Check if tables belong to postgres instead of onlyoffice user
owner_check = base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-d ' + dbName + ' -c "\dt"')
if owner_check['stdout'].find('postgres') != -1 and owner_check['stdout'].find(dbUser) == -1:
print('Tables belong to postgres, not ' + dbUser + ' - need to recreate')
print('Dropping existing tables...')
drop_result = base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-d ' + dbName + ' -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"')
print('Schema recreation result: ' + str(drop_result['returncode']))
print('Will proceed to recreate tables with correct owner...')
else:
print('Database ' + dbUser + ' already has correct tables - skipping configuration')
return result
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "SELECT pg_size_pretty(pg_database_size(' + "'" + dbName + "'" + '));"')['stdout'].find('7559 kB') != -1):
print('Database ' + dbName + ' not configured')
base.print_info('Configuring ' + dbName + ' database...')
result = configureDb(dbName, creatdb_path, postgre_path_to_bin) and result
print('Database ' + dbName + ' is valid')
# Configure database (either empty or after recreation)
print('Granting database privileges to user ' + dbUser + '...')
db_grant_cmd = postgreLoginRoot + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + dbUser + ';"'
db_grant_result = base.run_command_in_dir(postgre_path_to_bin, db_grant_cmd)
print('Database grant result: ' + str(db_grant_result['returncode']))
print('Granting schema privileges to user ' + dbUser + '...')
schema_cmd = postgreLoginRoot + '-d ' + dbName + ' -c "GRANT ALL ON SCHEMA public TO ' + dbUser + ';"'
schema_result = base.run_command_in_dir(postgre_path_to_bin, schema_cmd)
print('Schema grant result: ' + str(schema_result['returncode']))
base.print_info('Configuring ' + dbName + ' database...')
configure_result = configureDb(dbUser, dbName, creatdb_path, postgre_path_to_bin)
print('Configuration completed: ' + ('SUCCESS' if configure_result else 'FAILED'))
result = configure_result and result
if (base.run_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "\l+ ' + dbName + '"')['stdout'].find(dbUser +'=CTc/' + rootUser) == -1):
print('User ' + dbUser + ' has no database privileges!')
base.print_info('Setting database privileges for user ' + dbUser + '...')
result = set_dbPrivilegesForUser(dbUser, dbName, postgre_path_to_bin) and result
print('User ' + dbUser + ' has database privileges')
# User privileges are set above when configuring database
print('\n=== PostgreSQL Configuration Summary ===')
print('Database: ' + dbName + ' - ' + ('READY' if result else 'FAILED'))
print('User: ' + dbUser + ' - configured')
return result
def create_postgreDb(dbName, postgre_path_to_bin = ''):
print('\nCreating database: ' + dbName)
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
create_cmd = postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"'
print('Create database command: ' + create_cmd)
result = base.run_command_in_dir(postgre_path_to_bin, create_cmd)
print('Create database return code: ' + str(result['returncode']))
if result['stdout']:
print('Create database stdout: ' + result['stdout'])
if result['stderr']:
print('Create database stderr: ' + result['stderr'])
if (result['returncode'] != 0):
print('Database creation FAILED!')
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "CREATE DATABASE ' + dbName +';"') != 0):
return False
print('Database created successfully')
return True
def set_dbPrivilegesForUser(userName, dbName, postgre_path_to_bin = ''):
print('\nSetting database privileges for user: ' + userName)
postgreLoginUser = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
grant_cmd = postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"'
print('Grant command: ' + grant_cmd)
result = base.run_command_in_dir(postgre_path_to_bin, grant_cmd)
print('Grant return code: ' + str(result['returncode']))
if result['stdout']:
print('Grant stdout: ' + result['stdout'])
if result['stderr']:
print('Grant stderr: ' + result['stderr'])
if (result['returncode'] != 0):
print('Grant privileges FAILED!')
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginUser + '-c "GRANT ALL privileges ON DATABASE ' + dbName + ' TO ' + userName + ';"') != 0):
return False
print('Privileges granted successfully')
return True
def create_postgreUser(userName, userPass, postgre_path_to_bin = ''):
print('\nCreating user: ' + userName)
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
create_cmd = postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"'
print('Create user command: ' + create_cmd[:50] + '... [password hidden]')
result = base.run_command_in_dir(postgre_path_to_bin, create_cmd)
print('Create user return code: ' + str(result['returncode']))
if result['stdout']:
print('Create user stdout: ' + result['stdout'])
if result['stderr']:
print('Create user stderr: ' + result['stderr'])
if (result['returncode'] != 0):
print('User creation FAILED!')
if (base.exec_command_in_dir(postgre_path_to_bin, postgreLoginRoot + '-c "CREATE USER ' + userName + ' WITH password ' + "'" + userPass + "'" + ';"') != 0):
return False
print('User created successfully')
return True
def change_userPass(userName, userPass, postgre_path_to_bin = ''):
postgreLoginRoot = get_postgreLoginSrting(install_params['PostgreSQL']['root'])
@ -1045,68 +766,14 @@ def change_userPass(userName, userPass, postgre_path_to_bin = ''):
return False
return True
def configureDb(userName, dbName, scriptPath, postgre_path_to_bin = ''):
print('\n=== Configuring Database ===')
print('Script path: ' + scriptPath)
print('User: ' + userName)
print('Database: ' + dbName)
print('Bin path: ' + postgre_path_to_bin)
# Check if script exists
if not base.is_file(scriptPath):
print('ERROR: Script file does not exist: ' + scriptPath)
return False
print('Script file size: ' + str(os.path.getsize(scriptPath)) + ' bytes')
print('Execution ' + scriptPath)
postgreLoginSrt = get_postgreLoginSrting(userName)
print('Login string: ' + postgreLoginSrt)
full_command = postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"'
print('Full command: ' + full_command)
print('\nExecuting createdb.sql script...')
# Use run_command_in_dir instead of exec_command_in_dir to capture output
result = base.run_command_in_dir(postgre_path_to_bin, full_command)
code = result['returncode']
print('Execution return code: ' + str(code))
if result['stdout']:
print('Script output:\n' + result['stdout'])
if result['stderr']:
print('Script errors:\n' + result['stderr'])
code = base.exec_command_in_dir(postgre_path_to_bin, postgreLoginSrt + ' -d ' + dbName + ' -f "' + scriptPath + '"')
if (code != 0):
print('Execution FAILED! Return code: ' + str(code))
# Try to get more info about the failure
print('\nTrying to connect and check database...')
test_cmd = postgreLoginSrt + ' -d ' + dbName + ' -c "SELECT version();"'
test_result = base.run_command_in_dir(postgre_path_to_bin, test_cmd)
print('Connection test stdout: ' + test_result['stdout'])
if test_result['stderr']:
print('Connection test stderr: ' + test_result['stderr'])
print('Execution failed!')
return False
print('Execution completed successfully!')
# Verify tables were created
print('\nVerifying table creation...')
verify_cmd = postgreLoginSrt + ' -d ' + dbName + ' -c "\dt;"'
verify_result = base.run_command_in_dir(postgre_path_to_bin, verify_cmd)
# Count lines with table names (skip header)
table_lines = [line for line in verify_result['stdout'].split('\n') if '|' in line and 'table' in line.lower()]
table_count = len(table_lines)
if table_count > 0:
print('SUCCESS: Created ' + str(table_count) + ' tables')
print('Database is ready for use!')
else:
print('WARNING: No tables found after script execution')
print(verify_result['stdout'])
print('Execution completed')
return True
def uninstall_postgresql():
code = os.system('sudo DEBIAN_FRONTEND=noninteractive apt-get purge --auto-remove postgresql* -y')

View File

@ -4,6 +4,7 @@
import package_utils as utils
import package_common as common
import package_branding as branding
import urllib.request
def make():
utils.log_h1("BUILDER")
@ -178,6 +179,16 @@ def make_wheel():
old_cwd = utils.get_cwd()
utils.set_cwd("python/docbuilder")
# Download builder long-description
description_url = "https://raw.githubusercontent.com/ONLYOFFICE/DocumentBuilder/master/README.md"
description_path = "../README.md"
try:
utils.log("Downloading DocumentBuilder README.md from GitHub...")
urllib.request.urlretrieve(description_url, description_path)
utils.log("README.md downloaded successfully")
except Exception as e:
utils.log(f"Failed to download README.md: {e}")
if not utils.is_file("docbuilder.py"):
utils.copy_file("lib/docbuilder.py", "docbuilder.py")
# fix docbuilder.py

View File

@ -3,14 +3,14 @@
platformPrefixes = {
"windows_x64": "win_64",
"windows_x86": "win_32",
"windows_arm64": "win_arm64",
"windows_x64_xp": "win_64_xp",
"windows_x86_xp": "win_32_xp",
"darwin_x86_64": "mac_64",
"darwin_arm64": "mac_arm64",
"darwin_x86_64": "mac_64",
"darwin_x86_64_v8": "mac_64",
"linux_x86_64": "linux_64",
"linux_aarch64": "linux_arm64",
"linux_x86_64_cef": "linux_64",
}
out_dir = "build_tools/out"

View File

@ -44,7 +44,8 @@ def make_windows():
"windows_x64": "x64",
"windows_x64_xp": "x64",
"windows_x86": "x86",
"windows_x86_xp": "x86"
"windows_x86_xp": "x86",
"windows_arm64": "arm64"
}[common.platform]
xp = common.platform.endswith("_xp")
@ -61,20 +62,23 @@ def make_windows():
if not xp:
make_prepare()
make_zip()
make_inno()
if branding.onlyoffice:
make_inno()
make_inno("standalone")
make_inno("update")
make_advinst()
make_advinst()
make_prepare("commercial")
make_zip("commercial")
make_inno("commercial")
make_advinst("commercial")
make_prepare("commercial")
make_zip("commercial")
make_inno("commercial")
make_advinst("commercial")
else:
make_prepare("xp")
make_zip("xp")
make_inno("xp")
# Disable build online installer
# if common.platform == "windows_x86_xp":
# make_online()
utils.set_cwd(common.workspace_dir)
return
@ -83,7 +87,8 @@ def make_prepare(edition = "opensource"):
args = [
"-Version", package_version,
"-Arch", arch,
"-Target", edition
"-Target", edition,
"-CompanyName", branding.company_name
]
if common.sign:
args += ["-Sign"]
@ -101,7 +106,8 @@ def make_zip(edition = "opensource"):
args = [
"-Version", package_version,
"-Arch", arch,
"-Target", edition
"-Target", edition,
"-CompanyName", branding.company_name
]
# if common.sign:
# args += ["-Sign"]
@ -166,6 +172,18 @@ def make_advinst(edition = "opensource"):
utils.set_summary("desktop advinst " + edition + " deploy", ret)
return
def make_online():
online_file = utils.glob_file("OnlineInstaller-" + package_version + "*.exe")
utils.log_h2("desktop online installer build")
ret = utils.is_file(online_file)
utils.set_summary("desktop online installer build", ret)
if common.deploy and ret:
utils.log_h2("desktop online installer deploy")
ret = s3_upload([online_file], "desktop/win/online/")
utils.set_summary("desktop online installer deploy", ret)
return
#
# macOS
#