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.9.0", oauthDisabled: false, }), ], }) - Go to GitHub Developer Settings.
- Click
New OAuth Appand fill in:- Application name: e.g. "Twilight Blog CMS"
- Homepage URL: your-site-URL (e.g. "https://blog.spr-aachen.com")
- Authorization callback URL: your-site-URL/oauth/callback (e.g. "https://blog.spr-aachen.com/oauth/callback")
- 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-secret
2. Update the CMS Config
Edit public/admin/config.yml:
backend:
name: github
repo: your-username/your-repo-name # Replace with your GitHub repo
branch: main # Replace with your branch name
site_domain: your-domain # Replace with your domain
base_url: https://your-domain # Replace with your production URL
auth_endpoint: oauth3. Deploy and Access
- Push changes to your GitHub repository.
- Choose an SSR-capable platform for deployment, inject the
.envvalues into environment variables, then start deploying. - Open
https://your-domain/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 imported before deployment.
- 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
Open an Issue in the project repository if you need assistance.
