Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto update on Linux #771

Open
5 tasks done
ghost opened this issue Feb 2, 2024 · 20 comments
Open
5 tasks done

Auto update on Linux #771

ghost opened this issue Feb 2, 2024 · 20 comments
Labels
help wanted Extra attention is needed / I am not capable of it / I would need

Comments

@ghost
Copy link

ghost commented Feb 2, 2024

Preliminary checklist

  • I have read the README
  • I have read the FAQs.
  • I have searched existing issues for my feature request. This is a new issue (NOT a duplicate) and is not related to another issue.
  • I have searched wont fix issues and this request is not among them
  • This is a feature request for the Cromite browser; not the website nor F-Droid nor anything else.

Is your feature request related to privacy?

No

Is there a patch available for this feature somewhere?

No

Describe the solution you would like

Just make it able to auto update itself in any possible way.

Describe alternatives you have considered

A script that I made.
https://github.com/The-Hypervisor/Updating-Scripts/blob/main/scripts/Cromite.md

@Manjitsharmahere
Copy link

Preliminary checklist

  • I have read the README
  • I have read the FAQs.
  • I have searched existing issues for my feature request. This is a new issue (NOT a duplicate) and is not related to another issue.
  • I have searched wont fix issues and this request is not among them
  • This is a feature request for the Cromite browser; not the website nor F-Droid nor anything else.

Is your feature request related to privacy?

No

Is there a patch available for this feature somewhere?

No

Describe the solution you would like

Just make it able to auto update itself in any possible way.

Describe alternatives you have considered

A script that I made. https://github.com/The-Hypervisor/Updating-Scripts/blob/main/scripts/Cromite.md

ERROR ;

update-cromite
Scripts/Update/Cromite.sh: line 5: jq: command not found
Cromite has an update to version do you want to update it? (y/n)
y
--2024-02-09 16:31:58-- https://github.com/uazo/cromite/releases/download//chrome-lin64.tar.gz
Resolving github.com (github.com)... 20.207.73.82
Connecting to github.com (github.com)|20.207.73.82|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-02-09 16:31:59 ERROR 404: Not Found.

tar: ./chrome-lin64.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
mv: cannot stat 'chrome-lin/*': No such file or directory
rm: cannot remove 'chrome-lin64.tar.gz': No such file or directory

@ghost
Copy link
Author

ghost commented Feb 10, 2024

Try installing the jq command.
https://www.programmerhat.com/jq-command-not-found/

Then retry executing this command and tell me what did you get:

curl -s https://api.github.com/repos/uazo/cromite/releases/latest | jq -r '.tag_name'

Btw which Linux distro are you on?

@Manjitsharmahere
Copy link

Manjitsharmahere commented Feb 10, 2024 via email

@Manjitsharmahere
Copy link

Manjitsharmahere commented Feb 10, 2024 via email

@ghost
Copy link
Author

ghost commented Feb 10, 2024

I use zorin os

It should work once you install jq.

btw how to update manually

Just download the latest Linux build, remove the old one, extract the one you just downloaded and you are good to go, you will not lose your data when you remove the old directory.

@Manjitsharmahere
Copy link

Manjitsharmahere commented Feb 10, 2024 via email

@ghost
Copy link
Author

ghost commented Feb 10, 2024

man i just deleted cromite. YouTube was not working and i have most of the
work on youtube 💀

If you want also to delete all the data associated with it you should remove .config/chromium

rm -rf .config/chromium

@uazo
Copy link
Owner

uazo commented Feb 13, 2024

@The-Hypervisor thanks, but I would be more inclined to activate an apt repo for cromite, but I don't know how to do it.

YouTube was not working and i have most of the work on youtube

is because of #710
Try again with a more up-to-date version

@uazo uazo added the help wanted Extra attention is needed / I am not capable of it / I would need label Feb 13, 2024
@ghost
Copy link
Author

ghost commented Feb 23, 2024

@The-Hypervisor thanks, but I would be more inclined to activate an apt repo for cromite, but I don't know how to do it.

It would be very nice to make it available as a Flatpak in Fluthub so all Linux users can install it from there, because many people (myself included) do not use Debian or Debian based distros, so the apt repo will be a huge limitation for us.

@now0clock
Copy link

Hello.

I found this fork of Chromium and it has a deb repo FWIW:

https://github.com/Alex313031/Thorium

I have added this repo to my Ubuntu 22.04 PC's sources.list.d and it works great, instructions seen here:

https://thorium.rocks/#installation

I agree on making it available as a Flatpak too. Maybe you guys can collaborate with each other on something similar for Cromite. I would contribute to this project, but I am merely a beta tester (with a lot of different web browsers installed on my devices, maybe too many! lol)

Hope this helps the issue..

Thanks
☮️

@Jaaannis
Copy link

Jaaannis commented Mar 6, 2024

Anyone saved the script from post 1 ?

@now0clock
Copy link

Anyone saved the script from post 1 ?

404 Not Found

@Jaaannis
Copy link

Jaaannis commented Mar 17, 2024

here is a very simple one, it just download and move the latest release to your destination (lin64).
Just edit the and rename it from cromite_update.txt to cromite_update.sh (I cannot upload .sh files)
Than do a

bash cromite_update.sh

maybe someone have more time/knowledge to optimize that :-)
cromite_update.txt

@NearestWater262
Copy link

@The-Hypervisor thanks, but I would be more inclined to activate an apt repo for cromite, but I don't know how to do it.

It would be very nice to make it available as a Flatpak in Fluthub so all Linux users can install it from there, because many people (myself included) do not use Debian or Debian based distros, so the apt repo will be a huge limitation for us.

I agree! Flatpak would very much increase wide adoption for this browser

@Twig6943
Copy link

Twig6943 commented Apr 7, 2024

pls package as flatpak 😭

@ghnbr
Copy link

ghnbr commented Apr 11, 2024

i wasnt smart enough when searching therefore I made my own update script until an "official" update method is provided.

#! /bin/bash
# Cromite update script by someone
# Script to leverage the updateurl.txt file to update linux cromite and later run it. It can be fired from a .desktop file
# Usage: cromite_update.sh <folder_to_update> <parameter_to_send_to_cromite_at_run>
#
# Its recommended to create a parent folder for cromite and put in that folder the script, the cromite folder and the user profile folders
# - parentfolder
# -- cromite_update.sh
# -- cromite_folder, typically cromite-lin
# -- User1_profile_folder
# -- User2_profile_folder
# -- ...
#
# Then call the run the script cromite_update.sh cromite_folder --user-data-dir=User1_profile_folder
# 
# <folder_to_update>: is the folder in which cromite resides and the one to be updated. If the folder doesnt exist *it will be created*
# <parameter_to_send_to_cromite_at_run>: Optional. Usually used to set --user-data-dir= or other chromium options. 
# 
# VERSIONING
# 2024-04-11, nbr, v1: Initial version
# 

# This depends on uazo
cromite_updateurl_file="https://github.com/uazo/cromite/releases/latest/download/updateurl.txt"

# download the updateurl file
update_url=$(wget https://github.com/uazo/cromite/releases/latest/download/updateurl.txt -q -O -)
if [ $? -ne 0 ]; then
	notify-send  "wget failed!. Check connectivity and Cromite url"
	exit
fi

if [ $# -lt 1 ]; then
   # Script's folder
   cromite_local_folder=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/chrome-lin;
else
   cromite_local_folder=${1%/};
fi
notify-send "Checking updates for cromite in $cromite_local_folder"

#Check for chrome executable in case of empty folder, mkdir will fail but doesnt matter
if [ -f $cromite_local_folder/chrome ]; then
   version_installed=$($cromite_local_folder/chrome --version | grep -o '\<[0-9.]*\>')
else
   mkdir $cromite_local_folder
   version_installed="0"
fi

version_available=$(echo $update_url | grep -oP '(?<=\bversion=)[^;]+')
#download_url=$(grep -oP '(?<=\bdownload=)[^;]+' $update_url)
download_url=$(echo $update_url | grep -oP '(?<=\bdownload=)[^;]+')
# file is for windows, we are looking the linux one. All this to be ready for a linux updateurl.txt
download_url=${download_url/chrome-win.zip/chrome-lin64.tar.gz}

if { echo "$version_available"; echo "$version_installed"; } | sort --version-sort --check=silent; then
  echo "Current version $version_installed equal or greater than available $version_available"
  notify-send "Current cromite version $version_installed equal or greater than available $version_available"
else
  #echo "Current version $version_installed minor than available $version_available, update needed"
  #echo "Getting latest version $version_available from $download_url"
  notify-send "Getting latest version $version_available from $download_url"
  #TODO: get file name from url
  mkdir upd
  wget $download_url  -q --show-progress -O upd/chrome-lin64.tar.gz
  notify-send "Uncompressing downloaded file"
  tar -xf upd/chrome-lin64.tar.gz -C upd
  notify-send "Replacing files in $cromite_local_folder/"
  #if [ -d chrome-lin/locales ]; then mv -f chrome-lin/locales/* $cromite_local_folder/locales/; fi
  mv -f upd/chrome-lin/* $cromite_local_folder/
  
  #Cleanup
  rm -rf upd
 
fi

#Run the updated (or not) cromite using $2 as parameter
(nohup $cromite_local_folder/chrome $2 &)

cromite-update.txt

The idea is to leverage the udpdateurl.txt file same way is done for win version.

Im sharing to see if someone finds it helpful. Feel free to destroy it :P

Im using it from a shortcut in the desktop to update and run.

@ddulz
Copy link

ddulz commented Aug 30, 2024

i wasnt smart enough when searching therefore I made my own update script until an "official" update method is provided.

#! /bin/bash
# Cromite update script by someone
# Script to leverage the updateurl.txt file to update linux cromite and later run it. It can be fired from a .desktop file
# Usage: cromite_update.sh <folder_to_update> <parameter_to_send_to_cromite_at_run>
#
# Its recommended to create a parent folder for cromite and put in that folder the script, the cromite folder and the user profile folders
# - parentfolder
# -- cromite_update.sh
# -- cromite_folder, typically cromite-lin
# -- User1_profile_folder
# -- User2_profile_folder
# -- ...
#
# Then call the run the script cromite_update.sh cromite_folder --user-data-dir=User1_profile_folder
# 
# <folder_to_update>: is the folder in which cromite resides and the one to be updated. If the folder doesnt exist *it will be created*
# <parameter_to_send_to_cromite_at_run>: Optional. Usually used to set --user-data-dir= or other chromium options. 
# 
# VERSIONING
# 2024-04-11, nbr, v1: Initial version
# 

# This depends on uazo
cromite_updateurl_file="https://github.com/uazo/cromite/releases/latest/download/updateurl.txt"

# download the updateurl file
update_url=$(wget https://github.com/uazo/cromite/releases/latest/download/updateurl.txt -q -O -)
if [ $? -ne 0 ]; then
	notify-send  "wget failed!. Check connectivity and Cromite url"
	exit
fi

if [ $# -lt 1 ]; then
   # Script's folder
   cromite_local_folder=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/chrome-lin;
else
   cromite_local_folder=${1%/};
fi
notify-send "Checking updates for cromite in $cromite_local_folder"

#Check for chrome executable in case of empty folder, mkdir will fail but doesnt matter
if [ -f $cromite_local_folder/chrome ]; then
   version_installed=$($cromite_local_folder/chrome --version | grep -o '\<[0-9.]*\>')
else
   mkdir $cromite_local_folder
   version_installed="0"
fi

version_available=$(echo $update_url | grep -oP '(?<=\bversion=)[^;]+')
#download_url=$(grep -oP '(?<=\bdownload=)[^;]+' $update_url)
download_url=$(echo $update_url | grep -oP '(?<=\bdownload=)[^;]+')
# file is for windows, we are looking the linux one. All this to be ready for a linux updateurl.txt
download_url=${download_url/chrome-win.zip/chrome-lin64.tar.gz}

if { echo "$version_available"; echo "$version_installed"; } | sort --version-sort --check=silent; then
  echo "Current version $version_installed equal or greater than available $version_available"
  notify-send "Current cromite version $version_installed equal or greater than available $version_available"
else
  #echo "Current version $version_installed minor than available $version_available, update needed"
  #echo "Getting latest version $version_available from $download_url"
  notify-send "Getting latest version $version_available from $download_url"
  #TODO: get file name from url
  mkdir upd
  wget $download_url  -q --show-progress -O upd/chrome-lin64.tar.gz
  notify-send "Uncompressing downloaded file"
  tar -xf upd/chrome-lin64.tar.gz -C upd
  notify-send "Replacing files in $cromite_local_folder/"
  #if [ -d chrome-lin/locales ]; then mv -f chrome-lin/locales/* $cromite_local_folder/locales/; fi
  mv -f upd/chrome-lin/* $cromite_local_folder/
  
  #Cleanup
  rm -rf upd
 
fi

#Run the updated (or not) cromite using $2 as parameter
(nohup $cromite_local_folder/chrome $2 &)

cromite-update.txt

The idea is to leverage the udpdateurl.txt file same way is done for win version.

Im sharing to see if someone finds it helpful. Feel free to destroy it :P

Im using it from a shortcut in the desktop to update and run.

pretty good script, just maybe delete locales folder anyway, it cause segfault for me. not really sure why.

@DIGist
Copy link

DIGist commented Oct 23, 2024

@The-Hypervisor thanks, but I would be more inclined to activate an apt repo for cromite, but I don't know how to do it.

It would be very nice to make it available as a Flatpak in Fluthub so all Linux users can install it from there, because many people (myself included) do not use Debian or Debian based distros, so the apt repo will be a huge limitation for us.

I agree! Flatpak would very much increase wide adoption for this browser

I second the idea of packaging as flatpak or appimage for wider adoption and may help with some of the update challenges.

@uazo
Copy link
Owner

uazo commented Oct 23, 2024

I second the idea of packaging as flatpak

I do not recommend the use of flatpak with cromite/chromium, see #1053

... appimage

wip in #1579 but I don't know if it is the same appimage as you say.

@DIGist
Copy link

DIGist commented Oct 23, 2024

@uazo Yes, I just checked #1579, it does seem that you are already working on the Appimage solution, so I'm excited. I made a simple script to repackage the tar.gz as an appimage, but the script listed in #1579 is more robust. Thanks for everything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed / I am not capable of it / I would need
Projects
None yet
Development

No branches or pull requests

12 participants