Thanks! I've gone ahead and made it public at https://github.com/steviecoaster/InedoOps. Still have a while before I put it on the Gallery, but I like developing in the open when I can!
Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Posts
-
RE: Creating a new PowerShell module
-
Creating a new PowerShell module
I'm laboring on a new PowerShell module I'm tentatively calling
InedoOps, which enables an administrator to administer an Inedo ProGet instance via PowerShell. It is shaping up quite nicely, though I've got quite a bit more to do before I would consider it "ready".Would there be objections to my publishing this to the PowerShell Gallery once I'm done? Right now the code is private on my Github. If any Inedoers want to have a sneak peek, leave your Github username and I'll invite as a contributor, or if you are OK with it being flipped over to public, I can do that and share the link.
I'd really rather like a set of eyes on it from your side so you can see my approach to things and get your blessing on it. Particularly around my use of stored procedures for some things! I'm.....unsure how "stable" those are in terms of them changing in future versions, etc.
-
RE: Manipulate users using pgutil
I'VE DONE IT!!! What a wild ride. I ended up using the Stored Procedures for things. Going that route did the trick nicely. Though I did have to spend the weekend learning SQL to understand exactly what the hell is going on inside of Stored Procedures haha.
But, I've now got the code I need to go from 0 to a deployed ProGet instance programmatically. Still a bit of polishing left to do, and a whole heck of a lot of testing but I am super excited about this! Thank you very much for the Stored Procedure hint!!! I very much appreciate it.
-
RE: Manipulate users using pgutil
@atripp said in Manipulate users using pgutil:
tech/marketing partnership
That is above my pay grade as well to iron out he specifics but it is in my wheelhouse to push for it internally :)
-
RE: Manipulate users using pgutil
My end goal is to either replace Sonatype Nexus with Inedo ProGet or at least allow the choice of repository solution included with one of our canned Environments that we offer customers here at Chocolatey.
Right now we are able to fully provision a Sonatype Nexus server via the API so that the server has
- The necessary repositories created
- The necessary scripts/packages stored
- Security configured on the repositories.
Today I can get ~80% of the way there with Inedo, but until I can lock it down I can't start the work of baking it into our stuff. ProGet is the only repository in our testing that plays very very well with Chocolatey (thanks for that, btw), but without being able to natively do the security bits I'm afraid I can't move forward.
I hear you with the AD thing, but I can't guarantee AD will be available in all the environments we deploy too.
Our goal is to give them a turn-key "thing" they can be up and running with in under an hour and if they need to change things after the fact, they can work with our Support team to make those adjustments. Has worked out fairly well so far!
-
Manipulate users using pgutil
Are there plans to include the ability to work with user accounts via pgutil? For my use case I would like to be able to programmatically create a user account and assign it a read-only role to a specific feed such that I can configure and consume packages from the restricted feed on an endpoint. Currently there is not a way programmatically (at least that I can get to work) to do this sort of thing programmatically via PowerShell.
I've another thread on the forums which I was pulling on the HTTP api thread, but that led to a dead end as I can't craft appropriate JSON that the endpoint accepts, not for lack of trying haha.
-
RE: Publishing ProGet to Chocolatey Community Repository
We do have Chocolatey-AU (Automatic Updater) which will keep a version of a package up to date. Once I have everything setup it will look at whatever upstream I point at and keep the package updated for me automatically.
If you wanted to own the automation that's fine with me, but I have no problem with shoving the package source in my Chocolatey package's repository and using a Github Action to keep it updated (this is what I do today with other packages I maintain).
You've got my email, we can take this off the forums and hash out details of things privately if you prefer :)
-
RE: Publishing ProGet to Chocolatey Community Repository
Thanks, Alex! I have confirmed the request and have added one more person from my team as well so we have double coverage on this package.
As for the delisted packages, they won't show up for others on the community repository or via Chocolatey CLI once they are unlisted, but since you are the owner of those packages, they will continue to display on your profile. So all is right with the world there :)
If you're cool with it I may pick up packaging
pgutilas well. -
Publishing ProGet to Chocolatey Community Repository
I've reached out via the contact maintainers link on https://community.chocolatey.org/packages/proget but figured I'd post here as well for more visibility. I'd like to publish ProGet as a Chocolatey package. I've got the automation and packaging code working how I expect it should, but I can't publish it as there is already a package available.
While I could publish it under another package id....that seems icky to me so I'd rather be added as a maintainer and then setup a pipeline to keep it updated as you folks release new versions.
Let me know if you have any questions/comments/concerns!
-
ProGet License Text
I'm looking to publish a Chocolatey package to the Chocolatey Community Repository which will install the Free version of Inedo ProGet.
In order to do this, I am also going to publish a package for Inedo Hub, and take a dependency. Our Community Repository requires either a LICENSE.TXT include the license terms for an application being package, or a licenseUrl listed in the Nuspec. I cannot find the Licenser terms for either product. Perhaps I am just blind! :)
Can someone point me to those terms please so that I can properly publish these packages? I greatly appreciate it!
-
RE: Question about Salt_Bytes
@steviecoaster said in Question about Salt_Bytes:
Sweet mother Mary, I got it! It was the content type. I was using
application/jsonand it wantedapplication/x-ww-form-urlencodedThis code works properly to set the password for a user:
function Set-ProGetUserPassword { [Cmdletbinding()] Param( [Parameter(Mandatory)] [String] $Username, [Parameter(Mandatory)] [SecureString] $OldPassword, [Parameter(Mandatory)] [SecureString] $NewPassword ) begin { $confirm = Read-Host "Please re-enter your new password" -AsSecureString $identical = Compare-SecureString -SecureString1 $NewPassword -SecureString2 $confirm if (-not $identical) { Write-Error 'Passwords do not match!' break } } end { $unmanagedString = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($NewPassword) $plainTextPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($unmanagedString) [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($unmanagedString) # Clean up $iterations = 10000 $saltLength = 10 $hashLength = 20 $rfc2898 = [System.Security.Cryptography.Rfc2898DeriveBytes]::new($plainTextPassword, $saltLength, $iterations) $passwordBytes = $rfc2898.GetBytes($hashLength) $saltBytes = $rfc2898.Salt $base64Password = [System.Convert]::ToBase64String($passwordBytes) $base64Salt = [System.Convert]::ToBase64String($saltBytes) $body = @{ User_Name = $Username Password_Bytes = $base64Password Salt_Bytes = $base64Salt } Write-Verbose $body $Params = @{ Slug = '/api/json/Users_SetPassword' Method = 'POST' Body = $body ContentType = 'application/x-www-form-urlencoded' } Invoke-ProGet @Params } }Spoke to soon. This code functions and doesn't produce an error. However, the user cannot login with the credential set. More playing to do!
-
RE: Question about Salt_Bytes
Sweet mother Mary, I got it! It was the content type. I was using
application/jsonand it wantedapplication/x-ww-form-urlencodedThis code works properly to set the password for a user:
function Set-ProGetUserPassword { [Cmdletbinding()] Param( [Parameter(Mandatory)] [String] $Username, [Parameter(Mandatory)] [SecureString] $OldPassword, [Parameter(Mandatory)] [SecureString] $NewPassword ) begin { $confirm = Read-Host "Please re-enter your new password" -AsSecureString $identical = Compare-SecureString -SecureString1 $NewPassword -SecureString2 $confirm if (-not $identical) { Write-Error 'Passwords do not match!' break } } end { $unmanagedString = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($NewPassword) $plainTextPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($unmanagedString) [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($unmanagedString) # Clean up $iterations = 10000 $saltLength = 10 $hashLength = 20 $rfc2898 = [System.Security.Cryptography.Rfc2898DeriveBytes]::new($plainTextPassword, $saltLength, $iterations) $passwordBytes = $rfc2898.GetBytes($hashLength) $saltBytes = $rfc2898.Salt $base64Password = [System.Convert]::ToBase64String($passwordBytes) $base64Salt = [System.Convert]::ToBase64String($saltBytes) $body = @{ User_Name = $Username Password_Bytes = $base64Password Salt_Bytes = $base64Salt } Write-Verbose $body $Params = @{ Slug = '/api/json/Users_SetPassword' Method = 'POST' Body = $body ContentType = 'application/x-www-form-urlencoded' } Invoke-ProGet @Params } } -
RE: Question about Salt_Bytes
In my playing around yesterday, I did try to convert that to base64 and it still produced the same error. I'm very perplexed! For my use case I really need this functionality so I'm hopeful I can find a solution.
-
RE: Question about Salt_Bytes
Here's what I'm using currently, but it's complaining about Salt_Bytes. I'm fairly certain this is a PowerShell problem, but more eyes on it never hurt.
function Set-ProGetUserPassword { [Cmdletbinding()] Param( [Parameter(Mandatory)] [String] $Username, [Parameter(Mandatory)] [SecureString] $OldPassword, [Parameter(Mandatory)] [SecureString] $NewPassword ) begin { $confirm = Read-Host "Please re-enter your new password" -AsSecureString $identical = Compare-SecureString -SecureString1 $NewPassword -SecureString2 $confirm if(-not $identical){ Write-Error 'Passwords do not match!' break } } end { $unmanagedString = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($NewPassword) $plainTextPassword = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($unmanagedString) [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($unmanagedString) # Clean up $iterations = 10000 $saltLength = 10 $hashLength = 20 $rfc2898 = [System.Security.Cryptography.Rfc2898DeriveBytes]::new($plainTextPassword, $saltLength, $iterations) $passwordBytes = $rfc2898.GetBytes($hashLength) $saltBytes = $rfc2898.Salt $base64Password = [System.Convert]::ToBase64String($passwordBytes) $body = @{ User_Name = $UserName Password_Bytes = $base64Password Salt_Bytes = $saltBytes } Write-Verbose ($body | ConvertTo-Json) $Params = @{ Slug = '/api/json/Users_SetPassword' Method = 'POST' Body = $body } Invoke-ProGet @Params } } -
Question about Salt_Bytes
Re: Reset ProGet Admin Password via API
I've got code using the Native API which creates a user account and works wonders. But as I'm doing this programmatically I need to also generate a random password for the account, and set it. Seems pretty straightforward to do....but I'm unsure about what to do with the Salt_Bytes parameter available on the API. Any pointers would be outstanding.
-
RE: Max file upload
Are we sure this is a ProGet problem and not a Docker problem? Assuming the asset is outside the container and you're trying to upload it into ProGet inside the container, you may be hitting a setting inside Docker.
-
RE: API ability to control Feed Access
@dean-houston thanks for that info! I think that'll do nicely. I'll have to play around with it to be sure, but from what I can tell it looks straightforward to implement. Thank you!
-
RE: API ability to control Feed Access
@dean-houston said in API ability to control Feed Access:
I believe it's possible to configure security with the Native API, but obviously not as easy. So I would explore that, it's probably close to what you wnat.
Do you have documentation/guidance on that? Whilst I'm a fan of DevTools in a browser and bending things to my will, I'd much more a fan of using documented non-hacky processes, particularly when I'm going to be potentially work in a customer environment.
This conversation may be best served taken off the forum and into more direct communications. There's a method to my madness here, and it doesn't really have any reason to be hashed out here publicly.
-
API ability to control Feed Access
I'm looking to automate the setup and configuration of ProGet as much as I can. I've found the API to be really good so far, and Ive been able to automate 90% of the things that I require (I build a lot of repository instances). One thing that is super important to me is configuring Read-Only access to the feed to a particular user account, and configuring a Chocolatey client to use that credential to authenticate to the source.
There doesn't seem to be an API endpoint exposed to be able to configure local accounts programmatically. I know it's a non-trivial ask, but, could we get one?
-
RE: HTTPS not working when setup within ProGet web interface
I'm not sure the rules on posting links to gists, so if this breaks one, delete it. However, once I got my feet under me with setting ups HTTPS I went ahead and wrote some code so I can automate it. It assumes a few things, and could be improved but for my use case it is flexible where it needs to be. Enjoy!
https://gist.github.com/steviecoaster/0a2c0d4b09988dedf8e1df1844ec6b8a