# Functions
AddDirsToPath adds the directories in []string to the $PATH.
AddHereToPath adds the location of the executable to the $PATH.
No description provided by the author
Args0 returns the absolute path to the executable based on os.Args[0] For AppImages, it will resolve to the outside of an AppImage.
CalculateDigestSkippingRanges calculates the sha256 hash of a file while assuming that the supplied byteRanges are consisting fo '0x00's.
CalculateElfSize returns the size of an ELF binary as an int64 based on the information in the ELF header.
No description provided by the author
No description provided by the author
Check for needed files on $PATH.
CheckIfAllToolsArePresent checks if all the required tools, for example.
CheckIfExecFileExists checks whether a desktop file that points to an-existing Exec= entries.
CheckIfFileExists checks if a file exists and is not a directory before we try using it to prevent further errors.
CheckIfFileOrFolderExists checks if a file exists and is not a directory before we try using it to prevent further errors.
CheckIfFolderExists checks if a folder exists and is a directory before we try using it to prevent further errors.
CheckIfSquashfsVersionSufficient checks whether mksquashfs/unsquashfs is recent enough to use -offset, prints an error message otherwise Returns true if sufficient, false otherwise.
Return true if magic string (hex) is found at offset TODO: Instead of magic string, could probably use something like []byte{'\r', '\n'} or []byte("AI").
Return true if magic string (hex) is found at offset TODO: Instead of magic string, could probably use something like []byte{'\r', '\n'} or []byte("AI").
CheckSignature checks the signature embedded in an AppImage at path, returns the entity that has signed the AppImage and error based on https://stackoverflow.com/a/34008326.
CopyFile copies the src file to dst.
No description provided by the author
Decrypt decrypts a []byte that was encrypted using OpenSSL and AES-256-CBC.
DecryptBase64 decrypts a base64 encoded []byte that was encrypted using OpenSSL and AES-256-CBC.
DecryptString decrypts a base64 encoded string that was encrypted using OpenSSL and AES-256-CBC.
DeleteDesktopFilesWithNonExistingTargets deletes desktop files in xdg.DataHome + "/applications/" that point to non-existing Exec= entries.
EmbedStringInSegment embeds a string in an ELF segment, returns error.
Encrypt encrypts a []byte in a manner compatible to OpenSSL encryption functions using AES-256-CBC as encryption algorithm.
EncryptBase64 encrypts a []byte in a manner compatible to OpenSSL encryption functions using AES-256-CBC as encryption algorithm and encode to base64 format.
EncryptString encrypts a string in a manner compatible to OpenSSL encryption functions using AES-256-CBC as encryption algorithm and encode to base64 format.
Returns true if file or directory exists Why is this not in the standard library?.
FilesWithPrefixInDirectory returns the files in a given directory with the given filename extension, and err.
FilesWithSuffixInDirectory returns the files in a given directory with the given filename extension, and err.
FilesWithSuffixInDirectoryRecursive returns the files in a given directory with the given filename extension, and err.
FindMostRecentFile returns the most recent file from a slice of files, (currently) based on its mtime based on https://stackoverflow.com/a/45579190 TODO: mtime may be fast, but is it "good enough" for our purposes?.
GetCommitMessageForLatestCommit gets the commit message for the latest commit (currently only on GitHub) using UpdateInformation.
GetCommitMessageForThisCommitOnTravis returns a string with the most recent commit message for the commit in the TRAVIS_COMMIT environment variable, and error.
GetElfArchitecture returns the architecture of a file, and err.
GetGitRepository returns a git Repository if cwd is a git repository, and error otherwise.
GetReleaseURL gets the URL message for the latest release (currently only on GitHub) matching the given UpdateInformation.
GetSectionData returns the contents of an ELF section and error.
GetSectionOffsetAndLength returns the Offset and Length of an ELF section and error.
GetValuesForAllDesktopFiles gets the values for a given key from all desktop files in xdg.DataHome + "/applications/".
Here returns the absolute path to the parent directory of the executable based on /proc/self/exe This will only work on Linux.
HereArgs0 returns the absolute path to the parent directory of the executable based on os.Args[0] For AppImages, it will resolve to the outside of an AppImage.
IsCommandAvailable returns true if a file is on the $PATH.
Returns true if path is a directory Why is this not in the standard library?.
LogError logs error, prefixed by a string that explains the context.
No description provided by the author
NewUpdateInformationFromString returns an UpdateInformation struct for the given updateinformation string, and err TODO: Use UpdateInformation structs throughout the codebase.
No description provided by the author
PrintError prints error, prefixed by a string that explains the context.
No description provided by the author
ReplaceTextInFile replaces search string with replce string in a file.
RunCmdStringTransparently works like RunCmdTransparently but accepts a string rather than a []string as its input.
RunCmdTransparently runs the command given in a []string and runs it transparently (stdin and stderr appear immediately while the command is running).
SignAppImage signs an AppImage, returns error Based on https://gist.github.com/eliquious/9e96017f47d9bd43cdf9.
SliceContains returns true if the []string contains string, false otherwise.
No description provided by the author
ValidateAppStreamMetainfoFile validates an AppStream metainfo file using the appstreamcli tool on the $PATH Returns error if validation fails and prints any errors to stderr.
ValidateDesktopFile validates a desktop file using the desktop-file-validate tool on the $PATH Returns error if validation fails and prints any errors to stderr.
ValidateUpdateInformation validates an updateinformation string, returns error.
WriteFileIntoOtherFileAtOffset writes the content of inputfile into outputfile at Offset, without truncating Returns error in case of errors, otherwise returns nil.
WriteStringIntoOtherFileAtOffset writes the content of inputstring into outputfile at Offset, without truncating Returns error in case of errors, otherwise returns nil.
# Constants
Encrypted private key.
Name of the secret environment variable stored on Travis CI.
This key in the desktop files written by appimaged describes where the AppImage is in the filesystem.
Our namespace.
TODO: Instead of using hardcoded values here, we should grab those values from some URL where we can change them, to allow the broker and namespace to be switched at any time without having to update all clients.
Private key.
Public key.
This key in the desktop files written by appimaged contains the updateinformation string that we write there so that we can get all updateinformation strings easily when we get a MQTT message telling us that an update is available.
# Structs
No description provided by the author
No description provided by the author
Define the PubSubData that gets exchanged between AppImage authoring tool and AppImage desktop integration tool (e.g., appimagetool and appimaged).
Please note that pre-releases are not being considered when using "latest".
Watchdog calls a function once after a certain delay has elapsed; kicking it resets the delay.