mirror of
https://github.com/BeardedTek/flowbite-beardedtek.com.git
synced 2025-12-06 05:31:52 +00:00
3.4 KiB
3.4 KiB
Gitea Authentication Setup for BeardedTek
This guide will help you set up Sveltia CMS with your Gitea instance at https://git.beardedtek.com.
✅ Current Configuration
Your Sveltia CMS is now configured to use:
- Gitea Instance:
https://git.beardedtek.com - Repository:
beardedtek/flowbite-beardedtek.com - Backend: GitLab (compatible with Gitea)
- API Endpoint:
https://git.beardedtek.com/api/v1 - Auth Endpoint:
https://git.beardedtek.com/login/oauth/authorize
🔧 Setup Steps
1. Create Gitea OAuth Application
-
Login to your Gitea instance:
- Go to
https://git.beardedtek.com - Login with your account
- Go to
-
Create OAuth App:
- Go to Settings → Applications
- Click "Create new OAuth application"
- Fill in the details:
- Application Name:
Sveltia CMS - Redirect URIs:
https://beardedtek.com/admin/(or your domain) - Scopes: Select
repoanduser:email
- Application Name:
-
Save the credentials:
- Copy the Client ID
- Copy the Client Secret
2. Environment Variables
Add these environment variables to your deployment:
OAUTH_CLIENT_ID=your_gitea_client_id
OAUTH_CLIENT_SECRET=your_gitea_client_secret
3. Repository Access
Ensure your Gitea OAuth app has access to:
- Repository:
beardedtek/flowbite-beardedtek.com - Permissions: Read and write access
🚀 Testing
Local Development
- Run
hugo server - Visit
http://localhost:1313/admin/ - You should see the Gitea login option
Production
- Deploy your site with the environment variables
- Visit
https://beardedtek.com/admin/ - Click "Login with Gitea"
🔍 Troubleshooting
Common Issues
-
"Invalid redirect URI":
- Make sure the redirect URI in Gitea matches your site URL exactly
- Include the trailing slash:
https://beardedtek.com/admin/
-
"Repository not found":
- Verify the repo name is correct:
beardedtek/flowbite-beardedtek.com - Ensure the OAuth app has repository access
- Verify the repo name is correct:
-
"Authentication failed":
- Check that environment variables are set correctly
- Verify Client ID and Secret are correct
Debug Steps
-
Check Gitea API:
- Visit
https://git.beardedtek.com/api/v1/version - Should return Gitea version info
- Visit
-
Test OAuth Flow:
- Try logging in manually at
https://git.beardedtek.com/login/oauth/authorize - Verify your OAuth app appears in the list
- Try logging in manually at
-
Check Repository Access:
- Ensure your user has write access to the repository
- Check repository permissions in Gitea
📋 Configuration Files
Main Config (static/admin/config.yml)
backend:
name: gitlab
repo: beardedtek/flowbite-beardedtek.com
branch: main
base_url: https://git.beardedtek.com/api/v1
auth_endpoint: https://git.beardedtek.com/login/oauth/authorize
Environment Variables Needed
OAUTH_CLIENT_ID=your_client_id_here
OAUTH_CLIENT_SECRET=your_client_secret_here
🎯 Next Steps
- Create the OAuth app in your Gitea instance
- Set environment variables in your deployment
- Test locally with
hugo server - Deploy to production and test the full flow
📞 Support
If you encounter issues:
- Check the Gitea logs for authentication errors
- Verify all URLs and credentials are correct
- Test the OAuth flow manually in your browser
- Check that your repository exists and is accessible
Your Sveltia CMS is now ready to use with Gitea authentication!