Moonglade Blog System

Build Status Docker Build and Push .NET Build Linux ACR Build and Push

The .NET blog system of edi.wang that runs on Microsoft Azure. 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.

โ˜ 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 with only ~$300 USD/month.

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 2019 v16.8+ Visual Studio Code with .NET 5.0 SDK
SQL Server 2019 SQL Server LocalDB

๐Ÿ’พ Setup Database

Create a SQL Server 2019 or LocalDB 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;"

๐Ÿ”จ Build Source

Build and run ./src/Moonglade.sln

โš™ 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. Set GetImageByCDNRedirect to true, the blog will get images from client browser using a 302 redirect.

"CDNSettings": {
    "EnableCDNRedirect": true,
    "CDNEndpoint": "https://yourendpoint.azureedge.net/moonglade-images"
}

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",
"FileSystemSettings": {
  "Path": "${basedir}\\UploadedImages"
}

The Path can be relative or absolute. "$\{basedir\}" represents the websiteโ€™s current directory.

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
}

๐Ÿคฌ 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 set the values in appsettings.[env].json or in your runtime environment variables.

"Notification": {
  "Enabled": true,
  "AzureFunctionEndpoint": "{PROD-ENV-VARIABLE}"
}

๐Ÿ”ฉ Others

๐ŸŽ‰ Blog Protocols or Standards

๐Ÿผ Customers

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