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

Update Syncthing link to the latest version #2278

Closed
wants to merge 1 commit into from
Closed

Update Syncthing link to the latest version #2278

wants to merge 1 commit into from

Conversation

joaofl
Copy link
Contributor

@joaofl joaofl commented Nov 25, 2018

Status: Ready
Commit list/description:
Tested and working.

@MichaIng MichaIng added this to the v6.18 milestone Nov 25, 2018
@MichaIng
Copy link
Owner

MichaIng commented Nov 25, 2018

@joaofl
Thanks for this.

Perhaps we can replace the links by api.github.com ones to always grab the latest version automatically?

Jep, possible for Syncthing: https://api.github.com/repos/syncthing/syncthing/releases/latest

Scraping this is the better long term solution?

@MichaIng
Copy link
Owner

Okay, this works well and prevents us from always update the version string. Of course this means we rely on new version not breaking other config steps. But we rely on this for so much other software titles as well, where we download github master archive or from another source that automatically points to newest release. Risk vs. benefit for me is going with this:

                    INSTALL_URL_ADDRESS='https://api.github.com/repos/syncthing/syncthing/releases/latest'
                    G_CHECK_URL "$INSTALL_URL_ADDRESS"

                    # - armv6+
                    if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 2 )); then

                            no_check_url=1 Download_Install "$(curl -s $INSTALL_URL_ADDRESS | grep -m1 'browser_download_url.*linux-arm-v[0-9.]*tar\.gz' | cut -d \" -f 4)"

                    # - arm64
                    elif (( $G_HW_ARCH == 3 )); then

                            no_check_url=1 Download_Install "$(curl -s $INSTALL_URL_ADDRESS | grep -m1 'browser_download_url.*linux-arm64-v[0-9.]*tar\.gz' | cut -d \" -f 4)"

                    # - x86_64
                    elif (( $G_HW_ARCH == 10 )); then

                            no_check_url=1 Download_Install "$(curl -s $INSTALL_URL_ADDRESS | grep -m1 'browser_download_url.*linux-amd64-v[0-9.]*tar\.gz' | cut -d \" -f 4)"

                    fi

What should be fixed as well is the reinstall:

  • As Syncthing has an internal updater, we should not "silently" overwrite the old install dir with new download. In worst case, important internal database/config update steps are missing an will break the instance.
  • Instead we should skip download & install, informing user about internal updater and that, if the install is broken, the existing install dir needs to be removed manually (+config backup).

Btw. I really like the WebUI, that it allows to switch to HTTPS, while automatically creating a self-signed certificate, dark theme, internal updater and all of this. Quite great work 👍.

@joaofl
Just saw you're already working on pre-configure user, password and HTTPS. This is exactly what I am also thinking of now 👍.

@MichaIng
Copy link
Owner

MichaIng commented Nov 25, 2018

@joaofl
Sorry to break your PR by this, as said I am aiming for a more sustainable solution. Your PR greatly brought attention to Syncthing, as well of the config steps (user/pw/https).

I will open a new PR to implement as above, as well as the better reinstall handling. This should be into v6.18 still.
€: PR up: https://github.com/Fourdee/DietPi/pull/2284

Config adjustment should go into v6.19 instead to not further delay v6.18 release.

€: Okay will mark this as closed, in favour of other PR. Credits for joaofl still valid for bringing this to our attention. I mentioned it in changelog 🙂.

@joaofl
Copy link
Contributor Author

joaofl commented Nov 25, 2018

Great job @MichaIng! I was not aware of this "latest version" trick.
I actually like and rely very much on this Syncthing app. Today I'm setting up a new server (since long time ago), and felt like updating the scripts as I was installing things.

@joaofl joaofl deleted the patch-3 branch November 25, 2018 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants