Skip to content

Commit

Permalink
Tweak updater and add option to bypass backup.
Browse files Browse the repository at this point in the history
Closes #411.
  • Loading branch information
emaijala committed Nov 2, 2024
1 parent 154cb58 commit 530c653
Show file tree
Hide file tree
Showing 9 changed files with 230 additions and 106 deletions.
8 changes: 8 additions & 0 deletions htaccess-denyall
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>

<IfModule mod_authz_core.c>
Require all denied
</IfModule>
9 changes: 8 additions & 1 deletion js/mlinvoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,14 @@ var MLInvoice = (function CreateMLInvoice() {
'{date}': formatDate(data.date)
}
);
var $span = $('<span/>').attr('title', title).text(translate('UpdateAvailable') + ' ');
var text = translate(
'UpdateAvailable',
{
'{version}': data.version,
'{date}': formatDate(data.date)
}
);
var $span = $('<span/>').attr('title', title).text(text + ' ');
$('<br>').appendTo($span);
$('<a>').attr('href', data.url).attr('target', '_blank').text(translate('UpdateInformation')).appendTo($span);
$('<br>').appendTo($span);
Expand Down
4 changes: 2 additions & 2 deletions js/mlinvoice.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/mlinvoice.min.js.map

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions lang/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ ServerError = 'Error from server'
CannotDeleteCurrentUser = 'Cannot delete currently logged-in user'

; Updater
UpdateAvailable = '(update available)'
UpdateAvailable = '(update v{version} available)'
UpdateAvailableTitle = 'Update to version {version} available (release date {date})'
UpdatedVersionAvailable = 'Update to version %%version%% available. Currently installed version is %%currentversion%%.'
UpdateMajorVersion = 'This is a major update, this brings significant changes.'
UpdatedVersionAvailable = 'Update to version %%version%% (released %%date%%) available. Currently installed version is %%currentversion%%.'
UpdateMajorVersion = 'This is a major update that brings significant changes.'
UpdateInformation = 'Information about the updated version.'
UpdateFromChannel = 'UPDATE CHANNEL: %%channel%%'
UpdateNow = 'Update now.'
Expand All @@ -303,6 +303,7 @@ StartUpdate = 'Start Update'
LatestVersion = 'Latest version is already in use.'
DownloadingUpdate = 'Downloading update, please wait...'
UpdateDownloaded = 'Update has been downloaded.'
CreatingBackup = 'Creating backup, please wait...'
ExtractingUpdate = 'Extracting update, please wait...'
UpdateExtracted = 'Update has been extracted.'
UpdateSuccessful = 'Update complete.'
Expand All @@ -314,6 +315,9 @@ DatabaseUpgradeFailed = 'Database upgrade failed. Further details in PHP error l
ObsoleteFilesWillBeRemoved = 'Note that obsolete files that were previously installed as a part of MLInvoice will be automatically removed during the update.'
RemovingObsoleteFiles = 'Removing obsolete files, please wait...'
ObsoleteFilesRemoved = 'Obsolete files have been removed.'
UpdateBackupDescription = 'Creating a backup of files may slow down the update significantly. In some cases it can lead to the installation timing out. Backup of the database must be done separately.'
UpdateCreateBackup = 'Create Backup of files (in backup subdirectory on the server, does not include the database)'


; Form Buttons
Save = 'Save'
Expand Down
7 changes: 5 additions & 2 deletions lang/fi-FI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ ServerError = 'Virhe palvelimelta'
CannotDeleteCurrentUser = 'Kirjautuneena olevaa käyttäjää ei voida poistaa'

; Updater
UpdateAvailable = '(päivitys saatavissa)'
UpdateAvailable = '(päivitys v{version} saatavissa)'
UpdateAvailableTitle = 'Päivitys versioon {version} saatavissa (julkaistu {date})'
UpdatedVersionAvailable = 'Päivitys versioon %%version%% saatavissa. Käytössä on versio %%currentversion%%.'
UpdatedVersionAvailable = 'Päivitys versioon %%version%% (julkaistu %%date%%) saatavissa. Käytössä on versio %%currentversion%%.'
UpdateMajorVersion = 'Tämä on suuri versiopäivitys, joka tuo mukanaan merkittäviä muutoksia.'
UpdateInformation = 'Tietoa uudesta versiosta.'
UpdateFromChannel = 'PÄIVITYSKANAVA: %%channel%%'
Expand All @@ -303,6 +303,7 @@ StartUpdate = 'Aloita päivitys'
LatestVersion = 'Uusin versio on jo käytössä.'
DownloadingUpdate = 'Ladataan päivityspakettia, odota...'
UpdateDownloaded = 'Päivityspaketti on ladattu.'
CreatingBackup = 'Tehdään varmuuskopiota, odota...'
ExtractingUpdate = 'Puretaan päivityspakettia, odota...'
UpdateExtracted = 'Päivityspaketti on purettu.'
UpdateSuccessful = 'Päivitys on valmis.'
Expand All @@ -314,6 +315,8 @@ DatabaseUpgradeFailed = 'Tietokannan päivitys epäonnistui. Tarkemmat tiedot PH
ObsoleteFilesWillBeRemoved = 'Huom! Vanhentuneet tiedostot, jotka olivat aiemmin osa MLInvoicea, poistetaan automaattisesti.'
RemovingObsoleteFiles = 'Poistetaan vanhentuneita tiedostoja, odota...'
ObsoleteFilesRemoved = 'Vanhentuneet tiedostot on poistettu.'
UpdateBackupDescription = 'Varmuuskopion tekeminen voi hidastaa päivitystä huomattavasti. Joissain tapauksissa päivitys voi myös keskeytyä aikakatkaisuun. Tietokannan varmuuskopiointi on suoritettava erikseen.'
UpdateCreateBackup = 'Tee varmuuskopio (backup-hakemistoon palvelimella, ei sisällä tietokantaa)'

; Form Buttons
Save = 'Tallenna'
Expand Down
8 changes: 6 additions & 2 deletions lang/sv-FI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ ServerError = 'Fel från servern'
CannotDeleteCurrentUser = 'Kan inte radera inloggad användare'

; Updater
UpdateAvailable = '(uppdatering tillgänglig)'
UpdateAvailable = '(uppdatering till v{version} tillgänglig)'
UpdateAvailableTitle = 'Uppdatering till version {version} finns tillgänglig (publicerad {date})'
UpdatedVersionAvailable = 'Uppdatering till version %%version%% tillgänglig. Nuvarande versionen är %%currentversion%%.'
UpdatedVersionAvailable = 'Uppdatering till version %%version%% (publicerad %%date%%) tillgänglig. Nuvarande versionen är %%currentversion%%.'
UpdateMajorVersion = 'Detta är en stor uppdatering som innehåller signifikanta förändringar.'
UpdateInformation = 'Mer information om den uppdaterade versionen.'
UpdateFromChannel = 'UPPDATERINGSKANAL: %%channel%%'
Expand All @@ -305,6 +305,7 @@ StartUpdate = 'Starta uppdateringen'
LatestVersion = 'Senast version redan i bruk.'
DownloadingUpdate = 'Hämtar uppdateringen, var god vänta...'
UpdateDownloaded = 'Uppdateringen hämtats.'
CreatingBackup = 'Skapar en säkerhetskopia, var god vänta...'
ExtractingUpdate = 'Extraherar updateringen, var god vänta...'
UpdateExtracted = 'Uppdateringen har extraherats.'
UpdateSuccessful = 'Uppdateringen lyckad.'
Expand All @@ -316,6 +317,9 @@ DatabaseUpgradeFailed = 'Uppdatering av databas misslyckades. Närmare uppgifter
ObsoleteFilesWillBeRemoved = 'OBS! Föråldrade filer som tidigare installerades som en del av MLInvoice kommer att raderas automatiskt under uppgraderingen.'
RemovingObsoleteFiles = 'Raderar föråldrade filer, var god vänta...'
ObsoleteFilesRemoved = 'Föråldrade filer har raderats.'
UpdateBackupDescription = 'Att skapa en säkerhetskopia kan sakta ner uppdateringen avsevärt. I vissa fall kan det leda till att installationen avbryts. Säkerhetskopiering av databasen måste göras separat.'
UpdateCreateBackup = 'Skapa en säkerhetskopia (i backup mapp på servern, inkluderar inte databasen)'


; Form Buttons
Save = 'Spara'
Expand Down
2 changes: 1 addition & 1 deletion sqlfuncs.php
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,7 @@ function getDb(): \Doctrine\DBAL\Connection
'user' => _DB_USERNAME_,
'password' => _DB_PASSWORD_,
'host' => _DB_SERVER_,
'driver' => 'pdo_mysql',
'driver' => 'mysqli',
'charset' => 'utf8mb4',
];
return \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
Expand Down
Loading

0 comments on commit 530c653

Please sign in to comment.