diff --git a/.github/workflows/license-templates/LICENSE.txt b/.github/workflows/license-templates/LICENSE.txt
new file mode 100644
index 00000000000..60b675e3101
--- /dev/null
+++ b/.github/workflows/license-templates/LICENSE.txt
@@ -0,0 +1,16 @@
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7c1c7d75e8e..edb4d4ee88b 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -38,6 +38,19 @@ repos:
- id: gitleaks
name: run gitleaks
description: detect hardcoded secrets
+ - repo: https://github.com/Lucas-C/pre-commit-hooks
+ rev: v1.5.5
+ hooks:
+ - id: insert-license
+ name: add license for all Markdown files
+ files: \.md$
+ args:
+ - --comment-style
+ - ''
+ - --license-filepath
+ - .github/workflows/license-templates/LICENSE.txt
+ - --fuzzy-match-generates-todo
+ exclude: ^(CHANGES|ISSUE_TEMPLATE|PULL_REQUEST_TEMPLATE)\.md$|^ui/docs/(full|smoke)-test-plan\.template\.md$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c9b79bbd266..57b7a716cd4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,3 +1,22 @@
+
+
# Contributing to Apache CloudStack (ACS)
## Summary
diff --git a/INSTALL.md b/INSTALL.md
index b9dfd908efc..0619b97f21c 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1,3 +1,22 @@
+
+
# Apache CloudStack Installation basics
This document describes how to develop, build, package and install Apache
diff --git a/PRE-COMMIT.md b/PRE-COMMIT.md
index 7d4d27c8b88..9b76929d422 100644
--- a/PRE-COMMIT.md
+++ b/PRE-COMMIT.md
@@ -1,3 +1,22 @@
+
+
# pre-commit
We run [pre-commit](https://pre-commit.com/) with
diff --git a/README.md b/README.md
index 08540a0628d..a24131958a2 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,22 @@
+
+
# Apache CloudStack
[](https://github.com/apache/cloudstack/actions/workflows/build.yml)
diff --git a/packaging/README.md b/packaging/README.md
index 78057b828b2..0c01ce5497c 100644
--- a/packaging/README.md
+++ b/packaging/README.md
@@ -1,3 +1,22 @@
+
+
# CloudStack RPM and DEB packaging
This directory contains all the required scripts and tools needed to build RPM and DEB packages for Apache CloudStack.
diff --git a/plugins/storage/object/cloudian/README.md b/plugins/storage/object/cloudian/README.md
index a0f68d7bc12..f46f06f0a78 100644
--- a/plugins/storage/object/cloudian/README.md
+++ b/plugins/storage/object/cloudian/README.md
@@ -1,3 +1,22 @@
+
+
# Cloudian HyperStore Object Storage Plugin
## Plugin Purpose
diff --git a/plugins/storage/volume/adaptive/README.md b/plugins/storage/volume/adaptive/README.md
index f018f01cd5b..d863cf117df 100644
--- a/plugins/storage/volume/adaptive/README.md
+++ b/plugins/storage/volume/adaptive/README.md
@@ -1,3 +1,22 @@
+
+
# CloudStack Volume Provider Adaptive Plugin Base
The Adaptive Plugin Base is an abstract volume storage provider that
diff --git a/plugins/storage/volume/linstor/CHANGELOG.md b/plugins/storage/volume/linstor/CHANGELOG.md
index 7da3516955d..337f7786db9 100644
--- a/plugins/storage/volume/linstor/CHANGELOG.md
+++ b/plugins/storage/volume/linstor/CHANGELOG.md
@@ -1,3 +1,22 @@
+
+
# Changelog
All notable changes to Linstor CloudStack plugin will be documented in this file.
diff --git a/plugins/storage/volume/storpool/README.md b/plugins/storage/volume/storpool/README.md
index 8b98ac8851c..1f6829b8544 100644
--- a/plugins/storage/volume/storpool/README.md
+++ b/plugins/storage/volume/storpool/README.md
@@ -1,3 +1,22 @@
+
+
# StorPool CloudStack Integration
## CloudStack Overview
diff --git a/pom.xml b/pom.xml
index 300388b8dd9..b11c7baf7dd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1016,7 +1016,6 @@
**/.vagrant
**/*.json
**/.checkstyle
- **/*.md
.java-version
.python-version
.idea/
@@ -1026,10 +1025,8 @@
.gitignore
.markdownlintignore
CHANGES.md
- CONTRIBUTING.md
- README.md
- INSTALL.md
- PRE-COMMIT.md
+ ISSUE_TEMPLATE.md
+ PULL_REQUEST_TEMPLATE.md
build/build.number
debian/cloudstack-agent.dirs
debian/cloudstack-usage.dirs
@@ -1057,7 +1054,6 @@
systemvm/agent/packages/**
systemvm/debian/**
test/integration/component/test_host_ha.sh
- test/systemvm/README.md
tools/appliance/*/template.json
tools/cli/cloudmonkey.egg-info/*
tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf
@@ -1071,6 +1067,8 @@
tools/transifex/.tx/config
ui/.*
ui/.*/**
+ ui/docs/full-test-plan.template.md
+ ui/docs/smoke-test-plan.template.md
ui/src/assets/**
ui/public/**
ui/legacy/**
diff --git a/systemvm/agent/noVNC/vendor/pako/README.md b/systemvm/agent/noVNC/vendor/pako/README.md
index 755df643d76..6b8b37a6ee1 100644
--- a/systemvm/agent/noVNC/vendor/pako/README.md
+++ b/systemvm/agent/noVNC/vendor/pako/README.md
@@ -1,3 +1,22 @@
+
+
This is an ES6-modules-compatible version of
https://github.com/nodeca/pako, based on pako version 1.0.3.
diff --git a/test/integration/plugins/linstor/README.md b/test/integration/plugins/linstor/README.md
index f7093939e01..4505d1b7d57 100644
--- a/test/integration/plugins/linstor/README.md
+++ b/test/integration/plugins/linstor/README.md
@@ -1,3 +1,22 @@
+
+
# Linstor storage plugin
This directory contains the basic VM, Volume life cycle tests for Linstor storage pool (in KVM hypervisor).
diff --git a/test/integration/plugins/scaleio/README.md b/test/integration/plugins/scaleio/README.md
index 54c9f70ad5d..47d458d34f8 100644
--- a/test/integration/plugins/scaleio/README.md
+++ b/test/integration/plugins/scaleio/README.md
@@ -1,3 +1,22 @@
+
+
# PowerFlex/ScaleIO storage plugin
This directory contains the basic VM, Volume life cycle tests for PowerFlex/ScaleIO storage pool (in KVM hypervisor).
diff --git a/test/systemvm/README.md b/test/systemvm/README.md
index 5d4f93af154..89e79c2ebff 100644
--- a/test/systemvm/README.md
+++ b/test/systemvm/README.md
@@ -1,3 +1,22 @@
+
+
# Requirements
To run these tests, first get the vagrant setup for the systemvm working,
diff --git a/tools/devcloud4/README.md b/tools/devcloud4/README.md
index 96d33c914d4..d940f79630d 100644
--- a/tools/devcloud4/README.md
+++ b/tools/devcloud4/README.md
@@ -1,3 +1,22 @@
+
+
# Devcloud 4
## Introduction
diff --git a/tools/devcloud4/advanced/README.md b/tools/devcloud4/advanced/README.md
index 8c82b4e3a50..229e9385753 100644
--- a/tools/devcloud4/advanced/README.md
+++ b/tools/devcloud4/advanced/README.md
@@ -1,3 +1,22 @@
+
+
### Configure virtualbox
1. Open virtualbox and navigate to its preferences/settings window.
diff --git a/tools/devcloud4/basic/README.md b/tools/devcloud4/basic/README.md
index 21b5d97fd4a..91fa81462d6 100644
--- a/tools/devcloud4/basic/README.md
+++ b/tools/devcloud4/basic/README.md
@@ -1,3 +1,22 @@
+
+
### Configure virtualbox
1. Open virtualbox and navigate to its preferences/settings window.
diff --git a/tools/devcloud4/common/binary-installation/README.md b/tools/devcloud4/common/binary-installation/README.md
index e69de29bb2d..ef14affc68c 100644
--- a/tools/devcloud4/common/binary-installation/README.md
+++ b/tools/devcloud4/common/binary-installation/README.md
@@ -0,0 +1,18 @@
+
diff --git a/tools/devcloud4/common/development-installation/README.md b/tools/devcloud4/common/development-installation/README.md
index e69de29bb2d..ef14affc68c 100644
--- a/tools/devcloud4/common/development-installation/README.md
+++ b/tools/devcloud4/common/development-installation/README.md
@@ -0,0 +1,18 @@
+
diff --git a/tools/docker/README.md b/tools/docker/README.md
index 024eebb2aad..676101c32d6 100644
--- a/tools/docker/README.md
+++ b/tools/docker/README.md
@@ -1,3 +1,22 @@
+
+
# Docker Files for Apache CloudStack
Dockerfiles used to build CloudStack images are available on Docker hub.
diff --git a/ui/README.md b/ui/README.md
index c794c22b182..170232b574e 100644
--- a/ui/README.md
+++ b/ui/README.md
@@ -1,3 +1,22 @@
+
+
# CloudStack UI
A modern role-based progressive CloudStack UI based on Vue.js and Ant Design.
diff --git a/ui/docs/customize.md b/ui/docs/customize.md
index 1e0688e3370..5a3807e41d7 100644
--- a/ui/docs/customize.md
+++ b/ui/docs/customize.md
@@ -1,3 +1,22 @@
+
+
# UI customization
Use a `public/config.json` (or `dist/config.json` after build) file for customizing theme, logos,...
diff --git a/ui/docs/development.md b/ui/docs/development.md
index 8b1f67b7c42..363c6a3795b 100644
--- a/ui/docs/development.md
+++ b/ui/docs/development.md
@@ -1,3 +1,22 @@
+
+
# UI Development
The modern CloudStack UI is role-based progressive app that uses Vue.js and Ant Design.
diff --git a/ui/src/style/README.md b/ui/src/style/README.md
index 8e3fd832bd5..ee54d6ed7cd 100644
--- a/ui/src/style/README.md
+++ b/ui/src/style/README.md
@@ -1,3 +1,22 @@
+
+
# index.less
- src/styles/index.less imports all necessary rules for cloudstack