Show /setup URL in setup scripts
Direct users to the admin account creation page instead of root URL. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -165,8 +165,22 @@ Polish and UX improvements after the 4.1.1 stability release.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 4. Forced First-Login Setup
|
||||||
|
|
||||||
|
**Status:** Planned
|
||||||
|
|
||||||
|
**Problem:** Users can navigate the app without creating an admin account first. Should force password setup before anything else.
|
||||||
|
|
||||||
|
**Solution:** Middleware/decorator that redirects to setup page if no users exist.
|
||||||
|
|
||||||
|
### Files to Modify
|
||||||
|
- `frontends/web/app.py` (add before_request check)
|
||||||
|
- `frontends/web/templates/setup.html` (ensure it blocks other nav)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- Keep 4.1.2 focused - 3 features max
|
- Keep 4.1.2 focused - 4 small features
|
||||||
- Don't break DCT compatibility (4.1.1 RS format is stable)
|
- Don't break DCT compatibility (4.1.1 RS format is stable)
|
||||||
- Test on Pi before release
|
- Test on Pi before release
|
||||||
|
|||||||
@@ -373,15 +373,15 @@ HOSTNAME=$(hostname)
|
|||||||
# Build the access URL
|
# Build the access URL
|
||||||
if [ "$ENABLE_HTTPS" = "true" ]; then
|
if [ "$ENABLE_HTTPS" = "true" ]; then
|
||||||
if [ "$USE_PORT_443" = "true" ]; then
|
if [ "$USE_PORT_443" = "true" ]; then
|
||||||
ACCESS_URL="https://$PI_IP"
|
ACCESS_URL="https://$PI_IP/setup"
|
||||||
ACCESS_URL_LOCAL="https://$HOSTNAME.local"
|
ACCESS_URL_LOCAL="https://$HOSTNAME.local/setup"
|
||||||
else
|
else
|
||||||
ACCESS_URL="https://$PI_IP:5000"
|
ACCESS_URL="https://$PI_IP:5000/setup"
|
||||||
ACCESS_URL_LOCAL="https://$HOSTNAME.local:5000"
|
ACCESS_URL_LOCAL="https://$HOSTNAME.local:5000/setup"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
ACCESS_URL="http://$PI_IP:5000"
|
ACCESS_URL="http://$PI_IP:5000/setup"
|
||||||
ACCESS_URL_LOCAL="http://$HOSTNAME.local:5000"
|
ACCESS_URL_LOCAL="http://$HOSTNAME.local:5000/setup"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gum style \
|
gum style \
|
||||||
@@ -401,7 +401,7 @@ gum style \
|
|||||||
"Setup Complete!"
|
"Setup Complete!"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
gum style --foreground 82 --bold "Access URL:"
|
gum style --foreground 82 --bold "Create your admin account:"
|
||||||
gum style --foreground 226 " $ACCESS_URL"
|
gum style --foreground 226 " $ACCESS_URL"
|
||||||
gum style --foreground 245 " $ACCESS_URL_LOCAL (if mDNS works)"
|
gum style --foreground 245 " $ACCESS_URL_LOCAL (if mDNS works)"
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
16
rpi/setup.sh
16
rpi/setup.sh
@@ -446,15 +446,15 @@ echo ""
|
|||||||
|
|
||||||
PI_IP=$(hostname -I | awk '{print $1}')
|
PI_IP=$(hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
echo -e "${GREEN}Your Stegasoo server:${NC}"
|
echo -e "${GREEN}Create your admin account:${NC}"
|
||||||
if [ "$ENABLE_HTTPS" = "true" ]; then
|
if [ "$ENABLE_HTTPS" = "true" ]; then
|
||||||
if [ "$USE_PORT_443" = "true" ]; then
|
if [ "$USE_PORT_443" = "true" ]; then
|
||||||
echo -e " ${YELLOW}https://$PI_IP${NC}"
|
echo -e " ${YELLOW}https://$PI_IP/setup${NC}"
|
||||||
else
|
else
|
||||||
echo -e " ${YELLOW}https://$PI_IP:5000${NC}"
|
echo -e " ${YELLOW}https://$PI_IP:5000/setup${NC}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e " ${YELLOW}http://$PI_IP:5000${NC}"
|
echo -e " ${YELLOW}http://$PI_IP:5000/setup${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
@@ -470,8 +470,6 @@ echo " Stop: sudo systemctl stop stegasoo"
|
|||||||
echo " Status: sudo systemctl status stegasoo"
|
echo " Status: sudo systemctl status stegasoo"
|
||||||
echo " Logs: journalctl -u stegasoo -f"
|
echo " Logs: journalctl -u stegasoo -f"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${YELLOW}Note: On first access, you'll create an admin account.${NC}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Offer to start now
|
# Offer to start now
|
||||||
read -p "Start Stegasoo now? [Y/n] " -n 1 -r
|
read -p "Start Stegasoo now? [Y/n] " -n 1 -r
|
||||||
@@ -483,12 +481,12 @@ if [[ ! $REPLY =~ ^[Nn]$ ]]; then
|
|||||||
echo -e "${GREEN}✓ Stegasoo is running!${NC}"
|
echo -e "${GREEN}✓ Stegasoo is running!${NC}"
|
||||||
if [ "$ENABLE_HTTPS" = "true" ]; then
|
if [ "$ENABLE_HTTPS" = "true" ]; then
|
||||||
if [ "$USE_PORT_443" = "true" ]; then
|
if [ "$USE_PORT_443" = "true" ]; then
|
||||||
echo -e " Visit: ${YELLOW}https://$PI_IP${NC}"
|
echo -e " Create admin: ${YELLOW}https://$PI_IP/setup${NC}"
|
||||||
else
|
else
|
||||||
echo -e " Visit: ${YELLOW}https://$PI_IP:5000${NC}"
|
echo -e " Create admin: ${YELLOW}https://$PI_IP:5000/setup${NC}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e " Visit: ${YELLOW}http://$PI_IP:5000${NC}"
|
echo -e " Create admin: ${YELLOW}http://$PI_IP:5000/setup${NC}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e "${RED}✗ Failed to start. Check logs:${NC} journalctl -u stegasoo -f"
|
echo -e "${RED}✗ Failed to start. Check logs:${NC} journalctl -u stegasoo -f"
|
||||||
|
|||||||
BIN
test_data/carrier2.JPG
Normal file
BIN
test_data/carrier2.JPG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.7 MiB |
Reference in New Issue
Block a user