Aharonyan-Narek / Moonglade

The .NET 6 blog system of https://edi.wang, runs on Microsoft Azure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Moonglade Blog

Build Status Docker Build and Push .NET Build Linux

The .NET blog system of edi.wang that runs on Microsoft Azure. Designed for developers, enabling most common blogging features including posts, comments, categories, archive, tags and pages.

πŸ“¦ Deployment

  • It is recommended to use stable code from Release rather than master branch.

  • It is recommended to enable HTTP/2 support on your web server.

☁ Full Deploy on Azure (Recommend)

This is the way https://edi.wang is deployed, by taking advantage of as many Azure services as possible, the blog can run very fast and secure.

This diagram shows a full Azure deployment for Moonglade for reference.

image

πŸ‹ Quick Deploy on Azure

Use automated deployment script to get your Moonglade up and running in 10 minutes, follow instructions here

🐧 Quick Deploy on Linux without Docker

To quickly get it running on a new Linux machine without Docker, follow instructions here.

🐡 Development

Tools Alternative
Visual Studio 2022 v17.0+ Visual Studio Code with .NET 6.0 SDK
SQL Server 2019 SQL Server LocalDB or MySQL

πŸ’Ύ Setup Database

Create a SQL Server 2019, a LocalDB, or an MySQL database. e.g. moonglade

Update the MoongladeDatabase with your database connection string in appsettings.Development.json

"MoongladeDatabase": "Server=(localdb)\\MSSQLLocalDB;Database=moonglade;Trusted_Connection=True;"

To use MySQL, set DatabaseType to MySql

"DatabaseType": "MySql"

example MySQL connection string:

"MoongladeDatabase": "Server=localhost;Port=3306;Database=moonglade;Uid=root;Pwd=******;"

πŸ”¨ Build Source

Special hint: If you are in China, it's strongly recommended to use a "magic network" to ensure libman can restore front-end libraries successfully.

Build and run ./src/Moonglade.sln

  • Admin entrance: https://localhost:1055/admin
  • Default username: admin
  • Default password: admin123

βš™ Configuration

This section discuss system settings in appsettings.[env].json. For blog settings, please use "/admin/settings" UI.

For production, it is strongly recommended to use Environment Variables over appsetting.json file.

πŸ›‘ Authentication

Azure Active Directory

See Wiki document

Local Account (Alternative)

Set Authentication:Provider to "Local". You can manage accounts in /admin/settings/account

πŸ–Ό Image Storage

AppSettings:ImageStorage controls how blog post images are stored.

Azure Blob Storage (Preferred)

You need to create an Azure Blob Storage with container level permission.

{
  "Provider": "azurestorage"
  "AzureStorageSettings": {
    "ConnectionString": "YOUR CONNECTION STRING",
    "ContainerName": "YOUR CONTAINER NAME"
  }
}

When configured the image storage to use Azure Blob, you can take advantage of CDN for your image resources. Just enable CDN in admin settings, the blog will get images from CDN.

File System (Not Recommended)

You can also choose File System for image storage, but this will make your site root not read-only, which would be a potential security issue. And it will be harder for you to backup or update the website.

{
  "Provider": "filesystem",
  "FileSystemPath": "C:\\UploadedImages"
}

The Path can be relative or absolute.

Minio Blob Storage (Free)

You need to hava an Minio Server.

"Provider": "miniostorage"
"MinioStorageSettings": {
  "EndPoint": "Minio Server Endpoint(eg:localhost:9600)",
  "AccessKey": "Your Access Key",
  "SecretKey": "Your Secret Key",
  "BucketName": "Your BucketName",
  "WithSSL": false
}

Qiniu Blob Storage (Almost free)

You need to hava an Qiniu cloud account, and use Kodo storage service.

"Provider": "qiniustorage"
"QiniuStorageSettings": {
  "EndPoint": "Your Custom Domain",
  "AccessKey": "Your Access Key",
  "SecretKey": "Your Secret Key",
  "BucketName": "Your BucketName",
  "WithSSL": false
}

🀬 Comment Moderator

πŸ“§ Email Notification

If you need email notification for new comments, new replies and pingbacks, you have to setup the Moonglade.Notification Azure Function first, and then enable notification in admin portal.

πŸ”© Others

πŸŽ‰ Blog Protocols or Standards

  • RSS
  • Atom
  • OPML
  • Open Search
  • Pingback
  • Reader View
  • FOAF
  • RSD
  • MetaWeblog (Basic Support)
  • BlogML - Under triage
  • APML - Not planned
  • Trackback - Not planned

🐼 Example Blogs

There are a few individuals already setup thier blogs using Moonglade on Azure (Global or China), Alibaba Cloud, Tencent Cloud, etc.

Just Submit PR or issue if you want your blog to be listed here

About

The .NET 6 blog system of https://edi.wang, runs on Microsoft Azure

License:GNU General Public License v3.0


Languages

Language:C# 58.6%Language:HTML 31.6%Language:CSS 4.0%Language:JavaScript 3.1%Language:PowerShell 2.1%Language:Shell 0.6%Language:Dockerfile 0.1%