Closed foxdie987 closed 3 years ago
Can you provide a demo to reproduce this problem?
From the performance, I guess because the auth
route does not exist. So,
vuepress build docs
command, is there auth.html
output in the build artifacts directory?When I tried vuepress dev
, the problem from my localhost is the same (404) as in deploy server (vercel), and yes, there is an auth.html
file in docs output after build execution. However, there are some errors about .temp
folder:
> vuepress build
wait Extracting site metadata...
tip Apply theme @vuepress/theme-default ...
A subdirectory or file -p already exists.
Error occurred while processing: -p.
Error: Command failed: mkdir -p C:\VuePress\node_modules\vuepress-plugin-posts-encrypt\.temp
A subdirectory or file -p already exists.
Error occurred while processing: -p.
at checkExecSyncError (child_process.js:790:11)
at execSync (child_process.js:863:15)
at mkdir (C:\VuePress\node_modules\vuepress-plugin-posts-encrypt\lib\utils\index.js:386:38)
at exports.default (C:\VuePress\node_modules\vuepress-plugin-posts-encrypt\lib\options\index.js:28:23)
at module.exports (C:\VuePress\node_modules\vuepress-plugin-posts-encrypt\lib\index.js:8:117)
at exports.flattenPlugin (C:\VuePress\node_modules\@vuepress\core\lib\node\plugin-api\util.js:45:14)
at PluginAPI.normalizePlugin (C:\VuePress\node_modules\@vuepress\core\lib\node\plugin-api\index.js:130:14)
at PluginAPI.use (C:\VuePress\node_modules\@vuepress\core\lib\node\plugin-api\index.js:89:23)
at C:\VuePress\node_modules\@vuepress\core\lib\node\plugin-api\index.js:146:12
at Array.forEach (<anonymous>)
at PluginAPI.useByPluginsConfig (C:\VuePress\node_modules\@vuepress\core\lib\node\plugin-api\index.js:145:19)
at PluginAPI.use (C:\VuePress\node_modules\@vuepress\core\lib\node\plugin-api\index.js:107:12)
at App.applyUserPlugins (C:\VuePress\node_modules\@vuepress\core\lib\node\App.js:194:8)
at App.process (C:\VuePress\node_modules\@vuepress\core\lib\node\App.js:110:10)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async build (C:\VuePress\node_modules\@vuepress\core\lib\index.js:26:3) {
status: 1,
signal: null,
output: [
null,
<Buffer >,
<Buffer 41 20 73 75 62 64 69 72 65 63 74 6f 72 79 20 6f 72 20 66 69 6c 65 20 2d 70 20 61 6c 72 65 61 64 79 20 65 78 69 73 74 73 2e 0d 0a 45 72 72 6f 72 20 6f ... 31 more bytes>
],
pid: 3908,
stdout: <Buffer >,
stderr: <Buffer 41 20 73 75 62 64 69 72 65 63 74 6f 72 79 20 6f 72 20 66 69 6c 65 20 2d 70 20 61 6c 72 65 61 64 79 20 65 78 69 73 74 73 2e 0d 0a 45 72 72 6f 72 20 6f ... 31 more bytes>
}
error ERR@vuepress-plugin-posts-encrypt Failure: failed to mkdir: C:\VuePress\node_modules\vuepress-plugin-posts-encrypt\.temp
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...
tip Apply plugin mathjax (i.e. "vuepress-plugin-mathjax") ...
tip Apply plugin aplayer (i.e. "vuepress-plugin-aplayer") ...
tip Apply plugin posts-encrypt (i.e. "vuepress-plugin-posts-encrypt") ...
√ Client
Compiled successfully in 8.89s
√ Server
Compiled successfully in 6.37s
When I tried
vuepress dev
, the problem from my localhost is the same (404) as in deploy server (vercel), and yes, there is anauth.html
file in docs output after build
auth.html
?auth.html
path?However, there are some errors about
.temp
folder
C:\VuePress\node_modules\vuepress-plugin-posts-encrypt\.temp
Thanks!
Hi, @foxdie987!
I tried to fix the incompatibilities mentioned above and released a new version 0.0.4
.
Specific change can be referred to This commit
If it is convenient, you can try to fix the above problem by upgrading the latest version. Thanks!
I don't think problem is tied to Win OS because I do a total clean deploy on Vercel with only my Github repos (.vuepress and a bunch of .md and config.js file, a packake.json for commands, no plugin or node packages installed yet) and it's still 404 after built.
(also here is the build log from server)
I look at the Frontmatter code again, do I need to specify categories: and tags: , is this for Custom theme only? I only need to set secret: true
and passwd
: right?
---
title: A Private Post
date: 2021-09-03
categories:
- Profile
tags:
- resume
secret: true
passwd: 1233211234567
---
And here is what auth.html produced in Vercel after vuepress build. auth.html
is in root folder in Vercel together with other output html and js assets (which is docs
folder from my repos)
Hope it'll help. Thank you very much for your consideration. :D
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- do not cache this page -->
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<title>密码验证</title>
<!-- iview css -->
<link rel="stylesheet" type="text/css" href="//unpkg.com/view-design/dist/styles/iview.css" />
<!-- animate css -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
<!-- user css -->
<style type="text/css">#app,.content-wrapper,body,html{height:100%;max-height:100%;overflow:hidden}.content-wrapper{background:url('data:image/svg+xml;base64,PHN2ZwogIHZlcnNpb249IjEuMSIKICBiYXNlUHJvZmlsZT0iZnVsbCIKICB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICB2aWV3Qm94PSIwIDAgMTQwMCA4MDAiCj4KCiAgPHJlY3QgeD0iMTMwMCIgeT0iNDAwIiByeD0iNDAiIHJ5PSI0MCIgd2lkdGg9IjMwMCIgaGVpZ2h0PSIzMDAiIHN0cm9rZT0icmdiKDEyOSwgMjAxLCAxNDkpIiBmaWxsPSJyZ2IoMTI5LCAyMDEsIDE0OSkiPgogICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlVHlwZT0iWE1MIiBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIGJlZ2luPSIwcyIgZHVyPSIzNXMiIHR5cGU9InJvdG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SIzMHMiIHR5cGU9InJvdGF0ZSIgdmFsdWVzPSIwIDE0MCAzOTA7IC02MCAxNDAgMzkwOyAwIDE0MCAzOTAiIGtleVRpbWVzPSIwIDsgMC41IDsgMSIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIC8+CiAgPC9wYXRoPgoKICA8cmVjdCB4PSI0MDAiIHk9IjYwMCIgcng9IjQwIiByeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBzdHJva2U9InJnYigxMjksIDIwMSwgMTQ5KSIgZmlsbD0icmdiKDEyOSwgMjAxLCAxNDkpIj4KICAgIDxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZVR5cGU9IlhNTCIgYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiBiZWdpbj0iMHMiIGR1cj0iMzVzIiB0eXBlPSJyb3RhdGUiIGZyb209Ii0zMCA1NTAgNzUwIiB0bz0iMzMwIDU1MCA3NTAiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPgogIDwvcmVjdD4KPC9zdmc+Cg==') center center/cover no-repeat;display:flex;flex-direction:column;justify-content:flex-start;align-items:center}.content-wrapper #header{flex-basis:30%;width:500px;position:relative}.content-wrapper #body{flex-basis:50%}.content-wrapper #body .center{width:30rem;padding:6rem 3rem;box-sizing:border-box;background-color:#fefefe;backdrop-filter:sepia(0.4);border-radius:10px;box-shadow:0 0 300px #c5c8ce}@media (max-width:719px){.content-wrapper #body .center{width:20rem;padding:3rem 2rem}}.content-wrapper #footer .svg-wrapper{height:60px;margin:0 auto;position:relative;top:50%;transform:translateY(-50%);width:320px}.content-wrapper #footer .svg-wrapper:hover .shape{-webkit-animation:.5s draw linear forwards;animation:.5s draw linear forwards}.content-wrapper #footer .shape{fill:transparent;stroke-dasharray:140 540;stroke-dashoffset:-474;stroke-width:8px;stroke:#19be6b}.content-wrapper #footer .text{color:#808695;font-size:14px;font-weight:700;text-align:center;position:relative;top:-48px}.content-wrapper #footer .text a{text-decoration:none}@keyframes draw{0%{stroke-dasharray:140 540;stroke-dashoffset:-474;stroke-width:8px}100%{stroke-dasharray:760;stroke-dashoffset:0;stroke-width:2px}}#header .hexagon{position:absolute;background-color:#f91528;text-align:center;top:70%;left:280px;z-index:1;animation-duration:.96s;animation-name:updownR}#header .hexagon.dude,#header .hexagon.dude::after,#header .hexagon.dude::before{width:32px;height:53px;border-width:2px 0 2px 0;border-style:solid}#header .hexagon::before{background-color:inherit;content:'';position:absolute;transform:translateY(-2px) rotate(-60deg);z-index:1;top:0;left:0;border-color:inherit}#header .hexagon::after{background-color:inherit;content:'';position:absolute;transform:translateY(-2px) rotate(60deg);z-index:-1;top:0;left:0;border-color:inherit}#header .box{top:57%;left:180px;position:absolute;width:27px;height:23px;background-color:#f2600c;z-index:0;border-color:#4c4c4c;animation-duration:1.44s;animation-name:updownO}#header .box .face{width:16px;height:0;border-bottom:3px solid;position:absolute;z-index:5;top:11px;left:32px;border-color:inherit}#header .box:before{width:16px;height:23px;position:absolute;content:'';top:-2px;right:-16px;background:inherit;border:inherit}#header .box .face:after,#header .box .face:before{content:'';position:absolute;width:0;height:0;border:2px solid;border-radius:50%;top:-6px;border-color:inherit}#header .box .face:before{left:-4px}#header .box .face:after{left:3px}#header .dude{position:absolute;border:2px solid;padding:0;z-index:2;border-top-color:#333;border-bottom-color:#333;border-right-color:#333;border-left-color:#333;animation-iteration-count:infinite;animation-timing-function:linear}#header .rectangle{top:88%;left:80px;width:21px;height:12px;background:#41d641;animation-duration:.48s;animation-name:updownG}#header .rectangle .face{position:absolute;top:7px;left:18px;border-top:3px solid;height:0;width:12px;border-color:inherit}#header .rectangle .face:after{position:absolute;content:'';border-top:2px solid;border-left:2px solid;width:1px;height:1px;border-color:inherit;top:-8px;left:-1px}#header .circle.dude{top:80%;left:0;width:18px;height:18px;border-radius:50%;background:#41b6f0;animation-duration:.24s;animation-name:updownB}#header .circle .face{position:absolute;left:16px;top:8px;width:17px;border-top:2px solid;border-color:inherit;z-index:7}#header .circle .face:after{border-top:2px solid;border-color:inherit;width:17px;top:-1px;content:'';position:absolute;transform-origin:0 0;transform:rotateZ(8deg)}#header .circle .face:before{position:absolute;content:'';border-top:2px solid;border-left:2px solid;width:1px;height:1px;border-color:inherit;top:-7px;left:-4px;border-radius:50%}#header .hexagon .face{position:absolute;border-top:3px solid;border-color:inherit;left:8px;top:8px;width:26px;z-index:2}#header .hexagon .face:after{position:absolute;content:'';border-width:0 3px 3px 0;border-style:solid;border-color:inherit;width:8px;height:21px;left:12px;transform:skewX(11deg)}@keyframes updownR{0%{transform:translateY(0);animation-timing-function:cubic-bezier(0,0.5,0.5,1)}50%{transform:translateY(-96px);animation-timing-function:cubic-bezier(0.5,0,1,0.5)}}@keyframes updownO{0%{transform:translateY(0);animation-timing-function:cubic-bezier(0.585,0.24,0.865,0.445)}25%{transform:translateY(75px) rotateZ(90deg);animation-timing-function:cubic-bezier(0.07,0.405,0.4,0.82)}50%{transform:translateY(0) rotateZ(180deg);animation-timing-function:cubic-bezier(0.585,0.24,0.865,0.445)}75%{transform:translateY(75px) rotateZ(270deg);animation-timing-function:cubic-bezier(0.07,0.405,0.4,0.82)}100%{transform:translateY(0) rotateZ(360deg);animation-timing-function:cubic-bezier(0.585,0.24,0.865,0.445)}}@keyframes updownG{0%{transform:translateY(0) skewX(-25deg) scale(.8,1.8);animation-timing-function:cubic-bezier(0,0.5,0.5,1)}50%{transform:translateY(-50px);animation-timing-function:cubic-bezier(0.5,0,1,0.5)}100%{transform:translateY(0) skewX(25deg) scale(.8,1.8)}}@keyframes updownB{0%{transform:translateY(0);animation-timing-function:cubic-bezier(0.5,0,1,0.5)}50%{transform:translateY(25px) scale(1.2,1);animation-timing-function:cubic-bezier(0,0.5,0.5,1)}100%{transform:translateY(0)}}</style>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/vue@2.6.14"></script>
<!-- iview js -->
<script type="text/javascript" src="//unpkg.com/view-design/dist/iview.min.js"></script>
</head>
<body>
<div id="app">
<div class="content-wrapper">
<div id="header">
<div class="hexagon dude">
<div class="face"></div>
</div>
<div class="box dude">
<div class="face"></div>
</div>
<div class="rectangle dude">
<div class="face"></div>
</div>
<div class="circle dude">
<div class="face"></div>
</div>
</div>
<div id="body">
<div ref="formRef" :class="'center ' + lockClass" >
<i-form @submit.native.prevent ref="formInline" :model="formInline" :rules="ruleInline">
<Row type="flex" justify="center" align="top" style="margin-bottom: 20px;">
<i-col><Icon type="md-lock" size="60"/></i-col>
</Row>
<form-item prop="password">
<i-input
password
size="large"
type="password"
@on-enter="() => handleSubmit()"
v-model="formInline.password"
placeholder="口令">
</i-input>
</form-item>
</i-form>
</div>
</div>
<div id="footer">
<div class="svg-wrapper">
<svg height="60" width="320" xmlns="http://www.w3.org/2000/svg">
<rect class="shape" height="60" width="320" />
</svg>
<div class="text">
<span>Generated by </span><a href="https://github.com/alphawq/vuepress-plugin-posts-encrypt">@vuepress-plugin-posts-encrypt</a></div>
</a>
</div>
</div>
</div>
</div>
<!-- crypto js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js" integrity="sha512-E8QSvWZ0eCLGk4km3hxSsNmGWbLtSCSUcewDQPQWZF6pEU8GlT8a5fF32wOl1i8ftdMhssTrF/OhyGWwonTcXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- validate js-->
<script>const e=256,t=1e3,a=(t=500)=>new Promise(e=>setTimeout(e,t)),i=(()=>{const e=location.search,t=e?e.slice(1).split("&").reduce((e,t)=>{var[a,t]=t.split("=");return e[a]=decodeURIComponent(t),e},{}):{};return e=>t[e]})(),n=(t,a,n)=>{try{let e=JSON.parse(localStorage.getItem(t))||{};var i={value:"",expires:0,startTime:(new Date).getTime()};e[a]=Object.assign(i,n),localStorage.setItem(t,JSON.stringify(e))}catch(e){console.error(e)}};function s(e){var t=new RegExp(`${i("redirect")}_([^;]*)`),a="v-7ae5eb94_8a392ae645a5e38393185fd04d89443fc17dc58a5bf9d14e62fd5d84fcb63c878a5e7421d05a51de7e18928d8364022403b95063e1f5aa617c2b9651f06ba3da64SR5vEGQmBtIrFfFbOLXA==;v-0352bf4a_cb14b63f2bc3b6e025eea2f2e624b076ec6bf75a3ba81f9426eec3d07b6f8ab82d7482727624d53b69d64f444cf99515c24495db0fe65d8bf4fe8293e9c659d2K6JYZz9FZJ6xz5XeCnfCIg==".match(t);if(!a)return!1;const n=a[1];t=n.substring(0,64),a=n.substring(64);return CryptoJS.HmacSHA256(a,CryptoJS.SHA256(e).toString()).toString()===t}new Vue({el:"#app",data(){return{btnLoading:!1,lockClass:"",offListener:null,modal_loading:!1,formInline:{password:""},ruleInline:{password:[{validator:this.validatePass,trigger:"blur"}]}}},mounted(){this.offListener=this.bindListener("formRef",this.changeLockClass.bind(this,""))},unmounted(){this.offListener()},methods:{toggleBool(e){this[e]=!this[e]},bindListener(e,t){let a=this.$refs[e].$el||this.$refs[e],n=e=>{t.call(this,e)};return a&&a.addEventListener("animationend",n),()=>a.removeEventListener("animationend",n)},changeLockClass(e,t){this.lockClass=e},validatePass(e,t,a){if(!s(t))return a(new Error("Not Correct!"));a()},handleSubmit(e="formInline"){""!==this.formInline.password&&(this.toggleBool("btnLoading"),this.$refs[e].validate(async e=>{await a(),this.toggleBool("btnLoading"),e?(n("__vuepress_posts_encrypt_plugin__",i("redirect"),{value:!0,expires:6e4}),this.changeLockClass("animate__animated animate__hinge"),await a(1e3),location.replace(`${i("path")}`)):this.changeLockClass("animate__animated animate__headShake")}))}}});</script>
</body>
</html>
@foxdie987 I seem to know the reason.
You can just visit this address
Just need to add .html
to the auth path!
So, you can change route: '/auth'
to route: /auth.html
to make it work!
many thanks !
many thanks !
😄😄😄~
Hello there, could you help me with this issue
I copied the configuration code to my config.js
and in article Frontmatter:
But VuePress throws me an 404 when trying to access my post. redirecteg URL in the browser: https://(mydomain)/auth?redirect=v-7ae5eb94&path=%2F(my_dir)%2F(secret_page).html I can see it's opened for a split second and went to 404 error.
Any idea to fix this? Thanks.