sylque / discpage

A Discourse plugin to create static pages and attach discussions to headings
MIT License
30 stars 5 forks source link

does not work #1

Closed wanghaisheng closed 4 years ago

wanghaisheng commented 4 years ago

follow setup instruction and you can check here dicpage version 1.0.12 https://cp.9bx1.com/t/topic/24/2 image image

@sylque

sylque commented 4 years ago

Thanks @wanghaisheng

As you can see in the debug console, you're experiencing a Content Security Policy issue, which prevents DiscPage (and other contents) from loading. At this stage, I don't know why it happens.

Would you please tell me your Discourse version? Here is what it looks like on my side: image

Also, would you please provide a screenshot of your "content security policy" settings? Here is what it looks like on my side: image

sylque commented 4 years ago

Also, please uncheck "content security policy" in the settings and tell me what happens (then check it back , as it is an important security setting).

wanghaisheng commented 4 years ago

@sylque i do know this ,as you can see an app called fortify with cloudflare. discourse version and content security setting is the same with yours

image

wanghaisheng commented 4 years ago

disable fortify and content security setting,it works

sylque commented 4 years ago

Glad it works. However, I believe you shouldn't need to disable the "content security policy" Discourse setting.

wanghaisheng commented 4 years ago

yes here i want to discuss how to setting with content security policy enabled

sylque commented 4 years ago

Is Fortify disabled right now? Could you please disable it temporarily?

wanghaisheng commented 4 years ago

@sylque pls wait a little . its done now

uninstall fortify bypass cloudflare cache.

i was wondering how to get proper value for this Response Headers Headers that will be added to each response from the origin.

access-Control-Allow-Origin: https://*.9bx1.com Content-Security-Policy: default-src 'self'; img-src ; media-src ; script-src *

wanghaisheng commented 4 years ago

after debug some time if i keep the discouse and content security setting as above ,plus add this image

  1. keep fortify disabled, it works 2 keep fortify enabled , it does not show static page instead of usual forum display
wanghaisheng commented 4 years ago

another question is in the http://www.docuss.org/tags/dpg-209-demo1?r=false does "Si longus levis " "Isto modo ne improbos quidem si essent boni viri " different topic name under the same category?or different category? what does number "1" "2" mean? it seems to be topic number under the category

right now i have 3 category to be dispage, how to achieve the same result as demo page image

sylque commented 4 years ago

in the http://www.docuss.org/tags/dpg-209-demo1?r=false, does "Si longus levis " "Isto modo ne improbos quidem si essent boni viri " different topic name under the same category?or different category?

Topics created in an orange balloons have a specific Discourse tag. On your https://cp.9bx1.com/t/topic/24/2 page for example, the tag corresponding to your orange balloon is dpg-24-intro. It means all topics created in the balloon will get this tag.

Optionally, you can also set a category for orange balloon topics, by using the "discpage balloon category" setting.

what does number "1" "2" mean? it seems to be topic number under the category

Yes, the numbers indicate the topic count in each orange balloon.

right now i have 3 category to be dispage, how to achieve the same result as demo page

What do you mean by "same result"? What exactly do you want to achieve?

wanghaisheng commented 4 years ago

Yes, the numbers indicate the topic count in each orange balloon.

does this topic under same category ?

by using the "discpage balloon category" setting.does that mean in this category whether i explicit use dpg-24-intro. It will automatically generate one and count the topic number under this category

i have two topics under the same category.https://cp.9bx1.com/c/best-subscription-boxes append the following to topic content

{dpg-title-balloon}

[dpgb id=intro][/dpgb]

but how can i get a page/single url (like www.docuss.org/tags/dpg-209-demo1?r=false) where it shows two topic title with balloon icon and showing number '2' something like ''Isto modo ne improbos quidem si essent boni viri 2 ''

sylque commented 4 years ago

Yes, the numbers indicate the topic count in each orange balloon.

does this topic under same category ?

The numbers indicate the topic count in the tag of the orange balloon. There is no relationship between this number and categories.

by using the "discpage balloon category" setting.does that mean in this category whether i explicit use dpg-24-intro. It will automatically generate one and count the topic number under this category

If you create a topic and manually set the dpg-24-intro tag, the topic will appear in the corresponding orange balloon and the topic count for this balloon will be incremented. This doesn't relate to categories.

i have two topics under the same category.https://cp.9bx1.com/c/best-subscription-boxes append the following to topic content {dpg-title-balloon} [dpgb id=intro][/dpgb] but how can i get a page/single url (like www.docuss.org/tags/dpg-209-demo1?r=false) where it shows two topic title with balloon icon and showing number '2' something like ''Isto modo ne improbos quidem si essent boni viri 2 ''

Your url https://cp.9bx1.com/tags/dpg-38-intro is already very similar to www.docuss.org/tags/dpg-209-demo1. To make it even more similar, you can:

  1. Remove {dpg-title-balloon}
  2. Add a second balloon somewhere in the page by adding [dpgb id=whatever][/dpgb]
  3. Create some topics in the two balloons, so that the topic count is displayed beside the balloons
wanghaisheng commented 4 years ago

helpful . do we want to fix this one i can keep fortify enabled , it does not show static page instead of usual forum display

wanghaisheng commented 4 years ago

separately add the two in two topics under the same category.https://cp.9bx1.com/c/best-subscription-boxes [dpgb id=dpg38intro][/dpgb] [dpgb id=dpg39intro][/dpgb]

for my "http://www.docuss.org/tags/dpg-209-demo1" like url should be what? @sylque

sylque commented 4 years ago

keep fortify enabled ,

Unfortunately, I'm not very knowledgeable with Content Security Policy, so it is difficult for me to help you with Fortify. My feeling is that the Response Headers you've added are not compatible with Discourse. You might want to ask about that on Discourse Meta.

wanghaisheng commented 4 years ago

that`s fine . focus on the latter one is ok would you like make a youtube video to show how this wonderful plugin works?

wanghaisheng commented 4 years ago

is the following in the same one topic and with 7 dpgb id and for each id you have 2 or 1 topic created

This page is a demo for DiscPage, a Discourse plugin that allows to create static pages and attach discussions to headings. You are currently reading one of those static pages. And clicking an orange balloon below will show the discussions.

Si longus levis  1
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Scaevolam M. Comprehensum, quod cognitum non habet? Audeo dicere, inquit. Quodsi ipsam honestatem undique pertectam atque absolutam. Duo Reges: constructio interrete.

Isto modo ne improbos quidem si essent boni viri  2
Memini vero, inquam; Quid Zeno? At multis malis affectus. Atqui reperies, inquit, in hoc quidem pertinacem;

Illum mallem levares, quo optimum atque humanissimum virum, Cn. Illa tamen simplicia, vestra versuta. Si qua in iis corrigere voluit, deteriora fecit. Recte, inquit, intellegis. Paria sunt igitur. Illa videamus, quae a te de amicitia dicta sunt.

Prioris generis est docilitas, memoria; Quid ait Aristoteles reliquique Platonis alumni?

Isto modo ne si avia quidem eius nata non essetused 
Si id dicis, vicimus. Nulla erit controversia. Occultum facinus esse potuerit, gaudebit.

Ita ne hoc quidem modo paria peccata sunt. Ea, quae dialectici nunc tradunt et docent, nonne ab illis instituta sunt aut inventa sunt? In eo autem voluptas omnium Latine loquentium more ponitur, cum percipitur ea, quae sensum aliquem moveat, iucunditas. Graece donan, Latine voluptatem vocant.

Sed ad illum redeo 
Quis hoc dicit? At enim hic etiam dolore. Cur, nisi quod turpis oratio est? Num quid tale Democritus? Non laboro, inquit, de nomine.

Id est enim, de quo quaerimus 
Quis Aristidem non mortuum diligit? Hoc etsi multimodis reprehendi potest, tamen accipio, quod dant. Vide, quantum, inquam, fallare, Torquate. Praeclarae mortes sunt imperatoriae; Propter nos enim illam, non propter eam nosmet ipsos diligimus. Erat enim res aperta.

Duarum enim vitarum nobis erunt instituta capienda. Facillimum id quidem est, inquam. Tenent mordicus. Sed nunc, quod agimus;

Quodsi ipsam honestatem undique pertectam atque absolutam. Itaque contra est, ac dicitis; Praeteritis, inquit, gaudeo. Itaque contra est, ac dicitis;

Polemoni et iam ante Aristoteli ea prima visa sunt, quae paulo ante dixi 
Negat esse eam, inquit, propter se expetendam. Itaque nostrum est-quod nostrum dico, artis est-ad ea principia, quae accepimus. Haec dicuntur fortasse ieiunius; Hi autem ponunt illi quidem prima naturae, sed ea seiungunt a finibus et a summa bonorum; Quamquam haec quidem praeposita recte et reiecta dicere licebit.

Bona autem corporis huic sunt, quod posterius posui, similiora. Sed ille, ut dixi, vitiose. Et non ex maxima parte de tota iudicabis?

Nummus in Croesi divitiis obscuratur, pars est tamen divitiarum. Non quam nostram quidem, inquit Pomponius iocans;
wanghaisheng commented 4 years ago

If you create a topic and manually set the dpg-24-intro tag, the topic will appear in the corresponding orange balloon and the topic count for this balloon will be incremented. This doesn't relate to categories.

in the topic https://cp.9bx1.com/t/topic/38?r=false i have add 5 dpgb id, dpg38intro.......dpg41intro how to set [dpgb id=dpg38intro][/dpgb] when create a topic

sylque commented 4 years ago

Please don't use balloon ids like this: dpg38intro ... dpg41intro. Instead, use intro1...intro4. This will automatically generate the following urls: https://cp.9bx1.com/tags/dpg-38-intro1 ... https://cp.9bx1.com/tags/dpg-38-intro4.

sylque commented 4 years ago

how to set [dpgb id=dpg38intro][/dpgb] when create a topic

When people create a topic inside an orange balloon, the right tag will be automatically set.

wanghaisheng commented 4 years ago

Please don't use balloon ids like this: dpg38intro ... dpg41intro. Instead, use intro1...intro4. This will automatically generate the following urls: https://cp.9bx1.com/tags/dpg-38-intro1 ... https://cp.9bx1.com/tags/dpg-38-intro4.

if i use intro1...intro4 how could be dpg-38 instead of dpg-39 or others

sylque commented 4 years ago

if i use intro1...intro4 how could be dpg-38 instead of dpg-39 or others

In normal use, you don't need to know how tags are generated and set. This is done automatically.

Or maybe you want to achieve something special?

wanghaisheng commented 4 years ago

no i want to access this page through url maybe later specify the url in the menu another concern is when i specify a category for homepage plugin, if there is more than 1 topic here ,which topic could be the "a static page serve as the Discourse home page

sylque commented 4 years ago

no i want to access this page through url maybe later specify the url in the menu

Then why don't you just copy the url from the browser address bar?

another concern is when i specify a category for homepage plugin, if there is more than 1 topic here ,which topic could be the "a static page serve as the Discourse home page

To use a static page as the Discourse home page, use the static page path. For example, to set https://cp.9bx1.com/t/topic/24 as the static page, use /t/topic/24 or /t/24.

wanghaisheng commented 4 years ago

Then why don't you just copy the url from the browser address bar?

here what i want to figure out is exactly url content as said before is it be "https://cp.9bx1.com/tags/dpg-38-intro4" "dpg-38-intro4" where to look for this part since generated automatically?

To use a static page as the Discourse home page, use the static page path. For example, to set https://cp.9bx1.com/t/topic/24 as the static page, use /t/topic/24 or /t/24.

this is the situation using a topic not a category

This Discourse plugin allows to set any existing Discourse page (a topic, a category, etc.) as the home page of your Discourse instance.

sylque commented 4 years ago

as said before is it be "https://cp.9bx1.com/tags/dpg-38-intro4" "dpg-38-intro4" where to look for this part since generated automatically?

Just click on the balloon and look at the url in the browser address bar. The tag is composed of "dpg-" + [Discourse id of the static page topic] +"-" + [user-define id of the balloon].

this is the situation using a topic not a category

To use a category as the Discourse home page, use the category path. For example, to set https://cp.9bx1.com/c/subscription-box-review/7 as the home page, use /c/subscription-box-review/7 or /c/7.

wanghaisheng commented 4 years ago

Just click on the balloon and look at the url in the browser address bar. The tag is composed of "dpg-" + [Discourse id of the static page topic] +"-" + [user-define id of the balloon].

i think there is a communication barrier between us. if i create a topic lets say here is https://cp.9bx1.com/t/topic/38/2 as you said ,look the url when click on the first balloon, address bar just change to https://cp.9bx1.com/tags/dpg-38-intro1 but what i want is a url i can access this topic instead of a balloon tag inside this topic

To use a category as the Discourse home page, use the category path. For example, to set https://cp.9bx1.com/c/subscription-box-review/7 as the home page, use /c/subscription-box-review/7 or /c/7.

then if there is more than 1 topic in this category ,which topic could be the "a static page serve as the Discourse home page

sylque commented 4 years ago

i think there is a communication barrier between us.

Yes there is. Another issue is that your Discourse instance seems partially broken (at least from here): I see errors in the log console, the top left logo doesn't load, I get strange errors when trying to create an account, sometimes the site doesn't load at all...

but what i want is a url i can access this topic instead of a balloon tag inside this topic

I don't understand which topic you are referring to.

There are three possible urls with DiscPage

then if there is more than 1 topic in this category ,which topic could be the "a static page serve as the Discourse home page

I don't understand your question.

At this stage, maybe we could change the way we interact. For example, maybe you could describe an actual step-by-step use case (such as: 1. I go to this url 2. I click this balloon 3... ), and then describe:

Also, I'm surprised you never tried to create a topic inside a balloon (at least I can't see any). Is there a reason to that?

wanghaisheng commented 4 years ago

Also, I'm surprised you never tried to create a topic inside a balloon (at least I can't see any). Is there a reason to that? i do actually

step by step 1.if i want to add another menu like NEWS lets say Pages, and want to attach static page url to pages i do want to know what static page url is.this is the whole point i am arguing before and it seems you dont get the point though. and of course original url in the forum is https://cp.9bx1.com/t/topic/38,but your demo`s url is like xx/tags/intro, then i was wondering how to access this page(https://cp.9bx1.com/t/topic/38) through your demo style url and it seems for one topic there will be more than 1 balloon and for each one there is a balloon url but there is no all in one balloon url for one topic containing more than 1 balloon.

sylque commented 4 years ago

I think I get it.

On your forum, https://cp.9bx1.com/t/topic/38 is the static page url.

On my forum, http://www.docuss.org/t/discpage-demo/209 is the static page url. As you can see, there is no "tags" in the url.

On my forum, http://www.docuss.org/tags/dpg-209-demo1?r=false is not a static page url. It's a balloon url (as indicated by the yellow selection) with the right panel closed (see the ?r=false in the url). Click the green sidebar on the right and the topic list will appear.

As you can see, there is no such thing as a "demo style url".

Does it make more sense?

wanghaisheng commented 4 years ago

yes till now i get what this plugin can do~