support-chat
This is the support-chat chat channel, created by KajMagnus (KajMagnus), 2016-10-01 08:47:17.784Z
Chat about Talkyard and related things. E.g. ask quick questions.
(Not implemented)
Hi @Pierre_G — this is a self hosted server? Then you can check a log file — the reset-password magic link, is in log files which you can access as Linux root at /var/log/talkyard/
, I'll write more, e.g. exact log file path and what to search for in the logs, so you'll get the reset link, when I'm back again at the computer, in a few hours.
Hi @Pierre_G does this help: How to reset admin password? (before having configured email)
(Were you wondering about the admin account? Or an ordinary members account? I can write something about the latter too, if you want)
Hello,
Is there currently any way to change the landing page ?
I would prefer /categories than /latest.
At least for new users it seems better that way.
PS: about the previous question, I finally managed to setup the HTMl so I could reset it simplier. Thanks for the help and sorry for the late reaction.
Hi @Pierre_G , good question, I created a How-To page about that just now: How to change the Start Page
Thank you for your help, I didn't find it before because the favicon display was so huge I didn't see the other options below ...
I'm a bit embarrased, bc talkyard is so fine to set up and use, but I don't understand how groups work and if they can be private so that no other than the group members can see the discussions. I couldn't find a thread. Thank you for answering!
Does anyone happen to have a full list of all Talkyard environment variables? I can't seem to find anything.
Hi Anette @amm , good question. Yes, groups can have private discussions. Create a group, then create a category, and in the category's Security tab (you can see it when you create the category, or if you click Edit category later),
remove group Everyone, and add the new group instead. Thereafter, only people in that group, can see the category and discussions happening therein.
I'll try to write something more detailed including screenshots later today or tomorrow. (Sorry for the a bit late reply)
So, you'll need not just a group, but also a category, to have private discussions. (The group is for grouping people, the category is for grouping discussions.)
@Supernova3339 Do you mean Linux environment variables? (like:, bash$ SOME_ENV_VAR=123
)
And / or config values in the file /opt/talkyard/conf/play-framework.conf
? (Or sth else :- ))
Hello,
I am trying to embed a comments section into Zola hosted with github pages, but I am receiving a react bundle error.
slim-bundle.min.js:10:251110
Uncaught (in promise) Error: Minified React error #200; visit https://reactjs.org/docs/error-decoder.html?invariant=200 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Am I missing something? Thanks!
Hi Hunter @aquila_const — seems there're two problems:
1. The first is what looks like a Talkyard embedded comments bug, which happens if the admin enables:
Approve users — New users need to be approved by staff before they can do anything more than just reading.
Usually (or never until now?, hmm) people don't enable this setting, for blog comments, only for discussion forums. But I think it ought to work for blog comments too. So I'll look into that.
Until then, if you un-tick Approve users, the error should go away. But there's also:
2. There's a configuration error. I had a look at the embedded comments configuration, and noticed that you've included www.
in front of the your-address.github.io
. So it looks like: https://www.your-address.github.io
.
But should be just: https://your-address.github.io
without www.
(GitHub thinks www
is unnecessarry in this case (just more text to type) so just ones-username.github.io
is the address they give their users. — B.t.w., should also be just http://127.0.0.1
, not http://www.127.0.0.1
. One never combines IP numbers like 127.0.0.1
with a www
text prefix.)
@KajMagnus thank you for your help! Yeah I was reading the previous comments and I think it should be listed somewhere within the setup just because I had thought it was just the original https://github.io but didn't work and it was mainly due to the approve new users section. This is great. Thanks again!
@aquila_const ok :- ) Glad it works now anyway. Hmm yes it'd be nice if Talkyard said "www isn't needed", if it sees a GitHub domain name or an IP address. I opened a bug about the bug: Bug: Blog comments break if Approve Users enabled
Hey there! I was about to reply to a comment on my blog that was posted on Friday. I haven't made changes to the site since then, but now Talkyard won't load. Firefox console says:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://site-1cgaa3uxxd.talkyard.net/-/v0/get. (Reason: CORS request did not succeed). Status code: (null).
2
Request failed, no response [TyEFET0RSP] TypeError: NetworkError when attempting to fetch resource. talkyard-comments.min.js:10:20291
Chrome:
talkyard-comments.min.js:10
POST https://site-1cgaa3uxxd.talkyard.net/-/v0/get net::ERR_CERT_DATE_INVALID
| sendFetchRequest @ talkyard-comments.min.js:10
| e.fetchAndFillInCommentCounts @ talkyard-comments.min.js:10
| (anonymous) @ talkyard-comments.min.js:10
| (anonymous) @ talkyard-comments.min.js:10
talkyard-comments.min.js:10 Request failed, no response [TyEFET0RSP] TypeError: Failed to fetch
| at Object.sendFetchRequest (talkyard-comments.min.js:10:19616)
| at e.fetchAndFillInCommentCounts (talkyard-comments.min.js:10:21337)
| at talkyard-comments.min.js:10:22554
| at talkyard-comments.min.js:10:27854
| (anonymous) @ talkyard-comments.min.js:10
VM10:5 crbug/1173575, non-JS module files deprecated.
Ah Talkyard loads again, except 2 stylesheets have a 404 and my custom CSS is missing
Hi @koos, Should work now again. The DNS wildcard cert for *.talkyard.net
expired yesterday — I had forgotten to renew it (need to do every 3 months). (There's a way to automate this via Gandi.net's API: https://api.gandi.net/docs/livedns/ (Talkyard currently uses Gandi.net for domains) plus Certbot, but then apparently the same API key can also be used to change owner of the domain: https://api.gandi.net/docs/domains/ which seems risky, so for now I'm renewing the HTTPS cert manually instead every 3 months (hmm most of the time), ... and was thinking about moving to CloudFlare, who have a more granular API permissions (https://developers.cloudflare.com/fundamentals/api/get-started/create-token/), but they didn't support .io (which Talkyard .io uses), but it seems they nowadays do: https://www.cloudflare.com/tld-policies/ so maybe now / soon is the time.)
Sorry for the 1 day can't-post-comments problem.
@koos Oh yes you're right that the custom CSS doesn't load, I'll have a look
@koos Now this has been fixed — the custom CSS works again (the blog comments appear in the right color, I mean, the same as your blog). (There was a bug related to a new CDN feature, which wasn't really in use yet anyway, and for now I've disabled it via a feature flag.)
is tags a supported feature? I have a test website here: https://test256.talkyard.net/-/tags/all
and have created a few posts with tags. How do see the posts with a certain tag? I have searched a bit and haven't found anything yet.
@karu — listing pages tagged with a certain tag hasn't been implemented :- ( it's not going to take that long to implement. Maybe I should prioritize that now soon.
Anyway, exactly right now, you can tag things, but cannot yet list the tagged things.
How are you looking to use tags, b.t.w.? In the "normal" way, I mean, to describe what a page is about, and list other pages also about that?
Thanks for the quick response @KajMagnus . The use case I am envisioning is something like this.
At a prototypical URL: https://../-/tags/views/
Would list all the discussion topics associated with that tag. And it would have a header at the top that would allow some brief discussion about that tag. Basically exact same as a categories view (except with tags an entity can belong in multiple tags obviously). Does this seem intuitive to you?
a header at the top that would allow some brief discussion about that tag. [...] same as a categories view [...] Does this seem intuitive to you?
Yes, something like that.
(With "discussion", you mean description, right? But not people posting comments and talking about the tag? I imagine there wouldn't be enough space for the latter. There are, however, pages of type About, and maybe if one wanted to discuss a tag, one could start an About page and somehow link it to the tag. Then, Talkyard could know it's a meta discussion about the tag (and not an ordinary page tagged by the tag), hmm.)
Possibly the URL will let you specify many tags, like: https://server/-/tags/kittens,camels,kangaroos
and you'd see all topics with all those tags.
Or maybe such functionality would instead be provided via search queries: https://server/-/search?q=tags:kittens,camels,kangaroos
.
@karu, In your URL example, is "views" in https://../-/tags/views/
meant to be a tag named "views"? Or would the complete URL to a tag in your example, be: https://../-/tags/views/kittens
if the tag is "kittens"
yep - I meant brief "at the top brief description of the tag".
either with /search or the -/tags/kittens,camels - both sound good. Whichever you feels goes best with the flow of what you have.
With my URL example, I was just free-handing something. Not too particular. In my example, I was meaning view as a level of endpoint hierarchy in the URL. so the views can be ignored. In my example, /tags/views/kittens would show tags of kittens. Does this help clarify?
I have a separate unrelated question on the API interface. I am not sure if the page create API is working. Is this curl URL supposed to work:
curl -X POST --user tyid=2:XXXXXXXXXXXXXXXXXXXX https://test256.talkyard.net/-/v0/upsert-simple -H "Content-Type: application/json" -d '{"pages": {"categoryRef": "tyid:year-1997", "authorRef": "username:karu", "title": "this is the posted title", "body": "this is the body", "bodyMarkupLang?": "HTML", "pageType": 12}}'
Where XXXX is the secret API key.
@karu description/discussion etc, ok, yes, thanks for clarifying.
About the API, Is that for upserting publications from year 1997? Having had a quick look, I see 2 problems:
1/2: There's a typo / an error: bodyMarkupLang?
should be bodyMarkupLang
without the ?
. The ?
is from Typescript and means that that key-value is optional. Hmm I guess this should be clarified somewhere. I think you should include bodyMarkupLang
, otherwise the default is CommonMark (which then would get compiled to HTML).
2/2: "categoryRef": "tyid:year-1997"
— instead, go to that category, click Edit Category, and in the bottom of the edit category dialog, there's a link External ID (optional): None
— click it, and type year-1997
. Thereafter that category has a permanent id you can refer to, when upserting. And change from tyid:
to extid:
. So it'll look like: extid:year-1997
. (However, if using the category slug, then the external code that upserts into the category, would break, if you rename the category slug.)
There's this end-to-end test: api-upsert-pages.2browsers.test.ts if that's any helpful. Let me know how it goes?
trying this now...I still get a 403 Forbidden.
I created the external id for a the parent category (Papers); and still get the same error.
curl -X POST --user tyid=2:XXXXX https://test256.talkyard.net/-/v0/upsert-simple -H "Content-Type: application/json" -d '{"pages": {"categoryRef": "extid:year-1997", "authorRef": "username:karu", "title": "this is the posted title", "body": "this is th
e body", "bodyMarkupLang": "HTML", "pageType": 12}}'
403 Forbidden
Not allowed. Ask for help at https://www.talkyard.io/forum/ [TyEM0UPSSIMPL]
I don't mind sending you the secret API key (this is currently a test website - before public release). If that helps.
@karu 403 Forbidden TyEM0UPSSIMPL
— then I need to enable a feature flag for your site (ffMayPatchSite
) ... Now done, what happens if you try again?
(I was previously assuming it was a self-hosted site. And I had forgotten about that feature flag anyway.)
trying....
this one's on me. but any quick ideas you have I appreciate. I get a JSON array/object error. Presumably I need to formating the payload differently?
curl -X POST --user tyid=2:1f52zwr9g02izsg1a3j8lwdrr6 https://test256.talkyard.net/-/v0/upsert-simple -H "Content-Type: application/json" -d '{"pages": {"categoryRef": "extid:year-1997", "authorRef": "username:karu", "title": "this is the posted title", "body": "this is the body", "bodyMarkupLang": "HTML", "pageType": 12}}'
400 Bad Request
Invalid json: 'pages' is not a JsArray, but a JsObject [EsE4GLK3] [TyE306TMRT2]
ok got it to work.
Looks like I was missing extId, and pages is an array of objects. so do i get freedom to pass, whatever name/string I want through the extID field?
This is what is working: (I just passed in foobar0) as the extId.
curl -X POST --user tyid=2:1f52zwr9g02izsg1a3j8lwdrr6 https://test256.talkyard.net/-/v0/upsert-simple -H "Content-Type: application/json" -d '{"pages": [{"categoryRef": "extid:papers", "authorRef": "username:karu", "title": "this is the posted title", "body": "this is the body", "bodyMarkupLang": "HTML", "pageType": 12, "extId" : "foobar0"}]}'
and going back to tags, are tags supported in the API creating? From the tests, looks like tags for pages/discussion topics upserted via the API is not supported? I didn't see anything in the code in the tests that has tags.
@karu, About "extId" : "foobar0"
— I think that field might be optional. It's useful if you also want to upsert comments — then you can refer to that page, using foobar0
. If publications have any universal IDs (like ISBN for books?), that might be a good extid (external id).
(The internal ids, tyid:...
, are meant for Talkyard to use itself, if generating a JSON export file of a forum, for example.)
Back to tags: I think upserting tags is not currently supported (I can have a look, I don't remember having added that though). It seems the next thing in Ty, could be to add support for upserting tags, & tag descriptions & listing things by tag.
Can I install talkyard on my custom domain and have it like community.mydomain.com, not community.talkyard.com ?
@taerese Yes, if you create a community via our SaaS, then, you can go here:
https:// your forum .talkyard.net/-/admin/settings/site
and click Change address ....
If you install on your own server, you'd instead edit a config file: /opt/talkyard/conf/play-framework.conf
.
@myron_ai Yes there is, here: https://insightful.demo.talkyard.io — feel free to post test comments.
There used to be a link to that test forum, from the homepage — but people posted so many test comments, so it ended up looking like a total mess, not making a good impression any more, so I removed the link, for now. Some time later, all such test comments will get auto deleted regularly, so only more seriously looking comments will be there.
Hello Kaj. Hope you are well. I am getting a problem on my embedded comments. The first page load, the comments work fine. But on subsequent pages I am getting an error 403 dialog box: "Please log out and log in, to get a complete session id —
this endpoint, /-/v0/upsert-user-and-login, requires the HttpOnly part of the session id [TyEWEAKSID_]
This used to work fine, any idea what has changed and where I should look for the fault please.
Thx.
Hi @fas, when did this error start happening? If you haven't changed anything recently, and I also haven't (not released any new server during that time, I think I haven't), then, it could be that something has changed in the most recent browser versions. Apple and Google etc sometimes change when they do or don't include cookies related to iframe
s. — What browser and operating system do you use, if I can ask?
Do you use blog comments Single Sign-On?
Hi Kaj. It is very hard for me to determine when the problem first occured. We have not used this functionality in probably about 18 months but have had a new set of customers signed up and so restarted the system. I had changed the domain name for the website and so had to change it in the talkyard embedded comments settings as an allowed iframe origin. Then it worked but only on the first page, thereafter the error. My client id Win11 and I have tried Chrome (119.0.6045.160) and Firefox (120.0.1) both with the same error. I am using the Paseto token SSO.
@fas Ok, about this:
Then it worked but only on the first page, thereafter the error
Could you describe in a bit more detail what happens? (What's the second page? Is that for example if you start on page A at your website, and click a link to page B? Is it a single-page-application or complete page reloads, when you follow any such link?) — If you want, send a link to your website, maybe in a PM (click my name), and maybe I could try and see what happens (or parts of what happens, maybe not everything w/o an actual account).
I'll look at some related auto tests too and see if there's a way to reproduce
Its a single page app, difficult for me to give you an account as the content is my clients and is confidential. I can try and setup a separate account but that could take some time. The app is a single page app, but each page has a different URL and loads its own talkyard Javascript script with a different discussion ID. If I return to the first page that previously worked I get the error there as well. I just don't know where to start looking for a problem? Franz
Ah, i see there are some additional error message in the console:
403 Forbidden
No such API endpoint: upsert-user-and-login [TyEAPIGET404]
https://xxxxx/-/v0/upsert-user-and-login
Error POSTing to /-/v0/upsert-user-and-login: {"xhr":{},"status":403}, details: 403 Forbidden
Please log out and log in, to get a complete session id —
this endpoint, /-/v0/upsert-user-and-login, requires the HttpOnly part of the session id [TyEWEAKSID_]
talkyard-comments.min.js:10 Talkyard comments: Error logging in using authn token. Check the console log messages in the Talkyard comments iframe for details (its name is 'edComments-1').
Before the errors I get the following console log entries:
Talkyard comments: Starting v0.2023.010-23794d2ab ... (disable logging by setting talkyardLogLevel = 'warn')
talkyard-comments.min.js:10 Talkyard comments: Found authn token in js var
talkyard-comments.min.js:10 Talkyard comments: Session iframe inited
talkyard-comments.min.js:10 Talkyard comments: Editor iframe inited
talkyard-comments.min.js:10 Talkyard comments: Comments iframe nr 1 inited
talkyard-comments.min.js:10 Talkyard comments: All comment iframes inited — continuing ...
talkyard-comments.min.js:10 Talkyard comments: Sending authn token to first comments iframe
@fas Thanks, good to have some log messages. I'll continue looking into this later today or tomorrow (will be away for a little while now)
( @fas I'm trying to make two blog comments SSO automatic tests work again, I had commented them out because of an incompatibility with recent Nodejs versions Edit: and a javascript Paseto token library that relied on an old Nodejs crypto function, now gone)
@fas Now the embedded-comments-SSO tests work again. But they don't test a Single Page App (SPA), only full page reloads, so they might not detect the problem happening in your case.
I wonder, the error, does it happen when you click Reply or Log In, after having navigated once (or once and back again) to another SPA-page?
Or does the error happen immediately after you have navigated to another page? (Without any user interaction, except for the navigation link click?)
***
In your SPA, I'm guessing that when one navigates to a new page, any Talkyard comments section gets removed. And then a new one gets added (if the new page has any comments section, I suppose not all pages do).
However, when that new comments section is shown, it might not run the embedded comments initialization code (unless, hmm, you've added some code to do that explicitly). The initialization code ran on the original page load, but (I'm guessing) not when one SPA-navigates to a new page?
Therefore, the new comments section, wouldn't know that one is in fact logged in already, and if you click Reply or any button in the comments iframe, then, a login popup would appear. And, when trying to log in in that popup, the error happens? (Or did I get some of these things wrong?)
@fas Have a look here: https://github.com/debiki/gatsby-plugin-ed-comments/blob/0b94b7f782804215db0e6a45da8380aa7f950f56/index.js#L57 — you'll see how you can make the blog comments work also in a SPA, without any real page reloads. (The code is from an old Gatsby v1 Talkyard comments plugin.)
So, you can call a function window.talkyardReloadCommentsAndEditor();
after a SPA navigation, to have Talkyard load [the comments for the new URL path]. (But there's a little bit more to it than just that, so check out the link.)
What SPA framework do you use b.t.w.? Something like Next.js or Gatsby or ... ?
Maybe there could also be some Talkyard bug related to SSO and SPAs. I'm a bit surprised about the error message, I think maybe more likely the comments iframe wouldn't hav appeared at all, hmm, after SPA navigations
@Kaj: When you say "Now the embedded-comments-SSO tests work again." was there a problem that you have just fixed? If so how long before I get the fix automatically installed?
In my SPA I remove the old comments element and then load different page contents and the new comments with a different discussion id. The page contents also change and so it really behaves like a non-SPA web app. Is there some specific code I need to call when removing the talkyard old element? As I say this all used to work just fine ~18 months ago.
If the Error dialog in the screenshot is closed, a comment can be created and successfully posted.
@fas Thanks for the screenshot, now I better understand when & where this happens. I think this might be the problem:
The app is a single page app, but each page has a different URL and loads its own talkyard Javascript script with a different discussion ID.
It sounds as if the blog comments script is loaded again, when it's time to show a different discussion, at a new Single-Page-App URL path? Say, a <script>
tag loading that script again? I imagine that can have worked about two years ago, however, since then there's been some changes to session management, which I think would make loading-the-script-more-than-once no longer work.
What happens nowadays, is that the script, when loaded the second time, sends the Paseto token to the server to log in — but the user is already logged in (they got logged in, when the script was loaded the first time). So the server gets the Paseto token and the user's current session id, but only the embedded-comments part of the session id. The server then thinks something is wrong (it doesn't want a session and a token at the same time), and returns the error.
I think instead of loading the Javascript again upon SPA navigation, what's needed, should be to call a function talkyardLoadNewCommentIframes()
which I have started writing, but for some reason left it unfinished, commented out (probably I was short of time, and no one needed it, back at that time). I think I'll need to comment it in, have a look that it works, and then include in a new server version.
Thereafter, instead of loading the <script>
again, you'd call talkyardLoadNewCommentIframes()
.
When you say "Now the embedded-comments-SSO tests work again." was there a problem that you have just fixed? If so how long before I get the fix automatically installed?
Only the tests were broken for a while, there was no other problem related to those tests.
Is there some specific code I need to call when removing the talkyard old element?
Yes, or rather, when adding the new comments section for a new URL path (i.e. talkyardLoadNewCommentIframes()
) ... I'll write more about that tomorrow ...
Thanks for checking this Kaj. Your analysis makes sense. I will wait for the function to be uncomment and the adjust my code. Could an alternative solution be to either - a) close any open sessions on each new script load/startup, or b) close the session on page change? Or is there an advantage to reusing sessions?
@fas I think there's an alternative solution, not related to sessions though. Namely this:
Once you've SPA-navigated to another page, then, call a function talkyardForgetRemovedCommentIframes()
(which already exists). It makes Talkyard look for comment sections that have disappeared, and Talkyard will then forget about them (frees resources). And, to create a comment section, instead of adding the <div class="talkyard-comments" data-discussion-id="..." >
HTML snippet, call this Javascript function: talkyardAddCommentsIframe({ appendInside: '#blog-comments', discussionId: '123abc' })
and also add a <div id="blog-comments" />
where the comments will appear (just below the main article or blog post I suppose).
This is actually maybe even simpler, than calling the does-not-yet-exist talkyardLoadNewCommentIframes()
— because now you only need to call some js functions, not think about generating new & matching HTML all the time.
Here's an auto test that calls talkyardForgetRemovedCommentIframes()
: https://github.com/debiki/talkyard/blob/368517bae243228f34333f8ea6c0299976d89fce/tests/e2e-wdio7/specs/embcom.manyframes.js-api.2br.e2e.ts#L206 (but you don't need to do this: window['talkyardForgetRemovedCommentIframes']();
— that extra clutter is just because of the test framework. Instead you'd do just: talkyardForgetRemovedCommentIframes()
).
And here the same test calls talkyardAddCommentsIframe()
: https://github.com/debiki/talkyard/blob/368517bae243228f34333f8ea6c0299976d89fce/tests/e2e-wdio7/specs/embcom.manyframes.js-api.2br.e2e.ts#L222
To summarize: When SPA-navigating, after the URL has changed, and new comments should be shown, you'd do:
talkyardForgetRemovedCommentIframes();
talkyardAddCommentsIframe({ appendInside: '#blog-comments', discussionId: 'new-discussion-id' });
(Hmm you use discussion ids, right, to decide what comments to show?)
alternative solution be to [...] close any open sessions [...] ?
Maybe could work in some cases, however, see below
Or is there an advantage to reusing sessions?
Yes, better for performance, and fewer things that can go wrong. For example, Talkyard rate limits how often one can log in — it's not supposed to happen on each page view. If one hits the rate limits (e.g. jumps back and forth between a bunch of pages), there could be some error message or problem with getting SSO-logged-in and posting comments.
Hi Kaj. I have just tried the following and now the comments are now not appearing at all.
Firstly I have created a separate component/element to load the script and log in using the token that is attached to the main SPA page.
Then I have a second component that loads the comments and runs the script as per your instructions - but the comments element never shows up.
I suspect this may be due to the fact that the comments element "talkyard-comments" is in the shadow dom and the script cannot find it. I have also tried adding the discussion id attribute in the old style and that also doesn't load any comments.
Previously the script loading and comments happened within the same element. If I keep the session script in the comments component it will keep getting removed and relogged in.
Screenshots are of the current dom structure and the js code in the component.
Any ideas?
I have used a workaround to get the element into the light DOM, but the comments are not showing on screen at all. Is there some logging happening in talkyardAddCommentsIframe()?
I will try and enable debug logging.
Hi @fas,
Here's a minimal example, without Web Components or shadow roots:
<html>
<head></head>
<body>
<div>Blog post ...</div>
<div id="comments-wrapper"></div>
<script>
talkyardAuthnToken = "paseto:v2.local....";
talkyardServerUrl='https://ty server';
</script>
<script async defer src="https://ty server/-/talkyard-comments.js"></script>
</body>
</html>
And, when it's time to show the comments, or time to show new comments, you could do this:
// Remove old comments, and tell Talkyard they're gone:
getElementById('comments-wrapper').replaceChildren();
talkyardForgetRemovedCommentIframes();
// Show new comments: (for the new URL, or initial URL)
talkyardAddCommentsIframe({ appendInside: '#comments-wrapper', discussionId: '123abc' });
However! When loading the HTML page the first time (for "real", not via SPA navigation), then, if you call talkyardAddCommentsIframe()
too soon, it won't yet exist — because the talkyard-comments.js
is async defer
— it might not yet have created that function.
You could 1) remove async defer
, and make sure to call talkyardAddCommentsIframe()
after the whole page has been loaded (so that the script has been executed). (In future versions, you can define a function onTalkyardCommentsScriptLoaded
which talkyard-comments.js
will call (if it exists) so you won't have to think about that.)
Or you can 2) include the usual <div class="talkyard-comments" data-discussion-id="...">
, as a child of #comments-wrapper
, just for the initial page load (which the comments script will replace with a comments iframe
).
***
the comments element "talkyard-comments" is in the shadow dom and the script cannot find it
Yes that makes sense, better to not place the comments in a shadow-root I'd guess. At the same time, I see it's an "open" shadow root, and from what I'm reading, it's possible to access the things therein, but maybe one needs to specify the shadow-root document as the starting point for element lookups (rather than the main document). — I'm new to shadow-roots, haven't used myself this far.
Why is it a shadow-root b.t.w.? Is it the web framework, hmm, Vaadin it seems, that creates shadow roots?
I have also tried adding the discussion id attribute in the old style and that also doesn't load any comments.
Is that what the screenshot above shows? If you want, you could copy-paste the HTML (don't forget to remove anything private :- ))
Yes, I am using Vaadin which in turn uses LitElement which is all web components/shadow DOM stuff.
I think I am effectively doing what you describe, except that the
<div id="comments-wrapper"></div>
is completely removed (not only the children) and then recreated, and then I call the talkyardForgetRemovedCommentIframes() and talkyardAddCommentsIframe() functions.
@fas, logging, yes, set talkyardLogLevel = 99
, debug messages will get logged.
the comments are not showing on screen at all
I wonder if it could be talkyardAddCommentsIframe()
getting called before it exists? — The comments script is async defer
(unless you remove that).
If you want to set breakpoints in the comments script, you could change from /-/talkyard-comments.min.js
to /-/talkyard-comments.js
(without .min
) and it'd be simpler to read. In the script, this one: function addCommentsIframe()
is the same as talkyardAddCommentsIframe()
.
What happens if you call talkyardAddCommentsIframe(...)
manually in Dev Tools
OK, I figured it out.
I added the log level 99 but still no logs appear??
But debugging the non .min showed that I had to set:
talkyardManyCommentIframes = true;
There is a check in talkyardAddCommentsIframe() but the exception was getting swallowed somewhere.
Now the comments are loading and changing per page :-)
Thanks for all the help Kaj, you're brilliant :-).
@fas Ok :- ) & thanks you too for the patience. I'm glad it works. And now I know about some more documentation & helper function(s) and auto-tests to write, and I'll look into why log level 99 didn't work (& it's going to be possible to add e.g. #talkyardLogLevel=...
to the URL as well, if one wants to quickly change the log level without editing one's blogs config files)
I'll look into talkyardManyCommentIframes = true;
as well, maybe it's better if it's wasn't needed in this case (since there's just one iframe at a time).
i created an trial account, put newly created url into my hugo toml file and get nothing, but when i put public access demo url it works, i need configure something ?
@przeqpiciel Yes you need to add the URL to your blog at: https:// your account .talkyard.net/-/admin/settings/embedded-comments
, and edit some Hugo template files too — it seems you've done that now? (When I visit your blog, I see some comments at the end of the blog posts.)
B.t.w. any thoughts about how this could have been made more clear? So others will figure things out directly :- )
I wonder if this would have helped: Feedback about embedding comments (I couldn't find it) — that is, showing more blog comments settings directly, but grayed out, so you'd know you're on the right admin area page
Can I install talkyard on my custom domain and have it like community.mydomain.com, not community.talkyard.com ?
I wanted to ask if it is possible for members of the forum to create their own sub community within the forum. Such as you see various communities on Reddit.
I currently use Wpforo forum and I waanted to know how easy is it to migrate the contents over when I switch to talkyard. Also do you or anyone offers this migration services?
Hi @taerese — custom domains like community.mydomain.com
, yes. If you're a business, then that's in the Startups
price plan. (Or are you a not-for-profit community or something else?)
create their own sub community within the forum
Not as of now. There was long ago some basic support for that, but it's disabled & defunct for now. I think it'll be possible again (the database is "ready for it" ) but probably not within the nearest year :- (
(It would be interesting to hear a bit about what different sub communities your users might be interested in creating? I'm guessing the main forum itself would have some basic overall discussion theme?)
I currently use Wpforo forum and I waanted to know how easy is it to migrate the contents over when I switch to talkyard. Also do you or anyone offers this migration services?
Right now there's no importer from wpForo. I'd suspect it's fairly much work to create one.
What's the startup price plan? I intend to host the forum on my own server.
@taerese Self hosting costs nothing, it's open source:
https://github.com/debiki/talkyard-prod-one
(Otherwise starts at €25/month.)
@KajMagus. Would you be able to help install this on my server for a one-off fee? I fall in love with this script every day I come here. Unfortunately, I do not have £25/month, and we do not have 5 coworkers to manage this. If you can grant £5/month for me to use the Startup, I'll be glad.
@taerese About installation help: Hmm, I suspect that wouldn't be a one time thing: Sometimes there are major software releases, of Talkyard or the underlying operating system, and then it's not that easy to upgrade (can be similar to installing the first time). What server do you use / would you use? (You have one already, or would rent? What Operating System?)
About €5 for the Startup plan — yes that works fine. That's if you use Talkyard's hosting (while if you self host it's free, well, except for your server costs somehow).
Hi @KajMagnus, enjoying the platform. I created a custom domain and then realised I should have first email support to ensure https security is enabled. How can I resolve this? I've removed the CNAME from my DNS settings for now.
Hi @BSitzer oh sorry I'm doing that manually currently (running Certbot to generate a HTTPS cert). Send me an email, or a message here, once the CNAME is back? Sorry for the trouble.
All good thanks @KajMagnus.
I readded the CNAME again yesterday.
Hey there! I'm currently exploring Talkyard (and it's looking promising), but I'm curious if there's a straightforward method for creating posts through an API call (using curl). I've checked out the documentation but haven't stumbled upon a solution for this. Thanks a bunch in advance!
@gbenguze Yes there's an API for creating posts, check out this end-to-end test:
https://github.com/debiki/talkyard/blob/main/tests/e2e-wdio7/specs/do-api-create-pages-comts-check-webhooks-search.2br.e2e.ts
and search for "makeCreatePageAction" (in that file).
Here's more nice-to-read docs: How to Like and Subscribe to Pages via the API ... it's almost what you want, but about Liking and subscribing to pages. I can try to create a similar API docs page about posting posts, and send you a message.
With creating posts, you mean creating new pages? (Rather than comments?)
@KajMagnus Thanks a lot for getting back to me promptly. I'll take a look at the links you provided. Just to clarify, when I mentioned creating a post, I was referring to creating a new topic. Or is it more aligned with creating a comment?
@gbenguze It's for both creating topics and comments. I'll write some docs tomorrow, starting with how to create topics :- )
@KajMagnus That will be great. Looking forward to the docs
@gbenguze Here's the new docs: How to create Pages and Comments via the API. I'm going to proofread the docs tomorrow / later today (but maybe I might as well message you now).
Hi, I'm generally new to making websites etc. I made one with Hugo using Hinode template, depolyed on cloudflare. I'm trying to add talkyard commenting, but the iframe is blocked with csp. I get error
Refused to frame 'https://my-site.talkyard.net/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://usablewatts.com".
I think I tried to do everything to change the frame-ancestors policy, but no effect. I added _headers with various csp values and cloudflare can read them (ex. when I changes some for scripts-src the website breaks due to some inline scripts/styling - including scripts for talkyard). But the frame-ancestors never changes and I always get the same error. I also tried to add header via Transform Rules, but the same effect.
example _headers file:
/*
Content-Security-Policy: frame-ancestors 'self' https://*.talkyard.net;
any ideas?
Hi Marcin @sirlod, is there currently a page over at your blog that tries to load the comments? Then I could go there and have a look.
Hmm this looks odd: Refused to frame 'https://my-site.talkyard.net/'
— is the real text "my-site
" literally, or you've edited it and inserted "my-site
" as sample text?
I think I tried to do everything to change the frame-ancestors policy, but no effect. I added _headers with various csp values and cloudflare can read them
Hmm, you mean you did that for the Hugo blog? That wouldn't affect the blog comments though — they're served by a different server (the talkyard.net
server), which won't know about changes made to the Cloudflare settings.
the frame-ancestors never changes
Talkyard's Frame-Ancestor security policy wouldn't change if you edit the Hugo settings. Instead, you'd go to:
https://comments-for ... talkyard.net/-/admin/settings/embedded-comments
to change it. It's the Allow embedding from field — but it looks correct, I just had a look.
ok, I get it now. I was testing it on a dev page which has different url. I thought it was a csp problem on the hugo/cloudfare side. It is working now, thanks! now have to figure out how to make it dark/light mode themes and make them follow the theme of blog.. ;)
@sirlod Ok :- ) Dark/light modes — currently that's by editing CSS. (How familiar are you with CSS?) I see there's a theme switcher over at your blog. Then, check out this: Changing the colors #post-9 — it's about how to activate different CSS in the blog comments iframe, depending on what theme (light / dark) is active at the blog (embedding website).
ok, managed to make the theme of comments follow the theme of blog (dark/light/auto). It doesn't work for the writing comment windows, as it is another iframe. But it is ok for me for now. if anyone needs it for future, here is my js code on talkyard:
window.addEventListener('message', event => {
if (event.origin === 'https://your-domain.com') {
const data = event.data;
console.log('msg-in:', data.theme);
if (data.theme !== undefined) {
// Apply dark/light mode styles based on received theme
document.documentElement.classList.remove('light-mode', 'dark-mode');
if (data.theme === 'dark') {
document.documentElement.classList.add('dark-mode');
} else if (data.theme === 'light') {
document.documentElement.classList.add('light-mode');
} else if (data.theme === 'auto') {
// Use matchMedia to listen for changes in the color scheme preference
const matchMedia = window.matchMedia('(prefers-color-scheme: dark)');
if (matchMedia.matches) {
document.documentElement.classList.add('dark-mode');
} else {
document.documentElement.classList.add('light-mode');
}
}
}
}
});
window.parent.postMessage({ pageLoaded: true }, '*');
and on the blog side:
const postThemeToIframes = (theme) => {
// Send a message to all iframes
Array.from(document.querySelectorAll('iframe')).forEach(iframe => {
if (iframe.contentWindow) {
iframe.contentWindow.postMessage({ theme }, '*');
console.log('msg-out:', { theme });
}
});
}
window.addEventListener('DOMContentLoaded', () => {
window.addEventListener('message', (event) => {
if (event.data.pageLoaded) {
postThemeToIframes(theme); // Post the theme when iframe ready
}
});
document.querySelectorAll('[data-bs-theme-value]')
.forEach(toggle => {
toggle.addEventListener('click', () => {
const theme = toggle.getAttribute('data-bs-theme-value')
postThemeToIframes(theme); // Post the theme when it's changed
})
})
})
Hello! I'm a new user and I have managed to self-host Talkyard on a VPS. Just wanted to pop by and say that the installation process was really simple and the instructions were well written.
Thank you for working on this project!
Hi @hungrybluedev Ok :- ) Sorry for the late reply, I was distracted by the summer here
@sirlod Thanks for posting the dark/light/auto solution :- ) Sorry for the slow reply. Looks as something good to include in the documentation section, I'll move or copy it to there (if ok with you?)
Hey folks! Just started using talkyard and first impression is great. I have an issue embedding comment sections on my blog though.
I followed the instructions to add the comments to "Something Else" which meant adding the JS snippet to the blog post template.
I'm using AstroJS as a static website generator. What happens is that the script itself loads, but then there's a 404 trying to load additional stuff. That's the URL that gets requested: https://c1.ty-cdn.net/-/embedded-editor?embeddingUrl=https://walterra.dev&embeddingScriptV=2
And that's the response:
404 Not Found
There is no site with hostname 'c1.ty-cdn.net' [TyE404HOSTNAME]
Any thoughts on what I might be doing wrong? Let me know if you need more details.
From what I see so far I think there's some post-processing going on with Astro that strips the talkyardServerUrl = "..."
part, will investigate and report back!
Was able to fix it! The trick was to adapt the snippet and use <script is:inline>...</script>
with AstroJS.
@walterra Hmm this (from your first comment above) didn't look right: https://c1.ty-cdn.net/-/embedded-editor?...
— that ought to be https://site-12345abcde.talkyard.net/-/embedded-editor?...
. I had a look at your blog, and now it does show the latter, so, seems fine now.
I haven't used AstroJS, why does one need is:inline
? Aha, "To prevent Astro from processing a script, add the is:inline directive." https://docs.astro.build/en/guides/client-side-scripts/. Interesting with AstroJS, hadn't heard about :- )
Hello. I just joined Tlakyar and set up my initial account. Something went wrong, I guess, since I'm not receiving the email confirmation link. And now I can't access the community I just created. The error message is the following: : Error 403
You have not yet confirmed your email address. Please check your email inbox — you should find an email from us with a verification link; please click it. [TyEEML0VERIF_] Someone can help with this? Thanks a lot
Hi @German, There was an error (a hard bounce) delivering an email to your mail server (looking at the DNS configuration, seems you're using your own mail server?). Thereafter, the mail delivery SaaS Talkyard's hosting uses, stopped delivering any more emails.
Now I clicked a Reactivate
button in the mail software, ... I'll send you a PM
When I followed the instructions in the starting-talkyard.md document to run talkyard. I got stuck at the nix-shell step.
Here is the output when I start the nix-shell:
error: nodejs_14 has been removed as it is EOL.
(use '--show-trace' to show detailed location information)
Who can help me? Thank you.
(Hi @liuzhili, I'll reply here: Stuck at the starting talkyard)