-
-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iframe always loads from localhost (binary only, without docker) #321
Comments
The issue is real, but non-dockerized version only. Binary doesn't do this step and artifact's build enforcing 127.0.0.1:8080 I'm not sure (yet) how to fix this. @Reeywhaar probably nothing can be done on your side to mitigate it? @smurfpandey the only short-term workaround i can think of - change Dockerfile.artifacts with your domain and build it from the source., i.e. |
One solution I see is to explicitly provide remark host in remark_config, and move all thing regarding determining host from bundle time to runtime. Also, as we changing client setup, we can provide different startup script which will solve another problem: bundle size. Right now So, resulting script would be something: <script>
var remark_config = {
host: 'REMARK_HOST', // host of remark server, e.g. "https://demo.remark42.com"
site_id: 'YOUR_SITE_ID',
components: ['comments', 'last_comments', 'counter'], // optional param; which components to load. default to ['comments']
url: 'PAGE_URL', // optional param; if it isn't defined window.location.href will be used
max_shown_comments: 10, // optional param; if it isn't defined default value (15) will be used
theme: 'dark', // optional param; if it isn't defined default value ('light') will be used
page_title: 'Moving to Remark42' // optional param; if it isn't defined `document.title` will be used
};
(function(c) {
for(var i = 0; i < c.length; i++){
var d = document, s = d.createElement('script');
s.src = remark_config.host + '/web/' +c[i] +'.js';
(d.head || d.body).appendChild(s);
}
})(['vendor'].concat(remark_config.components || ['comments']));
</script> |
Handling all of this on client side sound like a good idea to me. This change will make all the setup less magical, i like it |
Thank you for the work-around suggestion. I will try building the binary myself and see how it goes. |
i have released v1.3.2 with the support of configurable @smurfpandey let me know if it addressed your issues |
It works. Thank you for the quick fix. :) |
I am trying to install remark on my server without docker. I can load the /web page but, iframe is trying to load from http://127.0.0.1:8080. I have installed remark on different domain though.
My startup command:
/var/www/remark42/remark42.linux-amd64 server --secret=qwe456@789 --url=http://comment.local.server/ --auth.anon --site=blog-local
The text was updated successfully, but these errors were encountered: