Merge branch 'release' into 'master'
Release See merge request yescent/yes.blog!54
This commit is contained in:
@@ -2,6 +2,7 @@ stages:
|
||||
- check
|
||||
- build
|
||||
- deploy
|
||||
- sync
|
||||
|
||||
variables:
|
||||
DockerfilePath: "./${ProjectName}/Dockerfile"
|
||||
@@ -9,6 +10,29 @@ variables:
|
||||
MasterDockerImage: "${Ali_Docker_Registry}/${Namespace}/${MasterPackageName}"
|
||||
|
||||
|
||||
sync_to_github:
|
||||
stage: sync
|
||||
image: alpine/git
|
||||
script:
|
||||
- git config --global user.email "ci@example.com"
|
||||
- git config --global user.name "GitLab CI"
|
||||
- git remote add github https://oauth2:${GITHUB_TOKEN}@github.com/8720826/hyrule.git
|
||||
- git push github --all
|
||||
- git push github --tags
|
||||
|
||||
sync_to_gitee:
|
||||
stage: sync
|
||||
image: alpine/git
|
||||
script:
|
||||
- git config --global user.email "ci@example.com"
|
||||
- git config --global user.name "GitLab CI"
|
||||
- git remote add gitee https://oauth2:${GITEE_TOKEN}@gitee.com/q8720826/hyrule.git
|
||||
- git push gitee --all
|
||||
- git push gitee --tags
|
||||
only:
|
||||
- master
|
||||
|
||||
|
||||
check-merge-target:
|
||||
stage: check
|
||||
script:
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
## Developer Certificate of Origin and License
|
||||
|
||||
By contributing to GitLab B.V., you accept and agree to the following terms and
|
||||
conditions for your present and future contributions submitted to GitLab B.V.
|
||||
Except for the license granted herein to GitLab B.V. and recipients of software
|
||||
distributed by GitLab B.V., you reserve all right, title, and interest in and to
|
||||
your Contributions.
|
||||
|
||||
All contributions are subject to the Developer Certificate of Origin and license set out at [docs.gitlab.com/ce/legal/developer_certificate_of_origin](https://docs.gitlab.com/ce/legal/developer_certificate_of_origin).
|
||||
|
||||
_This notice should stay as the first item in the CONTRIBUTING.md file._
|
||||
|
||||
## Code of conduct
|
||||
|
||||
As contributors and maintainers of this project, we pledge to respect all people
|
||||
who contribute through reporting issues, posting feature requests, updating
|
||||
documentation, submitting pull requests or patches, and other activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free
|
||||
experience for everyone, regardless of level of experience, gender, gender
|
||||
identity and expression, sexual orientation, disability, personal appearance,
|
||||
body size, race, ethnicity, age, or religion.
|
||||
|
||||
Examples of unacceptable behavior by participants include the use of sexual
|
||||
language or imagery, derogatory comments or personal attacks, trolling, public
|
||||
or private harassment, insults, or other unprofessional conduct.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct. Project maintainers who do not follow the
|
||||
Code of Conduct may be removed from the project team.
|
||||
|
||||
This code of conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior can be
|
||||
reported by emailing contact@gitlab.com.
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org), version 1.1.0,
|
||||
available at [https://contributor-covenant.org/version/1/1/0/](https://contributor-covenant.org/version/1/1/0/).
|
||||
137
README.md
137
README.md
@@ -1,93 +1,76 @@
|
||||
# Yes.Blog
|
||||
# Hyrule 开源博客系统
|
||||
|
||||
## 概述
|
||||
|
||||
   Hyrule 是一个基于现代化技术栈构建的开源博客系统,采用简洁高效的架构设计,支持高度定制化开发。系统遵循CQRS模式,内置多数据库支持,并提供灵活的主题模板系统。
|
||||
|
||||
## 技术栈
|
||||
|
||||
- 开发语言: C# (.NET 9.0)
|
||||
- 核心框架: ASP.NET Core Minimal API
|
||||
- 架构模式: CQRS with MediatR
|
||||
- 模板引擎: Liquid
|
||||
- 数据库支持:MySQL / SQL Server /PostgreSQL
|
||||
- ORM: Entity Framework Core
|
||||
- 前端: 原生js + alpine
|
||||
|
||||
## 功能特性
|
||||
|
||||
- 多用户博客管理
|
||||
- 文章/分类/标签系统
|
||||
- 评论与审核功能
|
||||
- SEO友好
|
||||
- 自定义URL
|
||||
- Markdown支持
|
||||
- 实时主题热重载
|
||||
- RESTful API
|
||||
- 支持多种数据库
|
||||
- 支持多种文件存储方式
|
||||
|
||||
## 快速开始
|
||||
|
||||
#### 环境要求
|
||||
- .NET SDK 9.0+
|
||||
- 支持的数据库任选其一
|
||||
|
||||
#### 部署方式
|
||||
|
||||
推荐在linux系统通过docker方式一键部署
|
||||
|
||||
~~~
|
||||
docker run -e TZ=Asia/Shanghai -d --restart=always -v /data/hyrule:/app/files --name hyrule -p 8080:8080 registry.cn-guangzhou.aliyuncs.com/yescent/hyrule:latest
|
||||
|
||||
~~~
|
||||
|
||||
#### 安装运行
|
||||
|
||||
1. 部署后访问 http(s)://{domain}:{port}
|
||||
2. 填写数据库连接信息安装,此时将自动创建数据库
|
||||
3. 默认账号密码 admin / admin
|
||||
4. 后台访问地址 http(s)://{domain}:{port}/admin
|
||||
|
||||
|
||||
|
||||
## Getting started
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
#### 演示站点
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
- [https://hyrule.yescent.com](https://hyrule.yescent.com)
|
||||
- 后台 [https://hyrule.yescent.com/admin](https://hyrule.yescent.com/admin)
|
||||
- 账号密码 test / test
|
||||
|
||||
## Add your files
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin http://192.168.1.101:8080/yesblog/Yes.blog.git
|
||||
git branch -M main
|
||||
git push -uf origin main
|
||||
```
|
||||
## 许可证
|
||||
- MIT License
|
||||
|
||||
## Integrate with your tools
|
||||
您可以自由使用、修改和分发本项目的代码,但请保留原作者的版权声明和许可证信息。
|
||||
|
||||
- [ ] [Set up project integrations](http://192.1168.1.101/yesblog/Yes.blog/-/settings/integrations)
|
||||
|
||||
## Collaborate with your team
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
|
||||
## Test and Deploy
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
---
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
欢迎通过任何方式参与本项目!
|
||||
|
||||
***
|
||||
|
||||
# Editing this README
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
|
||||
## Suggestions for a good README
|
||||
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
如有疑问请通过 issues 或 discussions 与我们交流。
|
||||
@@ -19,8 +19,12 @@
|
||||
|
||||
private async Task HandleExceptionAsync(HttpContext context, Exception ex)
|
||||
{
|
||||
context.Response.ContentType = "application/problem+json";
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError;
|
||||
if (!context.Response.HasStarted)
|
||||
{
|
||||
context.Response.ContentType = "application/problem+json";
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError;
|
||||
}
|
||||
|
||||
var title = "";
|
||||
var message = "";
|
||||
var exType = ex.GetType();
|
||||
@@ -50,22 +54,25 @@
|
||||
_logger.LogError(ex, "Exception");
|
||||
}
|
||||
|
||||
var acceptHeader = context.Request.Headers["Accept"].FirstOrDefault();
|
||||
var isAjaxRequest = acceptHeader?.Contains("application/json") == true;
|
||||
if (isAjaxRequest)
|
||||
if (!context.Response.HasStarted)
|
||||
{
|
||||
var problem = new ProblemDetails
|
||||
var acceptHeader = context.Request.Headers["Accept"].FirstOrDefault();
|
||||
var isAjaxRequest = acceptHeader?.Contains("application/json") == true;
|
||||
if (isAjaxRequest)
|
||||
{
|
||||
Status = StatusCodes.Status500InternalServerError,
|
||||
Title = title,
|
||||
Type = "https://tools.ietf.org/html/rfc7231#section-6.5.1",
|
||||
Detail = message
|
||||
};
|
||||
await context.Response.WriteAsJsonAsync(problem);
|
||||
}
|
||||
else
|
||||
{
|
||||
await context.Response.WriteAsync(message);
|
||||
var problem = new ProblemDetails
|
||||
{
|
||||
Status = StatusCodes.Status500InternalServerError,
|
||||
Title = title,
|
||||
Type = "https://tools.ietf.org/html/rfc7231#section-6.5.1",
|
||||
Detail = message
|
||||
};
|
||||
await context.Response.WriteAsJsonAsync(problem);
|
||||
}
|
||||
else
|
||||
{
|
||||
await context.Response.WriteAsync(message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user