MoongladePure.Web 7.0.37

There is a newer version of this package available.
See the version list below for details.
dotnet add package MoongladePure.Web --version 7.0.37
NuGet\Install-Package MoongladePure.Web -Version 7.0.37
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.37" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MoongladePure.Web --version 7.0.37
#r "nuget: MoongladePure.Web, 7.0.37"
#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.37

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

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.23 77 5/6/2024
8.0.22 74 5/4/2024
8.0.21 99 4/7/2024
8.0.20 69 4/5/2024
8.0.19 80 4/1/2024
8.0.18 87 3/31/2024
8.0.16 82 3/26/2024
8.0.15 70 3/25/2024
8.0.14 93 3/18/2024
8.0.13 83 3/17/2024
8.0.12 94 3/17/2024
8.0.11 75 3/17/2024
8.0.10 77 3/17/2024
8.0.9 90 3/12/2024
8.0.8 101 3/4/2024
8.0.7 103 3/1/2024
8.0.6 90 2/28/2024
8.0.5 94 2/28/2024
8.0.4 100 2/28/2024
8.0.3 88 2/26/2024
8.0.2 90 2/25/2024
8.0.1 92 2/19/2024
7.0.59 93 2/18/2024
7.0.58 94 2/15/2024
7.0.57 99 2/14/2024
7.0.56 96 2/10/2024
7.0.55 88 2/6/2024
7.0.54 80 2/5/2024
7.0.53 75 2/4/2024
7.0.52 80 2/3/2024
7.0.51 81 2/2/2024
7.0.50 79 2/2/2024
7.0.49 82 1/30/2024
7.0.48 81 1/30/2024
7.0.47 86 1/28/2024
7.0.46 79 1/27/2024
7.0.45 88 1/21/2024
7.0.44 85 1/18/2024
7.0.43 99 1/12/2024
7.0.42 91 1/11/2024
7.0.41 114 1/10/2024
7.0.40 121 1/5/2024
7.0.39 101 1/5/2024
7.0.38 108 1/4/2024
7.0.37 107 1/4/2024
7.0.36 118 1/4/2024
7.0.35 108 12/31/2023
7.0.34 101 12/30/2023
7.0.33 116 12/25/2023
7.0.32 115 12/24/2023
7.0.31 108 12/18/2023
7.0.30 92 12/16/2023
7.0.29 94 12/13/2023
7.0.28 109 12/12/2023
7.0.27 103 12/11/2023
7.0.26 115 12/11/2023
7.0.25 127 12/3/2023
7.0.24 115 12/1/2023
7.0.23 93 11/26/2023
7.0.22 129 11/21/2023
7.0.21 97 11/18/2023
7.0.20 105 11/14/2023
7.0.19 114 11/6/2023
7.0.18 90 11/2/2023
7.0.17 103 11/2/2023
7.0.16 103 11/2/2023
7.0.15 84 10/31/2023
7.0.14 95 10/31/2023
7.0.13 92 10/29/2023
7.0.12 101 10/27/2023
7.0.11 111 10/24/2023
7.0.10 116 10/18/2023
7.0.9 95 10/11/2023
7.0.8 87 10/11/2023
7.0.7 115 10/10/2023
7.0.6 119 10/6/2023
7.0.5 104 9/27/2023
7.0.4 95 9/20/2023
7.0.3 111 9/18/2023
7.0.2 127 9/13/2023
7.0.1 113 9/13/2023
7.0.0 116 9/5/2023
1.1.0 127 8/20/2023