diff --git a/Makefile.am_server b/Makefile.am_server index 9f08d707..c83bb46f 100644 --- a/Makefile.am_server +++ b/Makefile.am_server @@ -8,7 +8,7 @@ urbackupsrv_SOURCES += urbackupcommon/os_functions_lin.cpp urbackupcommon/sha2/s urbackupsrv_SOURCES += httpserver/dllmain.cpp httpserver/IndexFiles.cpp httpserver/HTTPAction.cpp httpserver/HTTPFile.cpp httpserver/HTTPService.cpp httpserver/HTTPClient.cpp httpserver/HTTPProxy.cpp httpserver/MIMEType.cpp -urbackupsrv_SOURCES += urbackupserver/dllmain.cpp urbackupserver/server.cpp urbackupserver/ClientMain.cpp urbackupserver/server_hash.cpp urbackupserver/server_prepare_hash.cpp urbackupserver/server_update.cpp urbackupserver/server_status.cpp urbackupserver/server_channel.cpp urbackupserver/server_ping.cpp urbackupserver/server_log.cpp urbackupserver/server_writer.cpp urbackupserver/server_running.cpp urbackupserver/server_cleanup.cpp urbackupserver/server_settings.cpp urbackupserver/server_update_stats.cpp urbackupserver/serverinterface/helper.cpp urbackupserver/serverinterface/lastacts.cpp urbackupserver/serverinterface/login.cpp urbackupserver/serverinterface/progress.cpp urbackupserver/serverinterface/salt.cpp urbackupserver/serverinterface/users.cpp urbackupserver/serverinterface/piegraph.cpp urbackupserver/serverinterface/usage.cpp urbackupserver/serverinterface/usagegraph.cpp urbackupserver/serverinterface/status.cpp urbackupserver/serverinterface/settings.cpp urbackupserver/serverinterface/backups.cpp urbackupserver/serverinterface/logs.cpp urbackupserver/serverinterface/getimage.cpp urbackupserver/serverinterface/download_client.cpp urbackupserver/treediff/TreeDiff.cpp urbackupserver/treediff/TreeNode.cpp urbackupserver/treediff/TreeReader.cpp urbackupserver/ChunkPatcher.cpp urbackupserver/InternetServiceConnector.cpp urbackupserver/server_archive.cpp urbackupserver/filedownload.cpp urbackupserver/serverinterface/shutdown.cpp urbackupserver/snapshot_helper.cpp urbackupserver/verify_hashes.cpp urbackupserver/apps/cleanup_cmd.cpp urbackupserver/apps/repair_cmd.cpp urbackupserver/apps/md5sum_check.cpp urbackupserver/apps/patch.cpp urbackupserver/dao/ServerCleanupDao.cpp urbackupserver/lmdb/mdb.c urbackupserver/lmdb/midl.c urbackupserver/LMDBFileIndex.cpp urbackupserver/FileIndex.cpp urbackupserver/create_files_index.cpp urbackupserver/serverinterface/livelog.cpp urbackupserver/serverinterface/start_backup.cpp urbackupserver/serverinterface/create_zip.cpp urbackupserver/server_dir_links.cpp urbackupserver/dao/ServerBackupDao.cpp urbackupserver/apps/export_auth_log.cpp urbackupserver/apps/check_files_index.cpp urbackupserver/ServerDownloadThread.cpp urbackupserver/Backup.cpp urbackupserver/ImageBackup.cpp urbackupserver/FileBackup.cpp urbackupserver/IncrFileBackup.cpp urbackupserver/FullFileBackup.cpp urbackupserver/ContinuousBackup.cpp urbackupserver/ThrottleUpdater.cpp urbackupserver/FileMetadataDownloadThread.cpp urbackupserver/restore_client.cpp urbackupcommon/WalCheckpointThread.cpp urbackupserver/apps/skiphash_copy.cpp urbackupserver/cmdline_preprocessor.cpp urbackupserver/dao/ServerFilesDao.cpp urbackupserver/dao/ServerLinkDao.cpp urbackupserver/dao/ServerLinkJournalDao.cpp urbackupserver/serverinterface/add_client.cpp urbackupserver/serverinterface/restore_prepare_wait.cpp urbackupserver/copy_storage.cpp urbackupserver/ImageMount.cpp urbackupserver/DataplanDb.cpp urbackupserver/PhashLoad.cpp urbackupserver/serverinterface/scripts.cpp urbackupserver/Alerts.cpp urbackupserver/Mailer.cpp +urbackupsrv_SOURCES += urbackupserver/dllmain.cpp urbackupserver/server.cpp urbackupserver/ClientMain.cpp urbackupserver/server_hash.cpp urbackupserver/server_prepare_hash.cpp urbackupserver/server_update.cpp urbackupserver/server_status.cpp urbackupserver/server_channel.cpp urbackupserver/server_ping.cpp urbackupserver/server_log.cpp urbackupserver/server_writer.cpp urbackupserver/server_running.cpp urbackupserver/server_cleanup.cpp urbackupserver/server_settings.cpp urbackupserver/server_update_stats.cpp urbackupserver/serverinterface/helper.cpp urbackupserver/serverinterface/lastacts.cpp urbackupserver/serverinterface/login.cpp urbackupserver/serverinterface/progress.cpp urbackupserver/serverinterface/salt.cpp urbackupserver/serverinterface/users.cpp urbackupserver/serverinterface/piegraph.cpp urbackupserver/serverinterface/usage.cpp urbackupserver/serverinterface/usagegraph.cpp urbackupserver/serverinterface/status.cpp urbackupserver/serverinterface/settings.cpp urbackupserver/serverinterface/backups.cpp urbackupserver/serverinterface/logs.cpp urbackupserver/serverinterface/getimage.cpp urbackupserver/serverinterface/download_client.cpp urbackupserver/treediff/TreeDiff.cpp urbackupserver/treediff/TreeNode.cpp urbackupserver/treediff/TreeReader.cpp urbackupserver/ChunkPatcher.cpp urbackupserver/InternetServiceConnector.cpp urbackupserver/server_archive.cpp urbackupserver/filedownload.cpp urbackupserver/serverinterface/shutdown.cpp urbackupserver/snapshot_helper.cpp urbackupserver/verify_hashes.cpp urbackupserver/apps/cleanup_cmd.cpp urbackupserver/apps/repair_cmd.cpp urbackupserver/apps/md5sum_check.cpp urbackupserver/apps/patch.cpp urbackupserver/dao/ServerCleanupDao.cpp urbackupserver/lmdb/mdb.c urbackupserver/lmdb/midl.c urbackupserver/LMDBFileIndex.cpp urbackupserver/FileIndex.cpp urbackupserver/create_files_index.cpp urbackupserver/serverinterface/livelog.cpp urbackupserver/serverinterface/start_backup.cpp urbackupserver/serverinterface/create_zip.cpp urbackupserver/server_dir_links.cpp urbackupserver/dao/ServerBackupDao.cpp urbackupserver/apps/export_auth_log.cpp urbackupserver/apps/check_files_index.cpp urbackupserver/ServerDownloadThread.cpp urbackupserver/Backup.cpp urbackupserver/ImageBackup.cpp urbackupserver/FileBackup.cpp urbackupserver/IncrFileBackup.cpp urbackupserver/FullFileBackup.cpp urbackupserver/ContinuousBackup.cpp urbackupserver/ThrottleUpdater.cpp urbackupserver/FileMetadataDownloadThread.cpp urbackupserver/restore_client.cpp urbackupcommon/WalCheckpointThread.cpp urbackupserver/apps/skiphash_copy.cpp urbackupserver/cmdline_preprocessor.cpp urbackupserver/dao/ServerFilesDao.cpp urbackupserver/dao/ServerLinkDao.cpp urbackupserver/dao/ServerLinkJournalDao.cpp urbackupserver/serverinterface/add_client.cpp urbackupserver/serverinterface/restore_prepare_wait.cpp urbackupserver/copy_storage.cpp urbackupserver/ImageMount.cpp urbackupserver/DataplanDb.cpp urbackupserver/PhashLoad.cpp urbackupserver/serverinterface/scripts.cpp urbackupserver/Alerts.cpp urbackupserver/Mailer.cpp urbackupserver/LogReport.cpp urbackupsrv_SOURCES += fileservplugin/dllmain.cpp fileservplugin/bufmgr.cpp fileservplugin/CClientThread.cpp fileservplugin/CriticalSection.cpp fileservplugin/CTCPFileServ.cpp fileservplugin/CUDPThread.cpp fileservplugin/FileServ.cpp fileservplugin/FileServFactory.cpp fileservplugin/log.cpp fileservplugin/main.cpp fileservplugin/map_buffer.cpp fileservplugin/pluginmgr.cpp fileservplugin/ChunkSendThread.cpp fileservplugin/PipeFile.cpp fileservplugin/PipeSessions.cpp fileservplugin/PipeFileUnix.cpp fileservplugin/PipeFileBase.cpp fileservplugin/FileMetadataPipe.cpp fileservplugin/PipeFileTar.cpp fileservplugin/PipeFileExt.cpp @@ -192,6 +192,6 @@ endif luaplugin_headers = luaplugin/ILuaInterpreter.h luaplugin/LuaInterpreter.h luaplugin/pluginmgr.h luaplugin/src/* -noinst_HEADERS=SessionMgr.h WorkerThread.h Helper_win32.h Database.h defaults.h ServiceAcceptor.h Query.h SettingsReader.h file.h file_memory.h MemorySettingsReader.h Condition_lin.h LookupService.h Template.h types.h DBSettingsReader.h stringtools.h ThreadPool.h libs.h vld_.h ServiceWorker.h StreamPipe.h LoadbalancerClient.h socket_header.h FileSettingsReader.h SelectThread.h md5.h vld.h Table.h Client.h MemoryPipe.h Mutex_lin.h AcceptThread.h OutputStream.h Server.h Interface/SessionMgr.h Interface/Service.h Interface/PluginMgr.h Interface/Database.h Interface/Pipe.h Interface/CustomClient.h Interface/User.h Interface/Query.h Interface/SettingsReader.h Interface/Types.h Interface/Template.h Interface/ThreadPool.h Interface/Mutex.h Interface/File.h Interface/Condition.h Interface/Table.h Interface/Plugin.h Interface/Thread.h Interface/Action.h Interface/Object.h Interface/OutputStream.h Interface/Server.h libfastcgi/fastcgi.hpp sqlite/sqlite3.h sqlite/sqlite3ext.h utf8/utf8.h utf8/utf8/checked.h utf8/utf8/core.h utf8/utf8/unchecked.h cryptoplugin/ICryptoFactory.h cryptoplugin/IAESEncryption.h cryptoplugin/IAESDecryption.h Interface/DatabaseFactory.h Interface/DatabaseInt.h SQLiteFactory.h sqlite/shell.h PipeThrottler.h Interface/PipeThrottler.h mt19937ar.h DatabaseCursor.h Interface/DatabaseCursor.h Interface/SharedMutex.h SharedMutex_lin.h httpserver/HTTPAction.h httpserver/HTTPClient.h httpserver/HTTPFile.h httpserver/HTTPProxy.h httpserver/HTTPService.h httpserver/IndexFiles.h httpserver/MIMEType.h urbackupserver/server_ping.h urbackupserver/server_cleanup.h urbackupcommon/os_functions.h urbackupcommon/json.h urbackupserver/serverinterface/helper.h urbackupserver/serverinterface/action_header.h urbackupserver/serverinterface/actions.h urbackupserver/server_writer.h urbackupcommon/settings.h urbackupserver/server_settings.h urbackupserver/zero_hash.h urbackupserver/server_update.h urbackupserver/server_log.h urbackupserver/server_hash.h urbackupserver/server_status.h urbackupcommon/bufmgr.h urbackupserver/server_update_stats.h urbackupcommon/sha2/sha2.h urbackupcommon/fileclient/FileClient.h common/data.h urbackupcommon/fileclient/socket_header.h urbackupcommon/fileclient/tcpstack.h urbackupcommon/fileclient/packet_ids.h urbackupserver/database.h urbackupserver/mbr_code.h urbackupserver/action_header.h urbackupcommon/escape.h urbackupserver/server.h urbackupserver/server_running.h urbackupserver/server_prepare_hash.h urbackupserver/actions.h urbackupserver/server_channel.h urbackupserver/ClientMain.h urbackupserver/treediff/TreeDiff.h urbackupserver/treediff/TreeNode.h urbackupserver/treediff/TreeReader.h fileservplugin/IFileServFactory.h fileservplugin/IFileServ.h urlplugin/IUrlFactory.h urbackupcommon/capa_bits.h cryptoplugin/ICryptoFactory.h urbackupcommon/fileclient/FileClientChunked.h urbackupserver/ChunkPatcher.h urbackupcommon/CompressedPipe.h urbackupcommon/InternetServicePipe.h urbackupcommon/InternetServicePipe2.h urbackupcommon/InternetServiceIDs.h urbackupserver/InternetServiceConnector.h md5.h urbackupcommon/settingslist.h urbackupserver/server_archive.h cryptoplugin/IZlibCompression.h cryptoplugin/IZlibDecompression.h cryptoplugin/ICryptoFactory.h cryptoplugin/IAESEncryption.h cryptoplugin/IAESDecryption.h fileservplugin/chunk_settings.h urbackupcommon/internet_pipe_capabilities.h urbackupcommon/mbrdata.h urbackupserver/filedownload.h urbackupserver/snapshot_helper.h urbackupserver/apps/cleanup_cmd.h urbackupserver/apps/repair_cmd.h urbackupserver/dao/ServerCleanupDao.h urbackupserver/lmdb/lmdb.h urbackupserver/lmdb/midl.h urbackupserver/LMDBFileIndex.h urbackupserver/create_files_index.h urbackupserver/FileIndex.h urbackupserver/serverinterface/rights.h urbackupserver/server_dir_links.h urbackupserver/dao/ServerBackupDao.h urbackupserver/apps/app.h urbackupserver/apps/export_auth_log.h urbackupserver/serverinterface/login.h urbackupserver/ServerDownloadThread.h common/adler32.h urbackupcommon/file_metadata.h urbackupcommon/filelist_utils.h urbackupserver/Backup.h urbackupserver/ImageBackup.h urbackupserver/FileBackup.h urbackupserver/IncrFileBackup.h urbackupserver/FullFileBackup.h urbackupserver/ContinuousBackup.h urbackupserver/ThrottleUpdater.h urbackupcommon/glob.h urbackupserver/FileMetadataDownloadThread.h urbackupserver/restore_client.h urbackupcommon/chunk_hasher.h urbackupcommon/WalCheckpointThread.h urbackupcommon/CompressedPipe2.h urlplugin/IUrlFactory.h urlplugin/pluginmgr.h urlplugin/UrlFactory.h StaticPluginRegistration.h $(cryptoplugin_headers) $(fileservplugin_headers) $(fsimageplugin_headers) $(tclap_headers) urbackupserver/backup_server_db.h urbackupcommon/SparseFile.h urbackupcommon/ExtentIterator.h urbackupserver/dao/ServerLinkDao.h urbackupserver/dao/ServerLinkJournalDao.h urbackupcommon/server_compat.h urbackupserver/dao/ServerFilesDao.h urbackupserver/apps/skiphash_copy.h urbackupserver/apps/check_files_index.h urbackupserver/apps/patch.h urbackupserver/serverinterface/backups.h urbackupserver/server_continuous.h urbackupcommon/change_ids.h urbackupcommon/TreeHash.h urbackupserver/copy_storage.h urbackupserver/ImageMount.h common/bitmap.h $(cryptopp_headers) common/miniz.h urbackupserver/DataplanDb.h common/lrucache.h urbackupserver/PhashLoad.h fileservplugin/IPipeFileExt.h urbackupserver/Alerts.h urbackupserver/Mailer.h urbackupserver/alert_lua.h $(luaplugin_headers) +noinst_HEADERS=SessionMgr.h WorkerThread.h Helper_win32.h Database.h defaults.h ServiceAcceptor.h Query.h SettingsReader.h file.h file_memory.h MemorySettingsReader.h Condition_lin.h LookupService.h Template.h types.h DBSettingsReader.h stringtools.h ThreadPool.h libs.h vld_.h ServiceWorker.h StreamPipe.h LoadbalancerClient.h socket_header.h FileSettingsReader.h SelectThread.h md5.h vld.h Table.h Client.h MemoryPipe.h Mutex_lin.h AcceptThread.h OutputStream.h Server.h Interface/SessionMgr.h Interface/Service.h Interface/PluginMgr.h Interface/Database.h Interface/Pipe.h Interface/CustomClient.h Interface/User.h Interface/Query.h Interface/SettingsReader.h Interface/Types.h Interface/Template.h Interface/ThreadPool.h Interface/Mutex.h Interface/File.h Interface/Condition.h Interface/Table.h Interface/Plugin.h Interface/Thread.h Interface/Action.h Interface/Object.h Interface/OutputStream.h Interface/Server.h libfastcgi/fastcgi.hpp sqlite/sqlite3.h sqlite/sqlite3ext.h utf8/utf8.h utf8/utf8/checked.h utf8/utf8/core.h utf8/utf8/unchecked.h cryptoplugin/ICryptoFactory.h cryptoplugin/IAESEncryption.h cryptoplugin/IAESDecryption.h Interface/DatabaseFactory.h Interface/DatabaseInt.h SQLiteFactory.h sqlite/shell.h PipeThrottler.h Interface/PipeThrottler.h mt19937ar.h DatabaseCursor.h Interface/DatabaseCursor.h Interface/SharedMutex.h SharedMutex_lin.h httpserver/HTTPAction.h httpserver/HTTPClient.h httpserver/HTTPFile.h httpserver/HTTPProxy.h httpserver/HTTPService.h httpserver/IndexFiles.h httpserver/MIMEType.h urbackupserver/server_ping.h urbackupserver/server_cleanup.h urbackupcommon/os_functions.h urbackupcommon/json.h urbackupserver/serverinterface/helper.h urbackupserver/serverinterface/action_header.h urbackupserver/serverinterface/actions.h urbackupserver/server_writer.h urbackupcommon/settings.h urbackupserver/server_settings.h urbackupserver/zero_hash.h urbackupserver/server_update.h urbackupserver/server_log.h urbackupserver/server_hash.h urbackupserver/server_status.h urbackupcommon/bufmgr.h urbackupserver/server_update_stats.h urbackupcommon/sha2/sha2.h urbackupcommon/fileclient/FileClient.h common/data.h urbackupcommon/fileclient/socket_header.h urbackupcommon/fileclient/tcpstack.h urbackupcommon/fileclient/packet_ids.h urbackupserver/database.h urbackupserver/mbr_code.h urbackupserver/action_header.h urbackupcommon/escape.h urbackupserver/server.h urbackupserver/server_running.h urbackupserver/server_prepare_hash.h urbackupserver/actions.h urbackupserver/server_channel.h urbackupserver/ClientMain.h urbackupserver/treediff/TreeDiff.h urbackupserver/treediff/TreeNode.h urbackupserver/treediff/TreeReader.h fileservplugin/IFileServFactory.h fileservplugin/IFileServ.h urlplugin/IUrlFactory.h urbackupcommon/capa_bits.h cryptoplugin/ICryptoFactory.h urbackupcommon/fileclient/FileClientChunked.h urbackupserver/ChunkPatcher.h urbackupcommon/CompressedPipe.h urbackupcommon/InternetServicePipe.h urbackupcommon/InternetServicePipe2.h urbackupcommon/InternetServiceIDs.h urbackupserver/InternetServiceConnector.h md5.h urbackupcommon/settingslist.h urbackupserver/server_archive.h cryptoplugin/IZlibCompression.h cryptoplugin/IZlibDecompression.h cryptoplugin/ICryptoFactory.h cryptoplugin/IAESEncryption.h cryptoplugin/IAESDecryption.h fileservplugin/chunk_settings.h urbackupcommon/internet_pipe_capabilities.h urbackupcommon/mbrdata.h urbackupserver/filedownload.h urbackupserver/snapshot_helper.h urbackupserver/apps/cleanup_cmd.h urbackupserver/apps/repair_cmd.h urbackupserver/dao/ServerCleanupDao.h urbackupserver/lmdb/lmdb.h urbackupserver/lmdb/midl.h urbackupserver/LMDBFileIndex.h urbackupserver/create_files_index.h urbackupserver/FileIndex.h urbackupserver/serverinterface/rights.h urbackupserver/server_dir_links.h urbackupserver/dao/ServerBackupDao.h urbackupserver/apps/app.h urbackupserver/apps/export_auth_log.h urbackupserver/serverinterface/login.h urbackupserver/ServerDownloadThread.h common/adler32.h urbackupcommon/file_metadata.h urbackupcommon/filelist_utils.h urbackupserver/Backup.h urbackupserver/ImageBackup.h urbackupserver/FileBackup.h urbackupserver/IncrFileBackup.h urbackupserver/FullFileBackup.h urbackupserver/ContinuousBackup.h urbackupserver/ThrottleUpdater.h urbackupcommon/glob.h urbackupserver/FileMetadataDownloadThread.h urbackupserver/restore_client.h urbackupcommon/chunk_hasher.h urbackupcommon/WalCheckpointThread.h urbackupcommon/CompressedPipe2.h urlplugin/IUrlFactory.h urlplugin/pluginmgr.h urlplugin/UrlFactory.h StaticPluginRegistration.h $(cryptoplugin_headers) $(fileservplugin_headers) $(fsimageplugin_headers) $(tclap_headers) urbackupserver/backup_server_db.h urbackupcommon/SparseFile.h urbackupcommon/ExtentIterator.h urbackupserver/dao/ServerLinkDao.h urbackupserver/dao/ServerLinkJournalDao.h urbackupcommon/server_compat.h urbackupserver/dao/ServerFilesDao.h urbackupserver/apps/skiphash_copy.h urbackupserver/apps/check_files_index.h urbackupserver/apps/patch.h urbackupserver/serverinterface/backups.h urbackupserver/server_continuous.h urbackupcommon/change_ids.h urbackupcommon/TreeHash.h urbackupserver/copy_storage.h urbackupserver/ImageMount.h common/bitmap.h $(cryptopp_headers) common/miniz.h urbackupserver/DataplanDb.h common/lrucache.h urbackupserver/PhashLoad.h fileservplugin/IPipeFileExt.h urbackupserver/Alerts.h urbackupserver/Mailer.h urbackupserver/alert_lua.h $(luaplugin_headers) urbackupserver/LogReport.h EXTRA_DIST=docs/urbackupsrv.1 init.d_server defaults_server logrotate_urbackupsrv urbackup-server.service urbackup-server-firewalld.xml urbackup/status.htm urbackupserver/www/js/*.js urbackupserver/www/js/vs/* urbackupserver/www/*.htm urbackupserver/www/*.ico urbackupserver/www/css/*.css urbackupserver/www/images/*.png urbackupserver/www/images/*.gif urbackupserver/www/*.ico urbackupserver/urbackup_ecdsa409k1.pub urbackupserver/www/swf/* urbackupserver/www/fonts/* tclap/COPYING tclap/AUTHORS server-license.txt urbackup/dataplan_db.txt diff --git a/luaplugin/ILuaInterpreter.h b/luaplugin/ILuaInterpreter.h index 90c5f1ed..0ad3be7c 100644 --- a/luaplugin/ILuaInterpreter.h +++ b/luaplugin/ILuaInterpreter.h @@ -19,6 +19,128 @@ public: IEMailFunction* mail_func; }; + struct Param + { + typedef std::map params_map; + + Param() + : tag(PARAM_VEC) + { + u.params = new params_map(); + } + + Param(const std::string& pstr) + : tag(PARAM_STR) + { + u.str = new std::string(pstr); + } + + Param(const char* pstr) + : tag(PARAM_STR) + { + u.str = new std::string(pstr); + } + + Param(double num) + :tag(PARAM_NUM) { + u.num = num; + } + + Param(int i) + : tag(PARAM_INT) { + u.i = i; + } + + Param(int64 i) + : tag(PARAM_NUM) { + u.num = static_cast(i); + } + + Param(bool b) + : tag(PARAM_BOOL) { + u.b = b; + } + + ~Param() { + if (tag == PARAM_VEC) { + delete u.params; + } + else if (tag == PARAM_STR) { + delete u.str; + } + } + + Param(const Param& other) + : tag(other.tag) { + if (tag == PARAM_VEC) { + u.params = new params_map(*other.u.params); + } + else if (tag == PARAM_STR) { + u.str = new std::string(*other.u.str); + } + else if (tag == PARAM_NUM) { + u.num = other.u.num; + } + else if (tag == PARAM_BOOL) { + u.b = other.u.b; + } + else if (tag == PARAM_INT) { + u.i = other.u.i; + } + } + + void swap(Param& first, Param& second) { + std::swap(first.tag, second.tag); + std::swap(first.u, second.u); + } + + Param& operator=(Param other) + { + swap(*this, other); + return *this; + } + + bool operator<(const Param& other) const { + if (tag != other.tag) { + return false; + } + if (tag == PARAM_VEC) { + return *u.params < *other.u.params; + } + else if (tag == PARAM_STR) { + return *u.str < *other.u.str; + } + else if (tag == PARAM_NUM) { + return u.num < other.u.num; + } + else if (tag == PARAM_BOOL) { + return u.b < other.u.b; + } + else if (tag == PARAM_INT) { + return u.i < other.u.i; + } + return false; + } + + union + { + params_map* params; + std::string* str; + double num; + bool b; + int i; + } u; + enum + { + PARAM_VEC = 1, + PARAM_STR, + PARAM_NUM, + PARAM_BOOL, + PARAM_INT + } tag; + }; + + virtual std::string compileScript(const std::string& script) = 0; - virtual int64 runScript(const std::string& script, const str_map& params, int64& ret2, std::string& state, std::string& global_data, const SInterpreterFunctions& funcs) = 0; + virtual int64 runScript(const std::string& script, const Param& params, int64& ret2, std::string& state, std::string& global_data, const SInterpreterFunctions& funcs) = 0; }; \ No newline at end of file diff --git a/luaplugin/LuaInterpreter.cpp b/luaplugin/LuaInterpreter.cpp index d0f056be..1c796c01 100644 --- a/luaplugin/LuaInterpreter.cpp +++ b/luaplugin/LuaInterpreter.cpp @@ -2,6 +2,11 @@ #include "src/lua.hpp" #include "../Interface/Server.h" #include "../common/data.h" +#include + +extern "C" { + LUAMOD_API int luaopen_os_custom(lua_State *L); +} namespace { @@ -188,6 +193,7 @@ namespace { LUA_STRLIBNAME, luaopen_string }, { LUA_MATHLIBNAME, luaopen_math }, { LUA_UTF8LIBNAME, luaopen_utf8 }, + { LUA_OSLIBNAME, luaopen_os_custom}, { NULL, NULL } }; @@ -228,6 +234,41 @@ namespace lua_pushboolean(L, b ? 1 : 0); return 1; } + + void set_param(lua_State* state, const ILuaInterpreter::Param& param) + { + if (param.tag == ILuaInterpreter::Param::PARAM_VEC) + { + lua_newtable(state); + for (ILuaInterpreter::Param::params_map::const_iterator it = param.u.params->begin(); + it!=param.u.params->end();++it) + { + set_param(state, it->first); + set_param(state, it->second); + lua_rawset(state, -3); + } + } + else if (param.tag == ILuaInterpreter::Param::PARAM_STR) + { + lua_pushstring(state, param.u.str->c_str()); + } + else if (param.tag == ILuaInterpreter::Param::PARAM_NUM) + { + lua_pushnumber(state, param.u.num); + } + else if (param.tag == ILuaInterpreter::Param::PARAM_INT) + { + lua_pushnumber(state, param.u.i); + } + else if (param.tag == ILuaInterpreter::Param::PARAM_BOOL) + { + lua_pushboolean(state, param.u.b); + } + else + { + assert(false); + } + } } std::string LuaInterpreter::compileScript(const std::string & script) @@ -257,7 +298,7 @@ std::string LuaInterpreter::compileScript(const std::string & script) return ret; } -int64 LuaInterpreter::runScript(const std::string& script, const str_map& params, int64& ret2, +int64 LuaInterpreter::runScript(const std::string& script, const ILuaInterpreter::Param& params, int64& ret2, std::string& state_data, std::string& global_data, const ILuaInterpreter::SInterpreterFunctions& funcs) { ret2 = -1; @@ -272,20 +313,13 @@ int64 LuaInterpreter::runScript(const std::string& script, const str_map& params luaL_openlibs_custom(state); - int rc = luaL_loadbuffer(state, script.c_str(), script.size(), "foo"); + int rc = luaL_loadbuffer(state, script.c_str(), script.size(), "script"); if (rc) { Server->Log(std::string("Error loading lua script: ") + lua_tostring(state, -1), LL_ERROR); return -1; } - lua_newtable(state); - for (str_map::const_iterator it = params.begin(); it != params.end(); ++it) - { - lua_pushstring(state, it->first.c_str()); - lua_pushstring(state, it->second.c_str()); - lua_rawset(state, -3); - } - + set_param(state, params); lua_setglobal(state, "params"); lua_pushlightuserdata(state, const_cast(&funcs)); @@ -339,6 +373,14 @@ int64 LuaInterpreter::runScript(const std::string& script, const str_map& params { Server->Log("Error serializing state data", LL_WARNING); } + + lua_getglobal(state, "global"); + + global_data = serialize_table(state); + if (global_data.empty()) + { + Server->Log("Error serializing global data", LL_WARNING); + } return ret; } diff --git a/luaplugin/LuaInterpreter.h b/luaplugin/LuaInterpreter.h index 557ea50b..331c09de 100644 --- a/luaplugin/LuaInterpreter.h +++ b/luaplugin/LuaInterpreter.h @@ -8,7 +8,7 @@ class LuaInterpreter : public ILuaInterpreter public: virtual std::string compileScript(const std::string& script); - virtual int64 runScript(const std::string& script, const str_map& params, int64& ret2, + virtual int64 runScript(const std::string& script, const Param& params, int64& ret2, std::string& state_data, std::string& global_data, const SInterpreterFunctions& funcs); }; \ No newline at end of file diff --git a/luaplugin/src/all.c b/luaplugin/src/all.c index abb88a1c..2d6708c3 100644 --- a/luaplugin/src/all.c +++ b/luaplugin/src/all.c @@ -37,3 +37,17 @@ #include "lcorolib.c" #include "lutf8lib.c" #include "lctype.c" + +static const luaL_Reg syslib_custom[] = { + { "clock", os_clock }, + { "date", os_date }, + { "difftime", os_difftime }, + { "time", os_time }, + { NULL, NULL } +}; + + +LUAMOD_API int luaopen_os_custom(lua_State *L) { + luaL_newlib(L, syslib_custom); + return 1; +} \ No newline at end of file diff --git a/urbackupserver/Alerts.cpp b/urbackupserver/Alerts.cpp index 72421b67..0a01d541 100644 --- a/urbackupserver/Alerts.cpp +++ b/urbackupserver/Alerts.cpp @@ -7,6 +7,8 @@ #include "../luaplugin/ILuaInterpreter.h" #include "Mailer.h" +extern ILuaInterpreter* lua_interpreter; + namespace { struct SScriptParam @@ -43,7 +45,7 @@ namespace if (!ret.code.empty()) { - ret.code = lua_interpreter->compileScript(ret.code); + //ret.code = lua_interpreter->compileScript(ret.code); } if (ret.code.empty()) @@ -75,11 +77,8 @@ namespace void Alerts::operator()() { - str_map params; - ILuaInterpreter* lua_interpreter = dynamic_cast(Server->getPlugin(Server->getThreadID(), Server->StartPlugin("lua", params))); if (lua_interpreter == NULL) { - Server->Log("Lua plugin missing. Alerts won't work.", LL_WARNING); return; } @@ -89,7 +88,7 @@ void Alerts::operator()() IQuery* q_get_alert_clients = db->Prepare("SELECT id, name, file_ok, image_ok, alerts_state, strftime('%s', lastbackup) AS lastbackup, " "strftime('%s', lastseen) AS lastseen, strftime('%s', lastbackup_image) AS lastbackup_image, created, os_simple " - "FROM clients WHERE alerts_next_check IS NULL OR alerts_next_check>=?"); + "FROM clients WHERE alerts_next_check IS NULL OR alerts_next_check<=?"); IQuery* q_update_client = db->Prepare("UPDATE clients SET file_ok=?, image_ok=?, alerts_next_check=?, alerts_state=? WHERE id=?"); std::map alert_scripts; @@ -99,7 +98,7 @@ void Alerts::operator()() while (true) { - Server->wait(1000); + Server->wait(60*1000); q_get_alert_clients->Bind(Server->getTimeMS()); db_results res = q_get_alert_clients->Read(); @@ -119,15 +118,16 @@ void Alerts::operator()() if (!it->second.code.empty()) { - str_map params; - params["clientid"] = convert(clientid); + ILuaInterpreter::Param params_raw; + ILuaInterpreter::Param::params_map& params = *params_raw.u.params; + params["clientid"] = clientid; params["clientname"] = res[i]["name"]; - params["incr_file_interval"] = convert(server_settings.getUpdateFreqFileIncr()); - params["full_file_interval"] = convert(server_settings.getUpdateFreqFileFull()); - params["incr_image_interval"] = convert(server_settings.getUpdateFreqImageIncr()); - params["full_image_interval"] = convert(server_settings.getUpdateFreqImageFull()); - params["no_images"] = server_settings.getSettings()->no_images ? "1" : "0"; - params["no_file_backups"] = server_settings.getSettings()->no_file_backups ? "1" : "0"; + params["incr_file_interval"] = server_settings.getUpdateFreqFileIncr(); + params["full_file_interval"] = server_settings.getUpdateFreqFileFull(); + params["incr_image_interval"] = server_settings.getUpdateFreqImageIncr(); + params["full_image_interval"] = server_settings.getUpdateFreqImageFull(); + params["no_images"] = server_settings.getSettings()->no_images; + params["no_file_backups"] = server_settings.getSettings()->no_file_backups; params["os_simple"] = res[i]["os_simple"]; int64 times = Server->getTimeSeconds(); @@ -135,11 +135,11 @@ void Alerts::operator()() int64 lastbackup_file = watoi64(res[i]["lastbackup"]); int64 lastbackup_image = watoi64(res[i]["lastbackup_image"]); - params["passed_time_lastseen"] = convert(times - watoi64(res[i]["lastseen"])); - params["passed_time_lastbackup_file"] = convert((std::min)(times - lastbackup_file, times - created) ); - params["passed_time_lastbackup_image"] = convert((std::min)(times - lastbackup_image, times - created) ); - params["lastbackup_file"] = convert(lastbackup_file); - params["lastbackup_image"] = convert(lastbackup_image); + params["passed_time_lastseen"] = times - watoi64(res[i]["lastseen"]); + params["passed_time_lastbackup_file"] = (std::min)(times - lastbackup_file, times - created); + params["passed_time_lastbackup_image"] = (std::min)(times - lastbackup_image, times - created); + params["lastbackup_file"] = lastbackup_file; + params["lastbackup_image"] = lastbackup_image; SSettings* settings = server_settings.getSettings(); @@ -148,16 +148,16 @@ void Alerts::operator()() || settings->update_freq_image_full.find(";") != std::string::npos || settings->update_freq_image_incr.find(";") != std::string::npos) { - params["complex_interval"] = "1"; + params["complex_interval"] = true; } else { - params["complex_interval"] = "0"; + params["complex_interval"] = false; } - std::string file_ok = res[i]["file_ok"]; + bool file_ok = res[i]["file_ok"] == "1"; params["file_ok"] = file_ok; - std::string image_ok = res[i]["image_ok"]; + bool image_ok = res[i]["image_ok"] == "1"; params["image_ok"] = image_ok; str_map nondefault_params; @@ -179,16 +179,16 @@ void Alerts::operator()() std::string state = res[i]["alerts_state"]; int64 ret2; - int64 ret = lua_interpreter->runScript(it->second.code, params, ret2, state, it->second.global, funcs); + int64 ret = lua_interpreter->runScript(it->second.code, params_raw, ret2, state, it->second.global, funcs); bool needs_update = false; if (ret>=0) { - file_ok = (ret & 1) ? "0" : "1"; - image_ok = (ret & 2) ? "0" : "1"; + file_ok = !(ret & 1); + image_ok = !(ret & 2); - if (file_ok != params["file_ok"] - || image_ok != params["image_ok"]) + if (file_ok != params["file_ok"].u.b + || image_ok != params["image_ok"].u.b) { needs_update = true; } @@ -206,8 +206,8 @@ void Alerts::operator()() } else { - if (file_ok == "0" - && image_ok == "0") + if (!file_ok + && !image_ok) { next_check = Server->getTimeMS() + 1*60*60*1000; needs_update = true; diff --git a/urbackupserver/Backup.cpp b/urbackupserver/Backup.cpp index e97d86b9..bb791d37 100644 --- a/urbackupserver/Backup.cpp +++ b/urbackupserver/Backup.cpp @@ -27,6 +27,7 @@ #include "../urlplugin/IUrlFactory.h" #include "server_status.h" #include "server_cleanup.h" +#include "LogReport.h" extern IUrlFactory *url_fak; @@ -242,6 +243,12 @@ void Backup::sendLogdataMail(bool r_success, int image, int incremental, bool re ( report_sendonly==2 && r_success) || ( report_sendonly==3 && !r_success && !has_timeout_error) ) ) { + if (run_report_script(incremental, resumed, image, infos, warnings, + errors, r_success, report_mail, data, clientname)) + { + return; + } + std::vector to_addrs; Tokenize(report_mail, to_addrs, ",;"); @@ -348,4 +355,4 @@ std::string Backup::getUserRights(int userid, std::string domain) { return "none"; } -} +} \ No newline at end of file diff --git a/urbackupserver/LogReport.cpp b/urbackupserver/LogReport.cpp new file mode 100644 index 00000000..802b2756 --- /dev/null +++ b/urbackupserver/LogReport.cpp @@ -0,0 +1,145 @@ +#include "LogReport.h" +#include "../Interface/Server.h" +#include "../Interface/Mutex.h" +#include "../Interface/Database.h" +#include "../stringtools.h" +#include "database.h" +#include "../luaplugin/ILuaInterpreter.h" +#include "Mailer.h" + +extern ILuaInterpreter* lua_interpreter; + +namespace +{ + IMutex* mutex; + std::string script; + + class MailBridge : public ILuaInterpreter::IEMailFunction + { + public: + // Inherited via IEMailFunction + virtual bool mail(const std::string & send_to, const std::string & subject, const std::string & message) + { + return Mailer::sendMail(send_to, subject, message); + } + }; + + ILuaInterpreter::SInterpreterFunctions funcs; + + IMutex* global_mutex; + std::string global_data; +} + +std::string load_report_script() +{ + IScopedLock lock(mutex); + + if (!script.empty()) + { + return script; + } + + if (FileExists("urbackupserver/report.lua")) + { + script = getFile("urbackupserver/report.lua"); + if (!script.empty()) + { + return script; + } + } + + IDatabase* db = Server->getDatabase(Server->getThreadID(), URBACKUPDB_SERVER); + + db_results res = db->Read("SELECT tvalue FROM misc WHERE tkey='report_script'"); + + if (!res.empty()) + { + return res[0]["tvalue"]; + } + + return std::string(); +} + +std::string get_report_script() +{ + std::string script = load_report_script(); + if (script.empty()) + return script; + + std::string ret = lua_interpreter->compileScript(script); + return ret; +} + +void init_log_report() +{ + mutex = Server->createMutex(); + funcs.mail_func = new MailBridge; + global_mutex = Server->createMutex(); +} + +void reload_report_script() +{ + IScopedLock lock(mutex); + script.clear(); +} + +bool run_report_script(int incremental, bool resumed, int image, + int infos, int warnings, int errors, bool success, const std::string& report_mail, + const std::string & data, const std::string& clientname) +{ + std::string script; + { + IScopedLock lock(mutex); + script = get_report_script(); + } + + if (script.empty()) + return false; + + ILuaInterpreter::Param param_raw; + ILuaInterpreter::Param::params_map& param = *param_raw.u.params; + + param["incremental"] = incremental; + param["resumed"] = resumed; + param["image"] = image; + param["infos"] = infos; + param["warnings"] = warnings; + param["warnings"] = errors; + param["report_mail"] = report_mail; + param["clientname"] = clientname; + ILuaInterpreter::Param::params_map& pdata = *param["data"].u.params; + + std::vector msgs; + TokenizeMail(data, msgs, "\n"); + + for (size_t j = 0; j(j + 1)].u.params; + std::string ll; + if (!msgs[j].empty()) ll = msgs[j][0]; + int li = watoi(ll); + msgs[j].erase(0, 2); + std::string tt = getuntil("-", msgs[j]); + std::string m = getafter("-", msgs[j]); + obj["time"] = watoi64(tt); + obj["msg"] = m; + obj["ll"] = li; + } + + int64 ret2; + std::string state; + int64 ret; + { + IScopedLock lock(global_mutex); + ret = lua_interpreter->runScript(script, param_raw, ret2, state, global_data, funcs); + } + + if (ret<0) + { + return false; + } + + return true; +} + + diff --git a/urbackupserver/LogReport.h b/urbackupserver/LogReport.h new file mode 100644 index 00000000..eb4cc1eb --- /dev/null +++ b/urbackupserver/LogReport.h @@ -0,0 +1,12 @@ +#pragma once +#include + +void init_log_report(); + +std::string load_report_script(); + +void reload_report_script(); + +bool run_report_script(int incremental, bool resumed, int image, int infos, + int warnings, int errors, bool success, const std::string& report_mail, const std::string& data, + const std::string& clientname); \ No newline at end of file diff --git a/urbackupserver/alert.lua b/urbackupserver/alert.lua index 79c6f2d6..01cc19c4 100644 --- a/urbackupserver/alert.lua +++ b/urbackupserver/alert.lua @@ -1,13 +1,13 @@ --find largest (maximum of incr and full interval) interval for file and image backups -local file_interval = tonumber(params.incr_file_interval) -local full_file_interval = tonumber(params.full_file_interval) +local file_interval = params.incr_file_interval +local full_file_interval = params.full_file_interval if full_file_interval>0 and full_file_interval0 and full_image_interval0 +local file_backup_nok = file_interval*tonumber(params.alert_file_mult) - params.passed_time_lastbackup_file +if file_backup_nok<0 then ret=ret + 1 --Send warning mail only once on status becoming not ok - if params.file_ok=="1" + if params.file_ok then - fail_mail(false, tonumber(params.passed_time_lastbackup_file), tonumber(params.lastbackup_file), file_interval*tonumber(params.alert_file_mult) ) + fail_mail(false, params.passed_time_lastbackup_file, params.lastbackup_file, file_interval*tonumber(params.alert_file_mult) ) end else next_check_ms = math.min(next_check_ms, file_backup_nok*1000) @@ -103,26 +119,27 @@ end if string.len(params.os_simple)==0 or params.os_simple=="windows" then - all_fail = all_fail + 2 --Time in seconds till image backup status is not ok - local image_backup_nok = image_interval*tonumber(params.alert_image_mult) - tonumber(params.passed_time_lastbackup_image) - if image_backup_nok<0 and image_interval>0 + local image_backup_nok = image_interval*tonumber(params.alert_image_mult) - params.passed_time_lastbackup_image + if image_backup_nok<0 then ret= ret + 2 - if params.image_ok=="1" + if params.image_ok then - fail_mail(true, tonumber(params.passed_time_lastbackup_image), tonumber(params.lastbackup_image), file_interval*tonumber(params.alert_image_mult) ) + fail_mail(true, params.passed_time_lastbackup_image, params.lastbackup_image, image_interval*tonumber(params.alert_image_mult) ) end else next_check_ms = math.min(next_check_ms, image_backup_nok*1000) end +else + ret = ret + 2 end --Second parameter returns the number of milliseconds to wait till the next status check --If the interval is complex (not a single number, but different numbers depending on window) we cannot return this time reliably --The alert script is automatically run after a backup so no need to return the wait time if both image and file backup status is not ok -if params.complex_interval=="1" or ret==all_fail +if params.complex_interval or ret==3 then return ret else diff --git a/urbackupserver/dllmain.cpp b/urbackupserver/dllmain.cpp index 76e65f69..7410e739 100644 --- a/urbackupserver/dllmain.cpp +++ b/urbackupserver/dllmain.cpp @@ -53,6 +53,7 @@ extern IServer* Server; #include "../fsimageplugin/IFSImageFactory.h" #include "../cryptoplugin/ICryptoFactory.h" #include "../urlplugin/IUrlFactory.h" +#include "../luaplugin/ILuaInterpreter.h" #include "database.h" #include "actions.h" @@ -96,6 +97,7 @@ SStartupStatus startup_status; #include "../urbackupcommon/WalCheckpointThread.h" #include "FileMetadataDownloadThread.h" #include "../urbackupcommon/chunk_hasher.h" +#include "LogReport.h" #define MINIZ_NO_ZLIB_COMPATIBLE_NAMES #include "../common/miniz.h" @@ -141,6 +143,7 @@ IFSImageFactory *image_fak; ICryptoFactory *crypto_fak; IUrlFactory *url_fak=NULL; IFileServ* fileserv=NULL; +ILuaInterpreter* lua_interpreter = NULL; std::string server_identity; std::string server_token; @@ -636,6 +639,15 @@ DLLEXPORT void LoadActions(IServer* pServer) } } + { + str_map params; + lua_interpreter = dynamic_cast(Server->getPlugin(Server->getThreadID(), Server->StartPlugin("lua", params))); + if (lua_interpreter == NULL) + { + Server->Log("Lua plugin missing. Alerts won't work.", LL_WARNING); + } + } + open_server_database(true); @@ -644,6 +656,7 @@ DLLEXPORT void LoadActions(IServer* pServer) ServerSettings::init_mutex(); ClientMain::init_mutex(); DataplanDb::init(); + init_log_report(); open_settings_database(); @@ -1981,6 +1994,7 @@ bool upgrade54_55() b &= db->Write("INSERT INTO alert_script_params (script_id, idx, name, label, default_value, has_translation) VALUES (1, 0, 'alert_file_mult', 'alert_file_mult', '3', 1)"); b &= db->Write("INSERT INTO alert_script_params (script_id, idx, name, label, default_value, has_translation) VALUES (1, 1, 'alert_image_mult', 'alert_image_mult', '3', 1)"); b &= db->Write("INSERT INTO alert_script_params (script_id, idx, name, label, default_value, has_translation) VALUES (1, 2, 'alert_emails', 'alert_emails', '', 1)"); + b &= db->Write("INSERT INTO alert_script_params (script_id, idx, name, label, default_value, has_translation) VALUES (1, 3, 'alert_important', 'alert_important', '0', 1)"); b &= db->Write("CREATE TABLE mail_queue (id INTEGER PRIMARY KEY, send_to TEXT, subject TEXT, message TEXT, next_try INTEGER, retry_count INTEGER DEFAULT 0)"); diff --git a/urbackupserver/report.lua b/urbackupserver/report.lua new file mode 100644 index 00000000..512e0220 --- /dev/null +++ b/urbackupserver/report.lua @@ -0,0 +1,64 @@ +local subj = "UrBackup: " +local msg = "UrBackup just did " + +if params.incremental>0 +then + if params.resumed + then + msg = msg .. "a resumed incremental " + subj = subj .. "Resumed incremental " + else + msg = msg .. "an incremental " + subj = subj .. "Incremental " + end +else + if params.resumed + then + msg = msg .. "a resumed full " + subj = subj .. "Resumed full " + else + msg = msg .. "a full " + subj = subj .. "Full " + end +end + +if params.image>0 +then + msg = msg .. "image " + subj = subj .. "image " +else + msg = msg .. "file " + subj = subj .. "file " +end + +subj = subj .. "backup of \"" .. params.clientname .. "\"\n" +msg = msg .. backup of \"" .. params.clientname .. "\".\n" +msg = msg .. "\nReport:\n" +msg = msg .. "( " .. params.infos +if params.infos!=1 then msg = msg .. " infos, " +else msg = msg .. " info, " end +msg = msg .. params.warnings +if params.warnings!=1 then msg = msg .. " warnings, " +else msg = msg .. " warning, " end +msg = msg .. params.errors +if params.errors!=1 then msg = msg .. " errors)\n\n" +else msg = msg .. " error)\n\n" end + +for i, v in ipairs(params.data) +do + local ll = "(info)" + if v.ll==1 then ll="(warning)" + elseif v.ll==2 then ll="(error)" end + msg = msg .. os.date("%x %X", v.time) .. ll .. ": " .. v.msg .. "\n" +end + +if params.success +then + subj = subj .. " - success" +else + subj = subj .. " - failed" +end + +mail(params.report_mail, subj, msg) + +return 0 \ No newline at end of file diff --git a/urbackupserver/serverinterface/logs.cpp b/urbackupserver/serverinterface/logs.cpp index 75dcbe51..821d44a2 100644 --- a/urbackupserver/serverinterface/logs.cpp +++ b/urbackupserver/serverinterface/logs.cpp @@ -206,6 +206,11 @@ ACTION_IMPL(logs) ret.set("HAS_MAIL_START", ""); } + + if (helper.getRights(RIGHT_REPORT_SCRIPT) == RIGHT_ALL) + { + ret.set("can_report_script_edit", true); + } } else { diff --git a/urbackupserver/serverinterface/rights.h b/urbackupserver/serverinterface/rights.h index 8cd30793..1ec18592 100644 --- a/urbackupserver/serverinterface/rights.h +++ b/urbackupserver/serverinterface/rights.h @@ -7,6 +7,7 @@ namespace const char* RIGHT_SETTINGS="settings"; const char* RIGHT_BROWSE_BACKUPS = "browse_backups"; const char* RIGHT_ALERT_SCRIPTS = "alert_scripts"; + const char* RIGHT_REPORT_SCRIPT = "report_script"; } #endif //_RIGHTS_H_ \ No newline at end of file diff --git a/urbackupserver/serverinterface/scripts.cpp b/urbackupserver/serverinterface/scripts.cpp index 25f25439..1e657335 100644 --- a/urbackupserver/serverinterface/scripts.cpp +++ b/urbackupserver/serverinterface/scripts.cpp @@ -16,6 +16,7 @@ * along with this program. If not, see . **************************************************************************/ #include "action_header.h" +#include "../LogReport.h" ACTION_IMPL(scripts) { @@ -79,6 +80,8 @@ ACTION_IMPL(scripts) q->Write(); q->Reset(); } + + ret.set("saved_ok", true); } else if (sa == "rm_alert" && id != 1) @@ -122,4 +125,26 @@ ACTION_IMPL(scripts) ret.set("params", params); helper.Write(ret.stringify(false)); } + else if (sa == "get_report" + || sa == "set_report") + { + if (helper.getRights(RIGHT_REPORT_SCRIPT) != RIGHT_ALL) + { + return; + } + + JSON::Object ret; + if (sa == "set_report") + { + db->Write("DELETE FROM misc WHERE tkey='report_script'"); + IQuery* q = db->Prepare("INSERT INTO misc (tkey, tvalue) VALUES ('report_script', ?)"); + q->Bind(POST["script"]); + q->Write(); + q->Reset(); + ret.set("saved_ok", true); + } + + ret.set("script", load_report_script()); + helper.Write(ret.stringify(false)); + } } \ No newline at end of file diff --git a/urbackupserver/urbackupserver.vcxproj b/urbackupserver/urbackupserver.vcxproj index 85a47e0f..2c386d1f 100644 --- a/urbackupserver/urbackupserver.vcxproj +++ b/urbackupserver/urbackupserver.vcxproj @@ -242,6 +242,7 @@ + @@ -359,6 +360,7 @@ + diff --git a/urbackupserver/urbackupserver.vcxproj.filters b/urbackupserver/urbackupserver.vcxproj.filters index 2c73fe8f..49cb37f0 100644 --- a/urbackupserver/urbackupserver.vcxproj.filters +++ b/urbackupserver/urbackupserver.vcxproj.filters @@ -369,6 +369,9 @@ serverinterface + + Quelldateien + @@ -668,5 +671,8 @@ Headerdateien + + Headerdateien + \ No newline at end of file diff --git a/urbackupserver/www/js/templates.js b/urbackupserver/www/js/templates.js index 6aef286e..e3829cdb 100644 --- a/urbackupserver/www/js/templates.js +++ b/urbackupserver/www/js/templates.js @@ -1,21 +1,21 @@ (function(){dust.register("about_urbackup",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tAbout UrBackup"], false),ctx,"h").w("
UrBackup Server ").f(ctx.get(["version"], false),ctx,"h").w("

Authors:
Translators:
Martin Raiber, Ettore Atalan (German)
Luis Miguel Muñoz (Spanish)
Mehmet Binici (Turkish)
Jussi Bergström (Finnish)
mehdincd, Charles Peltier (French)
Samuele, Paolo, Marco Longo (Italian)
buzzertnl, Pimmetje, buzzertnl (Dutch)
Artur Corumba, Juan Pablo Kerber (Portuguese (Brazil))
J. Almeida (Portuguese)
matsr (Norwegian)
janda (Slovak)
Jonas Aaslund (Svedish)
Ales Hermann (Czech)
Artem Alabin (Russian)
Olivian Daniel Tofan (Romanian)
Ihor Maydanovich (Ukrainian)
osiengine group (Farsi)
Zhengyu Ren (Traditional and Simplified Chinese)

A lot of work has gone into UrBackup.If you like it and want to support the ongoing development please consider donating.
Via PayPal:

Contribution of build server or testing infrastructure is welcome as well. The most appreciated contribution would be your time in form of help.

UrBackup is using following libraries/code:
UrBackup License:
\"AGPLv3+\"/
UrBackup is licensed as AGPLv3+. See here or the server-license.txt in your software distribution for the full license text of UrBackup and the licenses of used third-party software.
The source code of this server software instance is available for example at https://github.com/uroni/urbackup_backend.

");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("add_client",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tAdd client"], false),ctx,"h").w("

").f(ctx.get(["tUrBackup automatically discovers clients in your local network. If the server is in the same sub-network as the client just install the client and wait for it to be discovered."], false),ctx,"h").w("

").f(ctx.get(["tDownload the client from:"], false),ctx,"h").w(" www.urbackup.org

").f(ctx.get(["tIf you want a client to use multiple backup servers this server's identity is:"], false),ctx,"h").w(" ").f(ctx.get(["server_identity"], false),ctx,"h").w("



");}body_0.__dustBody=!0;return body_0;})(); -(function(){dust.register("alert_script_edit",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tEdit alert scripts"], false),ctx,"h").w("
 

").f(ctx.get(["tAlert script parameters"], false),ctx,"h").w("

").f(ctx.get(["mod_alert_params"], false),ctx,"h",["s"]).w("



").f(ctx.get(["tAlert script"], false),ctx,"h").w("

\t\t

");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("alert_script_edit",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tEdit alert scripts"], false),ctx,"h").w("
 

").f(ctx.get(["tAlert script parameters"], false),ctx,"h").w("

").f(ctx.get(["mod_alert_params"], false),ctx,"h",["s"]).w("



").f(ctx.get(["tAlert script"], false),ctx,"h").w("

\t\t

").x(ctx.get(["saved_ok"], false),ctx,{"block":body_1},{}).w("
");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("
Saved script successfully.
");}body_1.__dustBody=!0;return body_0;})(); (function(){dust.register("alert_script_edit_params",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tName:"], false),ctx,"h").w("
").f(ctx.get(["tLabel:"], false),ctx,"h").w("
").f(ctx.get(["tDefault value:"], false),ctx,"h").w("
 
");}body_0.__dustBody=!0;return body_0;})(); -(function(){dust.register("backup_restore_wait",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tPreparing restore. Please be patient..."], false),ctx,"h").w("
 
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("backup_item",body_0);function body_0(chk,ctx){return chk.w("
").x(ctx.get(["show_client_breadcrumb"], false),ctx,{"block":body_1},{}).w("").f(ctx.get(["clientname"], false),ctx,"h").w(" > ").f(ctx.get(["cpath"], false),ctx,"h",["s"]).w("
").x(ctx.get(["can_restore"], false),ctx,{"block":body_2},{}).w("").s(ctx.get(["items"], false),ctx,{"block":body_3},{}).w("
 ").f(ctx.get(["tFile"], false),ctx,"h").w("").f(ctx.get(["tSize"], false),ctx,"h").w("").f(ctx.get(["tCreated"], false),ctx,"h").w("").f(ctx.get(["tLast modified"], false),ctx,"h").w("").f(ctx.get(["tLast accessed"], false),ctx,"h").w("").f(ctx.get(["tBackup time"], false),ctx,"h").w("").f(ctx.get(["tVersion"], false),ctx,"h").w("
");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("").f(ctx.get(["tClients"], false),ctx,"h").w(" >");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w(" ").f(ctx.get(["name"], false),ctx,"h",["s"]).w("").f(ctx.get(["size"], false),ctx,"h",["s"]).w("").f(ctx.get(["creat"], false),ctx,"h",["s"]).w("").f(ctx.get(["mod"], false),ctx,"h",["s"]).w("").f(ctx.get(["access"], false),ctx,"h",["s"]).w("").f(ctx.get(["backuptime"], false),ctx,"h",["s"]).w("").x(ctx.get(["has_version"], false),ctx,{"block":body_4},{}).x(ctx.get(["can_restore"], false),ctx,{"block":body_5},{}).w("");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("").f(ctx.get(["version"], false),ctx,"h").w("");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("").f(ctx.get(["tRestore"], false),ctx,"h").w("");}body_5.__dustBody=!0;return body_0;})(); +(function(){dust.register("backup_restore_wait",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tPreparing restore. Please be patient..."], false),ctx,"h").w("
 
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("backups_access_denied",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tAccess denied"], false),ctx,"h").w("
").f(ctx.get(["tSorry, something went wrong or you do not have the required rights to access this file or folder."], false),ctx,"h").x(ctx.get(["errcode"], false),ctx,{"block":body_1},{}).w("

").f(ctx.get(["tLogin with username and password"], false),ctx,"h").w("

");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("(").f(ctx.get(["errcode"], false),ctx,"h").w(")");}body_1.__dustBody=!0;return body_0;})(); -(function(){dust.register("backups_clients",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tClients"], false),ctx,"h").w("
").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
 ").f(ctx.get(["tComputer name"], false),ctx,"h").w("").f(ctx.get(["tLast file backup"], false),ctx,"h").w("
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("backups_backups",body_0);function body_0(chk,ctx){return chk.w("
").x(ctx.get(["show_client_breadcrumb"], false),ctx,{"block":body_1},{}).w("").f(ctx.get(["clientname"], false),ctx,"h").w("
").x(ctx.get(["backups"], false),ctx,{"block":body_2},{}).x(ctx.get(["backup_images"], false),ctx,{"block":body_10},{}).nx(ctx.get(["backups"], false),ctx,{"block":body_18},{}).w("
");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("").f(ctx.get(["tClients"], false),ctx,"h").w(" >");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("

").f(ctx.get(["tFile backups"], false),ctx,"h").w("

").x(ctx.get(["has_actions"], false),ctx,{"block":body_3},{}).w("").s(ctx.get(["backups"], false),ctx,{"block":body_4},{}).w("
 ").f(ctx.get(["tBackup time"], false),ctx,"h").w("").f(ctx.get(["tIncremental"], false),ctx,"h").w("").f(ctx.get(["tSize"], false),ctx,"h").w("").f(ctx.get(["tArchived"], false),ctx,"h").w("?
");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("").f(ctx.get(["tActions"], false),ctx,"h").w("");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w(" ").f(ctx.get(["backuptime"], false),ctx,"h").w("").f(ctx.get(["incr"], false),ctx,"h").w("").f(ctx.get(["size_bytes"], false),ctx,"h").w("").f(ctx.get(["archived"], false),ctx,"h",["s"]).w("").x(ctx.get(["has_actions"], false),ctx,{"block":body_5},{}).w("");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("").nx(ctx.get(["is_archived"], false),ctx,{"block":body_6},{}).w("");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.x(ctx.get(["can_delete"], false),ctx,{"block":body_7},{});}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.x(ctx.get(["delete_pending"], false),ctx,{"else":body_8,"block":body_9},{});}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w(" ").f(ctx.get(["tDelete"], false),ctx,"h").w("");}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.w("").f(ctx.get(["tBackup is marked for deletion. Do not delete"], false),ctx,"h").w(" ").f(ctx.get(["tDelete now"], false),ctx,"h").w("");}body_9.__dustBody=!0;function body_10(chk,ctx){return chk.w("

").f(ctx.get(["tImage backups"], false),ctx,"h").w("

\t\t\t\t").x(ctx.get(["has_actions"], false),ctx,{"block":body_11},{}).w("").s(ctx.get(["backup_images"], false),ctx,{"block":body_12},{}).w("
 ").f(ctx.get(["tBackup time"], false),ctx,"h").w("").f(ctx.get(["tVolume"], false),ctx,"h").w("").f(ctx.get(["tIncremental"], false),ctx,"h").w("").f(ctx.get(["tSize"], false),ctx,"h").w("").f(ctx.get(["tArchived"], false),ctx,"h").w("?
");}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.w("").f(ctx.get(["tActions"], false),ctx,"h").w("");}body_11.__dustBody=!0;function body_12(chk,ctx){return chk.w(" ").f(ctx.get(["backuptime"], false),ctx,"h").w("").f(ctx.get(["letter"], false),ctx,"h").w("").f(ctx.get(["incr"], false),ctx,"h").w("").f(ctx.get(["size_bytes"], false),ctx,"h").w("").f(ctx.get(["archived"], false),ctx,"h",["s"]).w("").x(ctx.get(["has_actions"], false),ctx,{"block":body_13},{}).w("");}body_12.__dustBody=!0;function body_13(chk,ctx){return chk.w("").nx(ctx.get(["is_archived"], false),ctx,{"block":body_14},{}).w("");}body_13.__dustBody=!0;function body_14(chk,ctx){return chk.x(ctx.get(["can_delete"], false),ctx,{"block":body_15},{});}body_14.__dustBody=!0;function body_15(chk,ctx){return chk.x(ctx.get(["delete_pending"], false),ctx,{"else":body_16,"block":body_17},{});}body_15.__dustBody=!0;function body_16(chk,ctx){return chk.w(" ").f(ctx.get(["tDelete"], false),ctx,"h").w("");}body_16.__dustBody=!0;function body_17(chk,ctx){return chk.w("").f(ctx.get(["tBackup is marked for deletion. Do not delete"], false),ctx,"h").w(" ").f(ctx.get(["tDelete now"], false),ctx,"h").w("");}body_17.__dustBody=!0;function body_18(chk,ctx){return chk.nx(ctx.get(["backup_images"], false),ctx,{"block":body_19},{});}body_18.__dustBody=!0;function body_19(chk,ctx){return chk.w("

").f(ctx.get(["tNo backups"], false),ctx,"h").w("

").f(ctx.get(["tNo backups of this client yet"], false),ctx,"h");}body_19.__dustBody=!0;return body_0;})(); (function(){dust.register("backups_clients_row",body_0);function body_0(chk,ctx){return chk.w(" ").f(ctx.get(["name"], false),ctx,"h").w("").f(ctx.get(["lastbackup"], false),ctx,"h",["s"]).w("");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("backups_clients",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tClients"], false),ctx,"h").w("
").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
 ").f(ctx.get(["tComputer name"], false),ctx,"h").w("").f(ctx.get(["tLast file backup"], false),ctx,"h").w("
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("backups_error",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tError while accessing backups"], false),ctx,"h").w("
").f(ctx.get(["tSorry, something went wrong:"], false),ctx,"h").w(" ").f(ctx.get(["err"], false),ctx,"h").w("
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("backups_files",body_0);function body_0(chk,ctx){return chk.w("
").x(ctx.get(["show_client_breadcrumb"], false),ctx,{"block":body_1},{}).w("").f(ctx.get(["clientname"], false),ctx,"h").w(" > ").f(ctx.get(["cpath"], false),ctx,"h",["s"]).w("
").s(ctx.get(["image_backup_info"], false),ctx,{"block":body_2},{}).x(ctx.get(["can_mount"], false),ctx,{"else":body_3,"block":body_10},{}).x(ctx.get(["download_zip"], false),ctx,{"block":body_12},{}).x(ctx.get(["can_restore"], false),ctx,{"block":body_13},{}).w("
");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("").f(ctx.get(["tClients"], false),ctx,"h").w(" >");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("
").f(ctx.get(["tImage backup information"], false),ctx,"h").w("
").f(ctx.get(["tId"], false),ctx,"h").w(": ").f(ctx.get(["id"], false),ctx,"h").w("
").f(ctx.get(["tBackup time"], false),ctx,"h").w(": ").f(ctx.get(["backuptime"], false),ctx,"h").w("
").f(ctx.get(["tIncremental"], false),ctx,"h").w(": ").f(ctx.get(["incr"], false),ctx,"h").w("
").f(ctx.get(["tSize"], false),ctx,"h").w(": ").f(ctx.get(["size_bytes"], false),ctx,"h").w("
").f(ctx.get(["tVolume"], false),ctx,"h").w(": ").f(ctx.get(["letter"], false),ctx,"h").w("
").f(ctx.get(["tArchived"], false),ctx,"h").w(": ").f(ctx.get(["archived"], false),ctx,"h",["s"]).w("
").f(ctx.get(["tVolume size"], false),ctx,"h").w(": ").f(ctx.get(["volume_size"], false),ctx,"h").w("
").f(ctx.get(["tPartition style"], false),ctx,"h").w(": ").f(ctx.get(["part_table"], false),ctx,"h").w("
").f(ctx.get(["tDisk number"], false),ctx,"h").w(": ").f(ctx.get(["disk_number"], false),ctx,"h").w("
").f(ctx.get(["tPartition number"], false),ctx,"h").w(": ").f(ctx.get(["partition_number"], false),ctx,"h").w("
").f(ctx.get(["tFile system type"], false),ctx,"h").w(": ").f(ctx.get(["fs_type"], false),ctx,"h").w("
").f(ctx.get(["tVolume name"], false),ctx,"h").w(": ").f(ctx.get(["volume_name"], false),ctx,"h").w("
").f(ctx.get(["tSerial number"], false),ctx,"h").w(": ").f(ctx.get(["serial_number"], false),ctx,"h").w("
");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.nx(ctx.get(["no_files"], false),ctx,{"block":body_4},{});}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.x(ctx.get(["mount_failed"], false),ctx,{"else":body_5,"block":body_9},{});}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("").s(ctx.get(["files"], false),ctx,{"block":body_6},{}).w("
 ").f(ctx.get(["tFile"], false),ctx,"h").w("").f(ctx.get(["tSize"], false),ctx,"h").w("").f(ctx.get(["tCreated"], false),ctx,"h").w("").f(ctx.get(["tLast modified"], false),ctx,"h").w("").f(ctx.get(["tLast accessed"], false),ctx,"h").w(" 
");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w(" ").f(ctx.get(["name"], false),ctx,"h",["s"]).w("").f(ctx.get(["size"], false),ctx,"h").w("").f(ctx.get(["creat"], false),ctx,"h").w("").f(ctx.get(["mod"], false),ctx,"h").w("").f(ctx.get(["access"], false),ctx,"h").w("").x(ctx.get(["list_items"], false),ctx,{"block":body_7},{}).x(ctx.get(["can_restore"], false),ctx,{"block":body_8},{}).w("");}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.w("").f(ctx.get(["tList"], false),ctx,"h").w("");}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w("").f(ctx.get(["tRestore"], false),ctx,"h").w("");}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.w("
").f(ctx.get(["tMounting image failed. Please see server log file for details."], false),ctx,"h").w("
");}body_9.__dustBody=!0;function body_10(chk,ctx){return chk.w("

").f(ctx.get(["tMount image"], false),ctx,"h").w("").x(ctx.get(["os_mount"], false),ctx,{"block":body_11},{}).w("
");}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.w("
").f(ctx.get(["tUrBackup will use non-sandboxed server operating system functionality to mount the image. Only mount the image if you trust its source."], false),ctx,"h").w("");}body_11.__dustBody=!0;function body_12(chk,ctx){return chk.w("").f(ctx.get(["tDownload folder as ZIP"], false),ctx,"h").w("");}body_12.__dustBody=!0;function body_13(chk,ctx){return chk.w("").f(ctx.get(["tRestore folder to client"], false),ctx,"h").w("");}body_13.__dustBody=!0;return body_0;})(); (function(){dust.register("big_endian_info",body_0);function body_0(chk,ctx){return chk.w("
UrBackup is currently only partially tested on big endian systems. In particular image backups and restores have not been tested.
UrBackup has been put into testing mode. This means UrBackup will always log debug messages.
If you want to help make UrBackup available on big endian systems please report all problems to the forums or to our issue tracker. Thank you for your help!
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("change_pw",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tChange password"], false),ctx,"h").w("
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("change_pw_fail",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tChanging password failed:"], false),ctx,"h").w("
").f(ctx.get(["fail_reason"], false),ctx,"h").w("
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("change_pw_ok",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tChanged password successfully"], false),ctx,"h").w("
");}body_0.__dustBody=!0;return body_0;})(); -(function(){dust.register("database_error",body_0);function body_0(chk,ctx){return chk.w("\t\t\t
").f(ctx.get(["database_error_text"], false),ctx,"h").w("

").f(ctx.get(["tOk. Reset this error"], false),ctx,"h").w("


");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("client_added",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tClient added successfully"], false),ctx,"h").w("

").f(ctx.get(["tAdded new client with name:"], false),ctx,"h").w(" ").f(ctx.get(["new_clientname"], false),ctx,"h").w("

").f(ctx.get(["tDefault authentication key:"], false),ctx,"h").w(" ").f(ctx.get(["new_authkey"], false),ctx,"h").w("

  • ").f(ctx.get(["tDownload preconfigured client installer for Windows"], false),ctx,"h").w("
  • ").f(ctx.get(["tDownload preconfigured client installer for Mac OS X"], false),ctx,"h").w("

    ").f(ctx.get(["tInstall it directly in the terminal via:"], false),ctx,"h").w("

    TF=`mktemp` && curl \"").f(ctx.get(["mac_url"], false),ctx,"h").w("\" > $TF && bash $TF; rm $TF

  • ").f(ctx.get(["tDownload preconfigured client installer for Linux"], false),ctx,"h").w("

    ").f(ctx.get(["tInstall it directly in the terminal via:"], false),ctx,"h").w("

    TF=`mktemp` && wget \"").f(ctx.get(["linux_url"], false),ctx,"h").w("\" -O $TF && sh $TF; rm $TF

  • ").f(ctx.get(["tAlternatively after you installed the client from:"], false),ctx,"h").w(" https://www.urbackup.org/download.html

    • ").f(ctx.get(["tGo to the settings screen on the client"], false),ctx,"h").w("
    • ").f(ctx.get(["tEnable the internet mode on the client"], false),ctx,"h").w("
    • ").f(ctx.get(["tSet the internet server to:"], false),ctx,"h").w(" ").f(ctx.get(["internet_server"], false),ctx,"h").w("
    • ").f(ctx.get(["tSet the internet server port to:"], false),ctx,"h").w(" ").f(ctx.get(["internet_server_port"], false),ctx,"h").w("
    • ").f(ctx.get(["tSet the computer name to:"], false),ctx,"h").w(" ").f(ctx.get(["new_clientname"], false),ctx,"h").w("
    • ").f(ctx.get(["tSet the authentication key to:"], false),ctx,"h").w(" ").f(ctx.get(["new_authkey"], false),ctx,"h").w("
    • ").f(ctx.get(["tWithout firewall/NAT: Enable internet only mode if you only plan to use the client via internet. On Linux by changing INTERNET_ONLY to true in /etc/default/urbackupclient or /etc/sysconfig/urbackupclient"], false),ctx,"h").w("

    ").f(ctx.get(["tWith the command line:"], false),ctx,"h").w("

    urbackupclientctl set-settings -k internet_mode_enabled -v true -k internet_server -v ").f(ctx.get(["internet_server"], false),ctx,"h").w(" -k internet_server_port -v ").f(ctx.get(["internet_server_port"], false),ctx,"h").w(" -k computername -v \"").f(ctx.get(["new_clientname"], false),ctx,"h").w("\" -k internet_authkey -v ").f(ctx.get(["new_authkey"], false),ctx,"h").w("
    [ ! -e /etc/default/urbackupclient ] || sed -i 's/INTERNET_ONLY=false/INTERNET_ONLY=true/' /etc/default/urbackupclient
    [ ! -e /etc/sysconfig/urbackupclient ] || sed -i 's/INTERNET_ONLY=false/INTERNET_ONLY=true/' /etc/sysconfig/urbackupclient

");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("database_error",body_0);function body_0(chk,ctx){return chk.w("\t\t\t
").f(ctx.get(["database_error_text"], false),ctx,"h").w("

").f(ctx.get(["tOk. Reset this error"], false),ctx,"h").w("


");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("dir_error",body_0);function body_0(chk,ctx){return chk.w("\t\t\t

");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.f(ctx.get(["dir_error_text"], false),ctx,"h");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("

").f(ctx.get(["tOk. Stop showing this error"], false),ctx,"h").w("");}body_2.__dustBody=!0;return body_0;})(); (function(){dust.register("file_cache_error",body_0);function body_0(chk,ctx){return chk.w("
").x(ctx.get(["generic_text"], false),ctx,{"block":body_1},{}).f(ctx.get(["ext_text"], false),ctx,"h",["s"]).x(ctx.get(["stop_show_key"], false),ctx,{"block":body_2},{}).w("
\t\t\t
").f(ctx.get(["creating_filesindex_text"], false),ctx,"h").w("
").f(ctx.get(["tNumber of file entries processed"], false),ctx,"h").w(": ").f(ctx.get(["processed_file_entries"], false),ctx,"h").w("
").f(ctx.get(["tPercent finished"], false),ctx,"h").w(": ").f(ctx.get(["percent_finished"], false),ctx,"h").w("


");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("has_ident_error_clients",body_0);function body_0(chk,ctx){return chk.f(ctx.get(["tThis server has discovered clients which are currently not configured to use this server."], false),ctx,"h").w(" ").f(ctx.get(["tSee here for details on how this can happen."], false),ctx,"h").w("

").x(ctx.get(["stop_show_key"], false),ctx,{"block":body_1},{});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("").f(ctx.get(["tOk. Dismiss this hint."], false),ctx,"h").w("");}body_1.__dustBody=!0;return body_0;})(); @@ -26,49 +26,50 @@ (function(){dust.register("log_single",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tLog"], false),ctx,"h").w(": (").f(ctx.get(["name"], false),ctx,"h").w(")
\t").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
").f(ctx.get(["tLevel"], false),ctx,"h").w("").f(ctx.get(["tTime"], false),ctx,"h").w("").f(ctx.get(["tMessage"], false),ctx,"h").w("

").f(ctx.get(["tBack"], false),ctx,"h").w("

");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("log_single_filter",body_0);function body_0(chk,ctx){return chk.w("
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("log_single_none",body_0);function body_0(chk,ctx){return chk.w("").f(ctx.get(["tNo entries for this filter"], false),ctx,"h").w("");}body_0.__dustBody=!0;return body_0;})(); -(function(){dust.register("login",body_0);function body_0(chk,ctx){return chk.w("
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("log_single_row",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["level"], false),ctx,"h").w("
").f(ctx.get(["time"], false),ctx,"h").w("
").f(ctx.get(["message"], false),ctx,"h",["s"]).w("");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("login",body_0);function body_0(chk,ctx){return chk.w("
");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("logs_filter",body_0);function body_0(chk,ctx){return chk.w("");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("logs_none",body_0);function body_0(chk,ctx){return chk.w("").f(ctx.get(["tNo entries for this filter"], false),ctx,"h").w("");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("logs_report_mail",body_0);function body_0(chk,ctx){return chk.f(ctx.get(["report_single_mail"], false),ctx,"h").w(" -");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("logs_row",body_0);function body_0(chk,ctx){return chk.w(" ").f(ctx.get(["name"], false),ctx,"h").w("").f(ctx.get(["time"], false),ctx,"h").w("").f(ctx.get(["errors"], false),ctx,"h").w("
").f(ctx.get(["warnings"], false),ctx,"h").w("").f(ctx.get(["action"], false),ctx,"h").w("");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("logs_table",body_0);function body_0(chk,ctx){return chk.w("
").f(ctx.get(["tLogs"], false),ctx,"h").w("
\t").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
 ").f(ctx.get(["tComputer name"], false),ctx,"h").w("").f(ctx.get(["tBackup time"], false),ctx,"h").w("").f(ctx.get(["tErrors"], false),ctx,"h").w("").f(ctx.get(["tWarnings"], false),ctx,"h").w("").f(ctx.get(["tAction"], false),ctx,"h").w("
").f(ctx.get(["tLive Log"], false),ctx,"h").w("
").f(ctx.get(["tReports"], false),ctx,"h").w("
").x(ctx.get(["has_user"], false),ctx,{"else":body_1,"block":body_2},{}).w("
");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.f(ctx.get(["tYou need to create a user to be able to send reports"], false),ctx,"h");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("

 
+
").x(ctx.get(["can_report_script_edit"], false),ctx,{"block":body_3},{}).w("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("

").f(ctx.get(["tEdit report script"], false),ctx,"h").w("");}body_3.__dustBody=!0;return body_0;})(); (function(){dust.register("main_nav",body_0);function body_0(chk,ctx){return chk.w("
  • ").f(ctx.get(["name"], false),ctx,"h").w("
  • ");}body_0.__dustBody=!0;return body_0;})(); -(function(){dust.register("logs_table",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tLogs"], false),ctx,"h").w("
    \t").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
     ").f(ctx.get(["tComputer name"], false),ctx,"h").w("").f(ctx.get(["tBackup time"], false),ctx,"h").w("").f(ctx.get(["tErrors"], false),ctx,"h").w("").f(ctx.get(["tWarnings"], false),ctx,"h").w("").f(ctx.get(["tAction"], false),ctx,"h").w("
    ").f(ctx.get(["tLive Log"], false),ctx,"h").w("
    ").f(ctx.get(["tReports"], false),ctx,"h").w("
    ").x(ctx.get(["has_user"], false),ctx,{"else":body_1,"block":body_2},{}).w("
    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.f(ctx.get(["tYou need to create a user to be able to send reports"], false),ctx,"h");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("

     
    +
    ");}body_2.__dustBody=!0;return body_0;})(); -(function(){dust.register("main_nav_sel",body_0);function body_0(chk,ctx){return chk.w("
  • ").f(ctx.get(["name"], false),ctx,"h").w("
  • ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("new_version_available",body_0);function body_0(chk,ctx){return chk.f(ctx.get(["tThere is a new version of UrBackup server available"], false),ctx,"h").w(" (").f(ctx.get(["new_version_number"], false),ctx,"h").w("). Download it here.
    ").f(ctx.get(["tOk. Stop showing this."], false),ctx,"h").w("
    ");}body_0.__dustBody=!0;return body_0;})(); -(function(){dust.register("nospc_stalled",body_0);function body_0(chk,ctx){return chk.w("\t\t\t
    ").f(ctx.get(["nospc_stalled_text"], false),ctx,"h").w("

    ").f(ctx.get(["tOk. Reset this error"], false),ctx,"h").w("


    ");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("main_nav_sel",body_0);function body_0(chk,ctx){return chk.w("
  • ").f(ctx.get(["name"], false),ctx,"h").w("
  • ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("nospc_fatal",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["nospc_fatal_text"], false),ctx,"h").w("

    ").f(ctx.get(["tOk. Reset this error"], false),ctx,"h").w("


    ");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("nospc_stalled",body_0);function body_0(chk,ctx){return chk.w("\t\t\t
    ").f(ctx.get(["nospc_stalled_text"], false),ctx,"h").w("

    ").f(ctx.get(["tOk. Reset this error"], false),ctx,"h").w("


    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("progress_row",body_0);function body_0(chk,ctx){return chk.w("").f(ctx.get(["name"], false),ctx,"h").w("").f(ctx.get(["action"], false),ctx,"h").w("").x(ctx.get(["image"], false),ctx,{"else":body_1,"block":body_6},{}).x(ctx.get(["show_details"], false),ctx,{"block":body_7},{}).x(ctx.get(["backups_interrupted"], false),ctx,{"block":body_8},{}).w("
    ").x(ctx.get(["percent"], false),ctx,{"block":body_10},{}).w("
    ").x(ctx.get(["indexing"], false),ctx,{"block":body_11},{}).w("
    ").x(ctx.get(["f_total_bytes"], false),ctx,{"block":body_12},{}).w("").f(ctx.get(["eta"], false),ctx,"h").w("").f(ctx.get(["speed"], false),ctx,"h").w("").f(ctx.get(["queue"], false),ctx,"h").w("").x(ctx.get(["can_stop_backup"], false),ctx,{"block":body_13},{}).x(ctx.get(["can_stop_backup"], false),ctx,{"block":body_14},{}).x(ctx.get(["can_show_backup_log"], false),ctx,{"block":body_16},{}).w("");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.x(ctx.get(["client_update"], false),ctx,{"else":body_2,"block":body_5},{});}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.x(ctx.get(["file_restore"], false),ctx,{"else":body_3,"block":body_4},{});}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("-");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.f(ctx.get(["tPath:"], false),ctx,"h").w(" ").f(ctx.get(["details"], false),ctx,"h",["s"]);}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.f(ctx.get(["tTo version:"], false),ctx,"h").w(" ").f(ctx.get(["details"], false),ctx,"h");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.f(ctx.get(["tVolume:"], false),ctx,"h").w(" ").f(ctx.get(["details"], false),ctx,"h");}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.f(ctx.get(["details"], false),ctx,"h");}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w("
    ").f(ctx.get(["tBackups interrupted"], false),ctx,"h");}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.w("min-width: 2em;");}body_9.__dustBody=!0;function body_10(chk,ctx){return chk.f(ctx.get(["pcdone"], false),ctx,"h").w("%");}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.f(ctx.get(["tIndexing..."], false),ctx,"h");}body_11.__dustBody=!0;function body_12(chk,ctx){return chk.w("
    ").f(ctx.get(["f_done_bytes"], false),ctx,"h").w(" / ").f(ctx.get(["f_total_bytes"], false),ctx,"h").w("
    ");}body_12.__dustBody=!0;function body_13(chk,ctx){return chk.w("");}body_13.__dustBody=!0;function body_14(chk,ctx){return chk.x(ctx.get(["can_show_backup_log"], false),ctx,{"block":body_15},{});}body_14.__dustBody=!0;function body_15(chk,ctx){return chk.w(" ");}body_15.__dustBody=!0;function body_16(chk,ctx){return chk.w("");}body_16.__dustBody=!0;return body_0;})(); (function(){dust.register("progress_table",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tActivities"], false),ctx,"h").w("
    \t\t\t").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tComputer name"], false),ctx,"h").w("").f(ctx.get(["tAction"], false),ctx,"h").w("").f(ctx.get(["tDetails"], false),ctx,"h").w("").f(ctx.get(["tProgress"], false),ctx,"h").w("").f(ctx.get(["tETA"], false),ctx,"h").w("").f(ctx.get(["tSpeed"], false),ctx,"h").w("").f(ctx.get(["tFiles in queue"], false),ctx,"h").w(" 
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("progress_table_none",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tActivities"], false),ctx,"h").w("
    \t\t\t
    ").f(ctx.get(["tComputer name"], false),ctx,"h").w("").f(ctx.get(["tAction"], false),ctx,"h").w("").f(ctx.get(["tDetails"], false),ctx,"h").w("").f(ctx.get(["tProgress"], false),ctx,"h").w("").f(ctx.get(["tFiles in queue"], false),ctx,"h").w(" 
    ").f(ctx.get(["tNo activities"], false),ctx,"h").w("
    ");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("report_script_edit",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tEdit report script"], false),ctx,"h").w("

    ").f(ctx.get(["tReport script"], false),ctx,"h").w("

    \t\t

    ").x(ctx.get(["saved_ok"], false),ctx,{"block":body_1},{}).w("
    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("
    Saved script successfully.
    ");}body_1.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_archive_row",body_0);function body_0(chk,ctx){return chk.w("").f(ctx.get(["archive_every"], false),ctx,"h").w("").f(ctx.get(["archive_for"], false),ctx,"h").w("").f(ctx.get(["archive_window"], false),ctx,"h").w("").f(ctx.get(["archive_backup_type_str"], false),ctx,"h").w("").f(ctx.get(["archive_letters_str"], false),ctx,"h").w("").x(ctx.get(["show_archive_timeleft"], false),ctx,{"block":body_1},{}).w("");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("").f(ctx.get(["archive_timeleft"], false),ctx,"h").w("");}body_1.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_general",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["ONLY_WIN32_BEGIN"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["ONLY_WIN32_END"], false),ctx,"h",["s"]).w("
    MBit/s
     
    ").f(ctx.get(["settings_inv"], false),ctx,"h",["s"]).w("

     
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_group",body_0);function body_0(chk,ctx){return chk.w("

    ").f(ctx.get(["tGroup"], false),ctx,"h").w(" ").f(ctx.get(["groupname"], false),ctx,"h").w("

    \t\t\t\t\t\t
    \" onclick=\"addClientToGroup()\" />

    \t\t\t\t\t\t\t\t\t\t
    ").f(ctx.get(["settings_inv"], false),ctx,"h",["s"]).w("
    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("");}body_1.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_inv_row",body_0);function body_0(chk,ctx){return chk.x(ctx.get(["client_settings"], false),ctx,{"else":body_1,"block":body_2},{}).w("
    ").f(ctx.get(["thours"], false),ctx,"h").w("
    ").f(ctx.get(["tdays"], false),ctx,"h").w("
    ").f(ctx.get(["tdays"], false),ctx,"h").w("
    ").f(ctx.get(["tDays"], false),ctx,"h").w("
    ").x(ctx.get(["main_client"], false),ctx,{"block":body_4},{}).w("
    ").x(ctx.get(["main_client"], false),ctx,{"block":body_5},{}).w("
    ").x(ctx.get(["main_client"], false),ctx,{"block":body_6},{}).w("
    MBit/s
    ").x(ctx.get(["main_client"], false),ctx,{"block":body_7},{}).w("
    ").x(ctx.get(["main_client"], false),ctx,{"block":body_8},{}).w("
    ").f(ctx.get(["no_compname_start"], false),ctx,"h",["s"]).w("").f(ctx.get(["no_compname_end"], false),ctx,"h",["s"]).w("").f(ctx.get(["no_compname_start"], false),ctx,"h",["s"]).w("").f(ctx.get(["no_compname_end"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tArchive every"], false),ctx,"h").w("").f(ctx.get(["tArchive for"], false),ctx,"h").w("").f(ctx.get(["tArchive window"], false),ctx,"h").w(" ?").f(ctx.get(["tBackup type"], false),ctx,"h").w("").f(ctx.get(["tVolume letters"], false),ctx,"h").w("").f(ctx.get(["tNext archival"], false),ctx,"h").w(" 
     ").x(ctx.get(["archive_global"], false),ctx,{"block":body_9},{}).f(ctx.get(["no_compname_start"], false),ctx,"h",["s"]).w("").f(ctx.get(["no_compname_end"], false),ctx,"h",["s"]).w("\t\t
    ").x(ctx.get(["can_edit_scripts"], false),ctx,{"block":body_10},{}).w("
    ").f(ctx.get(["mod_alert_params"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["internet_settings_start"], false),ctx,"h",["s"]).w("
    ").x(ctx.get(["global_settings"], false),ctx,{"block":body_11},{}).x(ctx.get(["main_client"], false),ctx,{"block":body_12},{}).w("
    KBit/s
    ").x(ctx.get(["global_settings"], false),ctx,{"block":body_15},{}).x(ctx.get(["main_client"], false),ctx,{"block":body_16},{}).w("
    ").x(ctx.get(["main_client"], false),ctx,{"block":body_17},{}).w("
    ").f(ctx.get(["tMB"], false),ctx,"h").w("
    ").f(ctx.get(["tMB"], false),ctx,"h").w("
    ").x(ctx.get(["global_settings"], false),ctx,{"block":body_18},{}).w("
    ").f(ctx.get(["internet_settings_end"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["global_settings_start"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["global_settings_end"], false),ctx,"h",["s"]).w("
    \t\t\t
    ").f(ctx.get(["global_settings_start"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tMB"], false),ctx,"h").w("
    ").f(ctx.get(["global_settings_end"], false),ctx,"h",["s"]).w("
    ").x(ctx.get(["client_settings"], false),ctx,{"block":body_19},{});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("
    ");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("
    ");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("
    ");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("
    ").f(ctx.get(["tMin"], false),ctx,"h").w("
    ");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.f(ctx.get(["no_compname_start"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["no_compname_end"], false),ctx,"h",["s"]);}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.w("
    ");}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.f(ctx.get(["no_compname_start"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["no_compname_end"], false),ctx,"h",["s"]);}body_8.__dustBody=!0;function body_9(chk,ctx){return chk.w("");}body_9.__dustBody=!0;function body_10(chk,ctx){return chk.w("").f(ctx.get(["tEdit scripts"], false),ctx,"h").w("");}body_10.__dustBody=!0;function body_11(chk,ctx){return chk.w("
    ");}body_11.__dustBody=!0;function body_12(chk,ctx){return chk.nx(ctx.get(["global_settings"], false),ctx,{"block":body_13},{}).x(ctx.get(["with_authkey"], false),ctx,{"block":body_14},{});}body_12.__dustBody=!0;function body_13(chk,ctx){return chk.w("
    ");}body_13.__dustBody=!0;function body_14(chk,ctx){return chk.w("
    ");}body_14.__dustBody=!0;function body_15(chk,ctx){return chk.w("
    KBit/s
    ");}body_15.__dustBody=!0;function body_16(chk,ctx){return chk.w("
    ");}body_16.__dustBody=!0;function body_17(chk,ctx){return chk.w("
    ");}body_17.__dustBody=!0;function body_18(chk,ctx){return chk.w("
    ");}body_18.__dustBody=!0;function body_19(chk,ctx){return chk.w("
    ");}body_19.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_ldap",body_0);function body_0(chk,ctx){return chk.w("
    LDAP/AD login is currently undergoing development and testing. Please do not expect it to work.
    ").x(ctx.get(["test_login"], false),ctx,{"block":body_1},{}).w("
    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.x(ctx.get(["test_login_ok"], false),ctx,{"else":body_2,"block":body_3},{});}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("
    ").f(ctx.get(["tTest login failed. Error:"], false),ctx,"h").w(" ").f(ctx.get(["ldap_err"], false),ctx,"h").w("
    ");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("
    ").f(ctx.get(["tTest login succeeded. Rights of user:"], false),ctx,"h").w(" ").f(ctx.get(["ldap_rights"], false),ctx,"h").w("
    ");}body_3.__dustBody=!0;return body_0;})(); -(function(){dust.register("settings_mail_test_failed",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tSending test mail failed. Error:"], false),ctx,"h").w(" ").f(ctx.get(["mail_err"], false),ctx,"h").w("
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_mail",body_0);function body_0(chk,ctx){return chk.w("
    ");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("settings_mail_test_failed",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tSending test mail failed. Error:"], false),ctx,"h").w(" ").f(ctx.get(["mail_err"], false),ctx,"h").w("
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_mail_test_ok",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tTest Mail sent successfully"], false),ctx,"h").w(".
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_save_ok",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tSaved settings successfully"], false),ctx,"h").w(".
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_user_add_done",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["msg"], false),ctx,"h").w("
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_user_create",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["rights"], false),ctx,"h",["s"]).w("
    ");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("settings_user",body_0);function body_0(chk,ctx){return chk.w("

    ").f(ctx.get(["tClient"], false),ctx,"h").w(" ").f(ctx.get(["clientname"], false),ctx,"h").w("

    ").x(ctx.get(["groupmod"], false),ctx,{"block":body_1},{}).w("
    ").f(ctx.get(["settings_inv"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["overwrite_warning_start"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tWarning: The settings configured on the client will overwrite the settings configured here. If you want to change this behaviour do not allow the client to change settings."], false),ctx,"h").w("
    ").f(ctx.get(["overwrite_warning_end"], false),ctx,"h",["s"]).w("

     
    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("
    Member of group
    ");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("
  • ").f(ctx.get(["tPermissions"], false),ctx,"h").w("
  • ");}body_3.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_user_create_admin",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["rights"], false),ctx,"h",["s"]).w("
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_user_pw_change",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tChange password for user"], false),ctx,"h").w(": ").f(ctx.get(["username"], false),ctx,"h").w("
    ");}body_0.__dustBody=!0;return body_0;})(); -(function(){dust.register("settings_user_rights_change",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tChange rights for user"], false),ctx,"h").w(": ").f(ctx.get(["username"], false),ctx,"h").w("
    ").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tDomain"], false),ctx,"h").w("").f(ctx.get(["tRights"], false),ctx,"h").w("").f(ctx.get(["tTranslation"], false),ctx,"h").w("").f(ctx.get(["tActions"], false),ctx,"h").w("

    ").f(ctx.get(["tNew domain"], false),ctx,"h").w("
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_user_rights_change_row",body_0);function body_0(chk,ctx){return chk.w("");}body_0.__dustBody=!0;return body_0;})(); +(function(){dust.register("settings_user_rights_change",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tChange rights for user"], false),ctx,"h").w(": ").f(ctx.get(["username"], false),ctx,"h").w("
    ").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tDomain"], false),ctx,"h").w("").f(ctx.get(["tRights"], false),ctx,"h").w("").f(ctx.get(["tTranslation"], false),ctx,"h").w("").f(ctx.get(["tActions"], false),ctx,"h").w("

    ").f(ctx.get(["tNew domain"], false),ctx,"h").w("
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_users_start",body_0);function body_0(chk,ctx){return chk.w("
    \t\t\t").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tUsername"], false),ctx,"h").w("").f(ctx.get(["tRights"], false),ctx,"h").w("").f(ctx.get(["tActions"], false),ctx,"h").w("
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_users_start_row",body_0);function body_0(chk,ctx){return chk.w("").f(ctx.get(["name"], false),ctx,"h").w("").f(ctx.get(["rights"], false),ctx,"h").w("").x(ctx.get(["can_change"], false),ctx,{"block":body_1},{}).w("");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w(" ");}body_1.__dustBody=!0;return body_0;})(); (function(){dust.register("settings_users_start_row_empty",body_0);function body_0(chk,ctx){return chk.w("").f(ctx.get(["tNo Users"], false),ctx,"h").w("");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("stat_general",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tStorage usage"], false),ctx,"h").w("
    ").f(ctx.get(["tLoading"], false),ctx,"h").w("...

     
    ").x(ctx.get(["maximized"], false),ctx,{"block":body_1},{}).w("
    ").f(ctx.get(["tBackup Statistics"], false),ctx,"h").w("
    ").nx(ctx.get(["maximized"], false),ctx,{"block":body_2},{}).w("\t\t\t").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tComputer name"], false),ctx,"h").w("").f(ctx.get(["tImages"], false),ctx,"h").w("").f(ctx.get(["tFiles"], false),ctx,"h").w("").f(ctx.get(["tAll"], false),ctx,"h").w("
    ").f(ctx.get(["tSum"], false),ctx,"h").w("
    ").f(ctx.get(["tImages"], false),ctx,"h").w("").f(ctx.get(["images_total"], false),ctx,"h").w("
    ").f(ctx.get(["tFiles"], false),ctx,"h").w("").f(ctx.get(["files_total"], false),ctx,"h").w("
    ").f(ctx.get(["tAll"], false),ctx,"h").w("").f(ctx.get(["used_total"], false),ctx,"h").w("
    ").nx(ctx.get(["maximized"], false),ctx,{"block":body_3},{}).w("
    ").x(ctx.get(["maximized"], false),ctx,{"block":body_4},{}).w("
    ").f(ctx.get(["tStorage allocation"], false),ctx,"h").w("
    ").f(ctx.get(["tLoading"], false),ctx,"h").w("...
    ").x(ctx.get(["maximized"], false),ctx,{"block":body_5},{});}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("
    ");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("
    ");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("
    ");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("
    ");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("
    ");}body_5.__dustBody=!0;return body_0;})(); (function(){dust.register("stat_general_row",body_0);function body_0(chk,ctx){return chk.w("").f(ctx.get(["name"], false),ctx,"h").w("").f(ctx.get(["images"], false),ctx,"h").w("").f(ctx.get(["files"], false),ctx,"h").w("").f(ctx.get(["used"], false),ctx,"h").w("");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("stat_user",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tStorage usage of"], false),ctx,"h").w(" ").f(ctx.get(["clientname"], false),ctx,"h").w("
    ").f(ctx.get(["tLoading"], false),ctx,"h").w("...

     
    ");}body_0.__dustBody=!0;return body_0;})(); -(function(){dust.register("status_client_download",body_0);function body_0(chk,ctx){return chk.w("");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.f(ctx.get(["tDownload client for Windows"], false),ctx,"h");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.f(ctx.get(["tDownload client for Mac OS X"], false),ctx,"h");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.f(ctx.get(["tDownload client for Linux"], false),ctx,"h");}body_3.__dustBody=!0;return body_0;})(); (function(){dust.register("status_detail",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tBackup status"], false),ctx,"h").w("
    ").f(ctx.get(["nospc_fatal"], false),ctx,"h",["s"]).f(ctx.get(["nospc_stalled"], false),ctx,"h",["s"]).f(ctx.get(["dir_error"], false),ctx,"h",["s"]).f(ctx.get(["tmpdir_error"], false),ctx,"h",["s"]).f(ctx.get(["database_error"], false),ctx,"h",["s"]).f(ctx.get(["endian_info"], false),ctx,"h",["s"]).f(ctx.get(["virus_error"], false),ctx,"h",["s"]).w("").x(ctx.get(["show_select_box"], false),ctx,{"block":body_1},{}).w("").f(ctx.get(["rows"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tComputer name"], false),ctx,"h").w("").f(ctx.get(["tGroup name"], false),ctx,"h").w("").f(ctx.get(["tOnline"], false),ctx,"h").w("").f(ctx.get(["tStatus"], false),ctx,"h").w("").f(ctx.get(["tLast seen"], false),ctx,"h").w("").f(ctx.get(["tLast file backup"], false),ctx,"h").w("").f(ctx.get(["tLast image backup"], false),ctx,"h").w("").f(ctx.get(["tFile backup status"], false),ctx,"h").w("").f(ctx.get(["tImage backup status"], false),ctx,"h").w("").f(ctx.get(["tIP"], false),ctx,"h").w("").f(ctx.get(["tClient version"], false),ctx,"h").w("").f(ctx.get(["tOperating System"], false),ctx,"h").w("
    ").x(ctx.get(["status_can_show_all"], false),ctx,{"block":body_2},{}).f(ctx.get(["modify_clients"], false),ctx,"h",["s"]).x(ctx.get(["has_client_download"], false),ctx,{"block":body_3},{}).x(ctx.get(["allow_add_client"], false),ctx,{"block":body_4},{}).w("
    ").x(ctx.get(["removed_clients_table"], false),ctx,{"block":body_5},{}).w("
    ").x(ctx.get(["status_extra_clients"], false),ctx,{"block":body_8},{}).w("
    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("
    ").f(ctx.get(["status_client_download_windows"], false),ctx,"h",["s"]).f(ctx.get(["status_client_download_mac"], false),ctx,"h",["s"]).f(ctx.get(["status_client_download_linux"], false),ctx,"h",["s"]).w("
    ");}body_3.__dustBody=!0;function body_4(chk,ctx){return chk.w("");}body_4.__dustBody=!0;function body_5(chk,ctx){return chk.w("
    ").s(ctx.get(["removed_clients"], false),ctx,{"block":body_6},{}).w("
    ").f(ctx.get(["tComputer name"], false),ctx,"h").w(" 
    ");}body_5.__dustBody=!0;function body_6(chk,ctx){return chk.w("").f(ctx.get(["name"], false),ctx,"h").w("").f(ctx.get(["tThis client is going to be removed. "], false),ctx,"h").w(" ").x(ctx.get(["remove_client"], false),ctx,{"block":body_7},{}).f(ctx.get(["tClients are removed during the cleanup in the cleanup time window. "], false),ctx,"h").w("");}body_6.__dustBody=!0;function body_7(chk,ctx){return chk.w("").f(ctx.get(["tStop removing client"], false),ctx,"h").w(". ");}body_7.__dustBody=!0;function body_8(chk,ctx){return chk.w("
    ").f(ctx.get(["tClient discovery hints"], false),ctx,"h").w("
    \t\t\t").f(ctx.get(["extra_clients_rows"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tHostname/IP"], false),ctx,"h").w("").f(ctx.get(["tOnline"], false),ctx,"h").w("").f(ctx.get(["tActions"], false),ctx,"h").w("
    ");}body_8.__dustBody=!0;return body_0;})(); +(function(){dust.register("status_client_download",body_0);function body_0(chk,ctx){return chk.w("");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.f(ctx.get(["tDownload client for Windows"], false),ctx,"h");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.f(ctx.get(["tDownload client for Mac OS X"], false),ctx,"h");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.f(ctx.get(["tDownload client for Linux"], false),ctx,"h");}body_3.__dustBody=!0;return body_0;})(); (function(){dust.register("status_detail_extra_row",body_0);function body_0(chk,ctx){return chk.w("").f(ctx.get(["hostname"], false),ctx,"h").w("").f(ctx.get(["online"], false),ctx,"h").w("");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("status_detail_row",body_0);function body_0(chk,ctx){return chk.w("").x(ctx.get(["show_select_box"], false),ctx,{"block":body_1},{}).w("").f(ctx.get(["name"], false),ctx,"h").w("").f(ctx.get(["groupname"], false),ctx,"h").w("").f(ctx.get(["online"], false),ctx,"h").w("").f(ctx.get(["status"], false),ctx,"h",["s"]).w("").f(ctx.get(["lastseen"], false),ctx,"h").w("").f(ctx.get(["lastbackup"], false),ctx,"h").f(ctx.get(["start_file_backup"], false),ctx,"h",["s"]).w("").f(ctx.get(["lastbackup_image"], false),ctx,"h").f(ctx.get(["start_image_backup"], false),ctx,"h",["s"]).w("").f(ctx.get(["file_ok_t"], false),ctx,"h").w("").f(ctx.get(["image_ok_t"], false),ctx,"h").w("").f(ctx.get(["ip"], false),ctx,"h").w("").f(ctx.get(["client_version_string"], false),ctx,"h").w("").f(ctx.get(["os_version_string"], false),ctx,"h").w("");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("");}body_1.__dustBody=!0;return body_0;})(); +(function(){dust.register("status_percent_done",body_0);function body_0(chk,ctx){return chk.w("
    ").x(ctx.get(["percent"], false),ctx,{"block":body_2},{}).w("
    ").x(ctx.get(["indexing"], false),ctx,{"block":body_3},{}).w("
    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("min-width: 2em;");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.f(ctx.get(["pcdone"], false),ctx,"h").w("%");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.f(ctx.get(["tIndexing..."], false),ctx,"h");}body_3.__dustBody=!0;return body_0;})(); (function(){dust.register("status_modify_clients",body_0);function body_0(chk,ctx){return chk.w("
    ").f(ctx.get(["tSelect all"], false),ctx,"h").w("").f(ctx.get(["tSelect none"], false),ctx,"h").w("").f(ctx.get(["rem_start"], false),ctx,"h",["s"]).w("").f(ctx.get(["tRemove selected"], false),ctx,"h").w("").f(ctx.get(["rem_stop"], false),ctx,"h",["s"]).w("
    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("tmpdir_error",body_0);function body_0(chk,ctx){return chk.w("\t\t\t
    ").f(ctx.get(["tmpdir_error_text"], false),ctx,"h").x(ctx.get(["stop_show_key"], false),ctx,{"block":body_1},{}).w("


    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("

    ").f(ctx.get(["tOk. Stop showing this error"], false),ctx,"h").w("");}body_1.__dustBody=!0;return body_0;})(); (function(){dust.register("upgrade_error",body_0);function body_0(chk,ctx){return chk.w("\t\t\t
    ").f(ctx.get(["upgrade_error_text"], false),ctx,"h").w("
    ").f(ctx.get(["tCurrent version"], false),ctx,"h").w(": ").f(ctx.get(["curr_db_version"], false),ctx,"h").w("
    ").f(ctx.get(["tTarget version"], false),ctx,"h").w(": ").f(ctx.get(["target_db_version"], false),ctx,"h").w("


    ");}body_0.__dustBody=!0;return body_0;})(); (function(){dust.register("virus_error",body_0);function body_0(chk,ctx){return chk.w("\t\t\t
    On-access virus scanner active in temporary file path. This will cause backups to fail once your virus scanner detects a backed up file as a virus. Your virus scanner will also probably scan each backed up file multiple times causing performance problems. You should consider completely disabling the on-access virus scanner on the server or at the very least exclude UrBackup server's temporary path ( ").f(ctx.get(["virus_error_path"], false),ctx,"h").w(" ).").x(ctx.get(["stop_show_key"], false),ctx,{"block":body_1},{}).w("


    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("

    ").f(ctx.get(["tOk. Stop showing this error"], false),ctx,"h").w("");}body_1.__dustBody=!0;return body_0;})(); -(function(){dust.register("status_percent_done",body_0);function body_0(chk,ctx){return chk.w("
    ").x(ctx.get(["percent"], false),ctx,{"block":body_2},{}).w("
    ").x(ctx.get(["indexing"], false),ctx,{"block":body_3},{}).w("
    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("min-width: 2em;");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.f(ctx.get(["pcdone"], false),ctx,"h").w("%");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.f(ctx.get(["tIndexing..."], false),ctx,"h");}body_3.__dustBody=!0;return body_0;})(); -(function(){dust.register("settings_user",body_0);function body_0(chk,ctx){return chk.w("

    ").f(ctx.get(["tClient"], false),ctx,"h").w(" ").f(ctx.get(["clientname"], false),ctx,"h").w("

    ").x(ctx.get(["groupmod"], false),ctx,{"block":body_1},{}).w("
    ").f(ctx.get(["settings_inv"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["overwrite_warning_start"], false),ctx,"h",["s"]).w("
    ").f(ctx.get(["tWarning: The settings configured on the client will overwrite the settings configured here. If you want to change this behaviour do not allow the client to change settings."], false),ctx,"h").w("
    ").f(ctx.get(["overwrite_warning_end"], false),ctx,"h",["s"]).w("

     
    ");}body_0.__dustBody=!0;function body_1(chk,ctx){return chk.w("
    Member of group
    ");}body_1.__dustBody=!0;function body_2(chk,ctx){return chk.w("");}body_2.__dustBody=!0;function body_3(chk,ctx){return chk.w("
  • ").f(ctx.get(["tPermissions"], false),ctx,"h").w("
  • ");}body_3.__dustBody=!0;return body_0;})(); diff --git a/urbackupserver/www/js/translation.js b/urbackupserver/www/js/translation.js index 36bb4590..86c9a6f4 100644 --- a/urbackupserver/www/js/translation.js +++ b/urbackupserver/www/js/translation.js @@ -1587,7 +1587,8 @@ translations.en = { "confirm_alert_script_remove": "Are you sure you want to remove this alert script?", "alert_file_mult": "Number of times the file backup interval after which the file backup status is set to not ok", "alert_image_mult": "Number of times the image backup interval after which the image backup status is set to not ok", -"alert_emails": "E-Mail addresses (separated by ';') to notify once the image/file backup status is not ok" +"alert_emails": "E-Mail addresses (separated by ';') to notify once the image/file backup status is not ok", +"alert_important": "Add [Important] tag to alert mails" } translations.en_US = { "tInfos": "About" diff --git a/urbackupserver/www/js/urbackup.js b/urbackupserver/www/js/urbackup.js index b368319c..d6e4f696 100644 --- a/urbackupserver/www/js/urbackup.js +++ b/urbackupserver/www/js/urbackup.js @@ -4468,6 +4468,7 @@ function show_logs2(data) td.sel_warn=(data.report_loglevel==1)?sel:""; td.sel_error=(data.report_loglevel==2)?sel:""; td.live_log_clients=live_log_clients; + td.can_report_script_edit = data.can_report_script_edit; if(data.has_user) { td.has_user=true; @@ -5303,7 +5304,7 @@ function show_scripts2(data) g.alert_script_idx.push(j); } - var tdata = dustRender("alert_script_edit", {alert_scripts: script_options, mod_alert_params: params_html} ); + var tdata = dustRender("alert_script_edit", {alert_scripts: script_options, mod_alert_params: params_html, saved_ok: data.saved_ok} ); if(g.data_f!=tdata) { @@ -5311,6 +5312,11 @@ function show_scripts2(data) g.data_f=tdata; } + if(data.saved_ok) + { + setTimeout(remove_saved_ok, 5000); + } + require.config({ paths: { 'vs': 'js/vs' }}); require(['vs/editor/editor.main'], function() { @@ -5389,4 +5395,49 @@ function showAlertScript() { if(!startLoading()) return; new getJSON("scripts", "sa=get_alert&id="+I("alert_script").value, show_scripts2); +} +function show_report_script1() +{ + if(!startLoading()) return; + new getJSON("scripts", "sa=get_report", show_report_script2); + I('nav_pos').innerHTML=""; +} +function remove_saved_ok() +{ + if(I("saved_ok")) + { + I("saved_ok").remove(); + } +} +function show_report_script2(data) +{ + stopLoading(); + + var tdata = dustRender("report_script_edit", data); + + if(g.data_f!=tdata) + { + I('data_f').innerHTML=tdata; + g.data_f=tdata; + } + + if(data.saved_ok) + { + setTimeout(remove_saved_ok, 5000); + } + + require.config({ paths: { 'vs': 'js/vs' }}); + + require(['vs/editor/editor.main'], function() { + g.editor = monaco.editor.create(document.getElementById('editor'), { + value: unescapeHTML(data.script), + language: 'lua' + }); + }); +} +function saveReportScript() +{ + if(!startLoading()) return; + var params="&script="+encodeURIComponent(g.editor.getValue()); + new getJSON("scripts", "sa=set_report"+params, show_report_script2); } \ No newline at end of file diff --git a/urbackupserver/www/templates/alert_script_edit.htm b/urbackupserver/www/templates/alert_script_edit.htm index 8b5ae9a7..9feebd20 100644 --- a/urbackupserver/www/templates/alert_script_edit.htm +++ b/urbackupserver/www/templates/alert_script_edit.htm @@ -41,5 +41,10 @@
    + {?saved_ok} +
    + Saved script successfully. +
    + {/saved_ok} diff --git a/urbackupserver/www/templates/logs_table.htm b/urbackupserver/www/templates/logs_table.htm index 095ed202..eb6f2c3f 100644 --- a/urbackupserver/www/templates/logs_table.htm +++ b/urbackupserver/www/templates/logs_table.htm @@ -78,6 +78,11 @@
    + {?can_report_script_edit} +
    +
    + {tEdit report script} + {/can_report_script_edit} {:else} {tYou need to create a user to be able to send reports} diff --git a/urbackupserver/www/templates/report_script_edit.htm b/urbackupserver/www/templates/report_script_edit.htm new file mode 100644 index 00000000..88c9d1e5 --- /dev/null +++ b/urbackupserver/www/templates/report_script_edit.htm @@ -0,0 +1,17 @@ +
    +
    {tEdit report script}
    +
    +
    +

    {tReport script}

    +
    +
    +
    +
    + + {?saved_ok} +
    + Saved script successfully. +
    + {/saved_ok} +
    +