Skip to content

Commit c6c118e

Browse files
committed
fix: improve installer flow storage diagnostics and admin UX
1 parent 8d15a1f commit c6c118e

71 files changed

Lines changed: 5135 additions & 104 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
55
APP_URL=http://localhost
6+
ASSET_URL=
67

78
# Production must set APP_ENV=production, APP_DEBUG=false, a real APP_KEY, and the real HTTPS APP_URL.
9+
# For subdirectory installs such as https://example.com/cms, set APP_URL=https://example.com/cms and ASSET_URL=https://example.com/cms.
810

911
SEO_AUTO_REGENERATE_SITEMAP=false
1012
GENERATE_SITEMAP_ON_DEPLOY=false
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Bug report
2+
description: Report a reproducible problem in Mini CMS.
3+
title: "[Bug]: "
4+
labels:
5+
- bug
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Thanks for reporting a bug. Do not include secrets, production database files, `.env` values, private URLs, or customer data.
11+
- type: input
12+
id: version
13+
attributes:
14+
label: Version
15+
description: Mini CMS version, commit SHA, or release tag.
16+
placeholder: v0.2.0-beta
17+
validations:
18+
required: true
19+
- type: dropdown
20+
id: area
21+
attributes:
22+
label: Area
23+
options:
24+
- Public frontend
25+
- Admin panel
26+
- Menus
27+
- Pages and blocks
28+
- News
29+
- Galleries and media
30+
- Themes
31+
- SEO/sitemap
32+
- SQLite/deployment
33+
- Other
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: steps
38+
attributes:
39+
label: Steps to reproduce
40+
description: Provide the smallest reliable reproduction.
41+
placeholder: |
42+
1. Go to ...
43+
2. Click ...
44+
3. See ...
45+
validations:
46+
required: true
47+
- type: textarea
48+
id: expected
49+
attributes:
50+
label: Expected behavior
51+
validations:
52+
required: true
53+
- type: textarea
54+
id: actual
55+
attributes:
56+
label: Actual behavior
57+
validations:
58+
required: true
59+
- type: textarea
60+
id: environment
61+
attributes:
62+
label: Environment
63+
description: PHP, Laravel, browser, OS, web server, and database details.
64+
placeholder: |
65+
PHP:
66+
OS:
67+
Browser:
68+
Web server:
69+
Database:
70+
validations:
71+
required: false
72+
- type: textarea
73+
id: logs
74+
attributes:
75+
label: Relevant logs
76+
description: Paste redacted logs only.
77+
render: shell
78+
validations:
79+
required: false
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Feature request
2+
description: Suggest an improvement for Mini CMS.
3+
title: "[Feature]: "
4+
labels:
5+
- enhancement
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Please keep requests focused on Mini CMS. Do not include private client data, secrets, or production credentials.
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: Problem
15+
description: What user or maintainer problem would this solve?
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: proposal
20+
attributes:
21+
label: Proposed solution
22+
description: Describe the smallest useful change.
23+
validations:
24+
required: true
25+
- type: dropdown
26+
id: scope
27+
attributes:
28+
label: Scope
29+
options:
30+
- Documentation
31+
- Public frontend
32+
- Admin UX
33+
- CMS workflow
34+
- Deployment
35+
- Security
36+
- Testing
37+
- Other
38+
validations:
39+
required: true
40+
- type: textarea
41+
id: alternatives
42+
attributes:
43+
label: Alternatives considered
44+
validations:
45+
required: false
46+
- type: checkboxes
47+
id: constraints
48+
attributes:
49+
label: Compatibility
50+
options:
51+
- label: This can work with SQLite as the default MVP database.
52+
- label: This does not require a major architecture rewrite.
53+
- label: This does not require storing secrets in the repository.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## Summary
2+
3+
Describe the change and why it is needed.
4+
5+
## Scope
6+
7+
- [ ] Bug fix
8+
- [ ] Documentation
9+
- [ ] Tests
10+
- [ ] Deployment/release
11+
- [ ] UI/accessibility
12+
- [ ] Other
13+
14+
## Verification
15+
16+
Run and check:
17+
18+
```bash
19+
composer validate
20+
npm run build
21+
php artisan test
22+
```
23+
24+
For SQLite/deployment changes:
25+
26+
```bash
27+
php artisan sqlite:health
28+
```
29+
30+
## Security Checklist
31+
32+
- [ ] No `.env` values, credentials, API keys, tokens, production DBs, or private URLs are included.
33+
- [ ] No `database/*.sqlite*`, `storage` uploads, `public/storage`, `public/sitemap.xml`, `vendor`, `node_modules`, or ZIP files are included.
34+
- [ ] Upload, auth, role/permission, SEO, sitemap, and route behavior are not changed unless explicitly described.
35+
36+
## Notes
37+
38+
Add migration notes, deployment notes, or screenshots when relevant.

.github/workflows/package.yml

Lines changed: 81 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,34 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v4
2121

22-
- name: Create clean source package
22+
- name: Resolve package version
2323
shell: bash
2424
run: |
2525
set -euo pipefail
2626
27-
mkdir -p dist
28-
2927
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
3028
PACKAGE_VERSION="${GITHUB_REF_NAME}"
3129
else
3230
PACKAGE_VERSION="${GITHUB_SHA}"
3331
fi
3432
35-
PACKAGE_NAME="mini-cms-source-${PACKAGE_VERSION}"
33+
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> "${GITHUB_ENV}"
34+
echo "SOURCE_PACKAGE=mini-cms-source-${PACKAGE_VERSION}" >> "${GITHUB_ENV}"
35+
echo "INSTALLABLE_PACKAGE=mini-cms-installable-${PACKAGE_VERSION}" >> "${GITHUB_ENV}"
36+
37+
- name: Create clean source package
38+
shell: bash
39+
run: |
40+
set -euo pipefail
41+
42+
mkdir -p dist
3643
3744
rsync -av . "dist/mini-cms" \
3845
--exclude=".git" \
3946
--exclude="node_modules" \
4047
--exclude="vendor" \
4148
--exclude=".env" \
49+
--include=".env.example" \
4250
--exclude=".env.*" \
4351
--exclude="database/database.sqlite" \
4452
--exclude="database/*.sqlite" \
@@ -65,25 +73,86 @@ jobs:
6573
--exclude="*.zip"
6674
6775
cd dist
68-
zip -r "${PACKAGE_NAME}.zip" mini-cms
69-
echo "PACKAGE_PATH=dist/${PACKAGE_NAME}.zip" >> "${GITHUB_ENV}"
70-
echo "PACKAGE_NAME=${PACKAGE_NAME}" >> "${GITHUB_ENV}"
76+
zip -r "${SOURCE_PACKAGE}.zip" mini-cms
77+
cd ..
78+
rm -rf dist/mini-cms
79+
echo "SOURCE_PACKAGE_PATH=dist/${SOURCE_PACKAGE}.zip" >> "${GITHUB_ENV}"
80+
81+
- name: Prepare installable package dependencies
82+
shell: bash
83+
run: |
84+
set -euo pipefail
85+
86+
composer install --no-dev --optimize-autoloader --no-interaction --prefer-dist
87+
npm ci
88+
npm run build
89+
90+
- name: Create installable package
91+
shell: bash
92+
run: |
93+
set -euo pipefail
94+
95+
rsync -av . "dist/mini-cms" \
96+
--exclude=".git" \
97+
--exclude="node_modules" \
98+
--exclude=".env" \
99+
--include=".env.example" \
100+
--exclude=".env.*" \
101+
--exclude="database/database.sqlite" \
102+
--exclude="database/*.sqlite" \
103+
--exclude="database/*.sqlite-journal" \
104+
--exclude="database/*.sqlite-wal" \
105+
--exclude="database/*.sqlite-shm" \
106+
--include="storage/app/.gitignore" \
107+
--include="storage/app/private/.gitignore" \
108+
--include="storage/app/public/.gitignore" \
109+
--include="storage/app/public/.htaccess" \
110+
--exclude="storage/app/private/*" \
111+
--exclude="storage/app/public/*" \
112+
--exclude="storage/app/verification" \
113+
--exclude="storage/logs" \
114+
--exclude="storage/framework/cache" \
115+
--exclude="storage/framework/sessions" \
116+
--exclude="storage/framework/testing" \
117+
--exclude="storage/framework/views" \
118+
--exclude="public/storage" \
119+
--exclude="public/sitemap.xml" \
120+
--exclude="public/hot" \
121+
--exclude="tests" \
122+
--exclude="releases" \
123+
--exclude="dist" \
124+
--exclude="*.zip"
125+
126+
cd dist
127+
zip -r "${INSTALLABLE_PACKAGE}.zip" mini-cms
128+
cd ..
129+
rm -rf dist/mini-cms
130+
echo "INSTALLABLE_PACKAGE_PATH=dist/${INSTALLABLE_PACKAGE}.zip" >> "${GITHUB_ENV}"
71131
72132
# Push artifact = temporary workflow output for the latest main branch package.
73133
- name: Upload source ZIP artifact
74134
if: github.ref == 'refs/heads/main'
75135
uses: actions/upload-artifact@v4
76136
with:
77-
name: ${{ env.PACKAGE_NAME }}
78-
path: ${{ env.PACKAGE_PATH }}
137+
name: ${{ env.SOURCE_PACKAGE }}
138+
path: ${{ env.SOURCE_PACKAGE_PATH }}
139+
retention-days: 30
140+
141+
# Installable artifact = no-composer/no-node hosting package with vendor and built assets included.
142+
- name: Upload installable ZIP artifact
143+
if: github.ref == 'refs/heads/main'
144+
uses: actions/upload-artifact@v4
145+
with:
146+
name: ${{ env.INSTALLABLE_PACKAGE }}
147+
path: ${{ env.INSTALLABLE_PACKAGE_PATH }}
79148
retention-days: 30
80149

81-
# Tag release asset = versioned downloadable release package.
150+
# Tag release asset = versioned downloadable release packages.
82151
- name: Create GitHub Release
83152
if: startsWith(github.ref, 'refs/tags/v')
84153
env:
85154
GH_TOKEN: ${{ github.token }}
86155
run: |
87-
gh release create "${GITHUB_REF_NAME}" "${PACKAGE_PATH}" \
156+
gh release create "${GITHUB_REF_NAME}" "${SOURCE_PACKAGE_PATH}" "${INSTALLABLE_PACKAGE_PATH}" \
88157
--title "${GITHUB_REF_NAME}" \
89-
--notes "Mini CMS release ${GITHUB_REF_NAME}"
158+
--notes "Mini CMS release ${GITHUB_REF_NAME}. Use the installable ZIP for shared hosting installs."

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
# Laravel runtime
1111
/storage/*.key
12+
/storage/app/installed.lock
1213
/storage/logs/
1314
/storage/framework/cache/
1415
/storage/framework/sessions/

BACKUP.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,6 @@ php artisan optimize
6767
- Never expose `database/database.sqlite` publicly.
6868
- Never restore the database without matching media storage if media paths changed.
6969
- Take a database backup before migrations.
70+
- Take a backup before running the browser installer against any non-empty or previously configured site.
71+
- Take a backup before replacing code for a product update; see `docs/UPDATE.md`.
7072
- If the app is running in WAL mode, use a backup method that includes a consistent SQLite snapshot or includes matching WAL/SHM files.

CODE_OF_CONDUCT.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Code Of Conduct
2+
3+
## Our Pledge
4+
5+
We as contributors and maintainers pledge to make participation in Mini CMS a respectful and harassment-free experience for everyone.
6+
7+
## Expected Behavior
8+
9+
- Be respectful and constructive.
10+
- Focus criticism on code, documentation, design, and security outcomes.
11+
- Assume good intent, but be direct when something is unsafe or incorrect.
12+
- Keep discussions relevant to the project.
13+
14+
## Unacceptable Behavior
15+
16+
- Harassment, threats, or discriminatory language
17+
- Personal attacks
18+
- Publishing private information without permission
19+
- Sharing secrets, credentials, or private production data
20+
- Repeatedly derailing technical discussions
21+
22+
## Enforcement
23+
24+
Maintainers may remove comments, close issues, reject contributions, or block participants who violate this code of conduct.
25+
26+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers through the contact methods listed on the repository.

0 commit comments

Comments
 (0)