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

add packages #5

Open
affinis-mcs opened this issue Jul 19, 2023 · 5 comments
Open

add packages #5

affinis-mcs opened this issue Jul 19, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@affinis-mcs
Copy link

Hi Thilo,

is it possible to add packages through the api or directly in the filesystem? Or only through the webinterface?

@affinis-mcs affinis-mcs added the enhancement New feature or request label Jul 19, 2023
@thilojaeggi
Copy link
Owner

You could theoretically reuse the api endpoints which are already used by the forms and stuff defined in api_routes.py -> https://github.com/thilojaeggi/WinGetty/blob/v0.0.2/app/api_routes.py

Just with form data.
I'm currently working on a possibility to import WinGet yaml files/parse them.

@affinis-mcs
Copy link
Author

Thanks for sharing your work. Today we have pipelines for Chocolatey for Business to add/compare/update packages from public choco repo to private repo with approval for legit download URLs check. Need this for Winget :)

@randywatson1979
Copy link

randywatson1979 commented May 23, 2024

Nice job! I was also looking for this fearure to implement in a release pipeline. I believe that the use of authentication (bearer token) needs to be implemented yet in order to send these post requests? We currently have it running as a kubernetes deployment with an unpriviliged image and implement whitelist IP only accessible for specific clients. Works great!

@randywatson1979
Copy link

For those who want to use a pipeline to add package, a workaround solution with curl:

Authenticate and store temporary cookie:
curl -c ./wingetty.cookie -d "emailorusername=<MASKED_USERNAME>" -d "password=<MASKED_PASSWORD>" https://some-wingetty-domain.com/login

Post add package via api route:
curl -b ./wingetty.cookie -i -X POST -H "Content-Type: multipart/form-data" \ -F "publisher=Company Name" \ -F "name=App Name" \ -F "identifier=CompanyName.AppName" \ -F "installer-file=@localApp.exe" \ -F "installer-architecture=x86" \ -F "installer-installer_type=exe" \ -F "installer-nestedinstallertype=msi" \ -F "installer-nestedinstallerpath=" \ -F "installer-installer_scope=user" \ -F "installer-version=1.0.0" \ https://some-wingetty-domain.com/api/add_package

Cleanup:
rm ./wingetty.cookie

@icewolf69
Copy link

I wanted to +1 this and I think WinGetty might be in a good position to offer something that nothing else (that I know of) currently offers. It would be amazing if there was a way to either export/import a database/packages or, some way to trigger a database update based on the packages that were copied into the volume.

The use-case for this would be the ability to generate a DB/repo on an internet connected system, and then import it into an air-gapped system in an easy way. This would be huge for offline updates of systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants