GithubHelp home page GithubHelp logo

Comments (6)

taooceros avatar taooceros commented on May 27, 2024
        private async Task<UpdateManager> GitHubUpdateManager(string repository)
        {
            var uri = new Uri(repository);
            var api = $"https://api.github.com/repos{uri.AbsolutePath}/releases";


            var jsonStream = await Http.GetStreamAsync(api).ConfigureAwait(false);


            var releases = await System.Text.Json.JsonSerializer.DeserializeAsync<List<GithubRelease>>(jsonStream).ConfigureAwait(false);
            var latest = releases.Where(r => !r.Prerelease).OrderByDescending(r => r.PublishedAt).First();
            var latestUrl = latest.HtmlUrl.Replace("/tag/", "/download/");


            var client = new WebClient { Proxy = Http.WebProxy };
            var downloader = new FileDownloader(client);


            var manager = new UpdateManager(latestUrl, urlDownloader: downloader);


            return manager;
        }

from flow.launcher.pluginsmanifest.

taooceros avatar taooceros commented on May 27, 2024

Here are some idea.

  1. Remove the version number in plugin.json, since it will not be updated here.
  2. Add JsonDeserilization in PluginManager like what has done in Updater.cs.
  3. Only add the project url in pluginmanifest instead of the direct downloadurl.

from flow.launcher.pluginsmanifest.

jjw24 avatar jjw24 commented on May 27, 2024

Here are some idea.

  1. Remove the version number in plugin.json, since it will not be updated here.
  2. Add JsonDeserilization in PluginManager like what has done in Updater.cs.
  3. Only add the project url in pluginmanifest instead of the direct downloadurl.

I think we can follow the way Updater.cs checking the newest update for Flow to automatically get the newest update for plugins instead of storing the direct download link in plugin.json.
This can avoid updating pluginsmanifest every time plugins update. Or checking the update is also part of the review process?

hmm the reason i included version is so we dont have a scenario where malicious actor creates a plugin, gets approved, then uploads another zip file, and our code just looks for the latest and updates user's plugin to the malicious new release. At lease we can say on the day of our approval, we approved this version as at this date, any subsequent uploads to the same version we will not be able to be responsible. If we just approve the plugin once, subsequent uploads we won't know about.

What do you think?

from flow.launcher.pluginsmanifest.

jjw24 avatar jjw24 commented on May 27, 2024

Only add the project url in pluginmanifest instead of the direct downloadurl.

Project url/website, code url and direct download url are separated in the case where people may decide to have a website for the plugin different to where the code lives, eg GitLab

from flow.launcher.pluginsmanifest.

taooceros avatar taooceros commented on May 27, 2024

Only add the project url in pluginmanifest instead of the direct downloadurl.

Project url/website, code url and direct download url are separated in the case where people may decide to have a website for the plugin different to where the code lives, eg GitLab

You are right, but manually pr every update may be quite significant works when Plugins become more... Maybe we can provide different way of doing that. By providing direct url, we won't support auto update, while we can support auto update for github or gitlab.

from flow.launcher.pluginsmanifest.

taooceros avatar taooceros commented on May 27, 2024

Maybe we can use CI to automatically check for new update, and update the file.

from flow.launcher.pluginsmanifest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.