markdown-notes icon indicating copy to clipboard operation
markdown-notes copied to clipboard

Note Preview does not appear when using HTTPS

Open Nalydmerc opened this issue 9 years ago • 7 comments

The app is working correctly, but the preview does not appear. I've tested this and when using normal HTTP, it appears just fine.

My Apache configs read as follows:

<VirtualHost *:80>
    ServerName rs.naly.tech

    RewriteEngine On
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

</VirtualHost>

SSL:

<VirtualHost *:443>
    ServerName rs.naly.tech

    SSLEngine on

    SSLCertificateFile /[Removed]/ssl.cert
    SSLCertificateKeyFile /[Removed]/priv.key
    SSLCertificateChainFile /[Removed]/cert.chain

    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:8000/
    ProxyPassReverse / http://localhost:8000/

</VirtualHost>

Is there a proper way to configure apache to use SSL with markdownnotes?

Nalydmerc avatar Jul 29 '16 15:07 Nalydmerc

Hi Dylan,

Do you get any errors in the javascript console?

nicbou avatar Jul 29 '16 16:07 nicbou

Yes. Had to look up how to view that. I don't know anything about javascript, so I'm pretty lost on this matter. Here are the errors:

8f14de3f9c07.js:167
Deprecation warning: moment.lang is deprecated. Use moment.locale instead.
Arguments: en, [object Object]
Error
    at Function.lang (https://rs.naly.tech/static/CACHE/js/8f14de3f9c07.js:167:482)
    at Array.1 (https://rs.naly.tech/static/CACHE/js/8f14de3f9c07.js:2139:2611)
    at i (https://rs.naly.tech/static/CACHE/js/8f14de3f9c07.js:2139:1821)
    at 1.module.exports.module.constant.calendar.en.lastDay (https://rs.naly.tech/static/CACHE/js/8f14de3f9c07.js:2139:1970)
    at https://rs.naly.tech/static/CACHE/js/8f14de3f9c07.js:2139:1988
    at https://rs.naly.tech/static/CACHE/js/8f14de3f9c07.js:2139:1516
    at https://rs.naly.tech/static/CACHE/js/8f14de3f9c07.js:2139:1547
8f14de3f9c07.js:167
Deprecation warning: use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.
/app/#/1fdosnb/:1
Mixed Content: The page at 'https://rs.naly.tech/app/#/1fdosnb/' was loaded over HTTPS, but requested an insecure script 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&delayStartupUntil=configured'. This request has been blocked; the content must be served over HTTPS.
/app/#/1fdosnb/:18
Mixed Content: The page at 'https://rs.naly.tech/app/#/1fdosnb/' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Roboto:100,300,700,400|Roboto+Mono:300,300italic,700'. This request has been blocked; the content must be served over HTTPS.
/app/#/1fdosnb/:19
Mixed Content: The page at 'https://rs.naly.tech/app/#/1fdosnb/' was loaded over HTTPS, but requested an insecure stylesheet 'http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css'. This request has been blocked; the content must be served over HTTPS.
https://www.google-analytics.com/analytics.js
Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
angular.js:11655
ReferenceError: MathJax is not defined
    at link (https://rs.naly.tech/static/CACHE/js/8f14de3f9c07.js:2134:1122)
    at $ (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js:70:197)
    at B (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js:59:255)
    at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js:51:335)
    at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js:51:352)
    at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js:51:352)
    at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js:51:352)
    at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js:50:444
    at link (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-route.min.js:7:408)
    at $ (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js:70:197) <div id="preview" preview="">

Nalydmerc avatar Jul 29 '16 16:07 Nalydmerc

After some curiosity and digging, I found the solution.

/media/storage/markdown-notes/templates/base.html:60:    <link href='http://fonts.googleapis.com/css?family=Roboto:100,300,700,400|Roboto+Mono:300,300italic,700' rel='stylesheet' type='text/css'>

After changing all instances of http to https in the base.html file, the site works just fine.

Nalydmerc avatar Jul 29 '16 17:07 Nalydmerc

Awesome! That's also what I suspected. Would you mind sending the fix as a pull request?

Am 29.07.2016 19:10 schrieb "Dylan Smith" [email protected]:

After some curiosity and digging, I found the solution.

/media/storage/markdown-notes/templates/base.html:8: /media/storage/markdown-notes/templates/base.html:9: /media/storage/markdown-notes/templates/base.html:10: /media/storage/markdown-notes/templates/base.html:60:

After changing all instances of http to https, the site works just fine.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nicbou/markdown-notes/issues/34#issuecomment-236237531, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFbVQWphIXNj-Zq76FbgSriAic0xrMNks5qajP3gaJpZM4JYUzD .

nicbou avatar Jul 29 '16 17:07 nicbou

Done. Thank you for this project by the way! I looked at a lot of markdown note-taking apps, and this is the one that I thought was best for me. Good work on it.

Nalydmerc avatar Jul 29 '16 18:07 Nalydmerc

I can see the commit, but it doesn't show in the repo. Can you submit it as a pull request so I can merge it with master?

nicbou avatar Aug 01 '16 10:08 nicbou

@Nalydmerc can you please send the PR? Or I can incorporate it by myself...

AuHau avatar Oct 02 '16 10:10 AuHau