🔥 An awesome Updater for small projects 🔥
-
- 1.1. Built With
-
- 2.1. Binaries
- 2.2. Building from source
- 2.3 Setting Up
There are some good updaters out there but I haven't found a single one that is small enough and easy to use, so I created this project
Main benefits:
- Your time should be focused on creating something amazing, not thinking about delivering the product via complex processes
- Most updaters are really complex to set up. This one is just a few clicks away
If you have any problem, feel free to fork this project and edit it to your needs or create a pull request, everything counts!
- TQDM (easy to use progress bars)
- coloredlogs (easy loggin solution)
PLEASE CHECK IF YOUR pip
is pip from python3, if not, use pip3 in all the commands bellow
This is an example of how to install and set up your content delivery to your customers. These steps might require some knowledge of Linux and firewalls.
Binaries are probably the fastest way to get going. Feel free to grab one from releases (make sure you use the correct platform)
-
Clone the repository
git clone https://github.com/Stax124/Updater
-
Navigate to the created folder
cd Updater
-
Install dependencies
pip install -r requirements.txt
-
Build the application
$ pip install pyinstaller (Linux) chmod +x scripts/build.sh (Linux) ./scripts/build.sh (Windows) .\scripts\build.ps1
There should be a folder called
dist
with the executable in it.
-
Install
Apache2
/Nginx
(or similar) on your content distribution serversudo apt install apache2 (optional) sudo systemctl status apache2
-
Upload all your files to the webserver via sftp of similar (don't forget to add Updater executable to root of your project, so that it can be used from clients machine for downloading updates)
(local machine) cd [folder that you have your files for distribution] (local machine) sftp [username]@[server] (remote server) cd /var/www/html/[your folder that will be used as mirror] (remote machine) put *
-
Download Linux executable from releases and put it on path
cd ~ mkdir utils cd utils wget --no-check-certificate [link to executable from our releases] export PATH="~/utils:$PATH"
Note that it will be usable only for this session. If you don't want to use the
export PATH=...
command, you can add the following line to your~/.bashrc
file:export PATH="~/utils:$PATH"
-
Navigate to webserver folder and generate hashtable
cd /var/www/html/[folder where you want to store the distributables] updater -g hashtable.hash [-e files_or_directories_to_exclude]
File
hashtable.hash
will be generated. Client will then be able to download the latest version of your project. -
Open port 80 (or the one you want to use) on both your webserver and firewall
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport [port] -j ACCEPT sudo netfilter-persistent save --- or if you have ufw--- sudo ufw allow [port]
-
Test if the connection can be established (nmap is a good tool to test this)
nmap [remote server ip] -Pn -p [port] -sS
Place snippets of code for your language into your projects
All of these snippets are using system calls to run the updater. Feel free to modify them or use something else.
Optionally, if you are using python in your project, you can just copy this source code and then call is similarly as they are called in the main.py
file.
import os
os.system("updater -m http://example/mirror http://example/hashtable.hash -y")
const { exec } = require("child_process");
exec(
"updater -m http://example/mirror http://example/hashtable.hash -y",
(error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
}
);
const process = Deno.run({
cmd: ["updater", "-m http://example/mirror http://example/hashtable.hash -y"],
});
#include <iostream>
using namespace std;
int update ()
{
system("updater -m http://example/mirror http://example/hashtable.hash -y");
return 0;
}
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
file for more information.
Tomáš Novák - tamoncz@gmail.com
Project Link: https://github.com/Stax124/Updater