Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 27 07:11
    tidyui commented #1516
  • Feb 26 22:47
    tidyui opened #1522
  • Feb 26 22:19
    tidyui assigned #1520
  • Feb 26 22:19
    tidyui milestoned #1520
  • Feb 26 22:19
    tidyui labeled #1520
  • Feb 26 22:19
    tidyui labeled #1520
  • Feb 26 22:18
    tidyui closed #1520
  • Feb 26 22:18
    tidyui closed #1521
  • Feb 26 22:18
    tidyui opened #1521
  • Feb 26 22:18
    tidyui closed #1518
  • Feb 26 22:17
    tidyui closed #1516
  • Feb 26 22:17
    tidyui closed #1484
  • Feb 26 22:16
    tidyui commented #1484
  • Feb 26 22:16
    tidyui commented #1516
  • Feb 26 21:59
    tidyui labeled #1516
  • Feb 26 21:59
    tidyui labeled #1516
  • Feb 26 15:05
    eric-wilson commented #1516
  • Feb 26 14:41
    tidyui commented #1519
  • Feb 26 14:39
    AllPIM commented #1519
  • Feb 26 08:51
    jensbrak commented #1511
vigouredelaruse
@vigouredelaruse
@tidyui affirmative on the requirement to seamlessly deal with both connection string and connection string less blob storage auth - off the top of my head one could simply have a solution where if you don't populate the connection string it tries managed auth instead - should result in fewer changes to the code path
vigouredelaruse
@vigouredelaruse
when discussing eliminating azure secrets from code one can discuss managed identities and service principals and rbac for resources like blobs as i've been doing so far - and one also has azure keyvault - keeping the discussion centered around azure
there is the special case of an app deployed in azure app service - to reference a secret in azure keyvault from an azure app service one only needs to reference the keyvault secret with a special syntax in the app settings - this tutorial discusses that among other thigs https://www.compositional-it.com/news-blog/configuration-secrets-and-keyvault-with-asp-net-core/
so piranha cms right now supports removal of blob storage secrets from code in the special case of an app deployed to azure - not sure if the relevant documentation mentions this but it bears mention since my original query was about removing secrets after due consideration i see that i have all the resources available in my environment to achieve this without code changes
that is a piranha cms app i can deploy to azure app service - but i may prefer to run this from a vm in azure at some point, and that cannot be achieved today without code changes to piranha
vigouredelaruse
@vigouredelaruse
that is the vm iis instance doesn't come with automatic globbing of keyvault paths like the app service so the need is still there
Håkan Edling
@tidyui
@vigouredelaruse Yes you're completely right that this is already possible to do if you host your application in Azure App Service. We don't include this is our template projects as it's dependent on the fact that you host in Azure and that it really hasn't anything to do with Piranha. We always try to keep the templating to a minimum to make it simple to get an overview of.
Fergus Coulter
@FergusCoulter
Hi, am I right in saying that the 'piranha.usertokens' table is for tokens such as PasswordReset and EmailConfirmation generated using the User Manager?
Håkan Edling
@tidyui
All of the users, roles, claims and tokens tables are the standard ASP.NET Identity tables!
Fergus Coulter
@FergusCoulter
Ok Thanks!
Fergus Coulter
@FergusCoulter
One more question though, is there a way of registering the Default Token Providers without having to do them individually?
Like this:
 options.UseIdentity<IdentityMySQLDb>(db =>
                    db.UseMySql(_config.GetConnectionString("piranha")),
                    identityOptions: o => {
                        o.User.RequireUniqueEmail = true;
                        o.Tokens.PasswordResetTokenProvider = TokenOptions.DefaultProvider;
                        o.Tokens.EmailConfirmationTokenProvider = TokenOptions.DefaultProvider;

                    },
flashvenom
@flashvenom
Stupid question... but... is there anything in the mvc template or piranha routing or the cms itself that would prevent me from using jquery unobstrusive ajax? Even the simplest of forms doesn't work for me and I've tried everything I could think of. Just figured I would ask here.
Håkan Edling
@tidyui
@flashvenom Nothing in particular. I know the templates uses the default bootstrap dependencies, which means jQuery slim, maybe the validation library needs the full jQuery dist to work?
jensbrak
@jensbrak
Hmm, how is Hooks.Page.Register supposed to work. Havent used Page/Post hooks before, only comment hooks.
Felipe Pergher
@FelipePergher
Hey @tidyui I want to create a PR adding the pt-BR special character to slug generation, but I receive a 403 when tried to push my feature branch to repository, how is the right way to I can create a PR to contribute?
Håkan Edling
@tidyui
@FelipePergher You can’t push to someone else’s repository. Instead you push the changes to your own fork of the repo, and then send a PR from your repo to the original!
@jensbrak What are you referring to? There shouldn't be a Register for pages, only RegisterOnLoad, RegisterOnBeforeSave and so on:
App.Hooks.Pages.RegisterOnBeforeSave((p) => {
    p.Title = "I changed the title!!!";
});
jensbrak
@jensbrak

@tidyui Yes, I was just sloppy writing. I know there's 5 hooks for each Model that has hooks - part from those that have a sixth that is validation.
Reason I ask is that I can't get all hooks to fire as I would expect them to - and I suspect it's just me missing something rather obvious (or not so obvious maybe).
For Comments it's easy and I have had no issues what so ever to use them - similar to the example above.
Pages and Posts however... not so much. I believe there's something with the Posts and Pages being derived. A note on the documentation pages hints about casting but that does not make sense either since the hooks have a signature of the delegate.

When I write this now I realize something. I did NOT test Before/After save from the Manager. I only tried it using the seed functionality. Still, that code also save posts and pages.

Reason I asked was the fix of GenericContent hooks. The code in core calls the hooks but the HookManager lack the exposed Hook property. That's what I initially thought was the thing missing. And maybe it still is, but when I did not get the hooks to fire as I expected I reverted back to trying the Page/Post hooks for reference - and got in trouble there too.

Felipe Pergher
@FelipePergher
Thanks for the Answer, I will do that
jensbrak
@jensbrak
And heh, now I remember why I didn't test the manager. I got redirected to login page using both templates and examples in core. Remembered I got something similar before but did not really do anything to fix it. So I just toyed around a little in the seed.cs to trigger before/after hooks. I didn't really dig into anything that much - just followed the traces of the page/post hooks and considered the fix for content hook easy. Then I got some unexpected results while testing and dropped it due to work load at home/work. I just picked it up again and thought I might as well ask.
Chris
@GangsterGeek89
@jensbrak I have had the same problem with examples and cant seem to login to the manager with them I thought it was something I had done but couldn't figure out what lol. Be nice to find a fix for this problem
jensbrak
@jensbrak
@GangsterGeek89 oh ok. It's clear that the default credentials work (no wrong username/password) and logs confirm a redirect. Maybe something with clames setup in templates?
Seems we need an issue for it - what version of the template/piranha are you using?
Chris
@GangsterGeek89
@jensbrak Yeah as far as I could tell all the credentials was fine and even looking through the database all seemed fine from what I can see. Ive had this issue with both 8.4.2 (I
think it was) and the latest version 9
jensbrak
@jensbrak
I just tried it with 8.4. 9.0 also has this behaviour.
Yes, if wrong credentials are used there's an error message about it. With the right one it seems the login does not fail but someting throws out the user - haven't really considered why. The answer is most likely there in logs or something.
Chris
@GangsterGeek89
@jensbrak Yeah if I get sometime a bit later on I will take a look and see if I can figure it out :)
tashe
@tashe
We are planning to have around 10 sites in a single Piranha instance, each site with around 5-10k visits per day. This will be hosted on Azure. Are there any performance issues with having multiple sites setup like that? What would happen if one site was misbehaving? Would that affect the other sites?
Håkan Edling
@tidyui

@jensbrak Regarding your hooks not being called, the only thing I can think of is that since the methods internally are stored in a generic collection, they must be registered and called with the same type, i.e Comment. If PageComment or PostComment is passed in somewhere as type identifier there will be a mismatch.

https://github.com/PiranhaCMS/piranha.core/blob/master/core/Piranha/Services/PageService.cs#L667

jensbrak
@jensbrak
@tidyui yes, that's along the line of what I was thinking. The comment class is used in the template (and by me) as it is registered in Core. Since it's a final class there's no problem.
Pages and posts however... they are a different story.
But I still don't get it. The only thing I have done is adding some hooks in a couple of test projects (including template). Using the exact construct you mentioned.
I just get the feeling I'm missing something very obvious here. Really confused.
jensbrak
@jensbrak
But what you're saying is... ah. Is the only way to get page/post hooks to work to ... ah. Yes. Of course.
It's on the Model of my own app where the problem is. I cannot use those hooks if I have implemented my own models derived from the ones provided by core. Including using those that are provided in the samples.
If so, that might be a documentation enhancement I'd consider. It's so darn easy to make assumptions...
Chris
@GangsterGeek89

@jensbrak I have done a little digging with the manager login problem with the example apps in my case I have been using google chrome for my browser.

So all seems to be working from what I can see and the code is doing as it should as far as I can tell. So in an attempt to try and login I wondered what would happen if I open an incognito window and try to login, well it only went and worked and took me to the manager. So my initial thought was something is caching so I cleared all browser data and tried again out of incognito and login fails. I have then cleared browser data again and commented out this line from the startup class in the MvcWeb example


// Configure cache level
App.CacheLevel = Piranha.Cache.CacheLevel.Full;

and tried again but still the same problem and cannot login. So I opened the edge browser and tried to login and it works fine. Hopefully either you or @tidyui can help shed a little more light onto what is happening here as at the minute ive been left not knowing what to check next lol

jensbrak
@jensbrak
Well, it's not chrome that's the issue. My own page is live with 9 and works just fine. In Chrome.
However, I've seen issues in the manager related to cookies since version 9 that only occurs in my own page.
I do not know if things are connected but there's def something going on here - and I don't believe it's Piranha really.
Not nescessarerly anyway :)
Chris
@GangsterGeek89
@jensbrak Yeah same I have two projects one on version 8.4 and one on version 9 both working fine with chrome but for some reason I get this problem with the example apps on either of the versions
jensbrak
@jensbrak
*necessarily :P
jensbrak
@jensbrak
Errrr....
@GangsterGeek89 - now it works.
At least for me. Haven't really done anything as far as I know.
Chris
@GangsterGeek89

@jensbrak Great stuff I will resync my fork and see what happens :)

What was the cookie issues you was referring to earlier? just out of curiosity lol

Chris
@GangsterGeek89
Got mine working now as well :) seems something had cached and wasn't clearing properly earlier as I was doing it with the solution running, but stopped the solution and cleared browsing data and all seems to be working now
Håkan Edling
@tidyui

@jensbrak @GangsterGeek89 Regarding login issues, the only thing I’ve seen in the past is issues related to running one application on the local machine and logging in to the manager, then terminating that project and starting another application on the local machine on the same url. The login will fail in this case because of the stray cookie from the other application.

We tried to resolve this by always doing a sign out before signing in.

Chris
@GangsterGeek89
@tidyui Thanks for the reply. I figured it was something to do with a stray cookie and it seems more likely since the problem went away once I managed to clear all the data for that particular URL. I have noticed during the many hours in the source code these past couple of months you have the sign out before any signing in happens which I have used in my login page to keep things consistent. :)
jensbrak
@jensbrak

@GangsterGeek89 - I only tried different scenarious starting the app, not downloading it again or something. It just started to run and I was actually looking at cookies as it kinda reminded of the too-large-cookie-issue I have had.

@tidyui - Ah, that's why there was a logout before login. I noticed it while stepping though things. Obviously that is not a completely working fix but I appreciate the effort and it's a logical thing to do.
I will need to have a look at those cookies at some time since I get an error if I leave my online-site manager session for too long. There's something about asp.net and the cookies. Clearly.

The problem is to try to reproduce the login issue on demand in order to find a good fix for it. And as mentioned, I see nothing that is Piranha specific to this - even though Piranha is affected and there's a sort-of-fix already in place for it. :)

jensbrak
@jensbrak
@tidyui - if all that's required for the GenericContent hook to work is adding a property for it in HookManager, I'd say it's better you do it if you have to do changes anyway. Seems overkill to do a PR for one little line. I thought there was more to it but cannot see it is. All my effort has been around trying to understand the relation between the hooks and the type of classes using it. Seems to me there's a need to better explain this in documentation.
Still, if hooks are going to be redesigned (good idea!) it's better to put focus on that instead of documenting soon-to-be-deprecated features. :)
I'll instead continue my proposal for the "enhanced" comment class. Class itself and associated things done, looking at the manager part now. Or not now, but whenever I have some time not working.
Håkan Edling
@tidyui
@jensbrak I have updates the code with PageComment/PostComment as concrete implementations of Comment. I’ll make sure I’ll push this to master so you have the code available
jensbrak
@jensbrak
Cool. I will most likely have no significant problems merging it. I'll push my changes to my branch and give you a heads up when done. Would you prefer to check the suggestions in my branch or in a PR? I mean, they are only siggestions with pro's and cons and might be relevant to discuss and change. I haven't done that many PR's like that so I don't know what's the best way of doing iterative design. Well, not in the context of PR's in Open Source at least.
Those changes might also affect how to use the Comment hooks as I now realize more how hooks work - and do not work :) Exciting!
jensbrak
@jensbrak

@tidyui - I'm pretty much done with the changes of the comment moderation suggestion. Some tweaking and def more testing.
A question: notice you use Font Awesome for things like the trashbin in Manager. Is there any specific parts / packs from them in use? Was thinking about a suitable icon for the column that will show comments 'flagged'. Since it will be a column with an indication and not something to interact with, I was thinkin a suitable icon that is turned on or off (shown and now shown for instance).

Then we have a different scenarios regarding how to interpret att use the rejection/spam state - but maybe that's better to have in the PR and when looking at the suggestion presented.

flashvenom
@flashvenom
I have PDF (and will eventually add docx and xlsx) files in my media library and would like to have a thumbnail image for each file so that I can display them on a page as "downloads". I see that I can add a custom meta property for media, so I'm thinking about adding a "Thumbnail Image ID" field where I can paste the guid of the image of the custom thumbnail I made for each one. Does this seem like a good solution or does Piranha maybe have a cooler way of accomplishing this? (Eventually I'm excited to learn Vue and get into the media app / mediapicker component!)