diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e25267f95c92e413b706deb7e16713047e8c484b --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +npm-debug.log +coverage/ +.idea/ +run/ +.DS_Store +*.swp +*.vscode +doracms/ + + diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000000000000000000000000000000000000..fa225db67f8925d4b0cdb8408701097466cfa4fb --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 doramart + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.en.md b/README.en.md index 258130f3e4e436e8d56e1f550b4e793938d86a76..471753a83698882597472c2e80114b76c015c8a7 100644 --- a/README.en.md +++ b/README.en.md @@ -1,36 +1,33 @@ -# doracms +# DoraCMS #### Description -Open source content management system based on nodejs +`DoraCMS` is a set of content management system based on `Nodejs` `eggjs` `mongodb`. Its structure is simple. Compared with some open-source CMS, doracms is easy to expand, especially suitable for front-end development engineers to do secondary development. #### Software Architecture -Software architecture description +`Nodejs` `eggjs` `mongodb` #### Installation -1. xxxx -2. xxxx -3. xxxx +``` +sudo dnf install mongodb +sudo dnf install doracms +``` + +#### Start +``` +mongod & +service doracms start +``` #### Instructions -1. xxxx -2. xxxx -3. xxxx +1. Browser access http://127.0.0.1:8080 +2. Back-stage management http://127.0.0.1:8080/dr-admin #### Contribution 1. Fork the repository -2. Create Feat_xxx branch +2. Create Feat_doracms branch 3. Commit your code 4. Create Pull Request - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 80cd637c322550597cb369a811aaee5edad79617..5c6f9d899c8a90137dbba18d36971f540413ea05 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,35 @@ -# doracms +# DoraCMS #### 介绍 -Open source content management system based on nodejs +`DoraCMS` 是基于 `Nodejs` `eggjs` `mongodb` 编写的一套内容管理系统,结构简单,较目前一些开源的 `CMS` ,`DoraCMS` 易于拓展,特别适合前端开发工程师做二次开发。 #### 软件架构 -软件架构说明 +`Nodejs` `eggjs` `mongodb` #### 安装教程 -1. xxxx -2. xxxx -3. xxxx +``` +sudo dnf install mongodb +sudo dnf install doracms +``` + +#### 启动 +``` +mongod & +service doracms start +``` #### 使用说明 -1. xxxx -2. xxxx -3. xxxx +1. 浏览器访问 http://127.0.0.1:8080 +2. 后台管理 http://127.0.0.1:8080/dr-admin #### 参与贡献 1. Fork 本仓库 -2. 新建 Feat_xxx 分支 +2. 新建 Feat_doracms 分支 3. 提交代码 4. 新建 Pull Request -#### 码云特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/doracms.service b/doracms.service new file mode 100644 index 0000000000000000000000000000000000000000..fcd752a38909bfd42abdc72168ec25c81c592d1e --- /dev/null +++ b/doracms.service @@ -0,0 +1,16 @@ +[Unit] +Description= +After=network.target nss-lookup.target + +[Service] +ExecStart=/usr/bin/npm start +WorkingDirectory=/usr/lib/doracms +Restart=always +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=doracms +User=doracms +Group=doracms + +[Install] +WantedBy=multi-user.target diff --git a/doracms.spec b/doracms.spec new file mode 100644 index 0000000000000000000000000000000000000000..036f8356c197b8222216e5c19fc3adef45fddc56 --- /dev/null +++ b/doracms.spec @@ -0,0 +1,65 @@ +%define name doracms +%define version 1.0.0 +%define release 1 +%define buildroot %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +Name: %{name} +Version: %{version} +Release: %{release} +Summary: doracms + +Group: Installation Script +License: MIT +Source: %{name}.tar.gz +BuildRoot: %{buildroot} +Requires: nodejs >= 10.11.0 +Requires: mariadb >= 10.0.0 +BuildRequires: nodejs >= 10.11.0 +AutoReqProv: no + +%description + +%global debug_package %{nil} + +%prep +%setup -q -c -n %{name} + +%build + +#It runs right before installation of rpm +%pre +getent group doracms >/dev/null || groupadd -r doracms +getent passwd doracms >/dev/null || useradd -r -g doracms -G doracms -d / -s /sbin/nologin -c "doracms" doracms + +#it install rpm package in the build time +%install +mkdir -p %{buildroot}/usr/lib/doracms +cp -r ./ %{buildroot}/usr/lib/doracms +mkdir -p %{buildroot}/var/log/doracms +cd %{buildroot}/usr/lib/doracms + + +#Post installation +%post +cp /usr/lib/doracms/doracms.service /etc/systemd/system/doracms.service +systemctl daemon-reload +systemctl enable doracms +systemctl restart doracms + +#runs on uninstallation or upgrade (uninstall previous version) +%postun +if [ $1 == 0 ] ; then + #uninstall package + systemctl stop doracms + systemctl disable doracms + rm /etc/systemd/system/doracms.service +fi + + +%clean +rm -rf %{buildroot} + +%files +%defattr(644, doracms, doracms, 755) +/usr/lib/doracms +/var/log/doracms diff --git a/doracms.tar.gz b/doracms.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8ddf9b74a6b8e3aea48916d7095e3c66e041212e Binary files /dev/null and b/doracms.tar.gz differ diff --git a/doracms.yml b/doracms.yml new file mode 100644 index 0000000000000000000000000000000000000000..381a3d2fbed155283acf643adb2b76ce0492e990 --- /dev/null +++ b/doracms.yml @@ -0,0 +1,4 @@ +version_control: git +src_repo: https://github.com/doramart/DoraCMS.git +tag_prefix: ^v +seperator: . \ No newline at end of file