* build: new pipeline, new way to cross-compile and build docker images locally. (#3383)
* build: use alternative repositories
* build: fix
* build: validate taglib downloads
* build: control concurrency
* build: validate xx version
* build: remove taglib download validation as the version can be changed as an argument.
* [enhancement]: Provide native backup/restore mechanism
- db.go: add Backup/Restore functions that utilize Sqlite's built-in online backup mechanism
- support automatic backup with schedule, limit number of files
- provide commands to manually backup/restore Navidrome
Notes:
`Step(-1)` results in a read-only lock being held for the entire duration of the backup.
This will block out any other write operation (and may hold additional locks.
An alternate implementation that doesn't block but instead retries is available at https://www.sqlite.org/backup.html#:~:text=of%20a%20Running-,database,-%2F*%0A**%20Perform%20an%20online (easily adaptable to go), but has the potential problem of continually getting restarted by background writes.
Additionally, the restore should still only be called when Navidrome is offline, as the restore process does not run migrations that are missing.
* remove empty line
* add more granular backup schedule
* do not remove files when bypass is set
* move prune
* refactor: small nitpicks
* change commands and flags
* tests, return path from backup
* refactor: small nitpicks
---------
Co-authored-by: Deluan <deluan@navidrome.org>
* First version/rough layout of the required wix to build an MSI that embeds everything
* Don't need revision number
* produced exe from existing build process is navidrome not Navidrome
* Adding Kardianos wrapper around Cobra so the callbacks are handled
automatically (this is basically only for windows)
* Adding pointless check to shut up lint for now
* make format
* Revert disabling npm tidy
* Using Kardianos always will result in the application hanging so it
needs only be wrapped to handle the callbacks if it's being used in
the service context, otherwise use cobra directly
* Copying in service installation etc from https://github.com/navidrome/navidrome/pull/2295
* Under Linux this installs a user service (I don't think this is
correct, but lets get this working first). User units/services
cannot depends on system units, so previously this bombed out
with Exit Code 5.
* Under Windows we can install both the x86 and x64 builds, they
will install to different folders, but previously they would
overwrite the service as they were both called Navidrome. Now,
it will install 2 services. This will still be weird/broken as
they will attempt to listen on the same port, however uninstalling
the "wrong" arch will not cause the "right" one to be partially
uninstalled anymore
* Reverting changes to the context as they don't really seem necessary anyway
* Need to consistently name the service
* Fixing broken context
* The included files should be removed when the app is uninstalled
* Reverting back to the original context here, I don't think
it makes any difference to running under kardianos
* Let's see what we have immediately available
* OK, the build takes ages so let's just try and do the whole thing in one go, maybe we'll get lucky
* Need -r on directory copy, plus we'll probably need to install wixl
* No sudo cmd, so I assume this runs as root
* WORKSPACE!
* Moving the version to be a single variable, we'll probably be able to pull it from the github tag or whatever
* Might as well put the msi in the right folder, it's tidier
* Writing the version number into the msi, from the output of goreleaser
* Using jq to parse the goreleaser metadata, so need to install it
* MSI only supports numerical version numbers, so I'll make the "snapshot" version .1 minor patch greater
* -r or --raw (on newer versions) means we don't get the "" around the value
* Running as a user service I think makes limited sense for this
* Will now ask for configuration settings during install.
MSI/WiX only supports writing out INI files, Toml is almost
INI compatable, except that the INI needs to write out a section
first, so we need to have a script to strip that off.
We are forced to display a License.rtf file by the UI so I think
the build process should probably rename the default licence file
and that will suffice.
Uninstalling works cleanly, howvever upgrades seem to leave the old
version installed in "programs and features" currently.
Adding the UI has introduced a requirement for WiX 0.103
* Updating the build to include --ext ui for the new config ui
* Configuration dialog should not display for upgrades as the config file
is already written
* Making description consistent with the systemd service and making
the build process produce the required License.rtf
* Fixing " non-constant format string in call to fmt.Errorf (govet)"
* Its a string, not an int; read better.
* Wixl 103 is required for --ext ui, so we need 24.04
* OK this is still installing Wix 0.101, maybe it all needs to be 24.04?
* Switching the builds back to ubuntu-latest (22.04 at current)
as it runs on a custom container, it's actually debian anyway
Moving msi build into its own job so it can run on 24.04 so
we have access to wixl 0.103 for --ext ui support
* Forcing build
* Whitespace fix
* Adding sudo I guess
* Gotta checkout as well
* Adding debugging for when there's soemthing wrong with the paths
* Adding more ls to see if the output has worked
* The msi's are in subdirs
* Actually they're in the ./wix directory
* Still can't find these msi's?
* I think that was being treated literally previously
* No idea why this isn't working, give it a relative path instead?
* Making explicit on the dialogue that the configuration file will be
where the installation dir is
* The lint keeps failing and it's just getting in the way so I'll
turn this off for now and we'll edit out this commit from the merge
* Cutting more out of the build to get more stuff out of the way
* Need to increase the width to fit the text in
* Calling everything License.rtf, presumably one of them is correct
* I am pretty sure the License.rtf loading is broken under Wixl; so
let's just bypass the EULA from the UI which is a nicer experience
for the users anyway
* This needs to be after WelcomeDlg now the Eula isn't displayed
* You're supposed to be able to use <WixVariable> to override the
location that the bmp's are loaded from, I can't get this to work
under wixl so I'm guessing given that the ui extension is new, it
hasn't been implemented with that in mind. So we'll hack it by
overwriting the files installed with the package.
* We should make this less brittle so when wixl is updated it still works
* Re-enabling the lint and tests etc
* Improving the scaling quality and removing borders from images to
tidy them up a tad
* Pretty sure this isn't necessary as MY_PROPERTY will always be false
* Without publishing this event, we can't continue to the next dialogue
however I think we should be able to get away without the property
* Refactoring out the duplication so we only have one service
defined and we can run that either way
* Pushing the Interactive check into the root commmand? Feels like it
is probably getting closer to the right place at least
* go tidy
* OK this didn't work under windows, I'm guessing it's because
it's lacking all the metadata about the service it needs to
report back to Windows on.
* We need to run service execute now so that the windows
service will behave (hopefully)!
* Lint
* go tidy
* Renaming service to "navidrome" rather than "Navidrome" as this
is the filename that systemd writes and it's unusual to have
capital letters in service names under Linux.
Switching to use service execute for Linux to mirror Windows
* Need to provide the arguments to append
* Without passing the context around, the DB isn't closed gracefully
so we end up with with .db-shm and .db-wal files for recovery
* We should log fatal rather than outputting directly to stdout
* go tidy
* refactor: small nitpicks
* fix: terminate service gracefully
---------
Co-authored-by: Deluan Quintão <deluan@navidrome.org>