Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 05 04:21
    ili101 commented #916
  • Dec 04 11:16
    Badgerati commented #964
  • Dec 04 10:50
    Badgerati assigned #964
  • Dec 04 10:32

    Badgerati on Issue-1028

    (compare)

  • Dec 04 10:32
    Badgerati closed #1028
  • Dec 04 10:32

    Badgerati on develop

    #1028: fix missing 221 response… Merge pull request #1038 from B… (compare)

  • Dec 04 10:32
    Badgerati closed #1038
  • Dec 04 09:59
    Badgerati milestoned #1038
  • Dec 04 09:59
    Badgerati assigned #1038
  • Dec 04 09:59
    Badgerati milestoned #1038
  • Dec 04 09:59
    Badgerati opened #1038
  • Dec 04 09:56

    Badgerati on Issue-1028

    #1028: fix missing 221 response… (compare)

  • Dec 04 09:53
    Badgerati assigned #1028
  • Dec 03 11:00
    Badgerati milestoned #1009
  • Dec 03 11:00
    Badgerati labeled #1009
  • Dec 03 11:00
    Badgerati unlabeled #1009
  • Dec 03 10:59
    Badgerati milestoned #1030
  • Dec 03 10:52
    Badgerati unlabeled #647
  • Dec 03 10:52
    Badgerati milestoned #647
  • Nov 30 08:59
    phillippover closed #1034
Matthew Kelly
@Badgerati
By arguments, do you mean -ArgumentList, or something else?
Samuel Gagnon
@samuelleb11
Yes, now the only option I have is -DataValue
My solution is to merge objects properties that I need into one object and the convert it to JSON. Then in the modal ScriptBlock section I do a ConvertFrom-Json
Samuel Gagnon
@samuelleb11
Also, it seems that using custom modules cmdlets in a modal's ScriptBlock tends to block it. I then use Invoke-Command and pipe it into Out-Null to fix the issue.
Matthew Kelly
@Badgerati
the -ArgumentList is an object[], so you shouldbe able to do something like the following 🤔
New-PodeWebModal -ArgumentList $obj1, $obj2, $obj3 -ScriptBlock {
    param($obj1, $obj2, $obj3)
}
They shouldn't block, what's the cmdlet doing?
Samuel Gagnon
@samuelleb11
But then how do I pass the object from a foreach while building the page ?
Matthew Kelly
@Badgerati
Have you got a script example of what you're trying to achieve?
Holger Voges
@hvoges
I´ve got a problem with creating Tabs from an array. I read the configuration from a csv-file and create a list of WebTabs from it. But Pode.web is creating only one tab. Something I have missed or misunderstood here? This is the code-Snippet:
    $RoomList = Import-Csv -Path D:\Deployment\Rooms.csv -Delimiter ";" -Encoding UTF8
    $Tabs = @( Foreach ( $Room in $RoomList )
    {
        New-PodeWebTab -Name $Room.Name -Icon $Room.Icon -Layouts @(
            New-PodeWebCard -Content @(
                New-PodeWebText -Value 'Here is some Normal text.'
            )
        )

    } )

    Add-PodeWebPage -Name 'Rooms' -Icon google-classroom -ArgumentList $Tabs -ScriptBlock {
        param ($Tabs)
        New-PodeWebTabs -Tabs @($Tabs)
    }
Matthew Kelly
@Badgerati
Hi @hvoges, it'll be because -ArgumentList takes an array of objects and is then splatted onto the scriptblock. To keep the current way -ArgumentList @(,$Tabs) should do the trick, or use a hashtable instead: -ArgumentList @{ Tabs = $Tabs }
Veers01
@Veers01
Hi! I have a question about implementing AzureAD auth with Pode and Pode.web. I have a multipage site and I want to have define access control by page, not sitewide. If I use Active Directory auth, I can use the -AccessGroup or -AccessUser in add-PodeWebPage cmdlet. Is there anything equivalent for AAD? Thank you!
Matthew Kelly
@Badgerati
Hey @Veers01, it should be possible to use -AccessUsers with AAD, though you might need to set -UsernameProperty on Set-PodeWebLoginPage to either "preferred_username" or "email" to force a username property, rather than just use Pode.Web's default. For groups, it breaks a little bit there at the moment. The access_token I think should be a JWT and contains claims like the groups, but will need parsing - in the next version of Pode its ConvertFrom-PodeJwt should hopefully be moved to public :)
Veers01
@Veers01
@Badgerati Thank you, I'll try that!
Holger Voges
@hvoges
Hi @badgerati, thank you! Another Question: I want to use the chosen Value of a select-Element as an Input for another Element (Codeditor). Is there any way to preserver a value outside of a scriptblock?
New-PodeWebSelect -Name Job -Options "One","Two","Three"
In this special case I want to use the Chosen Value for an input for the Codeditior, but as there is currently no update-PodeWebCodeEditor, I cannot edit the Element inside the PodeWebSelect-Scriptblock.
2 replies
Miodrag Milić
@majkinetor
Hi @Badgerati , long time no see. I was thinking of creating web cron via Pode, like task scheduler on Windows just via web. So i am interested in the following : di you try to stress test scheduler ? Will it be able to run lets say 100 jobs, or job every second without losing executions, skipping them etc. I am currently using Rundeck but since they got new owners it started to suck a lot so I need alternative
image.png
As an example, here is what I want to recreated
this is a rundeck project that executes 8 powershell jobs, all are scheduled and organized into folders based on environment name. Bellow you see individual executions of jobs
each job has its properties and its own execution
image.png
and you can see CLI logs. And that it.
I tested several years ago its quartz scheduler and it was awesome.... executing thousands of jobs per day without any problem.
Do you think pode could menage something like that ?
Matthew Kelly
@Badgerati

Hey @majkinetor :D, the lowest Pode's can go down to is a minute using cron; I've never stress tested it to extreme limits but I do have a health probe running on numerous web servers which runs a minutely schedule and it's not suffered any; plus another, which is a timer, that runs every 20secs, which does the bulk of CPU/IIS/Service checks, and also running fine. The most schedules I've seen was in a Pingdom-esque site someone built, which was running like 10-20 minutely schedules without issue.

As Pode triggers schedules, they're run in their own runspace, in a pool which allows up to a max of 10 to run at the same time (we could allow this to be customised), and then queues them if the pool is full. If you did have a schedule run every minute, and one of the times it triggered it did happen to run for 2mins, then Pode would trigger the schedule another 2 times during the running one.

I've been thinking about building a scheduler like this as well in Pode, so will be interesting to see how schedules/timers perform under load 🤔

Robin Beismann
@RobinBeismann
Hey @majkinetor, we're using Jenkins for this purpose, I finally managed to onboard all jobs that have previously been running on task schedulers on various servers within the the last 2 years, now we're at 80 jobs in Jenkins and it works out great for us.
It takes a bit to get used to, especially the credential handling, but it was defo worth the effort.
Since Jenkins works a lot with Nodes, you can have the nodes as close as possible to the application you're automating. Let's say, you're automating stuff on SCCM, have a Jenkins Node on the SCCM Server and it can even use the servers local identity.
I've looked into Rundeck before too, but it has a cost so I looked into Jenkins instead.
Miodrag Milić
@majkinetor
@Badgerati thx a lot. Minute is fine, if something needs to run more then that it should be service, not a job.
@RobinBeismann Jenkins was first on my mind as Rundeck replacement. However, its just overkill
and its not designed for that purpose in mind
I am running all the shell scripts on server node . They either run locally or do remote session
FYI, Rundeck is free, enterprise is payed since year or two
i am using it like 10+ years for free
Rundeck is really great for this purpose, its just that new corporate overlords (pager duty) don't have the same goals as previous ones and that they have mega serious bug that they ignore (when job timeouts on Rundeck it keeps shell process running without killing it so they pile up)
Veers01
@Veers01
Hi! Is there a way to not show a page in the sidebar in pode.web?
1 reply
Holger Voges
@hvoges

Hi @Badgerati,
i have a problem with UserFile-Authentication. I used the following code:

Start-PodeServer {
    Add-PodeEndpoint -Address localhost -Port 80 -Protocol Http
    Enable-PodeSessionMiddleware -Duration (10*60) -Extend

    New-PodeAuthScheme -Form | Add-PodeAuthUserFile -Name 'Login' -Groups @("Admin","Developer")
    Use-PodewebTemplates  -Title 'Login Example'
    Set-PodeWebLoginPage -Authentication Login 
}

and the following users.json in the root of the Script ( SHA256-Hash of Passw0rd):

[
    {
        "Name": "hans",
        "Username": "hans",
        "Email": "hans.wurst@demo.com",
        "Password": "AB38EADAEB746599F2C1EE90F8267F31F467347462764A24D71AC1843EE77FE3",
        "Groups": [
            "Admin",
            "Developer"
        ],
        "Metadata": {
            "Created": "2022-01-05"
        }
    }
]

But I always get Access denied. I also tried HMAC SHA256, but to no avail. Can you give me hint what is going south here?

Matthew Kelly
@Badgerati

Hey @hvoges,

How are you generating the SHA256 of "Passw0rd"? When I do it I get: qzjq2ut0ZZnywe6Q+CZ/MfRnNHRidkok1xrBhD7nf+M=, using:

$password = 'Passw0rd'
$crypto = [System.Security.Cryptography.SHA256]::Create()
[System.Convert]::ToBase64String($crypto.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($password)))
1 reply
Craig Dayton
@cadayton_gitlab
What is the official chat tool being used for Pode?
Matthew Kelly
@Badgerati
Hey @cadayton_gitlab, it's Discord (https://discord.gg/fRqeGcbF6h), but I do try to keep an eye here for messages as well :)
Craig Dayton
@cadayton_gitlab

Hey @Badgerati

Not really a Pode.Web issue but thought you might have a answer.

I've create a simple Web page using Pode.Web and it is working as expected. With FireFox, I then save the Web page as 'index.html' using the option 'Web Page Complete'.

When the index.html file is opened with a Firefox, it appears to not be finding the css files and just renders the raw html content only.

Any thoughts on how to get it to render in the same manner as when running the service.ps1?

Matthew Kelly
@Badgerati

Hey @cadayton_gitlab, I'm not too sure to be honest! Looking at Firefox's docs it should be saving the html, along will all the css/js at the same path. I followed https://support.mozilla.org/en-US/kb/how-save-web-page and saved the ./basic.ps1 in examples, and then opened the index.htm saved. For me it loaded everything, but it looked a little weird.

It seems as though it only saves normal images, js and css; so js/css maps and fonts are a no-show it looks like 🤔.

Craig Dayton
@cadayton_gitlab

I found opening the 'index.html' file with the browse sort of worked but missing a couple of icons too. But if I browse to the 'index.html' location, I get just the raw html output.

I'm just trying to create a static webpage and hosting it on IPFS. Using either Brave or a browser with IPFS Companion installed, the following IPNS link should work as an example of what I'm up to.

https://ipfs.io/ipns/k51qzi5uqu5dlc0pztfwwd8g4hj8up0j2vnam1fxr7866psrl15zzygp5rol8d/

Craig Dayton
@cadayton_gitlab
Finally, fixed by discord account.
Matthew Kelly
@Badgerati

I had the same with the icons, the "complete" doesn't save everything - like fonts, maps, etc.

I managed to get it "working" just now by saving the single HTML page. Then:

  • Open the index.html and change all /pode.web/ references to pode.web/
  • In the same folder as the index.html, create a pode.web folder
  • In the Pode.Web module, there's a Templates/Public path. Copy all folders (images, libs, etc.) within the Templates/Public folder into the pode.web folder above

That should let everything render when browsed to. I've just been opening the html file by double-clicking it, but if you get a plain style again, check the Developer Console in the browser for errors :)

Craig Dayton
@cadayton_gitlab

I finally figured out the issue that I was encountering which boiled down to how the path is specified for 'href' to the .css and .js files. If I'm hosting from Keybase in a given directory path, the directory path needs to proceed, the 'index_files' directory. I.E. "<dir path>/index_files/..".

For an example see: https://jabless.keybase.pub/UnitedWeeStand

The same was true when hosting from IPFS and the html is Windows based. But if the html was being hosted from Linux using IPFS, I had to remove "dir_path" reference.

For an example see: https://ipfs.io/ipns/k51qzi5uqu5dhgvz0udvoqbsh51e0wvfmpr4teyoqodcfq7zxj9tjywwdhn5ee/

Matthew Kelly
@Badgerati
Aaah, glad you worked it out! :D
burtsimpson
@burtsimpson
@Badgerati Using something like AD Auth in Pode, do you think it might be possible to grab the originating requestors domain machine information and use that as a "pass through" authentication?
burtsimpson
@burtsimpson
What I would like to do is run a curl or get-webrequest from a machine to a remote pode endpoint and if the requesting computer's domain account is valid and joined to the domain to allow that to be a valid "login" request. I could further parse out the auth data (maybe like in the Additional Validation section at https://badgerati.github.io/Pode/Tutorials/Authentication/Inbuilt/WindowsAD/#additional-validation) to make sure it is a certain machine from a list or AD Group.
Matthew Kelly
@Badgerati
Hey @burtsimpson, this sounds a lot like Kerberos authentication that's been worked on here: Badgerati/Pode#402; does this do what you're after?
Craig Dayton
@cadayton_gitlab
If interested, I have a functional prototype of using Keybase as the authentication mechanism. It leverages the KV store of Keybase to generate a one-time password (OTP) from either your personal keybase account or a team in Keybase. Must install the PSKeyBase module that I wrote. https://cadayton.keybase.pub/PSGallery/Modules/PSKeyBase/PSKeyBase.html
Dementor 🇮🇱🇺🇸
@the-mentor:matrix.org
[m]
Hi @Badgerati congrats on the bby