aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/site
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.net>2025-07-14 01:24:40 +0100
committerLeonardo Bishop <me@leonardobishop.net>2025-07-14 01:24:40 +0100
commit08a3fb8a2b0281c3c329b33215ec7f8866add606 (patch)
treeff8a5413449ea198bc063bf0099fc025ea49c82b /pkg/site
parent684787bcb72aece2aa914597a3bc8788432e66f7 (diff)
Add authentication and ability to change host
Diffstat (limited to 'pkg/site')
-rw-r--r--pkg/site/site.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/site/site.go b/pkg/site/site.go
index 3daf5e7..704c34d 100644
--- a/pkg/site/site.go
+++ b/pkg/site/site.go
@@ -133,6 +133,9 @@ func (s *Site) CreateNewVersion() (string, error) {
}
func (s *Site) EvaluateSiteStatus() string {
+ if s.SiteConfig.Host == "" {
+ return "inactive"
+ }
stat, err := os.Stat(s.GetCurrentPath())
if err != nil || !stat.IsDir() {
return "inactive"
@@ -145,6 +148,9 @@ func (s *Site) EvaluateSiteStatus() string {
}
func (s *Site) EvaluateSiteStatusReason() string {
+ if s.SiteConfig.Host == "" {
+ return "This site is not served by scrapbook"
+ }
stat, err := os.Stat(s.GetCurrentPath())
if err != nil || !stat.IsDir() {
return "This site is inacessible because no version is active"