{"id":16748702,"url":"https://github.com/pimdewitte/dynamicupdateclient","last_synced_at":"2025-03-16T03:29:01.295Z","repository":{"id":27469602,"uuid":"30948841","full_name":"PimDeWitte/DynamicUpdateClient","owner":"PimDeWitte","description":"A dynamic update client that allows you to keep software updated on any linux-based operating system.","archived":false,"fork":false,"pushed_at":"2015-11-10T13:25:07.000Z","size":1248,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T16:12:53.975Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PimDeWitte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-18T02:28:09.000Z","updated_at":"2022-06-17T17:01:33.000Z","dependencies_parsed_at":"2022-09-02T07:51:19.865Z","dependency_job_id":null,"html_url":"https://github.com/PimDeWitte/DynamicUpdateClient","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PimDeWitte%2FDynamicUpdateClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PimDeWitte%2FDynamicUpdateClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PimDeWitte%2FDynamicUpdateClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PimDeWitte%2FDynamicUpdateClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PimDeWitte","download_url":"https://codeload.github.com/PimDeWitte/DynamicUpdateClient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822286,"owners_count":20353495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T02:13:26.939Z","updated_at":"2025-03-16T03:29:01.260Z","avatar_url":"https://github.com/PimDeWitte.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"http://i.imgur.com/Ig3C9h8.png\"/\u003e\n\nDynamicUpdateClient\n===================\n\nThe dynamic update client is a simple, lightweight but useful update client for linux that watches local versions and remote versions and updates the local system if new updates come available automatically. It uses cron to schedule logic.\n\nThe update client is placed on all devices that run modules which could be updated. The client is responsible for selecting, downloading and triggering updates. It was designed to run on the Intel Edison in order to update systems in places without internet, but it can be adapted more widely. \n\n###Running the Dynamic Update Client:\n\nIf you'd like to test it's functionality, simply place the contents of the www folder on any web server.\n\nIn the root folder, build the project by running the build script\n\n```\n    ./build.sh\n```\n\nIn the bin folder, run the following:\n```\n    ./duclient.sh --config\n```\n\nYou will now be prompted with the configuration where you can enter the Dynamic update host, port, and the user that will run the updates.\n\nAfter you're done, these settings will be written to a cron job and a configuration file. You can re-run this configuration at any time to add or remove modules.\n \nYou can edit the modules on your system by editing the bin/versions/config.json file. This makes it extremely easy to add or stop packages in your system.\n\n###How does it work?\n\nFirst, the update client retrieves the latest index file form the web repository listed in bin/versions/config.json. \n\nIt will then locally retrieve the currently installed version of that module. We will refer to this as from_version\n\nIt will then iterate over the versions that the web repository is showing, until it finds our local version. If any other versions are found, the update client will download and execute these updates in the order they are shown in the index file.\n\nFor each version that was found in the remote index file that came after our local version, we will execute the following tasks:\n\nEnsure this package should not be ignored (It will be ignored if it has returned 1 in the past, so that you can release a new package to update the system without it getting stuck)\n\nDownload the package\n\nInstall the package \n\nExecute the update.sh script with three parameters, the from_version, the version it is updating to (to_version) and the number of times the update has been retried.\n\nWhen the exit code is 0, the update was successful and the from_version  value should be updated.\n\nWhen the exit code is 1, the update was not successful and this package should be ignored in the future. As a security, the maximum amount of times an update can fail is 4 times.\n\nWhen the exit code is 2, the update was not successful but should be attempted again in X minutes. The update client must first do that before continuing with the next update.\n\n\n\n##Remote Package Contents\nEach shell package must at least contain an update.sh shell script. This shell script will be executed by the update client after extraction and is responsible for the update process.\n\nPackages must follow a particular naming convention. The filename is comprised of the module name (e.g. example-package), followed by a dash (-) and the version label (e.g. 1.0.0). The version label must follow the semantic version pattern int + ‘.’ + int + ‘.’ + int or int + ‘.’ + int. Some examples are: example-package-0.0.1. \n\nEach package has to contain an update.sh shell script\nThe update script will be executed as follows:\n\n```\n/bin/bash update.sh \u003cfrom_version\u003e \u003cto_version\u003e \u003cretry_count\u003e\n\n\u003cfrom_version\u003e is the currently installed version\n\u003cto_version\u003e is the version that the update script is expected to install\n\u003cretry_count\u003e is the number of times the script was retried, starting at 0\n```\n\nThe update script has three main responsibilities:\nOnly start an update if it was explicitly designed to be able to update from_version to to_version\nIf midway an update it cannot continue, it must revert the changes it has made to that point.\nReturn the appropriate exit code:\n0 - if the update was successful\n1 - if the update was not successful, nor can it be expected that it will in the future. An example could be that the from_version is not supported by that update.\n2 - if the update was not successful, but it should be tried again later. An example could be that user activity was detected too recently and it wants to avoid interrupting an ongoing process.\n\n\n\n##Index File\nAn index file has to be placed in the server repository root. It must have the exact name that was provided when configuring the module. It's a JSON array that you can add updates to as you go.\n\n```\n[\n    {\n            \"src\": \"http://packages.local/example-package-1.1.1.zip\",\n            \"version\": \"1.1.1\"\n    },\n  \t{\n            \"src\": \"http://packages.local/example-package.1.2.zip\",\n            \"version\": \"1.2\"\n    }\n]\n```\nThe index file is served by a web repository using an HTTP web server. The location of the index file follows the following pattern SERVER_URL + ‘/’ + MODULE_NAME + ‘.json’. For example: http://packages.local/example-package.json\n\n##Questions?\nEmail pim (at) [name of this company without inc] dot com or tweet me at @PimDeWitte","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpimdewitte%2Fdynamicupdateclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpimdewitte%2Fdynamicupdateclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpimdewitte%2Fdynamicupdateclient/lists"}