Safesync Resurrected - mirrorlist admin for experts - feedback is appreciated

Safesync wants to be yet another Archlinux Repositories Administrator, for more advanced usage, especially useful for experts.
Feedback from the first developer preview alpha(?) version, is appreciated.

Why Ressurected? Once upon a time, safesync was born, to overcome a distribution’s own utility, with which I had several disagreements on the functionality and usability. It was a personal bash self educating project, which served its purpose (at least for one user :smile: ). After being renamed to m1ms, it was left to silently disappear, while it helped me walk away from that other distribution :wink:

What can safesync do?

  • Initialize (create from nothing) a pacman mirrorlist
  • Prompts for countries selection, when available, using a rofi menu (for the time being, rofi is a dependency. To be changed in the future.)
  • Save the new mirrorlist file at the default system path (/etc/pacman.d/), or in the invoking user’s local respective folder ($HOME/.local/share/safesync/mirrorlists/), or in a custom path.
  • Rate the servers of a given mirrorlist file and sort them on speed.
  • Adds a file heading with info about the creation and modification time, as well as the command and parameters that were used to create/modify the list.

What can safesync do that is different or better than rankmirrors, or reflector?

  • Initializes (creates from nothing) and sorts any known repository. Currently, there is included information for EndeavourOS, Chaotic-AUR, Arcolinux, while it is easily extendable for other repositories.
  • Better speed ranking, as it downloads an as large as possible file from the given repository, using <$repo>.files by default or the selected $repo, in case the mirrorlist serves more than one repository (i.e. extra or community for Archlinux mirrorlist).
  • Better speed ranking, as it subtracts the connection time from the total download time, leading to a more accurate acual download speed, especially useful on secure protocols (HTTPS).
  • Can check remote repo timestamp and disable servers that are older than the local repository DB.
  • Saves activity logs and ranking info in temporary log files, that can be reviewed, for better understanding of servers behavior.
  • Can print normal, extra, or no activity information during runtime usage.
  • Is used with normal user privileges, no root usage is allowed. It uses sudo only when needed.
  • Can be used in scripted mode
  • When checking for safety, also checks Servers Include(d) inside pacman.conf :white_check_mark:
  • Is compatible with Arch Linux ARM :white_check_mark:

Known issues - TODOs

  • Add configuration file for user default preferences (almost ready)
  • Add rsync compatibility for servers with rsync protocol
  • Check, set, delete pacman DB lock, when saving at system path
  • :white_check_mark: Remove rofi dependency
  • Use a country selection method with bash/cli function

Install the latest version 0.2.2 using PKGBUILD:

pkgname=safesync
pkgver=0.2.2
pkgrel=1
pkgdesc="Yet another Archlinux Repositories Administrator, for more advanced usage, especially useful for experts"
arch=('any')
url="https://gitlab.com/petsam/$pkgname"
license=('GPL3')
depends=()
optdepends=('rofi')
source=("$url"/-/archive/$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('b38fd75f6ddaef20a995e8442f8126afb109d36bf1539205adc2b63679b22eb8')

package() {
	cd "$pkgname-$pkgver"
	install -Dm755 $pkgname $pkgdir/usr/bin/$pkgname
}
5 Likes

Link shows page not found.

Edit:
Is it possible to add archarm repos?

I don’t know why. It shows up when I click. Could it be private to me only?.. :fearful:
https://gitlab.com/petsam/safesync

I only need a url to a raw mirrorlist file and the repo name (as in pacman.conf)

The way archlinuxarm mirrors work is a bit different.
The default mirror is a global load balancing mirror and the other mirrors are normal mirrors like in archlinux. I currently manually uncomment the mirrors that are geographically located closest to me.

## Geo-IP based mirror selection and load balancing
#Server = http://mirror.archlinuxarm.org/$arch/$repo

### Mirrors by country

### Australia (not Austria!)
## Sydney
# Server = http://au.mirror.archlinuxarm.org/$arch/$repo

### Brazil
## Sao Paulo
# Server = http://br.mirror.archlinuxarm.org/$arch/$repo

### Denmark
## Aalborg
# Server = http://dk.mirror.archlinuxarm.org/$arch/$repo

### Germany
## Aachen
# Server = http://de3.mirror.archlinuxarm.org/$arch/$repo
## Berlin
# Server = http://de.mirror.archlinuxarm.org/$arch/$repo
## Coburg
# Server = http://de4.mirror.archlinuxarm.org/$arch/$repo
## Falkenstein
# Server = http://eu.mirror.archlinuxarm.org/$arch/$repo
# Server = http://de5.mirror.archlinuxarm.org/$arch/$repo

### Greece
## Athens
# Server = http://gr.mirror.archlinuxarm.org/$arch/$repo

### Hungary
## Budapest
# Server = http://hu.mirror.archlinuxarm.org/$arch/$repo

### Japan
## Tokyo
# Server = http://jp.mirror.archlinuxarm.org/$arch/$repo

### Singapore
# Server = http://sg.mirror.archlinuxarm.org/$arch/$repo

### South Africa
## Johannesburg
# Server = http://za.mirror.archlinuxarm.org/$arch/$repo

### Taiwan
## Hsinchu
# Server = http://tw2.mirror.archlinuxarm.org/$arch/$repo
## New Taipei City
# Server = http://tw.mirror.archlinuxarm.org/$arch/$repo

### United Kingdom
## London
# Server = http://uk.mirror.archlinuxarm.org/$arch/$repo

### United States
## California
#Server = http://ca.us.mirror.archlinuxarm.org/$arch/$repo
## Florida
# Server = http://fl.us.mirror.archlinuxarm.org/$arch/$repo
## Illinois
#Server = http://il.us.mirror.archlinuxarm.org/$arch/$repo
## New Jersey
#Server = http://nj.us.mirror.archlinuxarm.org/$arch/$repo

Anything to help me choose the best mirrors for me would be great. Looking forward to your project!!

Yep, you need to set project to public

Settings → General → Visibility, project features, permissions

1 Like

:sob: How the … do I do that?
I hate smart tools!!!

1 Like

That’s OK. A URL to download this within the program, is one of the advanced features. Is there a public link for this file?

1 Like

Link works for me. :wink:

1 Like

After 11 days of no negative feedback, I am proud to pronounce safesync as a bug-free program, in par to pacman!!! :crown:

Just joking, of course. We all know pacman has some small bugs. :rofl:

Thankfully, we have one but excellent tester! Thanks a lot @sradjoker . I hope Arch-ARM make use of this (soon…).

4 Likes

Do you have instructions to use it for EndeavourOS repos?

Everything is in the help message.
In short,

  • Use --init to create a complete mirrorlist with a lot or all the servers:
safesync --all-countries -10 -t system -i endeavouros

If you have rofi installed, you can select countries:

safesync -10 -t system -i endeavouros

That’s all!

  • Only if you have download problems and suspect a server is down, you can run --safe to re-evaluate the current mirrorlist, without any speed test:
safesync -10 -t system -s endeavouros
  • Only if the top server looks like it has degraded its speed, you can run --rate to rate the current mirrorlist’s servers:
safesync -10 -t system -r endeavouros
  • Any time safesync modifies a system mirrorlist file (/etc/pacman.d/), it creates a backup of the pre-existing file, at the same directory.
  • Any time safesync modifies a local mirrorlist file (~/.local/share/safesync/mirrorlists), it creates a backup of the pre-existing file, at the same directory.
2 Likes