update .gitignore
This commit is contained in:
parent
8c9ba51eaf
commit
defa00035c
|
@ -1,20 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/6.f86b5401.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/2.3e9bf4c9.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><div class="theme-default-content"><h1>404</h1> <blockquote>How did we get here?</blockquote> <a href="/docs/" class="router-link-active">
|
||||
Take me home.
|
||||
</a></div></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/6.f86b5401.js" defer></script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="12" height="13"><g stroke-width="2" stroke="#aaa" fill="none"><path d="M11.29 11.71l-4-4"/><circle cx="5" cy="5" r="4"/></g></svg>
|
Before Width: | Height: | Size: 216 B |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{370:function(_,t,v){"use strict";v.r(t);var s=v(41),r=Object(s.a)({},(function(){var _=this,t=_.$createElement,v=_._self._c||t;return v("ContentSlotsDistributor",{attrs:{"slot-key":_.$parent.slotKey}},[v("h1",{attrs:{id:"比赛介绍"}},[v("a",{staticClass:"header-anchor",attrs:{href:"#比赛介绍"}},[_._v("#")]),_._v(" 比赛介绍")]),_._v(" "),v("p",[v("img",{attrs:{src:"https://img-blog.csdnimg.cn/20210523221519574.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70",alt:"在这里插入图片描述"}})]),_._v(" "),v("h2",{attrs:{id:"两种赛制"}},[v("a",{staticClass:"header-anchor",attrs:{href:"#两种赛制"}},[_._v("#")]),_._v(" 两种赛制")]),_._v(" "),v("ul",[v("li",[v("p",[v("strong",[_._v("ACM 模式")])]),_._v(" "),v("p",[_._v("在该模式下,我们严格按照ACM-ICPC的比赛规则来进行,Contest设置项中的"),v("code",[_._v("Seal Time Rank")]),_._v("即为是否封榜,封榜后将不再刷新排名。可选择比赛结束前半小时,比赛前一小时,比赛全程封榜。")]),_._v(" "),v("p",[v("strong",[_._v("封榜期间的角色不同如下:")])]),_._v(" "),v("ol",[v("li",[_._v("封榜期间,"),v("strong",[_._v("超级管理员与比赛创建者")]),_._v("不受影响,正常可查看题目统计数据,提交数据等,排行榜需自行开启强制刷新,同时提交结果可以及时看到评测结果,但不会纳入排行榜!")]),_._v(" "),v("li",[_._v("封榜期间,"),v("strong",[_._v("普通用户与非比赛创建者")]),_._v("(包括其它管理员角色),可以及时看到自己的提交结果,但不可看到别人"),v("strong",[_._v("封榜后")]),_._v("的提交,不能看到题目的统计情况,排行榜保持"),v("strong",[_._v("封榜前")]),_._v("的排名数据。")])]),_._v(" "),v("p",[_._v("注意:比赛一结束,所有数据变成正常显示!")])]),_._v(" "),v("li",[v("p",[v("strong",[_._v("OI 模式")])]),_._v(" "),v("p",[_._v("在OI模式下,选手的提交将根据得分点来计分,多次提交以最后一次提交为准,排名规则为多个题目的总分数。同样可以进行封榜操作,封榜时段,选手不能查看到实时的排行榜数据!")]),_._v(" "),v("p",[v("strong",[_._v("如果开启封榜:")])]),_._v(" "),v("ol",[v("li",[_._v("封榜期间,"),v("strong",[_._v("超级管理员与比赛创建者")]),_._v("不受影响,正常可查看题目统计数据,提交数据等,排行榜需自行开启强制刷新,同时提交结果可以及时看到评测结果,但不会纳入排行榜!")]),_._v(" "),v("li",[_._v("封榜期间:"),v("strong",[_._v("普通用户与非比赛创建者")]),_._v("(包括其它管理员角色),看不到自己和其它所有人"),v("strong",[_._v("封榜后")]),_._v("的提交结果,不能看到题目的统计情况,排行榜保持"),v("strong",[_._v("封榜前")]),_._v("的排名数据。")])]),_._v(" "),v("p",[_._v("注意:比赛一结束,所有数据变成正常显示!")])])]),_._v(" "),v("p",[_._v("注意:管理员可以选择强制刷新,查看实时的排行榜数据!通过"),v("code",[_._v("Force Update")]),_._v("来强制刷新榜,且刷新后的榜仅对管理者可见。")]),_._v(" "),v("h2",{attrs:{id:"比赛权限"}},[v("a",{staticClass:"header-anchor",attrs:{href:"#比赛权限"}},[_._v("#")]),_._v(" 比赛权限")]),_._v(" "),v("ul",[v("li",[v("strong",[_._v("公开赛")]),_._v(":所有用户都可以查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,且都可以在比赛阶段随时提交。")]),_._v(" "),v("li",[v("strong",[_._v("保护赛")]),_._v(":所有用户都可以查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,但在比赛阶段提交需要提供该比赛的密码!")]),_._v(" "),v("li",[v("strong",[_._v("私有赛")]),_._v(":仅支持有比赛密码的用户进入比赛,查看查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,包括提交。")])])])}),[],!1,null,null,null);t.default=r.exports}}]);
|
|
@ -1 +0,0 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{371:function(t,s,a){"use strict";a.r(s);var e=a(41),r=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"评论管理"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#评论管理"}},[t._v("#")]),t._v(" 评论管理")]),t._v(" "),a("p",[a("img",{attrs:{src:"https://img-blog.csdnimg.cn/20210523223605573.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70#pic_center",alt:"在这里插入图片描述"}})]),t._v(" "),a("ul",[a("li",[a("p",[t._v("后台管理员可以查看所有的讨论帖,并且可以选择是否置顶,是否正常显示,删除,查看等")])]),t._v(" "),a("li",[a("p",[t._v("后台管理员可以查看对应讨论帖的举报内容")]),t._v(" "),a("p",[a("img",{attrs:{src:"https://img-blog.csdnimg.cn/20210523221321418.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70",alt:"在这里插入图片描述"}})])])])])}),[],!1,null,null,null);s.default=r.exports}}]);
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{318:function(t,e,n){},346:function(t,e,n){"use strict";n(318)},378:function(t,e,n){"use strict";n.r(e);var i={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,e){var n=e.props,i=e.slots;return t("span",{class:["badge",n.type],style:{verticalAlign:n.vertical}},n.text||i().default)}},r=(n(346),n(41)),p=Object(r.a)(i,void 0,void 0,!1,null,"69367c83",null);e.default=p.exports}}]);
|
|
@ -1 +0,0 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{376:function(s,a,t){"use strict";t.r(a);var n=t(41),e=Object(n.a)({},(function(){var s=this,a=s.$createElement,t=s._self._c||a;return t("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[t("h1",{attrs:{id:"测试用例"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#测试用例"}},[s._v("#")]),s._v(" 测试用例")]),s._v(" "),t("p",[t("img",{attrs:{src:"https://img-blog.csdnimg.cn/20210523215852734.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70",alt:"在这里插入图片描述"}})]),s._v(" "),t("p",[t("strong",[s._v("进入后台添加题目,上传题目测试用例数据可以选择手动输入、Zip文件上传两种方式")])]),s._v(" "),t("h2",{attrs:{id:"一、手动输入"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#一、手动输入"}},[s._v("#")]),s._v(" 一、手动输入")]),s._v(" "),t("p",[s._v("每次点击"),t("code",[s._v("Add Sampple")]),s._v("就可以手动填入该用例的输入与输出,该方式比较适合题目数据简单的,同时手动输入的题目数据将记录进数据库,下次对该题目进行修改可以直接获取,然后进行测试数据的修改,同时也会在服务器对应的testcase文件夹生成对应的文件。")]),s._v(" "),t("h2",{attrs:{id:"二、文件上传"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#二、文件上传"}},[s._v("#")]),s._v(" 二、文件上传")]),s._v(" "),t("p",[s._v("对于通题目,测试用例文件包括"),t("code",[s._v("in")]),s._v("、"),t("code",[s._v("out")]),s._v("、"),t("code",[s._v("ans")]),s._v("三种拓展名")]),s._v(" "),t("p",[s._v("例如有两组测试用例,则对于普通题目测试用例的文件名分别为"),t("code",[s._v("1.in, 1.out(1.ans), 2.in, 2.out(2.ans)")]),s._v("其他形式的文件后台均不识别。")]),s._v(" "),t("p",[s._v("压缩时,请将文件都放在压缩包的根目录,而不是包含在某一个文件夹中,比如正确的格式是:")]),s._v(" "),t("div",{staticClass:"language-bash line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[s._v("├── "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(".in\n├── "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(".out\n├── "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),s._v(".in\n├── "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),s._v(".out\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br")])]),t("div",{staticClass:"language-bash line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[s._v("├── "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(".in\n├── "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v(".ans\n├── "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),s._v(".in\n├── "),t("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),s._v(".ans\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br")])]),t("p",[s._v("然后压缩测试用例到一个zip中")]),s._v(" "),t("p",[s._v("注意:不要在这些文件外面套多一层文件夹,请直接压缩!!!")]),s._v(" "),t("p",[s._v("同时建议:尽量合并测试用例到一个文件中,减少测试用例组数,这会一定程度上提高判题性能。")])])}),[],!1,null,null,null);a.default=e.exports}}]);
|
|
@ -1 +0,0 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{377:function(s,n,e){"use strict";e.r(n);var t=e(41),a=Object(t.a)({},(function(){var s=this,n=s.$createElement,e=s._self._c||n;return e("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[e("h1",{attrs:{id:"自定义前端"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#自定义前端"}},[s._v("#")]),s._v(" 自定义前端")]),s._v(" "),e("p",[s._v("直接下载"),e("a",{attrs:{href:"https://gitee.com/himitzh0730/hoj/tree/master/hoj-vue",target:"_blank",rel:"noopener noreferrer"}},[s._v("https://gitee.com/himitzh0730/hoj/tree/master/hoj-vue"),e("OutboundLink")],1)]),s._v(" "),e("p",[s._v("修改后,使用"),e("code",[s._v("npm run build")]),s._v(",生成一个dist文件夹,结构如下:")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("dist\n├── index.html\n├── favicon.ico\n└── assets\n ├── css\n │ ├── ....\n ├── fonts\n │ ├── ....\n ├── img\n │ ├── ....\n ├── js\n │ ├── ....\n\n....\n....\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br"),e("span",{staticClass:"line-number"},[s._v("6")]),e("br"),e("span",{staticClass:"line-number"},[s._v("7")]),e("br"),e("span",{staticClass:"line-number"},[s._v("8")]),e("br"),e("span",{staticClass:"line-number"},[s._v("9")]),e("br"),e("span",{staticClass:"line-number"},[s._v("10")]),e("br"),e("span",{staticClass:"line-number"},[s._v("11")]),e("br"),e("span",{staticClass:"line-number"},[s._v("12")]),e("br"),e("span",{staticClass:"line-number"},[s._v("13")]),e("br"),e("span",{staticClass:"line-number"},[s._v("14")]),e("br"),e("span",{staticClass:"line-number"},[s._v("15")]),e("br")])]),e("p",[s._v("将 "),e("code",[s._v("dist")]),s._v(" 文件夹复制到服务器上某个目录下,比如 "),e("code",[s._v("/hoj/www/html/dist")]),s._v(",然后修改 "),e("code",[s._v("docker-compose.yml")]),s._v(",在 "),e("code",[s._v("hoj-frontend")]),s._v(" 模块中的 "),e("code",[s._v("volumes")]),s._v(" 中增加一行 "),e("code",[s._v("- /hoj/www/html/dist:/usr/share/nginx/html")]),s._v(" (冒号前面的请修改为实际的路径),然后 "),e("code",[s._v("docker-compose up -d")]),s._v(" 即可。")]),s._v(" "),e("p",[s._v("如果仅仅只是像修改前台logo、管理后台logo和favicon.ico,那么操作如下:")]),s._v(" "),e("p",[s._v("修改 "),e("code",[s._v("docker-compose.yml")]),s._v(",在 "),e("code",[s._v("hoj-frontend")]),s._v(" 模块中的 "),e("code",[s._v("volumes")]),s._v(" 中添加如下:")]),s._v(" "),e("div",{staticClass:"language-yaml line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-yaml"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("-")]),s._v(" ./logo.png"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v("/usr/share/nginx/html/assets/img/logo.a0924d7d.png\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("-")]),s._v(" ./backstage.png"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v("/usr/share/nginx/html/assets/img/backstage.8bce8c6e.png\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("-")]),s._v(" ./favicon.ico"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v("/usr/share/nginx/html/favicon.ico\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br")])]),e("p",[e("code",[s._v("logo.png")]),s._v("为前台导航栏左边的logo,"),e("code",[s._v("backstage.png")]),s._v("为后台侧边导航栏上方的logo,"),e("code",[s._v("favicon.ico")]),s._v("为小图标")]),s._v(" "),e("p",[e("strong",[s._v("图片文件需放在与docker-compose.yml同个目录下,或者提供绝对路径也可。")])])])}),[],!1,null,null,null);n.default=a.exports}}]);
|
|
@ -1 +0,0 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{319:function(t,e,n){},347:function(t,e,n){"use strict";n(319)},351:function(t,e,n){"use strict";n.r(e);var a={name:"CodeBlock",props:{title:{type:String,required:!0},active:{type:Boolean,default:!1}},mounted:function(){this.$parent&&this.$parent.loadTabs&&this.$parent.loadTabs()}},c=(n(347),n(41)),i=Object(c.a)(a,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"theme-code-block",class:{"theme-code-block__active":this.active}},[this._t("default")],2)}),[],!1,null,"c265c668",null);e.default=i.exports}}]);
|
|
@ -1 +0,0 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{320:function(e,t,a){},348:function(e,t,a){"use strict";a(320)},352:function(e,t,a){"use strict";a.r(t);a(59),a(23),a(90),a(91);var o={name:"CodeGroup",data:function(){return{codeTabs:[],activeCodeTabIndex:-1}},watch:{activeCodeTabIndex:function(e){this.activateCodeTab(e)}},mounted:function(){this.loadTabs()},methods:{changeCodeTab:function(e){this.activeCodeTabIndex=e},loadTabs:function(){var e=this;this.codeTabs=(this.$slots.default||[]).filter((function(e){return Boolean(e.componentOptions)})).map((function(t,a){return""===t.componentOptions.propsData.active&&(e.activeCodeTabIndex=a),{title:t.componentOptions.propsData.title,elm:t.elm}})),-1===this.activeCodeTabIndex&&this.codeTabs.length>0&&(this.activeCodeTabIndex=0),this.activateCodeTab(0)},activateCodeTab:function(e){this.codeTabs.forEach((function(e){e.elm&&e.elm.classList.remove("theme-code-block__active")})),this.codeTabs[e].elm&&this.codeTabs[e].elm.classList.add("theme-code-block__active")}}},n=(a(348),a(41)),c=Object(n.a)(o,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ClientOnly",[a("div",{staticClass:"theme-code-group"},[a("div",{staticClass:"theme-code-group__nav"},[a("ul",{staticClass:"theme-code-group__ul"},e._l(e.codeTabs,(function(t,o){return a("li",{key:t.title,staticClass:"theme-code-group__li"},[a("button",{staticClass:"theme-code-group__nav-tab",class:{"theme-code-group__nav-tab-active":o===e.activeCodeTabIndex},on:{click:function(t){return e.changeCodeTab(o)}}},[e._v("\n "+e._s(t.title)+"\n ")])])})),0)]),e._v(" "),e._t("default"),e._v(" "),e.codeTabs.length<1?a("pre",{staticClass:"pre-blank"},[e._v("// Make sure to add code blocks to your code group")]):e._e()],2)])}),[],!1,null,"77e00ed1",null);t.default=c.exports}}]);
|
|
@ -1 +0,0 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{350:function(t,e,s){"use strict";s.r(e);var n=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],o={methods:{getMsg:function(){return n[Math.floor(Math.random()*n.length)]}}},i=s(41),h=Object(i.a)(o,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"theme-container"},[e("div",{staticClass:"theme-default-content"},[e("h1",[this._v("404")]),this._v(" "),e("blockquote",[this._v(this._s(this.getMsg()))]),this._v(" "),e("RouterLink",{attrs:{to:"/"}},[this._v("\n Take me home.\n ")])],1)])}),[],!1,null,null,null);e.default=h.exports}}]);
|
|
@ -1 +0,0 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{353:function(t,e,n){"use strict";n.r(e);var s=n(41),l=Object(s.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);e.default=l.exports}}]);
|
|
@ -1,193 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>后端部署 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/9.8282f251.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>部署文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/deploy/" aria-current="page" class="sidebar-link">环境配置</a></li><li><a href="/docs/deploy/docker.html" class="sidebar-link">快速部署</a></li><li><a href="/docs/deploy/frontend.html" class="sidebar-link">前端部署</a></li><li><a href="/docs/deploy/mysql.html" class="sidebar-link">MySQL部署</a></li><li><a href="/docs/deploy/redis.html" class="sidebar-link">Redis部署</a></li><li><a href="/docs/deploy/nacos.html" class="sidebar-link">Nacos部署</a></li><li><a href="/docs/deploy/backend.html" aria-current="page" class="active sidebar-link">后端部署</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/backend.html#前言" class="sidebar-link">前言</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/backend.html#文件介绍" class="sidebar-link">文件介绍</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/backend.html#_1-check-nacos-sh" class="sidebar-link">1. check_nacos.sh</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/backend.html#_2-run-sh" class="sidebar-link">2. run.sh</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/backend.html#_3-dockerfile" class="sidebar-link">3. Dockerfile</a></li></ul></li></ul></li><li><a href="/docs/deploy/judgeserver.html" class="sidebar-link">判题服务部署</a></li><li><a href="/docs/deploy/rsync.html" class="sidebar-link">评测数据同步</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="后端部署"><a href="#后端部署" class="header-anchor">#</a> 后端部署</h1> <h2 id="前言"><a href="#前言" class="header-anchor">#</a> 前言</h2> <p>下载本项目,进入到当前文件夹执行打包命令</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">git</span> clone https://gitee.com/himitzh0730/hoj-deploy.git <span class="token operator">&&</span> <span class="token builtin class-name">cd</span> hoj-deploy/src/backend
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>当前文件夹为打包<code>hoj-backend</code>镜像的相关文件,将这些文件复制到同一个文件夹内,<strong>然后打包<a href="https://gitee.com/himitzh0730/hoj/tree/master/hoj-springboot/DataBackup" target="_blank" rel="noopener noreferrer">DataBackup<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>(SpringBoot项目)成jar包也放到当前文件夹</strong>,之后执行以下命令进行打包成镜像</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker build -t hoj-backend <span class="token builtin class-name">.</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>项目依赖于hoj-redis,hoj-nacos,hoj-mysql等镜像成功启动,以及根据前面三个镜像的配置修改环境参数才可正常启动</strong></p> <p>docker-compose 启动</p> <div class="language-yaml line-numbers-mode"><pre class="language-yaml"><code><span class="token key atrule">version</span><span class="token punctuation">:</span> <span class="token string">"3"</span>
|
||||
<span class="token key atrule">services</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">hoj-backend</span><span class="token punctuation">:</span>
|
||||
<span class="token comment"># image: registry.cn-shenzhen.aliyuncs.com/hcode/hoj_backend</span>
|
||||
<span class="token key atrule">image</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>backend
|
||||
<span class="token key atrule">container_name</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>backend
|
||||
<span class="token key atrule">restart</span><span class="token punctuation">:</span> always
|
||||
<span class="token key atrule">depends_on</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> hoj<span class="token punctuation">-</span>redis
|
||||
<span class="token punctuation">-</span> hoj<span class="token punctuation">-</span>mysql
|
||||
<span class="token punctuation">-</span> hoj<span class="token punctuation">-</span>nacos
|
||||
<span class="token key atrule">volumes</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> ./hoj/file<span class="token punctuation">:</span>/hoj/file
|
||||
<span class="token punctuation">-</span> ./hoj/testcase<span class="token punctuation">:</span>/hoj/testcase
|
||||
<span class="token punctuation">-</span> ./hoj/log/backend<span class="token punctuation">:</span>/hoj/log/backend
|
||||
<span class="token key atrule">environment</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> TZ=Asia/Shanghai
|
||||
<span class="token punctuation">-</span> BACKEND_SERVER_PORT=6688 <span class="token comment"># backend服务端口号</span>
|
||||
<span class="token punctuation">-</span> NACOS_URL=172.20.0.4<span class="token punctuation">:</span><span class="token number">8848</span> <span class="token comment"># hoj-nacos的url</span>
|
||||
<span class="token punctuation">-</span> NACOS_USERNAME=root <span class="token comment"># nacos的管理员账号</span>
|
||||
<span class="token punctuation">-</span> NACOS_PASSWORD=hoj123456 <span class="token comment"># nacos的管理员密码</span>
|
||||
<span class="token punctuation">-</span> JWT_TOKEN_SECRET=default <span class="token comment"># 加密秘钥 默认则生成32位随机密钥</span>
|
||||
<span class="token punctuation">-</span> JWT_TOKEN_EXPIRE=86400 <span class="token comment"># token过期时间默认为24小时 86400s</span>
|
||||
<span class="token punctuation">-</span> JWT_TOKEN_FRESH_EXPIRE=43200 <span class="token comment"># token默认12小时可自动刷新</span>
|
||||
<span class="token punctuation">-</span> JUDGE_TOKEN=default <span class="token comment"># 调用判题服务器的token 默认则生成32位随机密钥</span>
|
||||
<span class="token punctuation">-</span> MYSQL_HOST=172.20.0.3 <span class="token comment"># hoj-mysql的host</span>
|
||||
<span class="token punctuation">-</span> MYSQL_PUBLIC_HOST=172.20.0.3 <span class="token comment"># 如果判题服务是分布式,请提供当前mysql所在服务器的公网ip</span>
|
||||
<span class="token punctuation">-</span> MYSQL_PORT=3306 <span class="token comment"># hoj-mysql端口号</span>
|
||||
<span class="token punctuation">-</span> MYSQL_DATABASE_NAME=hoj <span class="token comment"># 改动需要修改hoj-mysql镜像,默认为hoj</span>
|
||||
<span class="token punctuation">-</span> MYSQL_USERNAME=root
|
||||
<span class="token punctuation">-</span> MYSQL_ROOT_PASSWORD=hoj123456 <span class="token comment"># hoj-mysql的root账号密码</span>
|
||||
<span class="token punctuation">-</span> EMAIL_SERVER_HOST=smtp.qq.com <span class="token comment"># 请使用邮件服务的域名或ip</span>
|
||||
<span class="token punctuation">-</span> EMAIL_SERVER_PORT=465 <span class="token comment"># 请使用邮件服务的端口号</span>
|
||||
<span class="token punctuation">-</span> EMAIL_USERNMAE=<span class="token punctuation">-</span>your_email_username <span class="token comment"># 请使用对应邮箱账号</span>
|
||||
<span class="token punctuation">-</span> EMAIL_PASSWORD=<span class="token punctuation">-</span>your_email_password <span class="token comment"># 请使用对应邮箱密码</span>
|
||||
<span class="token punctuation">-</span> REDIS_HOST=172.20.0.2 <span class="token comment"># hoj-redis的host</span>
|
||||
<span class="token punctuation">-</span> REDIS_PORT=6379 <span class="token comment"># hoj-redis的port</span>
|
||||
<span class="token punctuation">-</span> REDIS_PASSWORD=hoj123456 <span class="token comment">#hoj-redis的密码</span>
|
||||
<span class="token punctuation">-</span> OPEN_REMOTE_JUDGE=true <span class="token comment"># 是否开启对hdu和codeforces的虚拟判题</span>
|
||||
<span class="token comment"># 开启虚拟判题请提供对应oj的账号密码 格式为 </span>
|
||||
<span class="token comment"># username1,username2,...</span>
|
||||
<span class="token comment"># password1,password2,...</span>
|
||||
<span class="token punctuation">-</span> HDU_ACCOUNT_USERNAME_LIST=
|
||||
<span class="token punctuation">-</span> HDU_ACCOUNT_PASSWORD_LIST=
|
||||
<span class="token punctuation">-</span> CF_ACCOUNT_USERNAME_LIST=
|
||||
<span class="token punctuation">-</span> CF_ACCOUNT_USERNAME_LIST=
|
||||
<span class="token key atrule">ports</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> <span class="token string">"6688:6688"</span>
|
||||
<span class="token key atrule">networks</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">hoj-network</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">ipv4_address</span><span class="token punctuation">:</span> 172.20.0.5
|
||||
|
||||
<span class="token key atrule">hoj-redis</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">image</span><span class="token punctuation">:</span> redis<span class="token punctuation">:</span>5.0.9<span class="token punctuation">-</span>alpine
|
||||
<span class="token key atrule">container_name</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>redis
|
||||
<span class="token key atrule">restart</span><span class="token punctuation">:</span> always
|
||||
<span class="token key atrule">volumes</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> ./hoj/data/redis/data<span class="token punctuation">:</span>/data
|
||||
<span class="token key atrule">networks</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">hoj-network</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">ipv4_address</span><span class="token punctuation">:</span> 172.20.0.2
|
||||
<span class="token key atrule">ports</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> <span class="token string">"6379:6379"</span>
|
||||
<span class="token key atrule">command</span><span class="token punctuation">:</span> redis<span class="token punctuation">-</span>server <span class="token punctuation">-</span><span class="token punctuation">-</span>requirepass "hoj123456" <span class="token punctuation">-</span><span class="token punctuation">-</span>appendonly yes
|
||||
|
||||
<span class="token key atrule">hoj-mysql</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">image</span><span class="token punctuation">:</span> registry.cn<span class="token punctuation">-</span>shenzhen.aliyuncs.com/hcode/hoj_database
|
||||
<span class="token key atrule">container_name</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>mysql
|
||||
<span class="token key atrule">restart</span><span class="token punctuation">:</span> always
|
||||
<span class="token key atrule">volumes</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> ./hoj/data/mysql/data<span class="token punctuation">:</span>/var/lib/mysql
|
||||
<span class="token key atrule">environment</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> MYSQL_ROOT_PASSWORD=hoj123456
|
||||
<span class="token punctuation">-</span> TZ=Asia/Shanghai
|
||||
<span class="token punctuation">-</span> NACOS_USERNAME=root
|
||||
<span class="token punctuation">-</span> NACOS_PASSWORD=hoj123456
|
||||
<span class="token key atrule">ports</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> <span class="token string">"3306:3306"</span>
|
||||
<span class="token key atrule">networks</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">hoj-network</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">ipv4_address</span><span class="token punctuation">:</span> 172.20.0.3
|
||||
|
||||
<span class="token key atrule">hoj-nacos</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">image</span><span class="token punctuation">:</span> nacos/nacos<span class="token punctuation">-</span>server<span class="token punctuation">:</span>1.4.2
|
||||
<span class="token key atrule">container_name</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>nacos
|
||||
<span class="token key atrule">restart</span><span class="token punctuation">:</span> always
|
||||
<span class="token key atrule">depends_on</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> hoj<span class="token punctuation">-</span>mysql
|
||||
<span class="token key atrule">environment</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> JVM_XMX=384m
|
||||
<span class="token punctuation">-</span> JVM_XMS=384m
|
||||
<span class="token punctuation">-</span> JVM_XMN=192m
|
||||
<span class="token punctuation">-</span> MODE=standalone
|
||||
<span class="token punctuation">-</span> SPRING_DATASOURCE_PLATFORM=mysql
|
||||
<span class="token punctuation">-</span> MYSQL_SERVICE_HOST=172.20.0.3
|
||||
<span class="token punctuation">-</span> MYSQL_SERVICE_PORT=3306
|
||||
<span class="token punctuation">-</span> MYSQL_SERVICE_USER=root
|
||||
<span class="token punctuation">-</span> MYSQL_SERVICE_PASSWORD=Hzh<span class="token important">&hy2020</span>
|
||||
<span class="token punctuation">-</span> MYSQL_SERVICE_DB_NAME=nacos
|
||||
<span class="token punctuation">-</span> NACOS_AUTH_ENABLE=true <span class="token comment"># 开启鉴权</span>
|
||||
|
||||
<span class="token key atrule">networks</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">hoj-network</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">driver</span><span class="token punctuation">:</span> bridge
|
||||
<span class="token key atrule">ipam</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">config</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> <span class="token key atrule">subnet</span><span class="token punctuation">:</span> 172.20.0.0/16
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br><span class="line-number">95</span><br><span class="line-number">96</span><br><span class="line-number">97</span><br><span class="line-number">98</span><br><span class="line-number">99</span><br><span class="line-number">100</span><br><span class="line-number">101</span><br><span class="line-number">102</span><br><span class="line-number">103</span><br><span class="line-number">104</span><br><span class="line-number">105</span><br><span class="line-number">106</span><br><span class="line-number">107</span><br></div></div><h2 id="文件介绍"><a href="#文件介绍" class="header-anchor">#</a> 文件介绍</h2> <h3 id="_1-check-nacos-sh"><a href="#_1-check-nacos-sh" class="header-anchor">#</a> 1. check_nacos.sh</h3> <p>用于检测nacos是否启动完成,然后再执行启动backend</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token shebang important">#!/bin/bash</span>
|
||||
|
||||
<span class="token keyword">while</span> <span class="token builtin class-name">:</span>
|
||||
<span class="token keyword">do</span>
|
||||
<span class="token comment"># 访问nacos注册中心,获取http状态码</span>
|
||||
<span class="token assign-left variable">CODE</span><span class="token operator">=</span><span class="token variable"><span class="token variable">`</span><span class="token function">curl</span> -I -m <span class="token number">10</span> -o /dev/null -s -w %<span class="token punctuation">{</span>http_code<span class="token punctuation">}</span> http://$NACOS_URL/nacos/index.html<span class="token variable">`</span></span>
|
||||
<span class="token comment"># 判断状态码为200</span>
|
||||
<span class="token keyword">if</span> <span class="token punctuation">[</span><span class="token punctuation">[</span> <span class="token variable">$CODE</span> -eq <span class="token number">200</span> <span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
|
||||
<span class="token comment"># 输出绿色文字,并跳出循环</span>
|
||||
<span class="token builtin class-name">echo</span> -e <span class="token string">"<span class="token entity" title="\033">\033</span>[42;34m nacos is ok <span class="token entity" title="\033">\033</span>[0m"</span>
|
||||
<span class="token builtin class-name">break</span>
|
||||
<span class="token keyword">else</span>
|
||||
<span class="token comment"># 暂停1秒</span>
|
||||
<span class="token function">sleep</span> <span class="token number">1</span>
|
||||
<span class="token keyword">fi</span>
|
||||
<span class="token keyword">done</span>
|
||||
|
||||
<span class="token comment"># while结束时,执行容器中的run.sh。</span>
|
||||
<span class="token function">bash</span> /run.sh
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br></div></div><h3 id="_2-run-sh"><a href="#_2-run-sh" class="header-anchor">#</a> 2. run.sh</h3> <p>启动backend的springboot jar包</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token shebang important">#!/bin/sh</span>
|
||||
|
||||
java -Djava.security.egd<span class="token operator">=</span>file:/dev/./urandom -jar /app.jar
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><h3 id="_3-dockerfile"><a href="#_3-dockerfile" class="header-anchor">#</a> 3. Dockerfile</h3> <div class="language-dockerfile line-numbers-mode"><pre class="language-dockerfile"><code><span class="token keyword">FROM</span> java<span class="token punctuation">:</span>8
|
||||
|
||||
<span class="token keyword">COPY</span> *.jar /app.jar
|
||||
|
||||
<span class="token keyword">COPY</span> check_nacos.sh /check_nacos.sh
|
||||
|
||||
<span class="token keyword">COPY</span> run.sh /run.sh
|
||||
|
||||
<span class="token keyword">ENV</span> TZ=Asia/Shanghai
|
||||
|
||||
<span class="token keyword">ENV</span> BACKEND_SERVER_PORT=6688
|
||||
|
||||
<span class="token keyword">VOLUME</span> <span class="token punctuation">[</span><span class="token string">"/hoj/file"</span><span class="token punctuation">,</span><span class="token string">"/hoj/testcase"</span><span class="token punctuation">]</span>
|
||||
|
||||
<span class="token keyword">RUN</span> ln <span class="token punctuation">-</span>snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ <span class="token punctuation">></span> /etc/timezone
|
||||
|
||||
<span class="token keyword">CMD</span> <span class="token punctuation">[</span><span class="token string">"bash"</span><span class="token punctuation">,</span><span class="token string">"/check_nacos.sh"</span><span class="token punctuation">]</span>
|
||||
|
||||
<span class="token keyword">EXPOSE</span> $BACKEND_SERVER_PORT
|
||||
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br></div></div></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/deploy/nacos.html" class="prev">
|
||||
Nacos部署
|
||||
</a></span> <span class="next"><a href="/docs/deploy/judgeserver.html">
|
||||
判题服务部署
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/9.8282f251.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,186 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>快速部署 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/10.8a54dd52.js" as="script"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>部署文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/deploy/" aria-current="page" class="sidebar-link">环境配置</a></li><li><a href="/docs/deploy/docker.html" aria-current="page" class="active sidebar-link">快速部署</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/docker.html#一、单机部署" class="sidebar-link">一、单机部署</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/docker.html#二、分布式部署" class="sidebar-link">二、分布式部署</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/docker.html#三、开启https" class="sidebar-link">三、开启Https</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/docker.html#四、更新最新版本" class="sidebar-link">四、更新最新版本</a></li></ul></li><li><a href="/docs/deploy/frontend.html" class="sidebar-link">前端部署</a></li><li><a href="/docs/deploy/mysql.html" class="sidebar-link">MySQL部署</a></li><li><a href="/docs/deploy/redis.html" class="sidebar-link">Redis部署</a></li><li><a href="/docs/deploy/nacos.html" class="sidebar-link">Nacos部署</a></li><li><a href="/docs/deploy/backend.html" class="sidebar-link">后端部署</a></li><li><a href="/docs/deploy/judgeserver.html" class="sidebar-link">判题服务部署</a></li><li><a href="/docs/deploy/rsync.html" class="sidebar-link">评测数据同步</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="快速部署"><a href="#快速部署" class="header-anchor">#</a> 快速部署</h1> <blockquote><p>前提:已经在上一步准备好docker与docker-compose</p></blockquote> <h2 id="一、单机部署"><a href="#一、单机部署" class="header-anchor">#</a> 一、单机部署</h2> <ol><li><p>选择好需要安装的位置,运行下面命令</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">git</span> clone https://gitee.com/himitzh0730/hoj-deploy.git <span class="token operator">&&</span> <span class="token builtin class-name">cd</span> hoj-deploy
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>进入文件夹,使用docker-compose启动各容器服务</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token builtin class-name">cd</span> standAlone
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><code>standAlone</code>文件夹文件有以下:</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>├── docker-compose.yml
|
||||
├── .env
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>主要配置请修改<code>.env</code>文件,内容如下:</p> <blockquote><p>注意:各服务ip最好不改动,保持处于172.20.0.0/16网段的docker network</p></blockquote> <div class="language-properties line-numbers-mode"><pre class="language-properties"><code><span class="token comment"># redis的配置</span>
|
||||
<span class="token attr-name">REDIS_HOST</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.2</span>
|
||||
<span class="token attr-name">REDIS_PORT</span><span class="token punctuation">=</span><span class="token attr-value">6379</span>
|
||||
<span class="token attr-name">REDIS_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456</span>
|
||||
|
||||
<span class="token comment"># mysql的配置</span>
|
||||
<span class="token attr-name">MYSQL_HOST</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.3</span>
|
||||
<span class="token attr-name">MYSQL_PUBLIC_HOST</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.3 # 如果判题服务是分布式,请提供当前mysql所在服务器的公网ip</span>
|
||||
<span class="token attr-name">MYSQL_PORT</span><span class="token punctuation">=</span><span class="token attr-value">3306</span>
|
||||
<span class="token attr-name">MYSQL_ROOT_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456</span>
|
||||
|
||||
<span class="token comment"># nacos的配置</span>
|
||||
<span class="token attr-name">NACOS_HOST</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.4</span>
|
||||
<span class="token attr-name">NACOS_PORT</span><span class="token punctuation">=</span><span class="token attr-value">8848</span>
|
||||
<span class="token attr-name">NACOS_USERNAME</span><span class="token punctuation">=</span><span class="token attr-value">root</span>
|
||||
<span class="token attr-name">NACOS_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456</span>
|
||||
|
||||
<span class="token comment"># backend后端服务的配置</span>
|
||||
<span class="token attr-name">BACKEND_HOST</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.5</span>
|
||||
<span class="token attr-name">BACKEND_PORT</span><span class="token punctuation">=</span><span class="token attr-value">6688</span>
|
||||
<span class="token attr-name">JWT_TOKEN_SECRET</span><span class="token punctuation">=</span><span class="token attr-value">default # token加密秘钥 默认则生成32位随机密钥</span>
|
||||
<span class="token attr-name">JWT_TOKEN_EXPIRE</span><span class="token punctuation">=</span><span class="token attr-value">86400 # token过期时间默认为24小时 86400s</span>
|
||||
<span class="token attr-name">JWT_TOKEN_FRESH_EXPIRE</span><span class="token punctuation">=</span><span class="token attr-value">43200 # token默认12小时可自动刷新</span>
|
||||
<span class="token attr-name">JUDGE_TOKEN</span><span class="token punctuation">=</span><span class="token attr-value">default # 调用判题服务器的token 默认则生成32位随机密钥</span>
|
||||
<span class="token attr-name">EMAIL_SERVER_HOST</span><span class="token punctuation">=</span><span class="token attr-value">smtp.qq.com # 请使用邮件服务的域名或ip</span>
|
||||
<span class="token attr-name">EMAIL_SERVER_PORT</span><span class="token punctuation">=</span><span class="token attr-value">465</span>
|
||||
<span class="token attr-name">EMAIL_USERNMAE</span><span class="token punctuation">=</span><span class="token attr-value">your_email_username</span>
|
||||
<span class="token attr-name">EMAIL_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">your_email_password</span>
|
||||
<span class="token comment"># 开启虚拟判题请提供对应oj的账号密码 格式为 </span>
|
||||
<span class="token comment"># username1,username2,...</span>
|
||||
<span class="token comment"># password1,password2,...</span>
|
||||
<span class="token attr-name">HDU_ACCOUNT_USERNAME_LIST</span><span class="token punctuation">=</span>
|
||||
<span class="token attr-name">HDU_ACCOUNT_PASSWORD_LIST</span><span class="token punctuation">=</span>
|
||||
<span class="token attr-name">CF_ACCOUNT_USERNAME_LIST</span><span class="token punctuation">=</span>
|
||||
<span class="token attr-name">CF_ACCOUNT_PASSWORD_LIST</span><span class="token punctuation">=</span>
|
||||
|
||||
<span class="token comment"># judgeserver的配置</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_IP</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.7</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_PORT</span><span class="token punctuation">=</span><span class="token attr-value">8088</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_NAME</span><span class="token punctuation">=</span><span class="token attr-value">judger-alone</span>
|
||||
|
||||
<span class="token comment"># docker network的配置</span>
|
||||
<span class="token attr-name">SUBNET</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.0/16</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br></div></div><p>如果不改动,则以默认参数启动</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker-compose up -d
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>根据网速情况,大约十到二十分钟拉取镜像,全程无需人工干预,拉取完毕后,自动启动容器服务,大概需要一至两分钟的初始化。</strong></p> <p>等待命令执行完毕后,查看容器状态</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker <span class="token function">ps</span> -a
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>当看到所有的容器的状态status都为<code>UP</code>或<code>healthy</code>就代表 OJ 已经启动成功。</p> <blockquote><p>以下默认参数说明</p></blockquote> <ul><li>默认超级管理员账号与密码:root / hoj123456</li> <li>默认redis密码:hoj123456</li> <li>默认mysql账号与密码:root / hoj123456</li> <li>默认nacos管理员账号与密码:root / hoj123456</li> <li>默认不开启https,开启需修改文件同时提供证书文件</li> <li>判题并发数默认:cpu核心数*2</li> <li>默认开启vj判题,需要手动修改添加账号与密码,如果不添加不能vj判题!</li> <li>vj判题并发数默认:cpu核心数*4</li></ul></li></ol> <p><strong>登录root账号到后台查看服务状态以及到<code>http://ip/admin/conf</code>修改服务配置!</strong></p> <p><u>注意:网站的注册及用户账号相关操作需要邮件系统,所以请在系统配置中配置自己的SMTP邮件服务。</u></p> <p><strong>(如果已经在启动在.env文件配置了邮件服务即不用再次修改)</strong></p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>Host: smtp.qq.com
|
||||
Port: <span class="token number">465</span>
|
||||
Username: qq邮箱账号
|
||||
Password: 开启SMTP服务后生成的随机授权码
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><h2 id="二、分布式部署"><a href="#二、分布式部署" class="header-anchor">#</a> 二、分布式部署</h2> <blockquote><p>注意:主服务器(运行nacos,backend, frontend,redis)的服务器防火墙请开 <strong>8848,3306,873</strong>端口号</p> <p>从服务器(判题机)的防火墙请开<strong>8088</strong>端口号</p></blockquote> <ol><li><p>选择好需要安装的位置,运行下面命令</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">git</span> clone https://gitee.com/himitzh0730/hoj-deploy.git <span class="token operator">&&</span> <span class="token builtin class-name">cd</span> hoj-deploy
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>进入文件夹</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token builtin class-name">cd</span> distributed
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><code>distributed</code>文件夹有以下:</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>├── judgeserver
|
||||
├── main
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></li> <li><p>首先部署主服务,即是数据后台服务(DataBackup)</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token builtin class-name">cd</span> main
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>该文件夹下有:</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>├── docker-compose.yml
|
||||
├── .env
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>修改<code>.env</code>文件中的配置</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">vim</span> .env
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><blockquote><p>注意:各服务ip最好不改动,保持处于172.20.0.0/16网段的docker network</p></blockquote> <div class="language-properties line-numbers-mode"><pre class="language-properties"><code><span class="token comment"># redis的配置</span>
|
||||
<span class="token attr-name">REDIS_HOST</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.2</span>
|
||||
<span class="token attr-name">REDIS_PORT</span><span class="token punctuation">=</span><span class="token attr-value">6379</span>
|
||||
<span class="token attr-name">REDIS_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456</span>
|
||||
|
||||
<span class="token comment"># mysql的配置</span>
|
||||
<span class="token attr-name">MYSQL_HOST</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.3</span>
|
||||
<span class="token attr-name">MYSQL_PUBLIC_HOST</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.3 # 请提供当前mysql所在服务器的公网ip</span>
|
||||
<span class="token attr-name">MYSQL_PORT</span><span class="token punctuation">=</span><span class="token attr-value">3306</span>
|
||||
<span class="token attr-name">MYSQL_ROOT_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456</span>
|
||||
|
||||
<span class="token comment"># nacos的配置</span>
|
||||
<span class="token attr-name">NACOS_HOST</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.4</span>
|
||||
<span class="token attr-name">NACOS_PORT</span><span class="token punctuation">=</span><span class="token attr-value">8848</span>
|
||||
<span class="token attr-name">NACOS_USERNAME</span><span class="token punctuation">=</span><span class="token attr-value">root</span>
|
||||
<span class="token attr-name">NACOS_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456</span>
|
||||
|
||||
<span class="token comment"># backend后端服务的配置</span>
|
||||
<span class="token attr-name">BACKEND_HOST</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.5</span>
|
||||
<span class="token attr-name">BACKEND_PORT</span><span class="token punctuation">=</span><span class="token attr-value">6688</span>
|
||||
<span class="token attr-name">JWT_TOKEN_SECRET</span><span class="token punctuation">=</span><span class="token attr-value">default # token加密秘钥 默认则生成32位随机密钥</span>
|
||||
<span class="token attr-name">JWT_TOKEN_EXPIRE</span><span class="token punctuation">=</span><span class="token attr-value">86400 # token过期时间默认为24小时 86400s</span>
|
||||
<span class="token attr-name">JWT_TOKEN_FRESH_EXPIRE</span><span class="token punctuation">=</span><span class="token attr-value">43200 # token默认12小时可自动刷新</span>
|
||||
<span class="token attr-name">JUDGE_TOKEN</span><span class="token punctuation">=</span><span class="token attr-value">default # 调用判题服务器的token 默认则生成32位随机密钥</span>
|
||||
<span class="token attr-name">EMAIL_SERVER_HOST</span><span class="token punctuation">=</span><span class="token attr-value">smtp.qq.com # 请使用邮件服务的域名或ip</span>
|
||||
<span class="token attr-name">EMAIL_SERVER_PORT</span><span class="token punctuation">=</span><span class="token attr-value">465</span>
|
||||
<span class="token attr-name">EMAIL_USERNMAE</span><span class="token punctuation">=</span><span class="token attr-value">your_email_username</span>
|
||||
<span class="token attr-name">EMAIL_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">your_email_password</span>
|
||||
<span class="token comment"># 开启虚拟判题请提供对应oj的账号密码 格式为 </span>
|
||||
<span class="token comment"># username1,username2,...</span>
|
||||
<span class="token comment"># password1,password2,...</span>
|
||||
<span class="token attr-name">HDU_ACCOUNT_USERNAME_LIST</span><span class="token punctuation">=</span><span class="token attr-value">username1,username2</span>
|
||||
<span class="token attr-name">HDU_ACCOUNT_PASSWORD_LIST</span><span class="token punctuation">=</span><span class="token attr-value">password1,password2</span>
|
||||
<span class="token attr-name">CF_ACCOUNT_USERNAME_LIST</span><span class="token punctuation">=</span>
|
||||
<span class="token attr-name">CF_ACCOUNT_PASSWORD_LIST</span><span class="token punctuation">=</span>
|
||||
|
||||
<span class="token comment"># 评测数据同步的配置</span>
|
||||
<span class="token attr-name">RSYNC_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456 # 请修改数据同步密码</span>
|
||||
|
||||
<span class="token comment"># docker network的配置</span>
|
||||
<span class="token attr-name">SUBNET</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.0/16</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br></div></div><p>配置修改保存后,当前路径下启动该服务</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker-compose up -d
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>根据网速情况,大约十分钟即可安装完毕,全程无需人工干预。</p> <p>等待命令执行完毕后,查看容器状态</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker <span class="token function">ps</span> -a
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>当看到所有的容器的状态status都为<code>UP</code>或<code>healthy</code>就代表 OJ 已经启动成功。</p></li> <li><p>接着,在另一台服务器上,依旧git clone该文件夹下来,然后进入<code>judgeserver</code>文件夹,修改<code>.env</code>的配置</p> <div class="language-properties line-numbers-mode"><pre class="language-properties"><code><span class="token comment"># nacos的配置</span>
|
||||
<span class="token attr-name">NACOS_HOST</span><span class="token punctuation">=</span><span class="token attr-value">NACOS_HOST # 修改为nacos所在服务的ip,即主服务器的公网ip</span>
|
||||
<span class="token attr-name">NACOS_PORT</span><span class="token punctuation">=</span><span class="token attr-value">8848 # 修改为nacos启动端口号,默认为8848</span>
|
||||
<span class="token attr-name">NACOS_USERNAME</span><span class="token punctuation">=</span><span class="token attr-value">root # 修改为nacos的管理员账号</span>
|
||||
<span class="token attr-name">NACOS_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456 # 修改为nacos的管理员密码</span>
|
||||
|
||||
<span class="token comment"># judgeserver的配置</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_IP</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.7 # 修改为当前的服务器公网ip</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_PORT</span><span class="token punctuation">=</span><span class="token attr-value">8088 # judgeserver启动端口号</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_NAME</span><span class="token punctuation">=</span><span class="token attr-value">judger-1</span>
|
||||
<span class="token attr-name">MAX_TASK_NUM</span><span class="token punctuation">=</span><span class="token attr-value">-1 # -1表示最大并行任务数为cpu核心数*2</span>
|
||||
<span class="token attr-name">REMOTE_JUDGE_OPEN</span><span class="token punctuation">=</span><span class="token attr-value">true # 当前判题服务器是否开启远程虚拟判题功能</span>
|
||||
<span class="token attr-name">REMOTE_JUDGE_MAX_TASK_NUM</span><span class="token punctuation">=</span><span class="token attr-value">-1 # -1表示最大并行任务数为(cpu核心数*2)*2</span>
|
||||
|
||||
<span class="token comment"># rsync评测数据同步的配置</span>
|
||||
<span class="token attr-name">RSYNC_MASTER_ADDR</span><span class="token punctuation">=</span><span class="token attr-value">127.0.0.1 # 写入主服务器ip</span>
|
||||
<span class="token attr-name">RSYNC_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456 # 与主服务器的rsync密码一致</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br></div></div><p>配置修改保存后,当前路径下启动该服务</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker-compose up -d
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><blockquote><p>提示:需要开启多台判题机,就如当前第4步的操作一样,在每台服务器上执行以上的操作即可。</p></blockquote></li> <li><p>两个服务都启动完成,在浏览器输入主服务ip或域名进行访问,登录root账号到后台查看服务状态。</p></li></ol> <h2 id="三、开启https"><a href="#三、开启https" class="header-anchor">#</a> 三、开启Https</h2> <ul><li><p>单机部署:</p> <p>提供server.crt和server.key证书与密钥文件放置<code>/standAlone</code>目录下,与<code>docker-compose.yml</code>和<code>.env</code>文件放置同一位置,然后修改<code>docker-compose.yml</code>中的hoj-frontend的配置</p></li> <li><p>分布式部署:</p> <p>提供server.crt和server.key证书与密钥文件放置<code>/distributed/main目录下,与</code>docker-compose.yml<code>和</code>.env<code>文件放置同一位置,然后修改</code>docker-compose.yml`中的hoj-frontend的配置</p></li></ul> <div class="language-yaml line-numbers-mode"><pre class="language-yaml"><code><span class="token key atrule">hoj-frontend</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">image</span><span class="token punctuation">:</span> registry.cn<span class="token punctuation">-</span>shenzhen.aliyuncs.com/hcode/hoj_frontend
|
||||
<span class="token key atrule">container_name</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>frontend
|
||||
<span class="token key atrule">restart</span><span class="token punctuation">:</span> always
|
||||
<span class="token comment"># 开启https,请提供证书</span>
|
||||
<span class="token key atrule">volumes</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> ./server.crt<span class="token punctuation">:</span>/etc/nginx/etc/crt/server.crt
|
||||
<span class="token punctuation">-</span> ./server.key<span class="token punctuation">:</span>/etc/nginx/etc/crt/server.key
|
||||
<span class="token comment"># 修改前端logo</span>
|
||||
<span class="token comment"># - ./logo.a0924d7d.png:/usr/share/nginx/html/assets/img/logo.a0924d7d.png</span>
|
||||
<span class="token comment"># - ./backstage.8bce8c6e.png:/usr/share/nginx/html/assets/img/backstage.8bce8c6e.png</span>
|
||||
<span class="token key atrule">environment</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> SERVER_NAME=localhost <span class="token comment"># 提供你的域名!!!!</span>
|
||||
<span class="token punctuation">-</span> BACKEND_SERVER_HOST=$<span class="token punctuation">{</span>BACKEND_HOST<span class="token punctuation">:</span><span class="token punctuation">-</span>172.20.0.5<span class="token punctuation">}</span> <span class="token comment"># backend后端服务地址</span>
|
||||
<span class="token punctuation">-</span> BACKEND_SERVER_PORT=$<span class="token punctuation">{</span>BACKEND_PORT<span class="token punctuation">:</span><span class="token number">-6688</span><span class="token punctuation">}</span> <span class="token comment"># backend后端服务端口号</span>
|
||||
<span class="token punctuation">-</span> USE_HTTPS=true <span class="token comment"># 使用https请设置为true</span>
|
||||
<span class="token key atrule">ports</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> <span class="token string">"80:80"</span>
|
||||
<span class="token punctuation">-</span> <span class="token string">"443:443"</span>
|
||||
<span class="token key atrule">networks</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">hoj-network</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">ipv4_address</span><span class="token punctuation">:</span> 172.20.0.6
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br></div></div><h2 id="四、更新最新版本"><a href="#四、更新最新版本" class="header-anchor">#</a> 四、更新最新版本</h2> <p>请在对应的docker-compose.yml当前文件夹下执行<code>docker-compose pull</code>拉取最新镜像,然后重新<code>docker-compose up -d</code>即可。</p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/deploy/" class="prev router-link-active">
|
||||
环境配置
|
||||
</a></span> <span class="next"><a href="/docs/deploy/frontend.html">
|
||||
前端部署
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/10.8a54dd52.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,226 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>前端部署 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/11.41b16e2f.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>部署文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/deploy/" aria-current="page" class="sidebar-link">环境配置</a></li><li><a href="/docs/deploy/docker.html" class="sidebar-link">快速部署</a></li><li><a href="/docs/deploy/frontend.html" aria-current="page" class="active sidebar-link">前端部署</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/frontend.html#一、常规部署" class="sidebar-link">一、常规部署</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/frontend.html#二、docker部署" class="sidebar-link">二、docker部署</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/frontend.html#前言" class="sidebar-link">前言</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/frontend.html#文件介绍" class="sidebar-link">文件介绍</a></li></ul></li></ul></li><li><a href="/docs/deploy/mysql.html" class="sidebar-link">MySQL部署</a></li><li><a href="/docs/deploy/redis.html" class="sidebar-link">Redis部署</a></li><li><a href="/docs/deploy/nacos.html" class="sidebar-link">Nacos部署</a></li><li><a href="/docs/deploy/backend.html" class="sidebar-link">后端部署</a></li><li><a href="/docs/deploy/judgeserver.html" class="sidebar-link">判题服务部署</a></li><li><a href="/docs/deploy/rsync.html" class="sidebar-link">评测数据同步</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="前端部署"><a href="#前端部署" class="header-anchor">#</a> 前端部署</h1> <h2 id="一、常规部署"><a href="#一、常规部署" class="header-anchor">#</a> 一、常规部署</h2> <h4 id="_1-安装nginx"><a href="#_1-安装nginx" class="header-anchor">#</a> 1. 安装nginx</h4> <blockquote><p>注意:apt下载太慢的话,建议换阿里云源,请自行百度or谷歌</p></blockquote> <ol><li><p>使用apt安装</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> nginx
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>路径介绍</p> <ul><li>/usr/sbin/nginx:主程序</li> <li>/etc/nginx:存放配置文件</li> <li>/usr/share/nginx:存放静态文件</li> <li>/var/log/nginx:存放日志</li></ul></li> <li><p>启动nginx</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">service</span> nginx start
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>验证是否成功</p> <p>在浏览器输入你的ip地址,如果出现Wellcome to nginx 那么就是配置成功</p></li></ol> <h4 id="_2-部署"><a href="#_2-部署" class="header-anchor">#</a> 2. 部署</h4> <ol><li><p><a href="https://gitee.com/himitzh0730/hoj/tree/master/hoj-vue" target="_blank" rel="noopener noreferrer">下载本项目<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>,git clone或者download zip</p></li> <li><p>前提是本地有vue-cli4与npm,请自行百度下载</p></li> <li><p>然后在当前hoj-vue文件夹的src路径运行打包命令</p> <div class="language-powershell line-numbers-mode"><pre class="language-powershell"><code>npm run build
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>打包成功会在src同文件夹内有个dist文件夹,复制里面的html和css等静态文件</p></li> <li><p>在云服务器上创建文件夹</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">mkdir</span> -p /hoj/www/html
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>然后将这些静态文件复制到里面即可</p></li> <li><p>配置nginx,在安装好nginx后,修改nginx.conf配置</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> <span class="token function">vi</span> /etc/nginx/nginx.conf
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>将下面的内容复制进去</p> <p><strong>注意:没有域名使用IP+端口号也一样</strong></p> <div class="language-json line-numbers-mode"><pre class="language-json"><code>server<span class="token punctuation">{</span>
|
||||
listen <span class="token number">80</span>; # 监听访问的端口号
|
||||
server_name www.hcode.top; # 此处填写你的域名或IP
|
||||
root /hoj/www/html; # 此处填写你的网页根目录
|
||||
location /api<span class="token punctuation">{</span>
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http<span class="token operator">:</span><span class="token comment">//localhost:6688; # 填写你的后端地址和端口</span>
|
||||
<span class="token punctuation">}</span>
|
||||
location ~ .*\.(js|json|css)$ <span class="token punctuation">{</span>
|
||||
gzip on;
|
||||
gzip_static on; # gzip_static是nginx对于静态文件的处理模块,该模块可以读取预先压缩的gz文件,这样可以减少每次请求进行gzip压缩的CPU资源消耗。
|
||||
gzip_min_length 1k;
|
||||
gzip_http_version <span class="token number">1.1</span>;
|
||||
gzip_comp_level <span class="token number">9</span>;
|
||||
gzip_types text/css application/javascript application/json;
|
||||
root /hoj/www/html; # 此处填写你的网页根目录
|
||||
<span class="token punctuation">}</span>
|
||||
location / <span class="token punctuation">{</span> # 路由重定向以适应Vue中的路由
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br></div></div></li> <li><p>修改后保存,然后重启或者热重载nginx,不出意外应该可用访问前端页面了。</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> systemctl restart nginx
|
||||
或
|
||||
<span class="token function">sudo</span> nginx -s reload
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div></li></ol> <h2 id="二、docker部署"><a href="#二、docker部署" class="header-anchor">#</a> 二、docker部署</h2> <h3 id="前言"><a href="#前言" class="header-anchor">#</a> 前言</h3> <blockquote><p>html文件夹下为hoj的vue前端打包的静态资源</p></blockquote> <p>直接下载本项目,进入到当前文件夹执行打包命令</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">git</span> clone https://gitee.com/himitzh0730/hoj-deploy.git <span class="token operator">&&</span> <span class="token builtin class-name">cd</span> hoj-deploy/src/frontend
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>当前文件夹为打包<code>hoj-frontend</code>镜像的相关文件,将这些文件复制到同一个文件夹内,之后执行以下命令进行打包成镜像</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker build -t hoj-frontend <span class="token builtin class-name">.</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>docker run 启动</p> <ul><li><p>Http方式</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker run -d --name hoj-frontend <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">SERVER_NAME</span><span class="token operator">=</span>localhost <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">BACKEND_SERVER_HOST</span><span class="token operator">=</span>backend_server_host <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">BACKEND_SERVER_PORT</span><span class="token operator">=</span>backend_server_port <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">USE_HTTPS</span><span class="token operator">=</span>false <span class="token punctuation">\</span>
|
||||
-p <span class="token number">80</span>:80 <span class="token punctuation">\</span>
|
||||
--restart<span class="token operator">=</span><span class="token string">"always"</span> <span class="token punctuation">\</span>
|
||||
hoj-frontend
|
||||
<span class="token comment"># registry.cn-shenzhen.aliyuncs.com/hcode/hoj_frontend</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div></li> <li><p>Https方式</p> <p><strong>需将SSL证书与公钥文件(server.crt、server.kry)放置当前目录</strong></p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker run -d --name hoj-frontend <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">SERVER_NAME</span><span class="token operator">=</span>localhost <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">BACKEND_SERVER_HOST</span><span class="token operator">=</span>backend_server_host <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">BACKEND_SERVER_PORT</span><span class="token operator">=</span>backend_server_port <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">USE_HTTPS</span><span class="token operator">=</span>true <span class="token punctuation">\</span>
|
||||
-e ./server.crt:/etc/nginx/etc/crt/server.crt <span class="token punctuation">\</span>
|
||||
-e ./server.key:/etc/nginx/etc/crt/server.key <span class="token punctuation">\</span>
|
||||
-p <span class="token number">80</span>:80 <span class="token punctuation">\</span>
|
||||
-p <span class="token number">443</span>:443 <span class="token punctuation">\</span>
|
||||
--restart<span class="token operator">=</span><span class="token string">"always"</span> <span class="token punctuation">\</span>
|
||||
hoj-frontend
|
||||
<span class="token comment"># registry.cn-shenzhen.aliyuncs.com/hcode/hoj_frontend</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br></div></div></li></ul> <p>docker-compose 启动</p> <div class="language-yaml line-numbers-mode"><pre class="language-yaml"><code><span class="token key atrule">version</span><span class="token punctuation">:</span> <span class="token string">"3"</span>
|
||||
<span class="token key atrule">services</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">hoj-frontend</span><span class="token punctuation">:</span>
|
||||
<span class="token comment"># image: registry.cn-shenzhen.aliyuncs.com/hcode/hoj_frontend</span>
|
||||
<span class="token key atrule">image</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>frontend
|
||||
<span class="token key atrule">container_name</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>frontend
|
||||
<span class="token key atrule">restart</span><span class="token punctuation">:</span> always
|
||||
<span class="token comment"># 开启https,请提供证书</span>
|
||||
<span class="token comment">#volumes:</span>
|
||||
<span class="token comment"># - ./server.crt:/etc/nginx/etc/crt/server.crt</span>
|
||||
<span class="token comment"># - ./server.key:/etc/nginx/etc/crt/server.key</span>
|
||||
<span class="token key atrule">environment</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> SERVER_NAME=localhost <span class="token comment"># 域名或localhost(本地)</span>
|
||||
<span class="token punctuation">-</span> BACKEND_SERVER_HOST=172.20.0.5 <span class="token comment"># backend后端服务地址</span>
|
||||
<span class="token punctuation">-</span> BACKEND_SERVER_PORT=6688 <span class="token comment"># backend后端服务端口号</span>
|
||||
<span class="token punctuation">-</span> USE_HTTPS=false
|
||||
<span class="token key atrule">ports</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> <span class="token string">"80:80"</span>
|
||||
<span class="token punctuation">-</span> <span class="token string">"443:443"</span>
|
||||
<span class="token comment"># networks:</span>
|
||||
<span class="token comment"># hoj-network:</span>
|
||||
<span class="token comment"># ipv4_address: 172.20.0.6</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br></div></div><h3 id="文件介绍"><a href="#文件介绍" class="header-anchor">#</a> 文件介绍</h3> <h4 id="_1-default-conf-ssl-template"><a href="#_1-default-conf-ssl-template" class="header-anchor">#</a> 1. default.conf.ssl.template</h4> <p>nginx的SSL配置文件模板,需要在执行 run.sh注入环境变量生成对应的nginx.conf文件</p> <div class="language-nginx line-numbers-mode"><pre class="language-nginx"><code><span class="token keyword">server</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">listen</span> <span class="token number">80</span><span class="token punctuation">;</span>
|
||||
<span class="token comment">#填写绑定证书的域名</span>
|
||||
<span class="token keyword">server_name</span> $<span class="token punctuation">{</span><span class="token keyword">SERVER_NAME</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||||
<span class="token comment">#把http的域名请求转成https</span>
|
||||
<span class="token keyword">return</span> <span class="token number">301</span> <span class="token keyword">https</span><span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span><span class="token variable">$host</span><span class="token variable">$request_uri</span><span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token keyword">server</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">listen</span> <span class="token number">443</span> <span class="token keyword">ssl</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">server_name</span> $<span class="token punctuation">{</span><span class="token keyword">SERVER_NAME</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||||
<span class="token comment">#证书文件名称</span>
|
||||
<span class="token keyword">ssl_certificate</span> <span class="token operator">/</span>etc<span class="token operator">/</span>nginx<span class="token operator">/</span>etc<span class="token operator">/</span>crt<span class="token operator">/</span><span class="token keyword">server</span><span class="token punctuation">.</span>crt<span class="token punctuation">;</span>
|
||||
<span class="token comment">#私钥文件名称</span>
|
||||
<span class="token keyword">ssl_certificate_key</span> <span class="token operator">/</span>etc<span class="token operator">/</span>nginx<span class="token operator">/</span>etc<span class="token operator">/</span>crt<span class="token operator">/</span><span class="token keyword">server</span><span class="token punctuation">.</span>key<span class="token punctuation">;</span>
|
||||
<span class="token keyword">ssl_session_timeout</span> <span class="token number">5</span>m<span class="token punctuation">;</span>
|
||||
<span class="token comment">#请按照以下协议配置</span>
|
||||
<span class="token keyword">ssl_protocols</span> TLSv1 TLSv1<span class="token punctuation">.</span><span class="token number">1</span> TLSv1<span class="token punctuation">.</span><span class="token number">2</span><span class="token punctuation">;</span>
|
||||
<span class="token comment">#请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。</span>
|
||||
<span class="token keyword">ssl_ciphers</span> ECDHE<span class="token operator">-</span>RSA<span class="token operator">-</span>AES128<span class="token operator">-</span>GCM<span class="token operator">-</span>SHA256<span class="token punctuation">:</span>HIGH<span class="token punctuation">:</span><span class="token operator">!</span>aNULL<span class="token punctuation">:</span><span class="token operator">!</span>MD5<span class="token punctuation">:</span><span class="token operator">!</span>RC4<span class="token punctuation">:</span><span class="token operator">!</span>DHE<span class="token punctuation">;</span>
|
||||
<span class="token keyword">ssl_prefer_server_ciphers</span> on<span class="token punctuation">;</span>
|
||||
|
||||
<span class="token keyword">root</span> <span class="token operator">/</span>usr<span class="token operator">/</span>share<span class="token operator">/</span>nginx<span class="token operator">/</span>html<span class="token punctuation">;</span>
|
||||
<span class="token keyword">location</span> <span class="token operator">/</span>api<span class="token punctuation">{</span>
|
||||
<span class="token keyword">proxy_pass</span> <span class="token keyword">http</span><span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>$<span class="token punctuation">{</span>BACKEND_SERVER_HOST<span class="token punctuation">}</span><span class="token punctuation">:</span>$<span class="token punctuation">{</span>BACKEND_SERVER_PORT<span class="token punctuation">}</span><span class="token punctuation">;</span> <span class="token comment"># 填写你的后端地址和端口</span>
|
||||
<span class="token keyword">proxy_set_header</span> X<span class="token operator">-</span>Real<span class="token operator">-</span>IP <span class="token variable">$remote_addr</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">proxy_set_header</span> X<span class="token operator">-</span>Forwarded<span class="token operator">-</span>For <span class="token variable">$proxy_add_x_forwarded_for</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">proxy_set_header</span> Host <span class="token variable">$http_host</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">proxy_set_header</span> X<span class="token operator">-</span>Forwarded<span class="token operator">-</span>Proto <span class="token variable">$scheme</span><span class="token punctuation">;</span>
|
||||
|
||||
<span class="token keyword">client_max_body_size</span> <span class="token number">128</span>M<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">location</span> <span class="token operator">~</span> <span class="token punctuation">.</span><span class="token operator">*</span>\<span class="token punctuation">.</span><span class="token punctuation">(</span>js<span class="token operator">|</span>json<span class="token operator">|</span>css<span class="token punctuation">)</span>$ <span class="token punctuation">{</span>
|
||||
<span class="token keyword">gzip</span> on<span class="token punctuation">;</span>
|
||||
<span class="token keyword">gzip_static</span> on<span class="token punctuation">;</span> <span class="token comment"># gzip_static是nginx对于静态文件的处理模块,该模块可以读取预先压缩的gz文件,这样可以减少每次请求进行gzip压缩的CPU资源消耗。</span>
|
||||
<span class="token keyword">gzip_min_length</span> <span class="token number">1</span>k<span class="token punctuation">;</span>
|
||||
<span class="token keyword">gzip_http_version</span> <span class="token number">1.1</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">gzip_comp_level</span> <span class="token number">9</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">gzip_types</span> text<span class="token operator">/</span>css application<span class="token operator">/</span>javascript application<span class="token operator">/</span>json<span class="token punctuation">;</span>
|
||||
<span class="token keyword">root</span> <span class="token operator">/</span>usr<span class="token operator">/</span>share<span class="token operator">/</span>nginx<span class="token operator">/</span>html<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">location</span> <span class="token operator">/</span> <span class="token punctuation">{</span> <span class="token comment"># 路由重定向以适应Vue中的路由</span>
|
||||
<span class="token keyword">index</span> <span class="token keyword">index</span><span class="token punctuation">.</span>html<span class="token punctuation">;</span>
|
||||
<span class="token keyword">try_files</span> <span class="token variable">$uri</span> <span class="token variable">$uri</span><span class="token operator">/</span> <span class="token operator">/</span><span class="token keyword">index</span><span class="token punctuation">.</span>html<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br></div></div><h4 id="_2-default-conf-template"><a href="#_2-default-conf-template" class="header-anchor">#</a> 2. default.conf.template</h4> <p>nginx的配置文件模板,需要在执行 run.sh注入环境变量生成对应的nginx.conf文件</p> <div class="language-nginx line-numbers-mode"><pre class="language-nginx"><code><span class="token keyword">server</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">listen</span> <span class="token number">80</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">server_name</span> $<span class="token punctuation">{</span><span class="token keyword">SERVER_NAME</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">root</span> <span class="token operator">/</span>usr<span class="token operator">/</span>share<span class="token operator">/</span>nginx<span class="token operator">/</span>html<span class="token punctuation">;</span>
|
||||
<span class="token keyword">location</span> <span class="token operator">/</span>api<span class="token punctuation">{</span>
|
||||
<span class="token keyword">proxy_pass</span> <span class="token keyword">http</span><span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>$<span class="token punctuation">{</span>BACKEND_SERVER_HOST<span class="token punctuation">}</span><span class="token punctuation">:</span>$<span class="token punctuation">{</span>BACKEND_SERVER_PORT<span class="token punctuation">}</span><span class="token punctuation">;</span> <span class="token comment"># 填写你的后端地址和端口</span>
|
||||
<span class="token keyword">proxy_set_header</span> X<span class="token operator">-</span>Real<span class="token operator">-</span>IP <span class="token variable">$remote_addr</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">proxy_set_header</span> X<span class="token operator">-</span>Forwarded<span class="token operator">-</span>For <span class="token variable">$proxy_add_x_forwarded_for</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">proxy_set_header</span> Host <span class="token variable">$http_host</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">proxy_set_header</span> X<span class="token operator">-</span>Forwarded<span class="token operator">-</span>Proto <span class="token variable">$scheme</span><span class="token punctuation">;</span>
|
||||
|
||||
<span class="token keyword">client_max_body_size</span> <span class="token number">128</span>M<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">location</span> <span class="token operator">~</span> <span class="token punctuation">.</span><span class="token operator">*</span>\<span class="token punctuation">.</span><span class="token punctuation">(</span>js<span class="token operator">|</span>json<span class="token operator">|</span>css<span class="token punctuation">)</span>$ <span class="token punctuation">{</span>
|
||||
<span class="token keyword">gzip</span> on<span class="token punctuation">;</span>
|
||||
<span class="token keyword">gzip_static</span> on<span class="token punctuation">;</span> <span class="token comment"># gzip_static是nginx对于静态文件的处理模块,该模块可以读取预先压缩的gz文件,这样可以减少每次请求进行gzip压缩的CPU资源消耗。</span>
|
||||
<span class="token keyword">gzip_min_length</span> <span class="token number">1</span>k<span class="token punctuation">;</span>
|
||||
<span class="token keyword">gzip_http_version</span> <span class="token number">1.1</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">gzip_comp_level</span> <span class="token number">9</span><span class="token punctuation">;</span>
|
||||
<span class="token keyword">gzip_types</span> text<span class="token operator">/</span>css application<span class="token operator">/</span>javascript application<span class="token operator">/</span>json<span class="token punctuation">;</span>
|
||||
<span class="token keyword">root</span> <span class="token operator">/</span>usr<span class="token operator">/</span>share<span class="token operator">/</span>nginx<span class="token operator">/</span>html<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">location</span> <span class="token operator">/</span> <span class="token punctuation">{</span> <span class="token comment"># 路由重定向以适应Vue中的路由</span>
|
||||
<span class="token keyword">index</span> <span class="token keyword">index</span><span class="token punctuation">.</span>html<span class="token punctuation">;</span>
|
||||
<span class="token keyword">try_files</span> <span class="token variable">$uri</span> <span class="token variable">$uri</span><span class="token operator">/</span> <span class="token operator">/</span><span class="token keyword">index</span><span class="token punctuation">.</span>html<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br></div></div><h4 id="_3-run-sh"><a href="#_3-run-sh" class="header-anchor">#</a> 3. run.sh</h4> <p>作用是将模板conf配置文件注入对应环境变量,生成到指定文件夹</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token shebang important">#!/usr/bin/env sh</span>
|
||||
<span class="token builtin class-name">set</span> -eu
|
||||
<span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token string">"<span class="token variable">$USE_HTTPS</span>"</span> <span class="token operator">==</span> <span class="token string">"true"</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
|
||||
envsubst <span class="token string">'<span class="token variable">${SERVER_NAME}</span> <span class="token variable">${BACKEND_SERVER_HOST}</span> <span class="token variable">${BACKEND_SERVER_PORT}</span>'</span> <span class="token operator"><</span> /etc/nginx/conf.d/default.conf.ssl.template <span class="token operator">></span> /etc/nginx/conf.d/default.conf
|
||||
<span class="token keyword">else</span>
|
||||
envsubst <span class="token string">'<span class="token variable">${SERVER_NAME}</span> <span class="token variable">${BACKEND_SERVER_HOST}</span> <span class="token variable">${BACKEND_SERVER_PORT}</span>'</span> <span class="token operator"><</span> /etc/nginx/conf.d/default.conf.template <span class="token operator">></span> /etc/nginx/conf.d/default.conf
|
||||
<span class="token keyword">fi</span>
|
||||
<span class="token function">rm</span> /etc/nginx/conf.d/default.conf.template
|
||||
<span class="token function">rm</span> /etc/nginx/conf.d/default.conf.ssl.template
|
||||
<span class="token builtin class-name">exec</span> <span class="token string">"<span class="token variable">$@</span>"</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><h4 id="_4-dockerfile"><a href="#_4-dockerfile" class="header-anchor">#</a> 4. Dockerfile</h4> <div class="language-dockerfile line-numbers-mode"><pre class="language-dockerfile"><code><span class="token keyword">FROM</span> nginx<span class="token punctuation">:</span>1.15<span class="token punctuation">-</span>alpine
|
||||
|
||||
<span class="token keyword">COPY</span> default.conf.template /etc/nginx/conf.d/default.conf.template
|
||||
|
||||
<span class="token keyword">COPY</span> default.conf.ssl.template /etc/nginx/conf.d/default.conf.ssl.template
|
||||
|
||||
<span class="token keyword">ADD</span> html/ /usr/share/nginx/html/
|
||||
|
||||
<span class="token keyword">COPY</span> ./run.sh /docker<span class="token punctuation">-</span>entrypoint.sh
|
||||
|
||||
<span class="token keyword">RUN</span> chmod a+x /docker<span class="token punctuation">-</span>entrypoint.sh
|
||||
|
||||
<span class="token keyword">ENTRYPOINT</span> <span class="token punctuation">[</span><span class="token string">"/docker-entrypoint.sh"</span><span class="token punctuation">]</span>
|
||||
|
||||
<span class="token comment"># 每次容器启动时执行</span>
|
||||
<span class="token keyword">CMD</span> <span class="token punctuation">[</span><span class="token string">"nginx"</span><span class="token punctuation">,</span> <span class="token string">"-g"</span><span class="token punctuation">,</span> <span class="token string">"daemon off;"</span><span class="token punctuation">]</span>
|
||||
|
||||
<span class="token comment"># 容器应用端口</span>
|
||||
<span class="token keyword">EXPOSE</span> 80
|
||||
|
||||
<span class="token keyword">EXPOSE</span> 443
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br></div></div></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/deploy/docker.html" class="prev">
|
||||
快速部署
|
||||
</a></span> <span class="next"><a href="/docs/deploy/mysql.html">
|
||||
MySQL部署
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/11.41b16e2f.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,59 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>环境配置 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/8.bb76cd0d.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>部署文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/deploy/" aria-current="page" class="active sidebar-link">环境配置</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/#环境说明" class="sidebar-link">环境说明</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/#linux环境搭建" class="sidebar-link">Linux环境搭建</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/#安装docker" class="sidebar-link">安装docker</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/#安装docker-compose" class="sidebar-link">安装docker-compose</a></li></ul></li><li class="sidebar-sub-header"><a href="/docs/deploy/#windows-环境" class="sidebar-link">Windows 环境</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/#单个部署顺序" class="sidebar-link">单个部署顺序</a></li></ul></li><li><a href="/docs/deploy/docker.html" class="sidebar-link">快速部署</a></li><li><a href="/docs/deploy/frontend.html" class="sidebar-link">前端部署</a></li><li><a href="/docs/deploy/mysql.html" class="sidebar-link">MySQL部署</a></li><li><a href="/docs/deploy/redis.html" class="sidebar-link">Redis部署</a></li><li><a href="/docs/deploy/nacos.html" class="sidebar-link">Nacos部署</a></li><li><a href="/docs/deploy/backend.html" class="sidebar-link">后端部署</a></li><li><a href="/docs/deploy/judgeserver.html" class="sidebar-link">判题服务部署</a></li><li><a href="/docs/deploy/rsync.html" class="sidebar-link">评测数据同步</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="环境配置"><a href="#环境配置" class="header-anchor">#</a> 环境配置</h1> <h2 id="环境说明"><a href="#环境说明" class="header-anchor">#</a> 环境说明</h2> <ul><li>后端:需要在Linux系统下部署运行,建议使用ubuntu18.04,其它版本的Linux系统也可,同时需要<strong>Docker</strong>辅助部署</li> <li>前端:Linux系统下,需要nginx进行反向代理</li> <li>判题服务:由于判题沙盒有多操作系统版本,Linux系统或Windows都可,强烈建议Linux系统(Ubuntu)</li> <li>数据同步:需要运行判题服务和后端服务的服务器有rsync即可</li></ul> <h2 id="linux环境搭建"><a href="#linux环境搭建" class="header-anchor">#</a> Linux环境搭建</h2> <blockquote><p>请先准备一台 CPU: 1核 内存: 2G 硬盘: 30G的云服务器,推荐Ubuntu16.04以上的操作系统,</p> <p>HOJ使用的Ubuntu18.04版本,单机部署建议2G以上内存</p></blockquote> <h3 id="安装docker"><a href="#安装docker" class="header-anchor">#</a> 安装docker</h3> <ol><li><p>安装需要的包</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> <span class="token function">apt-get</span> update
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>安装依赖包</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> <span class="token function">apt-get</span> <span class="token function">install</span> <span class="token punctuation">\</span>
|
||||
apt-transport-https <span class="token punctuation">\</span>
|
||||
ca-certificates <span class="token punctuation">\</span>
|
||||
<span class="token function">curl</span> <span class="token punctuation">\</span>
|
||||
gnupg-agent <span class="token punctuation">\</span>
|
||||
software-properties-common
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div></li> <li><p>添加 Docker 的官方 GPG 密钥</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">curl</span> -fsSL https://download.docker.com/linux/ubuntu/gpg <span class="token operator">|</span> <span class="token function">sudo</span> apt-key <span class="token function">add</span> -
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>设置远程仓库</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> add-apt-repository <span class="token punctuation">\</span>
|
||||
<span class="token string">"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
||||
<span class="token variable"><span class="token variable">$(</span>lsb_release -cs<span class="token variable">)</span></span> \
|
||||
stable"</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div></li> <li><p>安装 Docker-CE</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> <span class="token function">apt-get</span> update
|
||||
<span class="token function">sudo</span> <span class="token function">apt-get</span> <span class="token function">install</span> docker-ce docker-ce-cli containerd.io
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></li> <li><p>验证是否成功</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> docker run hello-world
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li></ol> <h3 id="安装docker-compose"><a href="#安装docker-compose" class="header-anchor">#</a> 安装docker-compose</h3> <ol><li><p>下载</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> <span class="token function">curl</span> -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-<span class="token variable"><span class="token variable">`</span><span class="token function">uname</span> -s<span class="token variable">`</span></span>-<span class="token variable"><span class="token variable">`</span><span class="token function">uname</span> -m<span class="token variable">`</span></span> -o /usr/local/bin/docker-compose
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>授权</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">sudo</span> <span class="token function">chmod</span> +x /usr/local/bin/docker-compose
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li></ol> <h2 id="windows-环境"><a href="#windows-环境" class="header-anchor">#</a> Windows 环境</h2> <p>Windows 下的安装仅供体验,勿在生产环境使用。如有必要,请使用虚拟机安装 Linux 并将 OJ 安装在其中。</p> <p>以下教程仅适用于 Win10 x64 下的 <code>PowerShell</code></p> <ol><li>安装 Windows 的 Docker 工具</li> <li>右击右下角 Docker 图标,选择 Settings 进行设置</li> <li>选择 <code>Shared Drives</code> 菜单,之后勾选你想安装 OJ 的盘符位置(例如勾选D盘),点击 <code>Apply</code></li> <li>输入 Windows 的账号密码进行文件共享</li> <li>安装 <code>Python</code>、<code>pip</code>、<code>git</code>、<code>docker-compose</code>,安装方法自行搜索。</li></ol> <h2 id="单个部署顺序"><a href="#单个部署顺序" class="header-anchor">#</a> 单个部署顺序</h2> <p>单个部署的顺序是:redis,mysql,rsync,frontend >> nacos >> backend,judgeserver</p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/introducition/about.html" class="prev">
|
||||
简介
|
||||
</a></span> <span class="next"><a href="/docs/deploy/docker.html">
|
||||
快速部署
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/8.bb76cd0d.js" defer></script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
|
@ -1,172 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>MySQL部署 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/13.ac89c359.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>部署文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/deploy/" aria-current="page" class="sidebar-link">环境配置</a></li><li><a href="/docs/deploy/docker.html" class="sidebar-link">快速部署</a></li><li><a href="/docs/deploy/frontend.html" class="sidebar-link">前端部署</a></li><li><a href="/docs/deploy/mysql.html" aria-current="page" class="active sidebar-link">MySQL部署</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/mysql.html#前言" class="sidebar-link">前言</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/mysql.html#文件介绍" class="sidebar-link">文件介绍</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/mysql.html#_1-bcrypt" class="sidebar-link">1. bcrypt</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/mysql.html#_2-hoj-sql" class="sidebar-link">2. hoj.sql</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/mysql.html#_3-nacos-sql" class="sidebar-link">3. nacos.sql</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/mysql.html#_4-run-sh" class="sidebar-link">4. run.sh</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/mysql.html#_5-dockerfile" class="sidebar-link">5. Dockerfile</a></li></ul></li></ul></li><li><a href="/docs/deploy/redis.html" class="sidebar-link">Redis部署</a></li><li><a href="/docs/deploy/nacos.html" class="sidebar-link">Nacos部署</a></li><li><a href="/docs/deploy/backend.html" class="sidebar-link">后端部署</a></li><li><a href="/docs/deploy/judgeserver.html" class="sidebar-link">判题服务部署</a></li><li><a href="/docs/deploy/rsync.html" class="sidebar-link">评测数据同步</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="mysql部署"><a href="#mysql部署" class="header-anchor">#</a> MySQL部署</h1> <p>首先 先下载<a href="https://gitee.com/himitzh0730/hoj-deploy/tree/master" target="_blank" rel="noopener noreferrer">hoj-deploy<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">git</span> clone https://gitee.com/himitzh0730/hoj-deploy.git <span class="token operator">&&</span> <span class="token builtin class-name">cd</span> hoj-deploy/src/mysql
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h2 id="前言"><a href="#前言" class="header-anchor">#</a> 前言</h2> <p>当前文件夹为打包<code>hoj-mysql</code>镜像的相关文件,只需将这些文件复制到同一个文件夹内,之后执行以下命令进行打包成镜像。</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker build -t hoj-mysql <span class="token builtin class-name">.</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>docker run启动</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker run -d --name hoj-mysql <span class="token punctuation">\</span>
|
||||
-v ./hoj/data/mysql/data:/var/lib/mysql <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">MYSQL_ROOT_PASSWORD</span><span class="token operator">=</span><span class="token string">"hoj123456"</span> <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">TZ</span><span class="token operator">=</span><span class="token string">"Asia/Shanghai"</span> <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">NACOS_USERNAME</span><span class="token operator">=</span>root <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">NACOS_PASSWORD</span><span class="token operator">=</span>hoj123456 <span class="token punctuation">\</span>
|
||||
-p <span class="token number">3306</span>:3306 <span class="token punctuation">\</span>
|
||||
--restart<span class="token operator">=</span><span class="token string">"always"</span> <span class="token punctuation">\</span>
|
||||
hoj-mysql
|
||||
<span class="token comment">#registry.cn-shenzhen.aliyuncs.com/hcode/hoj_database</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><p>docker-compose 启动</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>version: <span class="token string">"3"</span>
|
||||
services:
|
||||
hoj-mysql:
|
||||
<span class="token comment">#image: registry.cn-shenzhen.aliyuncs.com/hcode/hoj_database</span>
|
||||
image: hoj-mysql
|
||||
container_name: hoj-mysql
|
||||
restart: always
|
||||
volumes:
|
||||
- ./hoj/data/mysql/data:/var/lib/mysql
|
||||
environment:
|
||||
- <span class="token assign-left variable">MYSQL_ROOT_PASSWORD</span><span class="token operator">=</span>hoj123456 <span class="token comment"># root账号的密码</span>
|
||||
- <span class="token assign-left variable">TZ</span><span class="token operator">=</span>Asia/Shanghai
|
||||
- <span class="token assign-left variable">NACOS_USERNAME</span><span class="token operator">=</span>root <span class="token comment"># 需要初始化nacos数据库的管理员账号</span>
|
||||
- <span class="token assign-left variable">NACOS_PASSWORD</span><span class="token operator">=</span>hoj123456 <span class="token comment"># nacos管理员账号的密码</span>
|
||||
ports:
|
||||
- <span class="token string">"3306:3306"</span>
|
||||
<span class="token comment"># 如果有自定义网络可以类似添加如下</span>
|
||||
<span class="token comment"># networks:</span>
|
||||
<span class="token comment"># hoj-network:</span>
|
||||
<span class="token comment"># ipv4_address: 172.20.0.3</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br></div></div><h2 id="文件介绍"><a href="#文件介绍" class="header-anchor">#</a> 文件介绍</h2> <h3 id="_1-bcrypt"><a href="#_1-bcrypt" class="header-anchor">#</a> 1. bcrypt</h3> <p>此文件为go打包的可执行文件,作用是生成经过bcrypt加密的对应<strong>nacos管理员账号的密码</strong>,然后生成对应的插入sql语句,代码内容如下:</p> <div class="language-go line-numbers-mode"><pre class="language-go"><code><span class="token keyword">package</span> main
|
||||
|
||||
<span class="token keyword">import</span> <span class="token punctuation">(</span>
|
||||
<span class="token string">"flag"</span>
|
||||
<span class="token string">"fmt"</span>
|
||||
<span class="token string">"golang.org/x/crypto/bcrypt"</span>
|
||||
<span class="token string">"os"</span>
|
||||
<span class="token punctuation">)</span>
|
||||
|
||||
<span class="token comment">// 加密密码</span>
|
||||
<span class="token keyword">func</span> <span class="token function">HashAndSalt</span><span class="token punctuation">(</span>pwd <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">byte</span><span class="token punctuation">)</span> <span class="token builtin">string</span> <span class="token punctuation">{</span>
|
||||
|
||||
hash<span class="token punctuation">,</span> err <span class="token operator">:=</span> bcrypt<span class="token punctuation">.</span><span class="token function">GenerateFromPassword</span><span class="token punctuation">(</span>pwd<span class="token punctuation">,</span> bcrypt<span class="token punctuation">.</span>MinCost<span class="token punctuation">)</span>
|
||||
<span class="token keyword">if</span> err <span class="token operator">!=</span> <span class="token boolean">nil</span> <span class="token punctuation">{</span>
|
||||
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">return</span> <span class="token function">string</span><span class="token punctuation">(</span>hash<span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token keyword">func</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">var</span> username <span class="token builtin">string</span>
|
||||
<span class="token keyword">var</span> password <span class="token builtin">string</span>
|
||||
<span class="token keyword">var</span> filePath <span class="token builtin">string</span>
|
||||
|
||||
flag<span class="token punctuation">.</span><span class="token function">StringVar</span><span class="token punctuation">(</span><span class="token operator">&</span>username<span class="token punctuation">,</span><span class="token string">"username"</span><span class="token punctuation">,</span> <span class="token string">"nacos"</span><span class="token punctuation">,</span> <span class="token string">"nacos登录账号"</span><span class="token punctuation">)</span>
|
||||
flag<span class="token punctuation">.</span><span class="token function">StringVar</span><span class="token punctuation">(</span><span class="token operator">&</span>password<span class="token punctuation">,</span><span class="token string">"password"</span><span class="token punctuation">,</span> <span class="token string">"nacos"</span><span class="token punctuation">,</span> <span class="token string">"nacos登录密码"</span><span class="token punctuation">)</span>
|
||||
flag<span class="token punctuation">.</span><span class="token function">StringVar</span><span class="token punctuation">(</span><span class="token operator">&</span>filePath<span class="token punctuation">,</span><span class="token string">"filepath"</span><span class="token punctuation">,</span> <span class="token string">"./nacos-data.sql"</span><span class="token punctuation">,</span> <span class="token string">"sql脚本的文件夹路径"</span><span class="token punctuation">)</span>
|
||||
|
||||
<span class="token comment">//解析命令行参数</span>
|
||||
flag<span class="token punctuation">.</span><span class="token function">Parse</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
||||
|
||||
bcrtpyPassword <span class="token operator">:=</span> <span class="token function">HashAndSalt</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token function">byte</span><span class="token punctuation">(</span>password<span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||||
|
||||
sql <span class="token operator">:=</span> <span class="token string">"use `nacos`;\nINSERT INTO users (username, password, enabled) VALUES ('%s', '%s', TRUE);\nINSERT INTO roles (username, role) VALUES ('%s', 'ROLE_ADMIN');"</span>
|
||||
formatSql <span class="token operator">:=</span> fmt<span class="token punctuation">.</span><span class="token function">Sprintf</span><span class="token punctuation">(</span>sql<span class="token punctuation">,</span> username<span class="token punctuation">,</span> bcrtpyPassword<span class="token punctuation">,</span> username<span class="token punctuation">)</span>
|
||||
|
||||
fileObj<span class="token punctuation">,</span> err <span class="token operator">:=</span> os<span class="token punctuation">.</span><span class="token function">OpenFile</span><span class="token punctuation">(</span>filePath<span class="token punctuation">,</span> os<span class="token punctuation">.</span>O_APPEND<span class="token operator">|</span>os<span class="token punctuation">.</span>O_CREATE<span class="token operator">|</span>os<span class="token punctuation">.</span>O_WRONLY<span class="token punctuation">,</span> <span class="token number">0111</span><span class="token punctuation">)</span>
|
||||
|
||||
<span class="token keyword">if</span> err <span class="token operator">!=</span> <span class="token boolean">nil</span> <span class="token punctuation">{</span>
|
||||
fmt<span class="token punctuation">.</span><span class="token function">Println</span><span class="token punctuation">(</span><span class="token string">"err:"</span> <span class="token operator">+</span> err<span class="token punctuation">.</span><span class="token function">Error</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">return</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token keyword">defer</span> fileObj<span class="token punctuation">.</span><span class="token function">Close</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
|
||||
fileObj<span class="token punctuation">.</span><span class="token function">WriteString</span><span class="token punctuation">(</span>formatSql<span class="token punctuation">)</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br></div></div><h3 id="_2-hoj-sql"><a href="#_2-hoj-sql" class="header-anchor">#</a> 2. hoj.sql</h3> <p>此文件为hoj数据库的生成脚本及相关表数据的初始化</p> <h3 id="_3-nacos-sql"><a href="#_3-nacos-sql" class="header-anchor">#</a> 3. nacos.sql</h3> <p>此文件为nacos数据库的生成脚本及相关表数据的初始化</p> <h3 id="_4-run-sh"><a href="#_4-run-sh" class="header-anchor">#</a> 4. run.sh</h3> <p>此文件为shell脚本,用于执行sql脚本文件的执行,生成hoj,nacos数据库及插入相关数据</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token shebang important">#!/bin/bash</span>
|
||||
|
||||
<span class="token variable">$WORK_PATH</span>/bcrypt --username<span class="token operator">=</span><span class="token variable">$NACOS_USERNAME</span> --password<span class="token operator">=</span><span class="token variable">$NACOS_PASSWORD</span> --filepath<span class="token operator">=</span><span class="token variable">$WORK_PATH</span>/<span class="token variable">$FILE_2</span><span class="token punctuation">;</span>
|
||||
|
||||
<span class="token function">sleep</span> <span class="token number">2</span><span class="token punctuation">;</span>
|
||||
|
||||
mysql -uroot -p<span class="token variable">$MYSQL_ROOT_PASSWORD</span> <span class="token operator"><<</span> <span class="token string">EOF
|
||||
system echo '================Start create database hoj====================';
|
||||
source <span class="token variable">$WORK_PATH</span>/<span class="token variable">$FILE_0</span>;
|
||||
system echo '================Start create database nacos==================';
|
||||
source <span class="token variable">$WORK_PATH</span>/<span class="token variable">$FILE_1</span>;
|
||||
system echo '================Start insert user into nacos=================';
|
||||
source <span class="token variable">$WORK_PATH</span>/<span class="token variable">$FILE_2</span>;
|
||||
system echo '=====================Everything is ok!=======================';
|
||||
EOF</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div><h3 id="_5-dockerfile"><a href="#_5-dockerfile" class="header-anchor">#</a> 5. Dockerfile</h3> <div class="language-dockerfile line-numbers-mode"><pre class="language-dockerfile"><code><span class="token keyword">FROM</span> mysql<span class="token punctuation">:</span>8
|
||||
|
||||
<span class="token comment">#定义工作目录</span>
|
||||
<span class="token keyword">ENV</span> WORK_PATH /usr/local/work
|
||||
|
||||
<span class="token comment">#定义会被容器自动执行的目录</span>
|
||||
<span class="token keyword">ENV</span> AUTO_RUN_DIR /docker<span class="token punctuation">-</span>entrypoint<span class="token punctuation">-</span>initdb.d
|
||||
|
||||
<span class="token comment">#定义sql文件名</span>
|
||||
<span class="token keyword">ENV</span> FILE_0 hoj.sql
|
||||
<span class="token keyword">ENV</span> FILE_1 nacos.sql
|
||||
<span class="token keyword">ENV</span> FILE_2 nacos<span class="token punctuation">-</span>data.sql
|
||||
|
||||
<span class="token comment">#定义shell文件名</span>
|
||||
<span class="token keyword">ENV</span> INSTALL_DATA_SHELL run.sh
|
||||
|
||||
<span class="token comment">#定义生成nacos-data.sql的文件名</span>
|
||||
<span class="token keyword">ENV</span> NACOS_DATA_SHELL bcrypt
|
||||
|
||||
<span class="token keyword">ENV</span> NACOS_USERNAME=$<span class="token punctuation">{</span>NACOS_USERNAME<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token keyword">ENV</span> NACOS_PASSWORD=$<span class="token punctuation">{</span>NACOS_PASSWORD<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token keyword">COPY</span> ./$FILE_0 $WORK_PATH/
|
||||
<span class="token keyword">COPY</span> ./$FILE_1 $WORK_PATH/
|
||||
|
||||
<span class="token keyword">COPY</span> ./$INSTALL_DATA_SHELL $AUTO_RUN_DIR/
|
||||
<span class="token keyword">COPY</span> ./bcrypt $WORK_PATH/
|
||||
|
||||
<span class="token keyword">RUN</span> chmod a+x $WORK_PATH/bcrypt
|
||||
|
||||
<span class="token keyword">RUN</span> echo <span class="token string">''</span> <span class="token punctuation">></span> $WORK_PATH/$FILE_2
|
||||
|
||||
<span class="token keyword">RUN</span> chmod +777 $WORK_PATH/$FILE_2
|
||||
|
||||
<span class="token comment">#给执行文件增加可执行权限</span>
|
||||
|
||||
<span class="token keyword">RUN</span> chmod a+x $AUTO_RUN_DIR/$INSTALL_DATA_SHELL
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br></div></div></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/deploy/frontend.html" class="prev">
|
||||
前端部署
|
||||
</a></span> <span class="next"><a href="/docs/deploy/redis.html">
|
||||
Redis部署
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/13.ac89c359.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,58 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Nacos部署 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/14.cd5e7136.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>部署文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/deploy/" aria-current="page" class="sidebar-link">环境配置</a></li><li><a href="/docs/deploy/docker.html" class="sidebar-link">快速部署</a></li><li><a href="/docs/deploy/frontend.html" class="sidebar-link">前端部署</a></li><li><a href="/docs/deploy/mysql.html" class="sidebar-link">MySQL部署</a></li><li><a href="/docs/deploy/redis.html" class="sidebar-link">Redis部署</a></li><li><a href="/docs/deploy/nacos.html" aria-current="page" class="active sidebar-link">Nacos部署</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/nacos.html#docker部署" class="sidebar-link">docker部署</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/nacos.html#常规部署" class="sidebar-link">常规部署</a></li></ul></li><li><a href="/docs/deploy/backend.html" class="sidebar-link">后端部署</a></li><li><a href="/docs/deploy/judgeserver.html" class="sidebar-link">判题服务部署</a></li><li><a href="/docs/deploy/rsync.html" class="sidebar-link">评测数据同步</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="nacos部署"><a href="#nacos部署" class="header-anchor">#</a> Nacos部署</h1> <h2 id="docker部署"><a href="#docker部署" class="header-anchor">#</a> docker部署</h2> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker run -d <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">JVM_XMS</span><span class="token operator">=</span>384m <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">JVM_XMX</span><span class="token operator">=</span>384m <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">JVM_XMN</span><span class="token operator">=</span>192m <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">MODE</span><span class="token operator">=</span>standalone <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">SPRING_DATASOURCE_PLATFORM</span><span class="token operator">=</span>mysql <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">MYSQL_SERVICE_HOST</span><span class="token operator">=</span>mysql_host <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">MYSQL_SERVICE_PORT</span><span class="token operator">=</span>mysql_port <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">MYSQL_SERVICE_USER</span><span class="token operator">=</span>root <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">MYSQL_SERVICE_PASSWORD</span><span class="token operator">=</span><span class="token string">"mysql_root_password"</span> <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">MYSQL_SERVICE_DB_NAME</span><span class="token operator">=</span>nacos <span class="token punctuation">\</span>
|
||||
--env <span class="token assign-left variable">NACOS_AUTH_ENABLE</span><span class="token operator">=</span>true <span class="token punctuation">\</span>
|
||||
-p <span class="token number">8848</span>:8848 <span class="token punctuation">\</span>
|
||||
--name nacos <span class="token punctuation">\</span>
|
||||
--restart<span class="token operator">=</span>always <span class="token punctuation">\</span>
|
||||
nacos/nacos-server:1.4.2
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br></div></div><h2 id="常规部署"><a href="#常规部署" class="header-anchor">#</a> 常规部署</h2> <p>请自行百度下载修改配置</p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/deploy/redis.html" class="prev">
|
||||
Redis部署
|
||||
</a></span> <span class="next"><a href="/docs/deploy/backend.html">
|
||||
后端部署
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/14.cd5e7136.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,47 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Redis部署 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/15.4e37b949.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>部署文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/deploy/" aria-current="page" class="sidebar-link">环境配置</a></li><li><a href="/docs/deploy/docker.html" class="sidebar-link">快速部署</a></li><li><a href="/docs/deploy/frontend.html" class="sidebar-link">前端部署</a></li><li><a href="/docs/deploy/mysql.html" class="sidebar-link">MySQL部署</a></li><li><a href="/docs/deploy/redis.html" aria-current="page" class="active sidebar-link">Redis部署</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/redis.html#docker部署" class="sidebar-link">docker部署</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/redis.html#常规部署" class="sidebar-link">常规部署</a></li></ul></li><li><a href="/docs/deploy/nacos.html" class="sidebar-link">Nacos部署</a></li><li><a href="/docs/deploy/backend.html" class="sidebar-link">后端部署</a></li><li><a href="/docs/deploy/judgeserver.html" class="sidebar-link">判题服务部署</a></li><li><a href="/docs/deploy/rsync.html" class="sidebar-link">评测数据同步</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="redis部署"><a href="#redis部署" class="header-anchor">#</a> Redis部署</h1> <h2 id="docker部署"><a href="#docker部署" class="header-anchor">#</a> docker部署</h2> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker run -d --name redis -p <span class="token number">6379</span>:6379
|
||||
-v /hoj/data/redis/data:/data <span class="token punctuation">\</span>
|
||||
--restart<span class="token operator">=</span><span class="token string">"always"</span> <span class="token punctuation">\</span>
|
||||
redis <span class="token punctuation">\</span>
|
||||
--requirepass <span class="token string">"redis_password"</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h2 id="常规部署"><a href="#常规部署" class="header-anchor">#</a> 常规部署</h2> <p>请自行百度。。</p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/deploy/mysql.html" class="prev">
|
||||
MySQL部署
|
||||
</a></span> <span class="next"><a href="/docs/deploy/nacos.html">
|
||||
Nacos部署
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/15.4e37b949.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,159 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>评测数据同步 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/16.39b5f0a9.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>部署文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/deploy/" aria-current="page" class="sidebar-link">环境配置</a></li><li><a href="/docs/deploy/docker.html" class="sidebar-link">快速部署</a></li><li><a href="/docs/deploy/frontend.html" class="sidebar-link">前端部署</a></li><li><a href="/docs/deploy/mysql.html" class="sidebar-link">MySQL部署</a></li><li><a href="/docs/deploy/redis.html" class="sidebar-link">Redis部署</a></li><li><a href="/docs/deploy/nacos.html" class="sidebar-link">Nacos部署</a></li><li><a href="/docs/deploy/backend.html" class="sidebar-link">后端部署</a></li><li><a href="/docs/deploy/judgeserver.html" class="sidebar-link">判题服务部署</a></li><li><a href="/docs/deploy/rsync.html" aria-current="page" class="active sidebar-link">评测数据同步</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/rsync.html#一、常规部署" class="sidebar-link">一、常规部署</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/rsync.html#二、docker部署" class="sidebar-link">二、docker部署</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/deploy/rsync.html#前言" class="sidebar-link">前言</a></li><li class="sidebar-sub-header"><a href="/docs/deploy/rsync.html#文件介绍" class="sidebar-link">文件介绍</a></li></ul></li></ul></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="评测数据同步"><a href="#评测数据同步" class="header-anchor">#</a> 评测数据同步</h1> <h2 id="一、常规部署"><a href="#一、常规部署" class="header-anchor">#</a> 一、常规部署</h2> <ol><li><p>在主后台服务开启rsync实现服务增量同步,本HOJ使用子服务器主动拉取最新评测数据的功能(可选择主服务推的功能,但对主服务器的功耗较大)</p></li> <li><p>首先在主服务器(运行后端服务)的服务器中配置,指令如下</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">vim</span> /etc/rsyncd/rsyncd.conf <span class="token comment"># 新建配置文件</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token comment"># 将以下内容写入的rsyncd.conf文件里面 然后保存退出</span>
|
||||
port <span class="token operator">=</span> <span class="token number">873</span>
|
||||
uid <span class="token operator">=</span> root
|
||||
gid <span class="token operator">=</span> root
|
||||
use <span class="token function">chroot</span> <span class="token operator">=</span> <span class="token function">yes</span>
|
||||
<span class="token builtin class-name">read</span> only <span class="token operator">=</span> <span class="token function">yes</span>
|
||||
log <span class="token function">file</span> <span class="token operator">=</span> /hoj/log/rsyncd.log
|
||||
<span class="token punctuation">[</span>testcase<span class="token punctuation">]</span>
|
||||
path <span class="token operator">=</span> /hoj/testcase/
|
||||
list <span class="token operator">=</span> <span class="token function">yes</span>
|
||||
auth <span class="token function">users</span> <span class="token operator">=</span> hojrsync
|
||||
secrets <span class="token function">file</span> <span class="token operator">=</span> /etc/rsyncd/rsyncd.passwd
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br></div></div><p>再新建密码配置文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">vim</span> /etc/rsyncd/rsyncd.passwd
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token comment"># 将以下内容写入rsyncd.passwd文件里面,冒号后面的密码可用自定义,然后保存退出。</span>
|
||||
hojrsync:123456
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>修改密码配置文件的权限为600</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">chmod</span> <span class="token number">600</span> /etc/rsyncd/rsyncd.passwd
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>然后使用命令,使用后台守护进程运行rsync</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">rsync</span> --daemon --config<span class="token operator">=</span>/etc/rsyncd/rsyncd.conf
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>设置开启自启动</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token builtin class-name">echo</span> <span class="token string">"/usr/bin/rsync --daemon --config=/etc/rsyncd/rsyncd.conf"</span> <span class="token operator">>></span> /etc/rc.local
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>之后在运行JudgeServer判题服务的服务器上使用rsync每60秒同步一次指定文件夹的评测数据(同步周期可自己改)</p> <p>新建密码配置文件,同时写入与主服务端的rsync一样的密码</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">vim</span> /etc/rsyncd/rsyncd.passwd
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token number">123456</span> <span class="token comment"># 保存退出</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>修改密码配置文件的权限为600</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">chmod</span> <span class="token number">600</span> /etc/rsyncd/rsyncd.passwd
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>然后编写sh文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">vim</span> /etc/rsyncd/rsyncd_slave.sh
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>注意${ip}写自己主服务器的ip</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token keyword">while</span> <span class="token boolean">true</span>
|
||||
<span class="token keyword">do</span>
|
||||
<span class="token function">rsync</span> -avz --delete --progress --password-file<span class="token operator">=</span>/etc/rsyncd/rsyncd.passwd hojrsync@<span class="token variable">${ip}</span>::testcase /hoj/testcase <span class="token operator">>></span> /hoj/log/rsync_slave.log
|
||||
<span class="token function">sleep</span> <span class="token number">60</span>
|
||||
<span class="token keyword">done</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p>使用 nohup后台运行即可</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">nohup</span> /etc/rsyncd/rsyncd_slave.sh <span class="token operator">&</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li></ol> <h2 id="二、docker部署"><a href="#二、docker部署" class="header-anchor">#</a> 二、docker部署</h2> <h3 id="前言"><a href="#前言" class="header-anchor">#</a> 前言</h3> <p>直接下载部署项目,进入到当前文件夹执行打包命令</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">git</span> clone https://gitee.com/himitzh0730/hoj-deploy.git <span class="token operator">&&</span> <span class="token builtin class-name">cd</span> hoj-deploy/src/rsync
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>当前文件夹为打包<code>hoj-rsync</code>镜像的相关文件,将这些文件复制到同一个文件夹内,之后执行以下命令进行打包成镜像.</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker build -t hoj-rsync <span class="token builtin class-name">.</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>该服务用于测试用例数据在不同服务器之间的同步</strong></p> <p>docker run启动</p> <ul><li><p>主服务器(Backend所在服务器)</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker run -d --name hoj-rsync <span class="token punctuation">\</span>
|
||||
-v ./hoj/testcase:/hoj/testcase:ro <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">RSYNC_MODE</span><span class="token operator">=</span>master <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">RSYNC_USER</span><span class="token operator">=</span>hojrsync <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">RSYNC_PASSWORD</span><span class="token operator">=</span>hoj123456 <span class="token punctuation">\</span>
|
||||
-p <span class="token number">873</span>:873 <span class="token punctuation">\</span>
|
||||
--restart<span class="token operator">=</span>always <span class="token punctuation">\</span>
|
||||
hoj-rsync
|
||||
<span class="token comment"># registry.cn-shenzhen.aliyuncs.com/hcode/hoj_rsync:1.0</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div></li> <li><p>从服务器(Judgeserver所在的服务器)</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker run -d --name hoj-rsync <span class="token punctuation">\</span>
|
||||
-v ./hoj/testcase:/hoj/testcase <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">RSYNC_MODE</span><span class="token operator">=</span>slave <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">RSYNC_USER</span><span class="token operator">=</span>hojrsync <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">RSYNC_PASSWORD</span><span class="token operator">=</span>hoj123456 <span class="token punctuation">\</span>
|
||||
-e <span class="token assign-left variable">RSYNC_MASTER_ADDR</span><span class="token operator">=</span>master_server_ip <span class="token punctuation">\</span>
|
||||
-p <span class="token number">873</span>:873 <span class="token punctuation">\</span>
|
||||
--restart<span class="token operator">=</span>always <span class="token punctuation">\</span>
|
||||
hoj-rsync
|
||||
<span class="token comment"># registry.cn-shenzhen.aliyuncs.com/hcode/hoj_rsync:1.0</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div></li></ul> <p>docker-compose启动</p> <ul><li><p>主服务器(Backend所在服务器)</p> <div class="language-yaml line-numbers-mode"><pre class="language-yaml"><code><span class="token key atrule">version</span><span class="token punctuation">:</span> <span class="token string">"3"</span>
|
||||
<span class="token key atrule">services</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">hoj-rsync-master</span><span class="token punctuation">:</span>
|
||||
<span class="token comment"># image: registry.cn-shenzhen.aliyuncs.com/hcode/hoj_rsync:1.0</span>
|
||||
<span class="token key atrule">image</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>rsync
|
||||
<span class="token key atrule">container_name</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>rsync<span class="token punctuation">-</span>master
|
||||
<span class="token key atrule">volumes</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> ./hoj/testcase<span class="token punctuation">:</span>/hoj/testcase<span class="token punctuation">:</span>ro
|
||||
<span class="token key atrule">environment</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> RSYNC_MODE=master <span class="token comment"># 当前为slave主服务</span>
|
||||
<span class="token punctuation">-</span> RSYNC_USER=hojrsync <span class="token comment"># 请勿修改</span>
|
||||
<span class="token punctuation">-</span> RSYNC_PASSWORD=hoj123456 <span class="token comment"># 请修改数据同步密码</span>
|
||||
<span class="token key atrule">ports</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> <span class="token string">"0.0.0.0:873:873"</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br></div></div></li> <li><p>从服务器(Judgeserver所在的服务器)</p> <div class="language-yaml line-numbers-mode"><pre class="language-yaml"><code><span class="token key atrule">version</span><span class="token punctuation">:</span> <span class="token string">"3"</span>
|
||||
<span class="token key atrule">services</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">hoj-rsync-slave</span><span class="token punctuation">:</span>
|
||||
<span class="token comment"># image: registry.cn-shenzhen.aliyuncs.com/hcode/hoj_rsync:1.0</span>
|
||||
<span class="token key atrule">image</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>rsync
|
||||
<span class="token key atrule">container_name</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>rsync<span class="token punctuation">-</span>slave
|
||||
<span class="token key atrule">restart</span><span class="token punctuation">:</span> always
|
||||
<span class="token key atrule">volumes</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> ./judge/test_case<span class="token punctuation">:</span>/hoj/testcase
|
||||
<span class="token punctuation">-</span> ./judge/log<span class="token punctuation">:</span>/hoj/log
|
||||
<span class="token key atrule">environment</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> RSYNC_MODE=slave <span class="token comment"># 当前为slave从服务</span>
|
||||
<span class="token punctuation">-</span> RSYNC_USER=hojrsync <span class="token comment"># 请勿修改</span>
|
||||
<span class="token punctuation">-</span> RSYNC_PASSWORD=hoj123456 <span class="token comment"># 与主服务器的rsync的密码一致</span>
|
||||
<span class="token punctuation">-</span> RSYNC_MASTER_ADDR=master_server_ip <span class="token comment"># 主服务器ip</span>
|
||||
<span class="token key atrule">ports</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> <span class="token string">"0.0.0.0:873:873"</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br></div></div></li></ul> <h3 id="文件介绍"><a href="#文件介绍" class="header-anchor">#</a> 文件介绍</h3> <h4 id="_1-rsync-conf"><a href="#_1-rsync-conf" class="header-anchor">#</a> 1. rsync.conf</h4> <p>主服务器的rsync配置文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>port <span class="token operator">=</span> <span class="token number">873</span>
|
||||
uid <span class="token operator">=</span> root
|
||||
gid <span class="token operator">=</span> root
|
||||
use <span class="token function">chroot</span> <span class="token operator">=</span> <span class="token function">yes</span>
|
||||
<span class="token builtin class-name">read</span> only <span class="token operator">=</span> <span class="token function">yes</span>
|
||||
log <span class="token function">file</span> <span class="token operator">=</span> /hoj/log/rsyncd.log
|
||||
<span class="token punctuation">[</span>testcase<span class="token punctuation">]</span>
|
||||
path <span class="token operator">=</span> /hoj/testcase/
|
||||
list <span class="token operator">=</span> <span class="token function">yes</span>
|
||||
auth <span class="token function">users</span> <span class="token operator">=</span> hojrsync
|
||||
secrets <span class="token function">file</span> <span class="token operator">=</span> /hoj/rsyncd/rsyncd.passwd
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><h4 id="_2-run-sh"><a href="#_2-run-sh" class="header-anchor">#</a> 2. run.sh</h4> <p>根据<code>$RSYNC_MODE</code>环境变量启动不同模式的rsync服务</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token shebang important">#!/usr/bin/bash</span>
|
||||
<span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token string">"<span class="token variable">$RSYNC_MODE</span>"</span> <span class="token operator">==</span> <span class="token string">"master"</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
|
||||
<span class="token builtin class-name">echo</span> <span class="token string">"<span class="token variable">$RSYNC_USER</span>:<span class="token variable">$RSYNC_PASSWORD</span>"</span> <span class="token operator">></span> /hoj/rsyncd/rsyncd_master.passwd
|
||||
<span class="token function">chmod</span> <span class="token number">600</span> /hoj/rsyncd/rsyncd_master.passwd
|
||||
<span class="token function">rsync</span> --daemon --config<span class="token operator">=</span>/hoj/rsyncd/rsyncd.conf
|
||||
<span class="token keyword">else</span>
|
||||
<span class="token builtin class-name">echo</span> <span class="token string">"<span class="token variable">$RSYNC_PASSWORD</span>"</span> <span class="token operator">></span> /hoj/rsyncd/rsyncd_slave.passwd
|
||||
<span class="token function">chmod</span> <span class="token number">600</span> /hoj/rsyncd/rsyncd_slave.passwd
|
||||
<span class="token keyword">while</span> <span class="token boolean">true</span>
|
||||
<span class="token keyword">do</span>
|
||||
<span class="token function">rsync</span> -avz --delete --progress --password-file<span class="token operator">=</span>/hoj/rsyncd/rsyncd_slave.passwd <span class="token variable">$RSYNC_USER</span>@<span class="token variable">$RSYNC_MASTER_ADDR</span>::testcase /hoj/testcase <span class="token operator">>></span> /hoj/log/rsync_slave.log
|
||||
<span class="token function">sleep</span> <span class="token number">100</span>
|
||||
<span class="token keyword">done</span>
|
||||
<span class="token keyword">fi</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br></div></div><h4 id="_3-dockerfile"><a href="#_3-dockerfile" class="header-anchor">#</a> 3. Dockerfile</h4> <div class="language-dockerfile line-numbers-mode"><pre class="language-dockerfile"><code><span class="token keyword">FROM</span> ubuntu<span class="token punctuation">:</span>18.04
|
||||
|
||||
<span class="token keyword">RUN</span> apt<span class="token punctuation">-</span>get update && apt<span class="token punctuation">-</span>get <span class="token punctuation">-</span>y install rsync
|
||||
|
||||
<span class="token keyword">RUN</span> mkdir <span class="token punctuation">-</span>p /hoj/rsyncd
|
||||
|
||||
<span class="token keyword">COPY</span> run.sh /hoj/rsyncd/run.sh
|
||||
|
||||
<span class="token keyword">COPY</span> rsyncd.conf /hoj/rsyncd/rsyncd.conf
|
||||
|
||||
<span class="token keyword">CMD</span> /bin/bash /hoj/rsyncd/run.sh
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/deploy/judgeserver.html" class="prev">
|
||||
判题服务部署
|
||||
</a></span> <span class="next"><a href="/docs/develop/">
|
||||
开发简介
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/16.39b5f0a9.js" defer></script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
|
@ -1,42 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>开发简介 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/17.8e0cb8c8.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>开发文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/develop/" aria-current="page" class="active sidebar-link">开发简介</a></li><li><a href="/docs/develop/db.html" class="sidebar-link">数据库说明</a></li><li><a href="/docs/develop/sandbox.html" class="sidebar-link">安全沙盒的调用</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="开发简介"><a href="#开发简介" class="header-anchor">#</a> 开发简介</h1> <ul><li>数据库表说明</li> <li>其它待续.......</li></ul></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/deploy/rsync.html" class="prev">
|
||||
评测数据同步
|
||||
</a></span> <span class="next"><a href="/docs/develop/db.html">
|
||||
数据库说明
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/17.8e0cb8c8.js" defer></script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 17 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.5 KiB |
|
@ -1,42 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/7.120c22d9.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container no-sidebar"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" aria-current="page" class="home-link router-link-exact-active router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>开始介绍</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/introducition/" class="sidebar-link">前言</a></li><li><a href="/docs/introducition/about.html" class="sidebar-link">简介</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main aria-labelledby="main-title" class="home"><header class="hero"><img src="/docs/img/logo.png" alt="hero"> <h1 id="main-title">
|
||||
HOJ
|
||||
</h1> <p class="description">
|
||||
基于分布式、前后端分离的高性能在线评测系统
|
||||
</p> <p class="action"><a href="/docs/introducition/" class="nav-link action-button">
|
||||
快速了解 →
|
||||
</a></p></header> <div class="features"><div class="feature"><h2>分布式</h2> <p>支持多台判题服务随时增减</p></div><div class="feature"><h2>高效化</h2> <p>采用前后端分离,开发迅速,使用高性能可复用判题沙盒</p></div><div class="feature"><h2>定制化</h2> <p>网站高度集中配置,支持定制化修改</p></div><div class="feature"><h2>安全化</h2> <p>判题使用 cgroup 隔离用户程序,网站权限控制完善</p></div><div class="feature"><h2>多样化</h2> <p>独有自身判题服务,同时支持其它知名OJ题目的提交判题</p></div></div> <div class="theme-default-content custom content__default"></div> <div class="footer">
|
||||
MIT Licensed | Copyright © 2021.06.14 @Author Himit_ZH QQ Group:598587305
|
||||
</div></main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/7.120c22d9.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,43 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>简介 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/21.3dac3195.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>开始介绍</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/introducition/" aria-current="page" class="sidebar-link">前言</a></li><li><a href="/docs/introducition/about.html" aria-current="page" class="active sidebar-link">简介</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/introducition/about.html#技术选型" class="sidebar-link">技术选型</a></li><li class="sidebar-sub-header"><a href="/docs/introducition/about.html#判题逻辑" class="sidebar-link">判题逻辑</a></li></ul></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>使用文档</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="简介"><a href="#简介" class="header-anchor">#</a> 简介</h1> <h2 id="技术选型"><a href="#技术选型" class="header-anchor">#</a> 技术选型</h2> <blockquote><p>基于Springcloud 和Vue.js的前后端分离的分布式在线评测系统</p></blockquote> <ul><li><p>前端:</p> <ul><li>技术以Vue为主,element-ui为主要框架,网站风格样式模仿qdoj</li> <li>支持手机端,响应式布局</li> <li>以CodeMirror作为在线代码编辑器</li> <li>以Mavon-Editor作为富文本编辑器</li> <li>支持用户头像上传,可选择性获取用户Codeforces分数</li> <li>定时获取例如Codeforces等其它知名OJ的近期比赛数据</li> <li>当前支持HDU的Virtual Judge(远程虚拟判题)与题目获取</li> <li>题目支持特别判题</li> <li>题目支持可选择性去除提交代码的末尾空白符(会影响CE判定)</li> <li>题目支持可选择性允许用户查看各个测试点结果(状态,运行时间,运行空间,OI题目的测试点得分),暂不支持测试点数据公开。</li> <li>题目讨论</li> <li>管理后台支持题目数据以ZIP上传或手动输入上传</li> <li>管理后台支持监控服务系统的状态及各判题服务的状态</li> <li>管理后台支持动态修改网站配置,例如邮件系统配置,数据库配置等</li> <li>比赛支持封榜,支持ACM与OI模式</li> <li>比赛支持私有赛(需要密码才可查看与提交),保护赛(每个用户都可查看,提交需要密码),公开赛(每个用户都可查看与提交)三种模式</li> <li>用户提交失败时可重新提交,管理员支持提交重判与比赛题目所有提交重判</li> <li>公共讨论区</li> <li>比赛讨论</li></ul></li> <li><p>后端:</p> <ul><li>Web框架技术以Springboot为主</li> <li>以Nacos为分布式注册中心及分布式配置中心,支持配置文件动态刷新,支持判题服务Ribbon的负载均衡</li> <li>以Mybatis-Plus为数据库中间件,负责数据实体类与数据库数据的转化与获取。</li> <li>以Jsoup为爬虫框架,负责远程虚拟OJ的题目获取及提交结果获取,同时定时获取各用户的Codeforces分数以及其它知名OJ的近期比赛。</li> <li>以Shiro为安全框架,支持用户角色权限管理,支持token刷新</li> <li>以redis的发布订阅者作为判题服务的消息提醒,以此调用判题服务</li> <li>后端分为数据后台服务(DataBackup)及判题服务(JudgeServer)
|
||||
<ul><li><p>数据后台服务:负责提供接口,提供相关数据给前端等</p></li> <li><p>判题服务:只负责获取数据后台服务传输过来的判题的提交,调用VJ判题或调用判题机(Go-Judge)进行评测,将对应结果写回数据库</p></li></ul></li></ul></li> <li><p>判题机:</p> <ul><li>支持HDU的VJ判题</li> <li>支持Codefoces的VJ判题</li> <li>以HttpAPI的形式调用Go-Jugde(高性能可复用的判题沙盒)判题安全沙盒进行提交程序的评测(调用线程池多线程跑评测)</li></ul></li> <li><p>数据库</p> <ul><li>Mysql</li></ul></li> <li><p>缓存中间件</p> <ul><li>Redis</li></ul></li></ul> <blockquote><p>HOJ基本逻辑架构图</p></blockquote> <p><img src="https://cdn.jsdelivr.net/gh/HimitZH/CDN/images/hoj.png" alt="image-20201030234527577"></p> <h2 id="判题逻辑"><a href="#判题逻辑" class="header-anchor">#</a> 判题逻辑</h2> <ol><li><p>前端用户提交数据。</p></li> <li><p>后端数据服务(DataBackup)获取到数据,先将提交数据初始化,同时将该提交的状态变成等待中,写入数据库。</p></li> <li><p>通过Redis,写入<strong>等待判题队列</strong></p></li> <li><p>调用work处理者,初始化传输数据,使用springcloud alibaba通过nacos注册中心调用判题微服务。</p></li> <li><p>若是调用判题服务失败(没有空闲的判题服务器),则重新通过发布者将该提交信息发布到对应<strong>等待判题队列</strong>,重回3。</p></li> <li><p>若是调用失败超过30次,则将提交的状态修改为提交失败,不再进行判题服务的调用。</p></li> <li><p>前端用户可看到提交变成提交失败,可点击状态进行重新提交,重回2(注:重新提交不影响提交时间等数据)</p></li> <li><p>判题微服务获取到提交数据:</p> <ul><li><p>若是远程调用,进行远程提交,获取对应的提交ID,若是获取失败则判为提交失败,若是获取成功,就启用线程定时器每2秒根据提交ID获取判题结果。</p> <p>定时尝试30次,获取成功,写回数据库,获取失败就修改此次提交为提交失败。</p></li> <li><p>若是自家题目提交,则启用线程池多线程使用Http将对应测试点数据与代码提交给Go-Judge判题沙盒进行编译与评测,最后获取各个评测点结果,进行结果计算写回数据库。</p></li></ul></li></ol></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/introducition/" class="prev router-link-active">
|
||||
前言
|
||||
</a></span> <span class="next"><a href="/docs/deploy/">
|
||||
环境配置
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/21.3dac3195.js" defer></script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,42 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>评论管理 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/25.69a7c9d2.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>使用文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/use/" aria-current="page" class="sidebar-link">使用简介</a></li><li><a href="/docs/use/testcase.html" class="sidebar-link">测试用例</a></li><li><a href="/docs/use/contest.html" class="sidebar-link">比赛介绍</a></li><li><a href="/docs/use/import-problem.html" class="sidebar-link">题目管理</a></li><li><a href="/docs/use/import-user.html" class="sidebar-link">导入用户</a></li><li><a href="/docs/use/admin-user.html" class="sidebar-link">用户管理</a></li><li><a href="/docs/use/discussion-admin.html" aria-current="page" class="active sidebar-link">评论管理</a></li><li><a href="/docs/use/multi-judgeserver.html" class="sidebar-link">多个判题机</a></li><li><a href="/docs/use/update-fe.html" class="sidebar-link">自定义前端</a></li><li><a href="/docs/use/spj.html" class="sidebar-link">特殊判题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="评论管理"><a href="#评论管理" class="header-anchor">#</a> 评论管理</h1> <p><img src="https://img-blog.csdnimg.cn/20210523223605573.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述"></p> <ul><li><p>后台管理员可以查看所有的讨论帖,并且可以选择是否置顶,是否正常显示,删除,查看等</p></li> <li><p>后台管理员可以查看对应讨论帖的举报内容</p> <p><img src="https://img-blog.csdnimg.cn/20210523221321418.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p></li></ul></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/use/admin-user.html" class="prev">
|
||||
用户管理
|
||||
</a></span> <span class="next"><a href="/docs/use/multi-judgeserver.html">
|
||||
多个判题机
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/25.69a7c9d2.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,113 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>题目管理 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/26.02331534.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>使用文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/use/" aria-current="page" class="sidebar-link">使用简介</a></li><li><a href="/docs/use/testcase.html" class="sidebar-link">测试用例</a></li><li><a href="/docs/use/contest.html" class="sidebar-link">比赛介绍</a></li><li><a href="/docs/use/import-problem.html" aria-current="page" class="active sidebar-link">题目管理</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/use/import-problem.html#一、hoj题目" class="sidebar-link">一、HOJ题目</a></li><li class="sidebar-sub-header"><a href="/docs/use/import-problem.html#二、导入qdoj的题目" class="sidebar-link">二、导入qdoj的题目</a></li><li class="sidebar-sub-header"><a href="/docs/use/import-problem.html#三、导入其它oj题目" class="sidebar-link">三、导入其它OJ题目</a></li></ul></li><li><a href="/docs/use/import-user.html" class="sidebar-link">导入用户</a></li><li><a href="/docs/use/admin-user.html" class="sidebar-link">用户管理</a></li><li><a href="/docs/use/discussion-admin.html" class="sidebar-link">评论管理</a></li><li><a href="/docs/use/multi-judgeserver.html" class="sidebar-link">多个判题机</a></li><li><a href="/docs/use/update-fe.html" class="sidebar-link">自定义前端</a></li><li><a href="/docs/use/spj.html" class="sidebar-link">特殊判题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="题目管理"><a href="#题目管理" class="header-anchor">#</a> 题目管理</h1> <h2 id="一、hoj题目"><a href="#一、hoj题目" class="header-anchor">#</a> 一、HOJ题目</h2> <p><img src="https://img-blog.csdnimg.cn/20210530214011773.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p> <h4 id="_1-导出题目"><a href="#_1-导出题目" class="header-anchor">#</a> 1. 导出题目</h4> <p>点击选择需要的题目,便可以批量导出成一个zip压缩包,分别对应一个json格式的题目数据,一个对应名字的文件夹存放评测数据文件,具体的文件结构如下:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>+-- problem_1000.json
|
||||
+-- problem_1000
|
||||
| +-- 1.in
|
||||
| +-- 1.out
|
||||
| +-- ....
|
||||
+-- problem_1001.json
|
||||
+-- problem_1001
|
||||
| +-- 1.in
|
||||
| +-- 1.out
|
||||
| +-- ....
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><h4 id="_2-导入题目"><a href="#_2-导入题目" class="header-anchor">#</a> 2. 导入题目</h4> <p>选择需要导入的题目数据zip压缩包,注意<strong>不要多一层文件夹进行压缩</strong>,<strong>请保证题目json文件的名字与其对应的存放评测数据的文件夹名字一致</strong>,具体文件格式如下:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>+-- problem_1000.json
|
||||
+-- problem_1000
|
||||
| +-- 1.in
|
||||
| +-- 1.out
|
||||
| +-- ....
|
||||
+-- problem_1001.json
|
||||
+-- problem_1001
|
||||
| +-- 1.in
|
||||
| +-- 1.out
|
||||
| +-- ....
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><h4 id="_3-题目的json文件格式"><a href="#_3-题目的json文件格式" class="header-anchor">#</a> 3. 题目的json文件格式</h4> <p>请严格按照以下格式,才可以正常导入。</p> <div class="language-json line-numbers-mode"><pre class="language-json"><code><span class="token punctuation">{</span>
|
||||
<span class="token comment">// 题目支持的语言如下,可增加与减少</span>
|
||||
<span class="token property">"languages"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">"C"</span><span class="token punctuation">,</span> <span class="token string">"C++"</span><span class="token punctuation">,</span> <span class="token string">"Java"</span><span class="token punctuation">,</span> <span class="token string">"Python3"</span><span class="token punctuation">,</span> <span class="token string">"Python2"</span><span class="token punctuation">,</span> <span class="token string">"Golang"</span><span class="token punctuation">,</span> <span class="token string">"C#"</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"samples"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
|
||||
<span class="token punctuation">{</span>
|
||||
<span class="token property">"output"</span><span class="token operator">:</span> <span class="token string">"1.in"</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"input"</span><span class="token operator">:</span> <span class="token string">"1.out"</span><span class="token punctuation">,</span>
|
||||
<span class="token comment">//"score": 10 // 如果是io题目需要给测试点加得分</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
<span class="token punctuation">{</span>
|
||||
<span class="token property">"output"</span><span class="token operator">:</span> <span class="token string">"2.in"</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"input"</span><span class="token operator">:</span> <span class="token string">"2.out"</span><span class="token punctuation">,</span>
|
||||
<span class="token comment">//"score": 10 // 如果是io题目需要给测试点加得分</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">]</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"tags"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">"测试题"</span><span class="token punctuation">,</span><span class="token string">"测试"</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token comment">// 题目标签,一般不超过三个 </span>
|
||||
<span class="token property">"problem"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
<span class="token property">"auth"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token comment">// 1 公开赛</span>
|
||||
<span class="token property">"author"</span><span class="token operator">:</span> <span class="token string">"admin"</span><span class="token punctuation">,</span> <span class="token comment">// 题目上传的作者,请使用用户名</span>
|
||||
<span class="token property">"isRemote"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 均为非VJ题目,不用修改</span>
|
||||
<span class="token property">"problemId"</span><span class="token operator">:</span> <span class="token string">"HOJ-1010"</span><span class="token punctuation">,</span> <span class="token comment">// 题目的展示id</span>
|
||||
<span class="token property">"description"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> <span class="token comment">// 题目的描述,支持markdown语法</span>
|
||||
<span class="token property">"source"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> <span class="token comment">// 题目来源</span>
|
||||
<span class="token property">"title"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> <span class="token comment">// 题目标题</span>
|
||||
<span class="token property">"type"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token comment">// 0为ACM题目,1为OI题目</span>
|
||||
<span class="token property">"timeLimit"</span><span class="token operator">:</span> <span class="token number">1000</span><span class="token punctuation">,</span> <span class="token comment">// 时间限制 单位是ms</span>
|
||||
<span class="token property">"memoryLimit"</span><span class="token operator">:</span> <span class="token number">256</span><span class="token punctuation">,</span> <span class="token comment">// 空间限制 单位是mb</span>
|
||||
<span class="token property">"input"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> <span class="token comment">// 题目的输入描述</span>
|
||||
<span class="token property">"output"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> <span class="token comment">// 题目的输出描述</span>
|
||||
<span class="token property">"difficulty"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> <span class="token comment">// 题目难度,1为简单,2为中等,3为困难</span>
|
||||
<span class="token property">"examples"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> <span class="token comment">// 题目的题面样例,格式为<input>输入</input><output>输出</output><input>输入</input><output>输出</output></span>
|
||||
<span class="token property">"ioScore"</span><span class="token operator">:</span> <span class="token number">100</span><span class="token punctuation">,</span> <span class="token comment">// OI题目总得分,与测试点总分一致</span>
|
||||
<span class="token property">"codeShare"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 该题目是否允许用户共享其提交的代码 </span>
|
||||
<span class="token property">"hint"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> <span class="token comment">// 题目提示</span>
|
||||
<span class="token property">"isRemoveEndBlank"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 评测数据的输出是否自动去掉行末空格</span>
|
||||
<span class="token property">"openCaseResult"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token comment">// 是否允许用户看到各个评测点的结果</span>
|
||||
<span class="token comment">// "spjLanguage:"C" // 特殊判题的程序代码语言</span>
|
||||
<span class="token comment">// "spjCode":"" // 特殊判题的代码</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"isSpj"</span><span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment">// 是否为特殊判题</span>
|
||||
<span class="token property">"codeTemplates"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
|
||||
<span class="token punctuation">{</span>
|
||||
<span class="token property">"code"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> <span class="token comment">// 模板代码</span>
|
||||
<span class="token property">"language"</span><span class="token operator">:</span> <span class="token string">"C"</span> <span class="token comment">// 模板代码语言</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
<span class="token punctuation">{</span>
|
||||
<span class="token property">"code"</span><span class="token operator">:</span> <span class="token string">""</span><span class="token punctuation">,</span> <span class="token comment">// 模板代码</span>
|
||||
<span class="token property">"language"</span><span class="token operator">:</span> <span class="token string">"C++"</span><span class="token comment">// 模板代码语言</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br></div></div><h2 id="二、导入qdoj的题目"><a href="#二、导入qdoj的题目" class="header-anchor">#</a> 二、导入qdoj的题目</h2> <p>请严格按照青岛oj的后台导出的压缩文件来上传。</p> <p><img src="https://img-blog.csdnimg.cn/20210530212411781.png" alt="在这里插入图片描述"></p> <h2 id="三、导入其它oj题目"><a href="#三、导入其它oj题目" class="header-anchor">#</a> 三、导入其它OJ题目</h2> <p>导入HDU、Codeforces题目,只需提供该题目的题号便可一键导入</p> <p><strong>管理员进入后台,点击题目列表</strong></p> <p><img src="https://img-blog.csdnimg.cn/20210523223454472.png#pic_center" alt="在这里插入图片描述"></p> <p>然后添加上方的添加按钮</p> <p><img src="https://img-blog.csdnimg.cn/20210523222914722.png" alt="在这里插入图片描述"></p> <p><strong>在弹出窗中选择OJ名字及题号,便可导入</strong></p> <p><img src="https://img-blog.csdnimg.cn/20210523223042100.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p> <p><strong>注意:</strong></p> <ul><li>HDU的题号一般是 1000以上的数字</li> <li>Codeforces的题号是1000A、1000B、这种数字加大写英文字母的格式</li></ul></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/use/contest.html" class="prev">
|
||||
比赛介绍
|
||||
</a></span> <span class="next"><a href="/docs/use/import-user.html">
|
||||
导入用户
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/26.02331534.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,42 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>导入用户 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/27.53a876b4.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>使用文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/use/" aria-current="page" class="sidebar-link">使用简介</a></li><li><a href="/docs/use/testcase.html" class="sidebar-link">测试用例</a></li><li><a href="/docs/use/contest.html" class="sidebar-link">比赛介绍</a></li><li><a href="/docs/use/import-problem.html" class="sidebar-link">题目管理</a></li><li><a href="/docs/use/import-user.html" aria-current="page" class="active sidebar-link">导入用户</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/use/import-user.html#导入用户" class="sidebar-link">导入用户</a></li></ul></li><li><a href="/docs/use/admin-user.html" class="sidebar-link">用户管理</a></li><li><a href="/docs/use/discussion-admin.html" class="sidebar-link">评论管理</a></li><li><a href="/docs/use/multi-judgeserver.html" class="sidebar-link">多个判题机</a></li><li><a href="/docs/use/update-fe.html" class="sidebar-link">自定义前端</a></li><li><a href="/docs/use/spj.html" class="sidebar-link">特殊判题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h2 id="导入用户"><a href="#导入用户" class="header-anchor">#</a> 导入用户</h2> <p><img src="https://img-blog.csdnimg.cn/2021052322072728.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p> <p>要求如下:</p> <ol><li><p>用户数据导入仅支持csv格式的用户数据。</p></li> <li><p>共三列数据: 用户名,密码,邮箱,任一列不能为空,否则该行数据可能导入失败。</p></li> <li><p>第一行不必写(“用户名”,“密码”,“邮箱”)这三个列名。</p></li> <li><p>请导入保存为UTF-8编码的文件,否则中文可能会乱码。</p></li></ol></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/use/import-problem.html" class="prev">
|
||||
题目管理
|
||||
</a></span> <span class="next"><a href="/docs/use/admin-user.html">
|
||||
用户管理
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/27.53a876b4.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,42 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>使用简介 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/22.2e9ffb3f.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>使用文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/use/" aria-current="page" class="active sidebar-link">使用简介</a></li><li><a href="/docs/use/testcase.html" class="sidebar-link">测试用例</a></li><li><a href="/docs/use/contest.html" class="sidebar-link">比赛介绍</a></li><li><a href="/docs/use/import-problem.html" class="sidebar-link">题目管理</a></li><li><a href="/docs/use/import-user.html" class="sidebar-link">导入用户</a></li><li><a href="/docs/use/admin-user.html" class="sidebar-link">用户管理</a></li><li><a href="/docs/use/discussion-admin.html" class="sidebar-link">评论管理</a></li><li><a href="/docs/use/multi-judgeserver.html" class="sidebar-link">多个判题机</a></li><li><a href="/docs/use/update-fe.html" class="sidebar-link">自定义前端</a></li><li><a href="/docs/use/spj.html" class="sidebar-link">特殊判题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="使用简介"><a href="#使用简介" class="header-anchor">#</a> 使用简介</h1> <ul><li>测试数据的介绍</li> <li>比赛的介绍</li> <li>导入题目的介绍</li> <li>导入用户的介绍</li> <li>讨论管理的介绍</li> <li>特殊判题的程序例子</li> <li>其它待续......</li></ul></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/develop/sandbox.html" class="prev">
|
||||
安全沙盒的调用
|
||||
</a></span> <span class="next"><a href="/docs/use/testcase.html">
|
||||
测试用例
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/22.2e9ffb3f.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,114 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>多个判题机 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/28.22b57d4d.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>使用文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/use/" aria-current="page" class="sidebar-link">使用简介</a></li><li><a href="/docs/use/testcase.html" class="sidebar-link">测试用例</a></li><li><a href="/docs/use/contest.html" class="sidebar-link">比赛介绍</a></li><li><a href="/docs/use/import-problem.html" class="sidebar-link">题目管理</a></li><li><a href="/docs/use/import-user.html" class="sidebar-link">导入用户</a></li><li><a href="/docs/use/admin-user.html" class="sidebar-link">用户管理</a></li><li><a href="/docs/use/discussion-admin.html" class="sidebar-link">评论管理</a></li><li><a href="/docs/use/multi-judgeserver.html" aria-current="page" class="active sidebar-link">多个判题机</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/use/multi-judgeserver.html#前言" class="sidebar-link">前言</a></li><li class="sidebar-sub-header"><a href="/docs/use/multi-judgeserver.html#单体部署" class="sidebar-link">单体部署</a></li><li class="sidebar-sub-header"><a href="/docs/use/multi-judgeserver.html#分布式部署" class="sidebar-link">分布式部署</a></li></ul></li><li><a href="/docs/use/update-fe.html" class="sidebar-link">自定义前端</a></li><li><a href="/docs/use/spj.html" class="sidebar-link">特殊判题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="多个判题机"><a href="#多个判题机" class="header-anchor">#</a> 多个判题机</h1> <h2 id="前言"><a href="#前言" class="header-anchor">#</a> 前言</h2> <p>不同判题机之间是通过rsync进行数据同步的,所以需要配置相应的rsync服务。</p> <p>同时注意以下两点:</p> <ol><li>保证rsync-slave服务的密码与主服务rsync-master的数据同步密码一致</li> <li>rsync-slave服务(判题机服务器)拉取主服务rsync-master的评测数据是每100s一次,所以后台上传评测数据后,需等待大概100s才能正常判题。</li></ol> <h2 id="单体部署"><a href="#单体部署" class="header-anchor">#</a> 单体部署</h2> <p>如果之前是选择了单体部署,也就是主服务器既有backend和judgeserver服务,那么部署更多不同服务器的判题机应该如下修改:</p> <ol><li><p>在原先运行的服务器上,修改<code>hoj-deploy/standAlone</code>文件夹里面的<code>docker-compose.yml</code>,<strong>添加以下rsync-master服务</strong>,数据同步密码请自行修改,如下:</p> <p><strong>(注意:如果云服务器有防火墙请开启8848,3306,873端口)</strong></p> <div class="language-yaml line-numbers-mode"><pre class="language-yaml"><code><span class="token key atrule">hoj-rsync-master</span><span class="token punctuation">:</span>
|
||||
<span class="token key atrule">image</span><span class="token punctuation">:</span> registry.cn<span class="token punctuation">-</span>shenzhen.aliyuncs.com/hcode/hoj_rsync<span class="token punctuation">:</span><span class="token number">1.0</span>
|
||||
<span class="token key atrule">container_name</span><span class="token punctuation">:</span> hoj<span class="token punctuation">-</span>rsync<span class="token punctuation">-</span>master
|
||||
<span class="token key atrule">volumes</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> ./hoj/testcase<span class="token punctuation">:</span>/hoj/testcase<span class="token punctuation">:</span>ro
|
||||
<span class="token key atrule">environment</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> RSYNC_MODE=master
|
||||
<span class="token punctuation">-</span> RSYNC_USER=hojrsync
|
||||
<span class="token punctuation">-</span> RSYNC_PASSWORD=hoj123456 <span class="token comment"># 请修改数据同步密码</span>
|
||||
<span class="token key atrule">ports</span><span class="token punctuation">:</span>
|
||||
<span class="token punctuation">-</span> <span class="token string">"0.0.0.0:873:873"</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div></li> <li><p>在其它服务器(判题机服务器)中使用docker-compose运行judgeserver服务,具体操作如下:</p> <p><strong>(注意:如果云服务器有防火墙请开启8088端口号,需要将判题服务暴露出去)</strong></p> <ol><li><p>下载文件,进入到指定文件夹</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">git</span> clone https://gitee.com/himitzh0730/hoj-deploy.git <span class="token operator">&&</span> <span class="token builtin class-name">cd</span> hoj-deploy/distributed/judgeserver
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>修改配置<code>.env</code>文件,里面的nacos参数,judgeServer,rsync的参数请正确修改!</p> <div class="language-properties line-numbers-mode"><pre class="language-properties"><code><span class="token comment"># nacos的配置</span>
|
||||
<span class="token comment"># 修改为nacos所在服务的ip</span>
|
||||
<span class="token attr-name">NACOS_HOST</span><span class="token punctuation">=</span><span class="token attr-value">NACOS_HOST</span>
|
||||
<span class="token comment"># 修改为nacos启动端口号,默认为8848</span>
|
||||
<span class="token attr-name">NACOS_PORT</span><span class="token punctuation">=</span><span class="token attr-value">8848</span>
|
||||
<span class="token comment"># 修改为nacos的管理员账号</span>
|
||||
<span class="token attr-name">NACOS_USERNAME</span><span class="token punctuation">=</span><span class="token attr-value">root</span>
|
||||
<span class="token comment"># 修改为nacos的管理员密码</span>
|
||||
<span class="token attr-name">NACOS_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456</span>
|
||||
|
||||
<span class="token comment"># judgeserver的配置</span>
|
||||
<span class="token comment">#修改为当前服务器公网ip</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_IP</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.7</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_PORT</span><span class="token punctuation">=</span><span class="token attr-value">8088</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_NAME</span><span class="token punctuation">=</span><span class="token attr-value">judger-1</span>
|
||||
<span class="token comment"># -1表示最大并行任务数为cpu核心数*2</span>
|
||||
<span class="token attr-name">MAX_TASK_NUM</span><span class="token punctuation">=</span><span class="token attr-value">-1</span>
|
||||
<span class="token comment"># 当前判题服务器是否开启远程虚拟判题功能</span>
|
||||
<span class="token attr-name">REMOTE_JUDGE_OPEN</span><span class="token punctuation">=</span><span class="token attr-value">true</span>
|
||||
<span class="token comment"># -1表示最大并行任务数为(cpu核心数*2)*2</span>
|
||||
<span class="token attr-name">REMOTE_JUDGE_MAX_TASK_NUM</span><span class="token punctuation">=</span><span class="token attr-value">-1</span>
|
||||
|
||||
<span class="token comment"># rsync评测数据同步的配置</span>
|
||||
<span class="token comment"># 写入主服务器ip</span>
|
||||
<span class="token attr-name">RSYNC_MASTER_ADDR</span><span class="token punctuation">=</span><span class="token attr-value">127.0.0.1</span>
|
||||
<span class="token comment"># 与主服务器的rsync密码一致</span>
|
||||
<span class="token attr-name">RSYNC_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br></div></div></li> <li><p>启动即可</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker-compose up -d
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li> <li><p>验证:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>访问 http://ip:8088/version
|
||||
如果返回信息正常即启动成功!
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></li></ol></li></ol> <h2 id="分布式部署"><a href="#分布式部署" class="header-anchor">#</a> 分布式部署</h2> <ol><li><p>如果之前已经选择了分布式部署,那么增加判题机,则与原先启动判题机的操作一样即可,在新的服务器上操作如下:</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">git</span> clone https://gitee.com/himitzh0730/hoj-deploy.git <span class="token operator">&&</span> <span class="token builtin class-name">cd</span> hoj-deploy/distributed/judgeserver
|
||||
<span class="token function">vim</span> .env
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div></li> <li><p>修改<code>.env</code>的配置</p> <div class="language-properties line-numbers-mode"><pre class="language-properties"><code><span class="token comment"># nacos的配置</span>
|
||||
<span class="token comment"># 修改为nacos所在服务的ip</span>
|
||||
<span class="token attr-name">NACOS_HOST</span><span class="token punctuation">=</span><span class="token attr-value">NACOS_HOST</span>
|
||||
<span class="token comment"># 修改为nacos启动端口号,默认为8848</span>
|
||||
<span class="token attr-name">NACOS_PORT</span><span class="token punctuation">=</span><span class="token attr-value">8848</span>
|
||||
<span class="token comment"># 修改为nacos的管理员账号</span>
|
||||
<span class="token attr-name">NACOS_USERNAME</span><span class="token punctuation">=</span><span class="token attr-value">root</span>
|
||||
<span class="token comment"># 修改为nacos的管理员密码</span>
|
||||
<span class="token attr-name">NACOS_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456</span>
|
||||
|
||||
<span class="token comment"># judgeserver的配置</span>
|
||||
<span class="token comment">#修改为当前服务器公网ip</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_IP</span><span class="token punctuation">=</span><span class="token attr-value">172.20.0.7</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_PORT</span><span class="token punctuation">=</span><span class="token attr-value">8088</span>
|
||||
<span class="token attr-name">JUDGE_SERVER_NAME</span><span class="token punctuation">=</span><span class="token attr-value">judger-1</span>
|
||||
<span class="token comment"># -1表示最大并行任务数为cpu核心数*2</span>
|
||||
<span class="token attr-name">MAX_TASK_NUM</span><span class="token punctuation">=</span><span class="token attr-value">-1</span>
|
||||
<span class="token comment"># 当前判题服务器是否开启远程虚拟判题功能</span>
|
||||
<span class="token attr-name">REMOTE_JUDGE_OPEN</span><span class="token punctuation">=</span><span class="token attr-value">true</span>
|
||||
<span class="token comment"># -1表示最大并行任务数为(cpu核心数*2)*2</span>
|
||||
<span class="token attr-name">REMOTE_JUDGE_MAX_TASK_NUM</span><span class="token punctuation">=</span><span class="token attr-value">-1</span>
|
||||
|
||||
<span class="token comment"># rsync评测数据同步的配置</span>
|
||||
<span class="token comment"># 写入主服务器ip</span>
|
||||
<span class="token attr-name">RSYNC_MASTER_ADDR</span><span class="token punctuation">=</span><span class="token attr-value">127.0.0.1</span>
|
||||
<span class="token comment"># 与主服务器的rsync密码一致</span>
|
||||
<span class="token attr-name">RSYNC_PASSWORD</span><span class="token punctuation">=</span><span class="token attr-value">hoj123456</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br></div></div></li> <li><p>修改完保存,启动即可。</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code>docker-compose up -d
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></li></ol></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/use/discussion-admin.html" class="prev">
|
||||
评论管理
|
||||
</a></span> <span class="next"><a href="/docs/use/update-fe.html">
|
||||
自定义前端
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/28.22b57d4d.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,78 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>特殊判题 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/29.87a95cdc.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>使用文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/use/" aria-current="page" class="sidebar-link">使用简介</a></li><li><a href="/docs/use/testcase.html" class="sidebar-link">测试用例</a></li><li><a href="/docs/use/contest.html" class="sidebar-link">比赛介绍</a></li><li><a href="/docs/use/import-problem.html" class="sidebar-link">题目管理</a></li><li><a href="/docs/use/import-user.html" class="sidebar-link">导入用户</a></li><li><a href="/docs/use/admin-user.html" class="sidebar-link">用户管理</a></li><li><a href="/docs/use/discussion-admin.html" class="sidebar-link">评论管理</a></li><li><a href="/docs/use/multi-judgeserver.html" class="sidebar-link">多个判题机</a></li><li><a href="/docs/use/update-fe.html" class="sidebar-link">自定义前端</a></li><li><a href="/docs/use/spj.html" aria-current="page" class="active sidebar-link">特殊判题</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/use/spj.html#什么是特殊判题" class="sidebar-link">什么是特殊判题?</a></li><li class="sidebar-sub-header"><a href="/docs/use/spj.html#使用场景" class="sidebar-link">使用场景</a></li><li class="sidebar-sub-header"><a href="/docs/use/spj.html#例子" class="sidebar-link">例子:</a></li></ul></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="特殊判题"><a href="#特殊判题" class="header-anchor">#</a> 特殊判题</h1> <h2 id="什么是特殊判题"><a href="#什么是特殊判题" class="header-anchor">#</a> 什么是特殊判题?</h2> <p>特殊判题(Special Judge)是指OJ将使用一个特定的程序来判断提交的程序的输出是不是正确的,而不是单纯地看提交的程序的输出是否和标准输出一模一样。</p> <h2 id="使用场景"><a href="#使用场景" class="header-anchor">#</a> 使用场景</h2> <p>一般使用Special Judge都是因为题目的答案不唯一,更具体一点说的话一般是两种情况:</p> <ul><li>题目最终要求输出一个解决方案,而且这个解决方案可能不唯一。</li> <li>题目最终要求输出一个浮点数,而且会告诉只要答案和标准答案相差不超过某个较小的数就可以,比如0.01。这种情况保留3位小数、4位小数等等都是可以的,而且多保留几位小数也没什么坏处。</li></ul> <h2 id="例子"><a href="#例子" class="header-anchor">#</a> 例子:</h2> <p>在创建题目的适合,选择开启特殊判题,编写特殊判题程序,然后编译通过便可。</p> <p><strong>注意:用户的输出数据以stdin流输入道spj程序里面,也就是可以直接用scanf或cin等获取用户的输出数据,具体形式跟用户程序的输入数据获取一样。</strong></p> <blockquote><p>后台对题目使用特殊判题时,请参考以下程序例子 判断精度</p></blockquote> <div class="language-cpp line-numbers-mode"><pre class="language-cpp"><code><span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span><span class="token string"><iostream></span></span>
|
||||
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">include</span><span class="token string"><cstdio></span></span>
|
||||
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">define</span> <span class="token macro-name">AC</span> <span class="token expression"><span class="token number">100</span></span></span>
|
||||
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">define</span> <span class="token macro-name">WA</span> <span class="token expression"><span class="token number">101</span></span></span>
|
||||
<span class="token macro property"><span class="token directive-hash">#</span><span class="token directive keyword">define</span> <span class="token macro-name">ERROR</span> <span class="token expression"><span class="token number">102</span></span></span>
|
||||
<span class="token keyword">using</span> <span class="token keyword">namespace</span> std<span class="token punctuation">;</span>
|
||||
|
||||
|
||||
<span class="token keyword">int</span> <span class="token function">spj</span><span class="token punctuation">(</span><span class="token keyword">int</span> user_output<span class="token punctuation">,</span> FILE <span class="token operator">*</span>output<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
|
||||
<span class="token keyword">void</span> <span class="token function">close_file</span><span class="token punctuation">(</span>FILE <span class="token operator">*</span>f<span class="token punctuation">)</span><span class="token punctuation">{</span>
|
||||
<span class="token keyword">if</span><span class="token punctuation">(</span>f <span class="token operator">!=</span> <span class="token constant">NULL</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
|
||||
<span class="token function">fclose</span><span class="token punctuation">(</span>f<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
|
||||
<span class="token keyword">int</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token keyword">int</span> argc<span class="token punctuation">,</span> <span class="token keyword">char</span> <span class="token operator">*</span>args<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
|
||||
<span class="token keyword">if</span><span class="token punctuation">(</span>argc <span class="token operator">!=</span> <span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
|
||||
<span class="token keyword">return</span> ERROR<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token comment">/**
|
||||
input:输入
|
||||
output:样例的输出
|
||||
user_output:用户的输出
|
||||
**/</span>
|
||||
FILE <span class="token operator">*</span>input <span class="token operator">=</span> <span class="token function">fopen</span><span class="token punctuation">(</span>args<span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token string">"r"</span><span class="token punctuation">)</span>
|
||||
FILE <span class="token operator">*</span>output <span class="token operator">=</span> <span class="token function">fopen</span><span class="token punctuation">(</span>args<span class="token punctuation">[</span><span class="token number">2</span><span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token string">"r"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
|
||||
<span class="token keyword">double</span> std_out<span class="token punctuation">;</span>
|
||||
<span class="token function">fscanf</span><span class="token punctuation">(</span>output<span class="token punctuation">,</span> <span class="token string">"%lf"</span><span class="token punctuation">,</span> <span class="token operator">&</span>std_out<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token function">close_file</span><span class="token punctuation">(</span>output<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token function">close_file</span><span class="token punctuation">(</span>input<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
|
||||
<span class="token keyword">double</span> user_output<span class="token punctuation">;</span><span class="token comment">//读入用户输出 </span>
|
||||
cin<span class="token operator">>></span>user_output<span class="token punctuation">;</span>
|
||||
<span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token function">fabs</span><span class="token punctuation">(</span>user_output <span class="token operator">-</span> std_out<span class="token punctuation">)</span><span class="token operator"><=</span><span class="token number">1e-6</span><span class="token punctuation">)</span>
|
||||
<span class="token keyword">return</span> AC<span class="token punctuation">;</span>
|
||||
<span class="token keyword">else</span>
|
||||
<span class="token keyword">return</span> WA<span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br></div></div></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/use/update-fe.html" class="prev">
|
||||
自定义前端
|
||||
</a></span> <!----></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/29.87a95cdc.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,50 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>测试用例 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/30.f12254c0.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/31.772200ed.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>使用文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/use/" aria-current="page" class="sidebar-link">使用简介</a></li><li><a href="/docs/use/testcase.html" aria-current="page" class="active sidebar-link">测试用例</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/use/testcase.html#一、手动输入" class="sidebar-link">一、手动输入</a></li><li class="sidebar-sub-header"><a href="/docs/use/testcase.html#二、文件上传" class="sidebar-link">二、文件上传</a></li></ul></li><li><a href="/docs/use/contest.html" class="sidebar-link">比赛介绍</a></li><li><a href="/docs/use/import-problem.html" class="sidebar-link">题目管理</a></li><li><a href="/docs/use/import-user.html" class="sidebar-link">导入用户</a></li><li><a href="/docs/use/admin-user.html" class="sidebar-link">用户管理</a></li><li><a href="/docs/use/discussion-admin.html" class="sidebar-link">评论管理</a></li><li><a href="/docs/use/multi-judgeserver.html" class="sidebar-link">多个判题机</a></li><li><a href="/docs/use/update-fe.html" class="sidebar-link">自定义前端</a></li><li><a href="/docs/use/spj.html" class="sidebar-link">特殊判题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="测试用例"><a href="#测试用例" class="header-anchor">#</a> 测试用例</h1> <p><img src="https://img-blog.csdnimg.cn/20210523215852734.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述"></p> <p><strong>进入后台添加题目,上传题目测试用例数据可以选择手动输入、Zip文件上传两种方式</strong></p> <h2 id="一、手动输入"><a href="#一、手动输入" class="header-anchor">#</a> 一、手动输入</h2> <p>每次点击<code>Add Sampple</code>就可以手动填入该用例的输入与输出,该方式比较适合题目数据简单的,同时手动输入的题目数据将记录进数据库,下次对该题目进行修改可以直接获取,然后进行测试数据的修改,同时也会在服务器对应的testcase文件夹生成对应的文件。</p> <h2 id="二、文件上传"><a href="#二、文件上传" class="header-anchor">#</a> 二、文件上传</h2> <p>对于通题目,测试用例文件包括<code>in</code>、<code>out</code>、<code>ans</code>三种拓展名</p> <p>例如有两组测试用例,则对于普通题目测试用例的文件名分别为<code>1.in, 1.out(1.ans), 2.in, 2.out(2.ans)</code>其他形式的文件后台均不识别。</p> <p>压缩时,请将文件都放在压缩包的根目录,而不是包含在某一个文件夹中,比如正确的格式是:</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>├── <span class="token number">1</span>.in
|
||||
├── <span class="token number">1</span>.out
|
||||
├── <span class="token number">2</span>.in
|
||||
├── <span class="token number">2</span>.out
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><div class="language-bash line-numbers-mode"><pre class="language-bash"><code>├── <span class="token number">1</span>.in
|
||||
├── <span class="token number">1</span>.ans
|
||||
├── <span class="token number">2</span>.in
|
||||
├── <span class="token number">2</span>.ans
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><p>然后压缩测试用例到一个zip中</p> <p>注意:不要在这些文件外面套多一层文件夹,请直接压缩!!!</p> <p>同时建议:尽量合并测试用例到一个文件中,减少测试用例组数,这会一定程度上提高判题性能。</p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/use/" class="prev router-link-active">
|
||||
使用简介
|
||||
</a></span> <span class="next"><a href="/docs/use/contest.html">
|
||||
比赛介绍
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/30.f12254c0.js" defer></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,60 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>自定义前端 | HOJ 文档</title>
|
||||
<meta name="generator" content="VuePress 1.8.2">
|
||||
<link rel="icon" href="/docs/img/favicon.ico">
|
||||
<meta name="description" content="HOJ 的开发与使用文档">
|
||||
|
||||
<link rel="preload" href="/docs/assets/css/0.styles.0538ca31.css" as="style"><link rel="preload" href="/docs/assets/js/app.65c8b032.js" as="script"><link rel="preload" href="/docs/assets/js/2.3e9bf4c9.js" as="script"><link rel="preload" href="/docs/assets/js/31.772200ed.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.8a54dd52.js"><link rel="prefetch" href="/docs/assets/js/11.41b16e2f.js"><link rel="prefetch" href="/docs/assets/js/12.f5d67101.js"><link rel="prefetch" href="/docs/assets/js/13.ac89c359.js"><link rel="prefetch" href="/docs/assets/js/14.cd5e7136.js"><link rel="prefetch" href="/docs/assets/js/15.4e37b949.js"><link rel="prefetch" href="/docs/assets/js/16.39b5f0a9.js"><link rel="prefetch" href="/docs/assets/js/17.8e0cb8c8.js"><link rel="prefetch" href="/docs/assets/js/18.a6a0f06e.js"><link rel="prefetch" href="/docs/assets/js/19.fab778fa.js"><link rel="prefetch" href="/docs/assets/js/20.6241150b.js"><link rel="prefetch" href="/docs/assets/js/21.3dac3195.js"><link rel="prefetch" href="/docs/assets/js/22.2e9ffb3f.js"><link rel="prefetch" href="/docs/assets/js/23.4545af3b.js"><link rel="prefetch" href="/docs/assets/js/24.e4e8588b.js"><link rel="prefetch" href="/docs/assets/js/25.69a7c9d2.js"><link rel="prefetch" href="/docs/assets/js/26.02331534.js"><link rel="prefetch" href="/docs/assets/js/27.53a876b4.js"><link rel="prefetch" href="/docs/assets/js/28.22b57d4d.js"><link rel="prefetch" href="/docs/assets/js/29.87a95cdc.js"><link rel="prefetch" href="/docs/assets/js/3.646ec45b.js"><link rel="prefetch" href="/docs/assets/js/30.f12254c0.js"><link rel="prefetch" href="/docs/assets/js/4.3f3da556.js"><link rel="prefetch" href="/docs/assets/js/5.abc1b238.js"><link rel="prefetch" href="/docs/assets/js/6.f86b5401.js"><link rel="prefetch" href="/docs/assets/js/7.120c22d9.js"><link rel="prefetch" href="/docs/assets/js/8.bb76cd0d.js"><link rel="prefetch" href="/docs/assets/js/9.8282f251.js">
|
||||
<link rel="stylesheet" href="/docs/assets/css/0.styles.0538ca31.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">HOJ 文档</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="https://www.hcode.top" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Demo
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://gitee.com/himitzh0730/hoj" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Gitee
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://github.com/HimitZH/HOJ" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
Github
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://blog.csdn.net/weixin_43853097" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
作者首页
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开始介绍</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>部署文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>开发文档</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>使用文档</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/use/" aria-current="page" class="sidebar-link">使用简介</a></li><li><a href="/docs/use/testcase.html" class="sidebar-link">测试用例</a></li><li><a href="/docs/use/contest.html" class="sidebar-link">比赛介绍</a></li><li><a href="/docs/use/import-problem.html" class="sidebar-link">题目管理</a></li><li><a href="/docs/use/import-user.html" class="sidebar-link">导入用户</a></li><li><a href="/docs/use/admin-user.html" class="sidebar-link">用户管理</a></li><li><a href="/docs/use/discussion-admin.html" class="sidebar-link">评论管理</a></li><li><a href="/docs/use/multi-judgeserver.html" class="sidebar-link">多个判题机</a></li><li><a href="/docs/use/update-fe.html" aria-current="page" class="active sidebar-link">自定义前端</a></li><li><a href="/docs/use/spj.html" class="sidebar-link">特殊判题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="自定义前端"><a href="#自定义前端" class="header-anchor">#</a> 自定义前端</h1> <p>直接下载<a href="https://gitee.com/himitzh0730/hoj/tree/master/hoj-vue" target="_blank" rel="noopener noreferrer">https://gitee.com/himitzh0730/hoj/tree/master/hoj-vue<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>修改后,使用<code>npm run build</code>,生成一个dist文件夹,结构如下:</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>dist
|
||||
├── index.html
|
||||
├── favicon.ico
|
||||
└── assets
|
||||
├── css
|
||||
│ ├── ....
|
||||
├── fonts
|
||||
│ ├── ....
|
||||
├── img
|
||||
│ ├── ....
|
||||
├── js
|
||||
│ ├── ....
|
||||
|
||||
....
|
||||
....
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br></div></div><p>将 <code>dist</code> 文件夹复制到服务器上某个目录下,比如 <code>/hoj/www/html/dist</code>,然后修改 <code>docker-compose.yml</code>,在 <code>hoj-frontend</code> 模块中的 <code>volumes</code> 中增加一行 <code>- /hoj/www/html/dist:/usr/share/nginx/html</code> (冒号前面的请修改为实际的路径),然后 <code>docker-compose up -d</code> 即可。</p> <p>如果仅仅只是像修改前台logo、管理后台logo和favicon.ico,那么操作如下:</p> <p>修改 <code>docker-compose.yml</code>,在 <code>hoj-frontend</code> 模块中的 <code>volumes</code> 中添加如下:</p> <div class="language-yaml line-numbers-mode"><pre class="language-yaml"><code><span class="token punctuation">-</span> ./logo.png<span class="token punctuation">:</span>/usr/share/nginx/html/assets/img/logo.a0924d7d.png
|
||||
<span class="token punctuation">-</span> ./backstage.png<span class="token punctuation">:</span>/usr/share/nginx/html/assets/img/backstage.8bce8c6e.png
|
||||
<span class="token punctuation">-</span> ./favicon.ico<span class="token punctuation">:</span>/usr/share/nginx/html/favicon.ico
|
||||
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><p><code>logo.png</code>为前台导航栏左边的logo,<code>backstage.png</code>为后台侧边导航栏上方的logo,<code>favicon.ico</code>为小图标</p> <p><strong>图片文件需放在与docker-compose.yml同个目录下,或者提供绝对路径也可。</strong></p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
|
||||
←
|
||||
<a href="/docs/use/multi-judgeserver.html" class="prev">
|
||||
多个判题机
|
||||
</a></span> <span class="next"><a href="/docs/use/spj.html">
|
||||
特殊判题
|
||||
</a>
|
||||
→
|
||||
</span></p></div> </main></div><div class="global-ui"></div></div>
|
||||
<script src="/docs/assets/js/app.65c8b032.js" defer></script><script src="/docs/assets/js/2.3e9bf4c9.js" defer></script><script src="/docs/assets/js/31.772200ed.js" defer></script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{367:function(t,e,s){\"use strict\";s.r(e);var l=s(41),n=Object(l.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[s(\"h1\",{attrs:{id:\"使用简介\"}},[s(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#使用简介\"}},[t._v(\"#\")]),t._v(\" 使用简介\")]),t._v(\" \"),s(\"ul\",[s(\"li\",[t._v(\"安全沙盒的简单介绍\")]),t._v(\" \"),s(\"li\",[t._v(\"特殊判题的程序例子\")]),t._v(\" \"),s(\"li\",[t._v(\"其它待续......\")])])])}),[],!1,null,null,null);e.default=n.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{376:function(s,a,t){\"use strict\";t.r(a);var n=t(41),e=Object(n.a)({},(function(){var s=this,a=s.$createElement,t=s._self._c||a;return t(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":s.$parent.slotKey}},[t(\"h1\",{attrs:{id:\"测试用例\"}},[t(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#测试用例\"}},[s._v(\"#\")]),s._v(\" 测试用例\")]),s._v(\" \"),t(\"p\",[t(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523215852734.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})]),s._v(\" \"),t(\"p\",[t(\"strong\",[s._v(\"进入后台添加题目,上传题目测试用例数据可以选择手动输入、Zip文件上传两种方式\")])]),s._v(\" \"),t(\"h2\",{attrs:{id:\"一、手动输入\"}},[t(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#一、手动输入\"}},[s._v(\"#\")]),s._v(\" 一、手动输入\")]),s._v(\" \"),t(\"p\",[s._v(\"每次点击\"),t(\"code\",[s._v(\"Add Sampple\")]),s._v(\"就可以手动填入该用例的输入与输出,该方式比较适合题目数据简单的,同时手动输入的题目数据将记录进数据库,下次对该题目进行修改可以直接获取,然后进行测试数据的修改,同时也会在服务器对应的testcase文件夹生成对应的文件。\")]),s._v(\" \"),t(\"h2\",{attrs:{id:\"二、文件上传\"}},[t(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#二、文件上传\"}},[s._v(\"#\")]),s._v(\" 二、文件上传\")]),s._v(\" \"),t(\"p\",[s._v(\"对于通题目,测试用例文件包括\"),t(\"code\",[s._v(\"in\")]),s._v(\"、\"),t(\"code\",[s._v(\"out\")]),s._v(\"、\"),t(\"code\",[s._v(\"ans\")]),s._v(\"三种拓展名\")]),s._v(\" \"),t(\"p\",[s._v(\"例如有两组测试用例,则对于普通题目测试用例的文件名分别为\"),t(\"code\",[s._v(\"1.in, 1.out(1.ans), 2.in, 2.out(2.ans)\")]),s._v(\"其他形式的文件后台均不识别。\")]),s._v(\" \"),t(\"p\",[s._v(\"压缩时,请将文件都放在压缩包的根目录,而不是包含在某一个文件夹中,比如正确的格式是:\")]),s._v(\" \"),t(\"div\",{staticClass:\"language-bash line-numbers-mode\"},[t(\"pre\",{pre:!0,attrs:{class:\"language-bash\"}},[t(\"code\",[s._v(\"├── \"),t(\"span\",{pre:!0,attrs:{class:\"token number\"}},[s._v(\"1\")]),s._v(\".in\\n├── \"),t(\"span\",{pre:!0,attrs:{class:\"token number\"}},[s._v(\"1\")]),s._v(\".out\\n├── \"),t(\"span\",{pre:!0,attrs:{class:\"token number\"}},[s._v(\"2\")]),s._v(\".in\\n├── \"),t(\"span\",{pre:!0,attrs:{class:\"token number\"}},[s._v(\"2\")]),s._v(\".out\\n\")])]),s._v(\" \"),t(\"div\",{staticClass:\"line-numbers-wrapper\"},[t(\"span\",{staticClass:\"line-number\"},[s._v(\"1\")]),t(\"br\"),t(\"span\",{staticClass:\"line-number\"},[s._v(\"2\")]),t(\"br\"),t(\"span\",{staticClass:\"line-number\"},[s._v(\"3\")]),t(\"br\"),t(\"span\",{staticClass:\"line-number\"},[s._v(\"4\")]),t(\"br\")])]),t(\"div\",{staticClass:\"language-bash line-numbers-mode\"},[t(\"pre\",{pre:!0,attrs:{class:\"language-bash\"}},[t(\"code\",[s._v(\"├── \"),t(\"span\",{pre:!0,attrs:{class:\"token number\"}},[s._v(\"1\")]),s._v(\".in\\n├── \"),t(\"span\",{pre:!0,attrs:{class:\"token number\"}},[s._v(\"1\")]),s._v(\".ans\\n├── \"),t(\"span\",{pre:!0,attrs:{class:\"token number\"}},[s._v(\"2\")]),s._v(\".in\\n├── \"),t(\"span\",{pre:!0,attrs:{class:\"token number\"}},[s._v(\"2\")]),s._v(\".ans\\n\")])]),s._v(\" \"),t(\"div\",{staticClass:\"line-numbers-wrapper\"},[t(\"span\",{staticClass:\"line-number\"},[s._v(\"1\")]),t(\"br\"),t(\"span\",{staticClass:\"line-number\"},[s._v(\"2\")]),t(\"br\"),t(\"span\",{staticClass:\"line-number\"},[s._v(\"3\")]),t(\"br\"),t(\"span\",{staticClass:\"line-number\"},[s._v(\"4\")]),t(\"br\")])]),t(\"p\",[s._v(\"然后压缩测试用例到一个zip中\")]),s._v(\" \"),t(\"p\",[s._v(\"注意:不要在这些文件外面套多一层文件夹,请直接压缩!!!\")]),s._v(\" \"),t(\"p\",[s._v(\"同时建议:尽量合并测试用例到一个文件中,减少测试用例组数,这会一定程度上提高判题性能。\")])])}),[],!1,null,null,null);a.default=e.exports}}]);","extractedComments":[]}
|
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{370:function(_,t,v){\"use strict\";v.r(t);var s=v(41),r=Object(s.a)({},(function(){var _=this,t=_.$createElement,v=_._self._c||t;return v(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":_.$parent.slotKey}},[v(\"h1\",{attrs:{id:\"比赛介绍\"}},[v(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#比赛介绍\"}},[_._v(\"#\")]),_._v(\" 比赛介绍\")]),_._v(\" \"),v(\"p\",[v(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523221519574.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})]),_._v(\" \"),v(\"h2\",{attrs:{id:\"两种赛制\"}},[v(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#两种赛制\"}},[_._v(\"#\")]),_._v(\" 两种赛制\")]),_._v(\" \"),v(\"ul\",[v(\"li\",[v(\"p\",[v(\"strong\",[_._v(\"ACM 模式\")])]),_._v(\" \"),v(\"p\",[_._v(\"在该模式下,我们严格按照ACM-ICPC的比赛规则来进行,Contest设置项中的\"),v(\"code\",[_._v(\"Seal Time Rank\")]),_._v(\"即为是否封榜,封榜后将不再刷新排名。可选择比赛结束前半小时,比赛前一小时,比赛全程封榜。\")]),_._v(\" \"),v(\"p\",[v(\"strong\",[_._v(\"封榜期间的角色不同如下:\")])]),_._v(\" \"),v(\"ol\",[v(\"li\",[_._v(\"封榜期间,\"),v(\"strong\",[_._v(\"超级管理员与比赛创建者\")]),_._v(\"不受影响,正常可查看题目统计数据,提交数据等,排行榜需自行开启强制刷新,同时提交结果可以及时看到评测结果,但不会纳入排行榜!\")]),_._v(\" \"),v(\"li\",[_._v(\"封榜期间,\"),v(\"strong\",[_._v(\"普通用户与非比赛创建者\")]),_._v(\"(包括其它管理员角色),可以及时看到自己的提交结果,但不可看到别人\"),v(\"strong\",[_._v(\"封榜后\")]),_._v(\"的提交,不能看到题目的统计情况,排行榜保持\"),v(\"strong\",[_._v(\"封榜前\")]),_._v(\"的排名数据。\")])]),_._v(\" \"),v(\"p\",[_._v(\"注意:比赛一结束,所有数据变成正常显示!\")])]),_._v(\" \"),v(\"li\",[v(\"p\",[v(\"strong\",[_._v(\"OI 模式\")])]),_._v(\" \"),v(\"p\",[_._v(\"在OI模式下,选手的提交将根据得分点来计分,多次提交以最后一次提交为准,排名规则为多个题目的总分数。同样可以进行封榜操作,封榜时段,选手不能查看到实时的排行榜数据!\")]),_._v(\" \"),v(\"p\",[v(\"strong\",[_._v(\"如果开启封榜:\")])]),_._v(\" \"),v(\"ol\",[v(\"li\",[_._v(\"封榜期间,\"),v(\"strong\",[_._v(\"超级管理员与比赛创建者\")]),_._v(\"不受影响,正常可查看题目统计数据,提交数据等,排行榜需自行开启强制刷新,同时提交结果可以及时看到评测结果,但不会纳入排行榜!\")]),_._v(\" \"),v(\"li\",[_._v(\"封榜期间:\"),v(\"strong\",[_._v(\"普通用户与非比赛创建者\")]),_._v(\"(包括其它管理员角色),看不到自己和其它所有人\"),v(\"strong\",[_._v(\"封榜后\")]),_._v(\"的提交结果,不能看到题目的统计情况,排行榜保持\"),v(\"strong\",[_._v(\"封榜前\")]),_._v(\"的排名数据。\")])]),_._v(\" \"),v(\"p\",[_._v(\"注意:比赛一结束,所有数据变成正常显示!\")])])]),_._v(\" \"),v(\"p\",[_._v(\"注意:管理员可以选择强制刷新,查看实时的排行榜数据!通过\"),v(\"code\",[_._v(\"Force Update\")]),_._v(\"来强制刷新榜,且刷新后的榜仅对管理者可见。\")]),_._v(\" \"),v(\"h2\",{attrs:{id:\"比赛权限\"}},[v(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#比赛权限\"}},[_._v(\"#\")]),_._v(\" 比赛权限\")]),_._v(\" \"),v(\"ul\",[v(\"li\",[v(\"strong\",[_._v(\"公开赛\")]),_._v(\":所有用户都可以查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,且都可以在比赛阶段随时提交。\")]),_._v(\" \"),v(\"li\",[v(\"strong\",[_._v(\"保护赛\")]),_._v(\":所有用户都可以查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,但在比赛阶段提交需要提供该比赛的密码!\")]),_._v(\" \"),v(\"li\",[v(\"strong\",[_._v(\"私有赛\")]),_._v(\":仅支持有比赛密码的用户进入比赛,查看查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,包括提交。\")])])])}),[],!1,null,null,null);t.default=r.exports}}]);","extractedComments":[]}
|
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{320:function(e,t,a){},348:function(e,t,a){\"use strict\";a(320)},352:function(e,t,a){\"use strict\";a.r(t);a(59),a(23),a(90),a(91);var o={name:\"CodeGroup\",data:function(){return{codeTabs:[],activeCodeTabIndex:-1}},watch:{activeCodeTabIndex:function(e){this.activateCodeTab(e)}},mounted:function(){this.loadTabs()},methods:{changeCodeTab:function(e){this.activeCodeTabIndex=e},loadTabs:function(){var e=this;this.codeTabs=(this.$slots.default||[]).filter((function(e){return Boolean(e.componentOptions)})).map((function(t,a){return\"\"===t.componentOptions.propsData.active&&(e.activeCodeTabIndex=a),{title:t.componentOptions.propsData.title,elm:t.elm}})),-1===this.activeCodeTabIndex&&this.codeTabs.length>0&&(this.activeCodeTabIndex=0),this.activateCodeTab(0)},activateCodeTab:function(e){this.codeTabs.forEach((function(e){e.elm&&e.elm.classList.remove(\"theme-code-block__active\")})),this.codeTabs[e].elm&&this.codeTabs[e].elm.classList.add(\"theme-code-block__active\")}}},n=(a(348),a(41)),c=Object(n.a)(o,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a(\"ClientOnly\",[a(\"div\",{staticClass:\"theme-code-group\"},[a(\"div\",{staticClass:\"theme-code-group__nav\"},[a(\"ul\",{staticClass:\"theme-code-group__ul\"},e._l(e.codeTabs,(function(t,o){return a(\"li\",{key:t.title,staticClass:\"theme-code-group__li\"},[a(\"button\",{staticClass:\"theme-code-group__nav-tab\",class:{\"theme-code-group__nav-tab-active\":o===e.activeCodeTabIndex},on:{click:function(t){return e.changeCodeTab(o)}}},[e._v(\"\\n \"+e._s(t.title)+\"\\n \")])])})),0)]),e._v(\" \"),e._t(\"default\"),e._v(\" \"),e.codeTabs.length<1?a(\"pre\",{staticClass:\"pre-blank\"},[e._v(\"// Make sure to add code blocks to your code group\")]):e._e()],2)])}),[],!1,null,\"77e00ed1\",null);t.default=c.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{373:function(t,s,a){\"use strict\";a.r(s);var e=a(41),l=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[a(\"h2\",{attrs:{id:\"导入用户\"}},[a(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#导入用户\"}},[t._v(\"#\")]),t._v(\" 导入用户\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/2021052322072728.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),a(\"p\",[t._v(\"要求如下:\")]),t._v(\" \"),a(\"ol\",[a(\"li\",[a(\"p\",[t._v(\"用户数据导入仅支持csv格式的用户数据。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"共三列数据: 用户名,密码,邮箱,任一列不能为空,否则该行数据可能导入失败。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"第一行不必写(“用户名”,“密码”,“邮箱”)这三个列名。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"请导入保存为UTF-8编码的文件,否则中文可能会乱码。\")])])])])}),[],!1,null,null,null);s.default=l.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{373:function(t,s,a){\"use strict\";a.r(s);var e=a(41),r=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[a(\"h1\",{attrs:{id:\"评论管理\"}},[a(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#评论管理\"}},[t._v(\"#\")]),t._v(\" 评论管理\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523223605573.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70#pic_center\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),a(\"ul\",[a(\"li\",[a(\"p\",[t._v(\"后台管理员可以查看所有的讨论帖,并且可以选择是否置顶,是否正常显示,删除,查看等\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"后台管理员可以查看对应讨论帖的举报内容\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523221321418.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})])])])])}),[],!1,null,null,null);s.default=r.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{371:function(t,s,a){\"use strict\";a.r(s);var e=a(41),r=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[a(\"h1\",{attrs:{id:\"评论管理\"}},[a(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#评论管理\"}},[t._v(\"#\")]),t._v(\" 评论管理\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523223605573.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70#pic_center\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),a(\"ul\",[a(\"li\",[a(\"p\",[t._v(\"后台管理员可以查看所有的讨论帖,并且可以选择是否置顶,是否正常显示,删除,查看等\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"后台管理员可以查看对应讨论帖的举报内容\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523221321418.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})])])])])}),[],!1,null,null,null);s.default=r.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{372:function(t,s,a){\"use strict\";a.r(s);var e=a(41),l=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[a(\"h2\",{attrs:{id:\"导入用户\"}},[a(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#导入用户\"}},[t._v(\"#\")]),t._v(\" 导入用户\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/2021052322072728.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),a(\"p\",[t._v(\"要求如下:\")]),t._v(\" \"),a(\"ol\",[a(\"li\",[a(\"p\",[t._v(\"用户数据导入仅支持csv格式的用户数据。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"共三列数据: 用户名,密码,邮箱,任一列不能为空,否则该行数据可能导入失败。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"第一行不必写(“用户名”,“密码”,“邮箱”)这三个列名。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"请导入保存为UTF-8编码的文件,否则中文可能会乱码。\")])])])])}),[],!1,null,null,null);s.default=l.exports}}]);","extractedComments":[]}
|
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{369:function(t,s,a){\"use strict\";a.r(s);var e=a(41),l=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[a(\"h2\",{attrs:{id:\"导入用户\"}},[a(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#导入用户\"}},[t._v(\"#\")]),t._v(\" 导入用户\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/2021052322072728.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),a(\"p\",[t._v(\"要求如下:\")]),t._v(\" \"),a(\"ol\",[a(\"li\",[a(\"p\",[t._v(\"用户数据导入仅支持csv格式的用户数据。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"共三列数据: 用户名,密码,邮箱,任一列不能为空,否则该行数据可能导入失败。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"第一行不必写(“用户名”,“密码”,“邮箱”)这三个列名。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"请导入保存为UTF-8编码的文件,否则中文可能会乱码。\")])])])])}),[],!1,null,null,null);s.default=l.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{353:function(t,e,n){\"use strict\";n.r(e);var s=n(41),l=Object(s.a)({},(function(){var t=this.$createElement;return(this._self._c||t)(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":this.$parent.slotKey}})}),[],!1,null,null,null);e.default=l.exports}}]);","extractedComments":[]}
|
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{372:function(t,s,a){\"use strict\";a.r(s);var e=a(41),l=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[a(\"h2\",{attrs:{id:\"导入用户\"}},[a(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#导入用户\"}},[t._v(\"#\")]),t._v(\" 导入用户\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/2021052322072728.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),a(\"p\",[t._v(\"要求如下:\")]),t._v(\" \"),a(\"ol\",[a(\"li\",[a(\"p\",[t._v(\"用户数据导入仅支持csv格式的用户数据。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"共三列数据: 用户名,密码,邮箱,任一列不能为空,否则该行数据可能导入失败。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"第一行不必写(“用户名”,“密码”,“邮箱”)这三个列名。\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"请导入保存为UTF-8编码的文件,否则中文可能会乱码。\")])])])])}),[],!1,null,null,null);s.default=l.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{359:function(t,e,s){\"use strict\";s.r(e);var l=s(41),n=Object(l.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[s(\"h1\",{attrs:{id:\"使用简介\"}},[s(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#使用简介\"}},[t._v(\"#\")]),t._v(\" 使用简介\")]),t._v(\" \"),s(\"ul\",[s(\"li\",[t._v(\"安全沙盒的简单介绍\")]),t._v(\" \"),s(\"li\",[t._v(\"特殊判题的程序例子\")]),t._v(\" \"),s(\"li\",[t._v(\"其它待续......\")])])])}),[],!1,null,null,null);e.default=n.exports}}]);","extractedComments":[]}
|
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{369:function(t,_,s){\"use strict\";s.r(_);var e=s(41),v=Object(e.a)({},(function(){var t=this,_=t.$createElement,s=t._self._c||_;return s(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[s(\"h1\",{attrs:{id:\"比赛介绍\"}},[s(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#比赛介绍\"}},[t._v(\"#\")]),t._v(\" 比赛介绍\")]),t._v(\" \"),s(\"p\",[s(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523221519574.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),s(\"p\",[t._v(\"创建比赛时两种赛制:\")]),t._v(\" \"),s(\"ul\",[s(\"li\",[s(\"p\",[s(\"strong\",[t._v(\"ACM 模式\")])]),t._v(\" \"),s(\"p\",[t._v(\"在该模式下,我们严格按照ACM-ICPC的比赛规则来进行,Contest设置项中的\"),s(\"code\",[t._v(\"Seal Time Rank\")]),t._v(\"即为是否封榜,封榜后将不再刷新排名。可选择比赛结束前半小时,比赛前一小时,比赛全程封榜。\")])]),t._v(\" \"),s(\"li\",[s(\"p\",[s(\"strong\",[t._v(\"OI 模式\")])]),t._v(\" \"),s(\"p\",[t._v(\"在OI模式下,选手的提交将根据得分点来计分,多次提交以最后一次提交为准,排名规则为多个题目的总分数。同样可以进行封榜操作,封榜时段,选手不能查看到实时的排行榜数据!\")])])]),t._v(\" \"),s(\"p\",[t._v(\"注意:管理员可以选择强制刷新,查看实时的排行榜数据!通过\"),s(\"code\",[t._v(\"Force Update\")]),t._v(\"来强制刷新榜,且刷新后的榜仅对管理者可见。\")]),t._v(\" \"),s(\"p\",[t._v(\"比赛权限模式有三种:\")]),t._v(\" \"),s(\"ul\",[s(\"li\",[s(\"strong\",[t._v(\"公开赛\")]),t._v(\":所有用户都可以查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,且都可以在比赛阶段随时提交。\")]),t._v(\" \"),s(\"li\",[s(\"strong\",[t._v(\"保护赛\")]),t._v(\":所有用户都可以查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,但在比赛阶段提交需要提供该比赛的密码!\")]),t._v(\" \"),s(\"li\",[s(\"strong\",[t._v(\"私有赛\")]),t._v(\":仅支持有比赛密码的用户进入比赛,查看查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,包括提交。\")])])])}),[],!1,null,null,null);_.default=v.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{367:function(t,s,a){\"use strict\";a.r(s);var e=a(41),r=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[a(\"h1\",{attrs:{id:\"评论管理\"}},[a(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#评论管理\"}},[t._v(\"#\")]),t._v(\" 评论管理\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523223605573.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70#pic_center\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),a(\"ul\",[a(\"li\",[a(\"p\",[t._v(\"后台管理员可以查看所有的讨论帖,并且可以选择是否置顶,是否正常显示,删除,查看等\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"后台管理员可以查看对应讨论帖的举报内容\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523221321418.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})])])])])}),[],!1,null,null,null);s.default=r.exports}}]);","extractedComments":[]}
|
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{373:function(t,_,s){\"use strict\";s.r(_);var e=s(41),v=Object(e.a)({},(function(){var t=this,_=t.$createElement,s=t._self._c||_;return s(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[s(\"h1\",{attrs:{id:\"比赛介绍\"}},[s(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#比赛介绍\"}},[t._v(\"#\")]),t._v(\" 比赛介绍\")]),t._v(\" \"),s(\"p\",[s(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523221519574.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),s(\"p\",[t._v(\"创建比赛时两种赛制:\")]),t._v(\" \"),s(\"ul\",[s(\"li\",[s(\"p\",[s(\"strong\",[t._v(\"ACM 模式\")])]),t._v(\" \"),s(\"p\",[t._v(\"在该模式下,我们严格按照ACM-ICPC的比赛规则来进行,Contest设置项中的\"),s(\"code\",[t._v(\"Seal Time Rank\")]),t._v(\"即为是否封榜,封榜后将不再刷新排名。可选择比赛结束前半小时,比赛前一小时,比赛全程封榜。\")])]),t._v(\" \"),s(\"li\",[s(\"p\",[s(\"strong\",[t._v(\"OI 模式\")])]),t._v(\" \"),s(\"p\",[t._v(\"在OI模式下,选手的提交将根据得分点来计分,多次提交以最后一次提交为准,排名规则为多个题目的总分数。同样可以进行封榜操作,封榜时段,选手不能查看到实时的排行榜数据!\")])])]),t._v(\" \"),s(\"p\",[t._v(\"注意:管理员可以选择强制刷新,查看实时的排行榜数据!通过\"),s(\"code\",[t._v(\"Force Update\")]),t._v(\"来强制刷新榜,且刷新后的榜仅对管理者可见。\")]),t._v(\" \"),s(\"p\",[t._v(\"比赛权限模式有三种:\")]),t._v(\" \"),s(\"ul\",[s(\"li\",[s(\"strong\",[t._v(\"公开赛\")]),t._v(\":所有用户都可以查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,且都可以在比赛阶段随时提交。\")]),t._v(\" \"),s(\"li\",[s(\"strong\",[t._v(\"保护赛\")]),t._v(\":所有用户都可以查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,但在比赛阶段提交需要提供该比赛的密码!\")]),t._v(\" \"),s(\"li\",[s(\"strong\",[t._v(\"私有赛\")]),t._v(\":仅支持有比赛密码的用户进入比赛,查看查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,包括提交。\")])])])}),[],!1,null,null,null);_.default=v.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{369:function(t,l,e){\"use strict\";e.r(l);var s=e(41),v=Object(s.a)({},(function(){var t=this,l=t.$createElement,e=t._self._c||l;return e(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[e(\"h1\",{attrs:{id:\"使用简介\"}},[e(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#使用简介\"}},[t._v(\"#\")]),t._v(\" 使用简介\")]),t._v(\" \"),e(\"ul\",[e(\"li\",[t._v(\"测试数据的介绍\")]),t._v(\" \"),e(\"li\",[t._v(\"比赛的介绍\")]),t._v(\" \"),e(\"li\",[t._v(\"导入题目的介绍\")]),t._v(\" \"),e(\"li\",[t._v(\"导入用户的介绍\")]),t._v(\" \"),e(\"li\",[t._v(\"讨论管理的介绍\")]),t._v(\" \"),e(\"li\",[t._v(\"特殊判题的程序例子\")]),t._v(\" \"),e(\"li\",[t._v(\"其它待续......\")])])])}),[],!1,null,null,null);l.default=v.exports}}]);","extractedComments":[]}
|
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{361:function(s,a,t){\"use strict\";t.r(a);var r=t(41),e=Object(r.a)({},(function(){var s=this,a=s.$createElement,t=s._self._c||a;return t(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":s.$parent.slotKey}},[t(\"h1\",{attrs:{id:\"redis部署\"}},[t(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#redis部署\"}},[s._v(\"#\")]),s._v(\" redis部署\")]),s._v(\" \"),t(\"h2\",{attrs:{id:\"docker部署\"}},[t(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#docker部署\"}},[s._v(\"#\")]),s._v(\" docker部署\")]),s._v(\" \"),t(\"div\",{staticClass:\"language-shell line-numbers-mode\"},[t(\"pre\",{pre:!0,attrs:{class:\"language-shell\"}},[t(\"code\",[s._v(\"docker run -d --name redis -p \"),t(\"span\",{pre:!0,attrs:{class:\"token number\"}},[s._v(\"6379\")]),s._v(\":6379 \\n-v /hoj/data/redis/data:/data \"),t(\"span\",{pre:!0,attrs:{class:\"token punctuation\"}},[s._v(\"\\\\\")]),s._v(\"\\n--restart\"),t(\"span\",{pre:!0,attrs:{class:\"token operator\"}},[s._v(\"=\")]),t(\"span\",{pre:!0,attrs:{class:\"token string\"}},[s._v('\"always\"')]),s._v(\" \"),t(\"span\",{pre:!0,attrs:{class:\"token punctuation\"}},[s._v(\"\\\\\")]),s._v(\"\\nredis \"),t(\"span\",{pre:!0,attrs:{class:\"token punctuation\"}},[s._v(\"\\\\\")]),s._v(\"\\n--requirepass \"),t(\"span\",{pre:!0,attrs:{class:\"token string\"}},[s._v('\"redis_password\"')]),s._v(\" \\n\")])]),s._v(\" \"),t(\"div\",{staticClass:\"line-numbers-wrapper\"},[t(\"span\",{staticClass:\"line-number\"},[s._v(\"1\")]),t(\"br\"),t(\"span\",{staticClass:\"line-number\"},[s._v(\"2\")]),t(\"br\"),t(\"span\",{staticClass:\"line-number\"},[s._v(\"3\")]),t(\"br\"),t(\"span\",{staticClass:\"line-number\"},[s._v(\"4\")]),t(\"br\"),t(\"span\",{staticClass:\"line-number\"},[s._v(\"5\")]),t(\"br\")])]),t(\"h2\",{attrs:{id:\"常规部署\"}},[t(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#常规部署\"}},[s._v(\"#\")]),s._v(\" 常规部署\")]),s._v(\" \"),t(\"p\",[s._v(\"请自行百度。。\")])])}),[],!1,null,null,null);a.default=e.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{370:function(t,s,a){\"use strict\";a.r(s);var e=a(41),r=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[a(\"h1\",{attrs:{id:\"评论管理\"}},[a(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#评论管理\"}},[t._v(\"#\")]),t._v(\" 评论管理\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523223605573.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70#pic_center\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),a(\"ul\",[a(\"li\",[a(\"p\",[t._v(\"后台管理员可以查看所有的讨论帖,并且可以选择是否置顶,是否正常显示,删除,查看等\")])]),t._v(\" \"),a(\"li\",[a(\"p\",[t._v(\"后台管理员可以查看对应讨论帖的举报内容\")]),t._v(\" \"),a(\"p\",[a(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523221321418.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})])])])])}),[],!1,null,null,null);s.default=r.exports}}]);","extractedComments":[]}
|
|
@ -1 +0,0 @@
|
|||
{"code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{366:function(t,_,s){\"use strict\";s.r(_);var e=s(41),v=Object(e.a)({},(function(){var t=this,_=t.$createElement,s=t._self._c||_;return s(\"ContentSlotsDistributor\",{attrs:{\"slot-key\":t.$parent.slotKey}},[s(\"h1\",{attrs:{id:\"比赛介绍\"}},[s(\"a\",{staticClass:\"header-anchor\",attrs:{href:\"#比赛介绍\"}},[t._v(\"#\")]),t._v(\" 比赛介绍\")]),t._v(\" \"),s(\"p\",[s(\"img\",{attrs:{src:\"https://img-blog.csdnimg.cn/20210523221519574.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80Mzg1MzA5Nw==,size_16,color_FFFFFF,t_70\",alt:\"在这里插入图片描述\"}})]),t._v(\" \"),s(\"p\",[t._v(\"创建比赛时两种赛制:\")]),t._v(\" \"),s(\"ul\",[s(\"li\",[s(\"p\",[s(\"strong\",[t._v(\"ACM 模式\")])]),t._v(\" \"),s(\"p\",[t._v(\"在该模式下,我们严格按照ACM-ICPC的比赛规则来进行,Contest设置项中的\"),s(\"code\",[t._v(\"Seal Time Rank\")]),t._v(\"即为是否封榜,封榜后将不再刷新排名。可选择比赛结束前半小时,比赛前一小时,比赛全程封榜。\")])]),t._v(\" \"),s(\"li\",[s(\"p\",[s(\"strong\",[t._v(\"OI 模式\")])]),t._v(\" \"),s(\"p\",[t._v(\"在OI模式下,选手的提交将根据得分点来计分,多次提交以最后一次提交为准,排名规则为多个题目的总分数。同样可以进行封榜操作,封榜时段,选手不能查看到实时的排行榜数据!\")])])]),t._v(\" \"),s(\"p\",[t._v(\"注意:管理员可以选择强制刷新,查看实时的排行榜数据!通过\"),s(\"code\",[t._v(\"Force Update\")]),t._v(\"来强制刷新榜,且刷新后的榜仅对管理者可见。\")]),t._v(\" \"),s(\"p\",[t._v(\"比赛权限模式有三种:\")]),t._v(\" \"),s(\"ul\",[s(\"li\",[s(\"strong\",[t._v(\"公开赛\")]),t._v(\":所有用户都可以查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,且都可以在比赛阶段随时提交。\")]),t._v(\" \"),s(\"li\",[s(\"strong\",[t._v(\"保护赛\")]),t._v(\":所有用户都可以查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,但在比赛阶段提交需要提供该比赛的密码!\")]),t._v(\" \"),s(\"li\",[s(\"strong\",[t._v(\"私有赛\")]),t._v(\":仅支持有比赛密码的用户进入比赛,查看查看比赛详情、比赛题目、比赛提交,比赛排行榜、比赛讨论等,包括提交。\")])])])}),[],!1,null,null,null);_.default=v.exports}}]);","extractedComments":[]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue