Admin Panel Configuration
About 299 wordsAbout 1 min
2025-10-10
Backend administration setup using Decap CMS.
File Structure
project-root/
├── public/
│ └── admin/
│ └── config.yml # Decap CMS configuration
├── astro.config.mjs # Includes Decap CMS integration
└── .env # Environment variablesSetup Steps
1. Create a GitHub OAuth App
- Edit
astro.config.mjsand make sureoauthDisabledisfalse:
export default defineConfig({
integrations: [
decapCmsOauth({
decapCMSVersion: "3.3.3",
oauthDisabled: false,
}),
],
})- Go to GitHub Developer Settings.
- Click New OAuth App and fill in:
- Application name: e.g.
Twilight Blog CMS - Homepage URL: your site URL
- Authorization callback URL:
https://your-domain.com/oauth/callback
- Application name: e.g.
- Click Register application.
- Generate a Client Secret.
- Create a local
.envfile with:
OAUTH_GITHUB_CLIENT_ID=your-github-client-id
OAUTH_GITHUB_CLIENT_SECRET=your-github-client-secret2. Update the CMS Config
Edit public/admin/config.yml:
backend:
name: github
branch: main
repo: your-username/your-repo-name # Replace with your GitHub repo
site_domain: your-domain.com # Replace with your domain
base_url: https://your-domain.com # Replace with your production URL
auth_endpoint: oauth3. Deploy and Access
- Push changes to your GitHub repository.
- Deploy to an SSR-capable platform and inject the
.envvalues into environment variables. - Open
https://your-domain.com/adminto access the CMS dashboard.
Troubleshooting
Common Issues
- OAuth authentication fails
- Confirm the Client ID/Secret are correct.
- Double-check the callback URL.
- Cannot access the admin panel
- Ensure environment variables are available in production.
- Confirm the hosting platform supports SSR.
- Content fails to save
- Verify GitHub repository permissions.
- Confirm the branch name matches the config.
- Dev server fails to start
- Check for missing environment variables.
- Reinstall dependencies if needed.
Getting Help
- Review the Decap CMS documentation
- Check the astro-decap-cms-oauth project
- Open an Issue in this repository for support
