MoongladePure.Web 7.0.23

There is a newer version of this package available.
See the version list below for details.
dotnet add package MoongladePure.Web --version 7.0.23                
NuGet\Install-Package MoongladePure.Web -Version 7.0.23                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MoongladePure.Web" Version="7.0.23" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MoongladePure.Web --version 7.0.23                
#r "nuget: MoongladePure.Web, 7.0.23"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MoongladePure.Web as a Cake Addin
#addin nuget:?package=MoongladePure.Web&version=7.0.23

// Install MoongladePure.Web as a Cake Tool
#tool nuget:?package=MoongladePure.Web&version=7.0.23                

MoongladePure

GPL licensed Pipeline stat Test Coverage NuGet version (MoongladePure.Core ManHours Website

MoongladePure, regain control over your data.

MoongladePure can be deployed completely on-premises without coupling to any particular cloud. 100% local!

MoongladePure uses MySQL as database and file system as data store. It's extremely easy to try and deploy!

<div align=center> <img src="./assets/demo.png"> </div>

Run locally

Install .NET 7 SDK.

Clone the project and go to the web project to run it. Only for development, NOT for production!

git clone https://gitlab.aiursoft.cn/aiursoft/moongladepure.git
cd ./MoongladePure/src/Moonglade.Web/
ASPNETCORE_ENVIRONMENT=Development dotnet run --urls=http://0.0.0.0:8080

You may see the following output:

warn: MoongladePure.Web[0]
      Running in environment: Development.
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://0.0.0.0:8080
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.

Now open your browser and browse to http://localhost:8080. You should see the MoongladePure welcome page.

Run in Docker

Install Docker and Docker-Compose here.

Then run the following commands in the project path:

docker-compose build
docker-compose up

That will start a web server at http://localhost:8080 and you can test the app.

Run in a production server

It is suggested to use Ubuntu 22.04 LTS as the operating system.

Prerequisites

  • MySQL
  • .NET
  • Caddy(Optional)

Prepare MySQL Server

Install MySQL server as the database of MoongladePure.

The database can be a different server from the Web app server.

sudo apt install mysql-server -y
sudo systemctl enable mysql
sudo systemctl start mysql

Set admin password:

sudo mysql_secure_installation

Or

sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword';
exit;

To sign in your MySQL:

sudo mysql -u root -p

Create a database for MoongladePure:

CREATE DATABASE MoongladePure;
CREATE USER 'moongladepure'@'localhost' IDENTIFIED BY 'YOUR_STRONG_PASSWORD';
GRANT ALL PRIVILEGES ON MoongladePure.* TO 'moongladepure'@'localhost';
FLUSH PRIVILEGES;
exit;

Prepare a storage path

Create a folder for MoongladePure to store data:

sudo mkdir /mnt/datastore
sudo chown -R www-data:www-data /mnt/datastore

Download MoongladePure

You can download MoongladePure via:

wget https://gitlab.aiursoft.cn/aiursoft/moongladepure/-/archive/master/moongladepure-master.tar.gz
tar -zxvf ./moongladepure-master.tar.gz moongladepure-master/
ls

Build MoongladePure

Install dotnet7 first.

sudo apt install -y dotnet7

Prepare a directory:

sudo mkdir -p /opt/apps/MoongladePure
sudo chown -R www-data:www-data /opt/apps/MoongladePure

Then build it:

dotnet publish -c Release -o ./bin -r linux-x64 --no-self-contained ./moongladepure-master/src/Moonglade.Web/MoongladePure.Web.csproj

Copy the files to the directory:

sudo cp ./bin/* /opt/apps/MoongladePure/ -rv
sudo chown -R www-data:www-data /opt/apps/MoongladePure

Download related fonts:

sudo mkdir /usr/share/fonts
sudo wget https://gitlab.aiursoft.cn/aiursoft/moongladepure/-/raw/master/assets/OpenSans-Regular.ttf -O /usr/share/fonts/OpenSans-Regular.ttf
sudo chown www-data:www-data /usr/share/fonts/OpenSans-Regular.ttf

Edit the configuration

Copy the configuration file as production first:

sudo -u www-data cp /opt/apps/MoongladePure/appsettings.json /opt/apps/MoongladePure/appsettings.Production.json

Then edit the production JSON file.

  • Make the database connection string to your real database.
  • Make the storage path to be your real storage path.
sudo -u www-data vim /opt/apps/MoongladePure/appsettings.Production.json

Run MoongladePure

First register MoongladePure as a service:

echo '[Unit]
Description=MoongladePure Service
After=network.target mysql.service
Wants=network.target mysql.service

[Service]
Type=simple
User=www-data
ExecStart=/usr/bin/dotnet /opt/apps/MoongladePure/MoongladePure.Web.dll --urls=http://0.0.0.0:48466/
WorkingDirectory=/opt/apps/MoongladePure
Restart=always
RestartSec=10
KillSignal=SIGINT
Environment="ASPNETCORE_ENVIRONMENT=Production"
Environment="DOTNET_PRINT_TELEMETRY_MESSAGE=false"
Environment="DOTNET_CLI_TELEMETRY_OPTOUT=1"
Environment="ASPNETCORE_FORWARDEDHEADERS_ENABLED=true"

[Install]
WantedBy=multi-user.target' | sudo tee -a /etc/systemd/system/moongladepure.service

Then start the service.

sudo systemctl daemon-reload
sudo systemctl enable moongladepure
sudo systemctl start moongladepure

Now you can visit your MoongladePure site via http://your-ip:48466.

The admin panel is at http://your-ip:48466/admin. The default username is admin and password is admin123.

Prepare HTTPS

Please make sure you have a domain name ready and point to your server's IP address.

Then install a reverse proxy server. For example, I'm using Caddy.

echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" | sudo tee -a /etc/apt/sources.list.d/caddy-fury.list
sudo apt update
sudo apt install caddy -y

Then edit the Caddyfile:

sudo vim /etc/caddy/Caddyfile

Add the following content:

your.domain.com {
        reverse_proxy http://localhost:48466 {
        }
}

Then restart Caddy:

sudo systemctl restart caddy

Now try to open your browser and try:

https://your.domain.com

Advanced setup

MoongladePure supports scaling out. You can deploy multiple MoongladePure instances to serve your users.

Moonglade-scale-out

The following articles might be needed.

You can follow the best practice after having a Linux server.

If you deployed the MySQL database on another server, you might need to set up MySQL to allow remote connection.

If you want to share the storage path on a different remote server to scale out, you can use NFS to share the folder.

Yes! MoongladePure is stateless. You can setup multiple MoongladePure Web servers to scale out and shares the same database and NFS storage.

And in that case, you need Caddy as a load balance. Here are some tips:

It is also suggested to mount a big disk to save your blog's content. View more here:

How to contribute

There are many ways to contribute to the project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.

Even if you with push rights on the repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your workflow cruft out of sight.

We're also interested in your feedback on the future of this project. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.44 67 9/21/2024
8.0.43 103 7/24/2024
8.0.42 95 7/23/2024
8.0.41 102 7/19/2024
8.0.40 98 7/14/2024
8.0.39 84 7/11/2024
8.0.38 84 7/10/2024
8.0.37 86 7/9/2024
8.0.36 94 7/8/2024
8.0.35 107 6/30/2024
8.0.34 112 6/29/2024
8.0.33 96 6/25/2024
8.0.32 96 6/21/2024
8.0.31 116 6/18/2024
8.0.30 95 6/12/2024
8.0.29 88 6/11/2024
8.0.28 107 6/8/2024
8.0.27 84 6/6/2024
8.0.26 99 6/5/2024
8.0.24 112 5/16/2024
8.0.23 107 5/6/2024
8.0.22 110 5/4/2024
8.0.21 128 4/7/2024
8.0.20 93 4/5/2024
8.0.19 115 4/1/2024
8.0.18 114 3/31/2024
8.0.16 131 3/26/2024
8.0.15 104 3/25/2024
8.0.14 128 3/18/2024
8.0.13 106 3/17/2024
8.0.12 128 3/17/2024
8.0.11 108 3/17/2024
8.0.10 108 3/17/2024
8.0.9 121 3/12/2024
8.0.8 139 3/4/2024
8.0.7 139 3/1/2024
8.0.6 117 2/28/2024
8.0.5 120 2/28/2024
8.0.4 125 2/28/2024
8.0.3 116 2/26/2024
8.0.2 101 2/25/2024
8.0.1 122 2/19/2024
7.0.59 127 2/18/2024
7.0.58 112 2/15/2024
7.0.57 133 2/14/2024
7.0.56 124 2/10/2024
7.0.55 124 2/6/2024
7.0.54 118 2/5/2024
7.0.53 114 2/4/2024
7.0.52 117 2/3/2024
7.0.51 108 2/2/2024
7.0.50 112 2/2/2024
7.0.49 92 1/30/2024
7.0.48 115 1/30/2024
7.0.47 112 1/28/2024
7.0.46 90 1/27/2024
7.0.45 119 1/21/2024
7.0.44 114 1/18/2024
7.0.43 131 1/12/2024
7.0.42 120 1/11/2024
7.0.41 121 1/10/2024
7.0.40 137 1/5/2024
7.0.39 110 1/5/2024
7.0.38 137 1/4/2024
7.0.37 136 1/4/2024
7.0.36 151 1/4/2024
7.0.35 141 12/31/2023
7.0.34 127 12/30/2023
7.0.33 136 12/25/2023
7.0.32 142 12/24/2023
7.0.31 141 12/18/2023
7.0.30 124 12/16/2023
7.0.29 125 12/13/2023
7.0.28 135 12/12/2023
7.0.27 134 12/11/2023
7.0.26 144 12/11/2023
7.0.25 152 12/3/2023
7.0.24 148 12/1/2023
7.0.23 126 11/26/2023
7.0.22 161 11/21/2023
7.0.21 118 11/18/2023
7.0.20 132 11/14/2023
7.0.19 143 11/6/2023
7.0.18 117 11/2/2023
7.0.17 137 11/2/2023
7.0.16 133 11/2/2023
7.0.15 111 10/31/2023
7.0.14 122 10/31/2023
7.0.13 123 10/29/2023
7.0.12 129 10/27/2023
7.0.11 121 10/24/2023
7.0.10 147 10/18/2023
7.0.9 124 10/11/2023
7.0.8 116 10/11/2023
7.0.7 147 10/10/2023
7.0.6 136 10/6/2023
7.0.5 118 9/27/2023
7.0.4 122 9/20/2023
7.0.3 126 9/18/2023
7.0.2 155 9/13/2023
7.0.1 145 9/13/2023
7.0.0 143 9/5/2023
1.1.0 153 8/20/2023