diff --git a/assets/static/img/avatar.svg b/assets/static/img/avatar.svg
new file mode 100644
index 000000000..b4d2ba10b
--- /dev/null
+++ b/assets/static/img/avatar.svg
@@ -0,0 +1,19 @@
+
diff --git a/assets/static/favicons/favicon.ico b/assets/static/img/favicon.ico
similarity index 100%
rename from assets/static/favicons/favicon.ico
rename to assets/static/img/favicon.ico
diff --git a/assets/static/favicons/favicon.png b/assets/static/img/favicon.png
similarity index 100%
rename from assets/static/favicons/favicon.png
rename to assets/static/img/favicon.png
diff --git a/assets/static/img/logo.png b/assets/static/img/logo.png
deleted file mode 100644
index 15e06c974..000000000
Binary files a/assets/static/img/logo.png and /dev/null differ
diff --git a/assets/static/svg/logo-white-6pt.svg b/assets/static/img/logo.svg
similarity index 100%
rename from assets/static/svg/logo-white-6pt.svg
rename to assets/static/img/logo.svg
diff --git a/assets/static/img/preview.png b/assets/static/img/preview.png
deleted file mode 100644
index 6d80c1cf2..000000000
Binary files a/assets/static/img/preview.png and /dev/null differ
diff --git a/assets/static/manifest.json b/assets/static/manifest.json
index 76745081a..cac17130c 100644
--- a/assets/static/manifest.json
+++ b/assets/static/manifest.json
@@ -3,7 +3,7 @@
"name": "PhotoPrism",
"icons": [
{
- "src": "/static/favicons/favicon.png",
+ "src": "/static/img/favicon.png",
"sizes": "723x729",
"type": "image/png"
}
diff --git a/assets/static/svg/logo-black-5pt.svg b/assets/static/svg/logo-black-5pt.svg
deleted file mode 100644
index 63d89cf45..000000000
--- a/assets/static/svg/logo-black-5pt.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-black-6pt.svg b/assets/static/svg/logo-black-6pt.svg
deleted file mode 100644
index 9a85ac376..000000000
--- a/assets/static/svg/logo-black-6pt.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-black-7pt.svg b/assets/static/svg/logo-black-7pt.svg
deleted file mode 100644
index a729a326a..000000000
--- a/assets/static/svg/logo-black-7pt.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-black-bold.svg b/assets/static/svg/logo-black-bold.svg
deleted file mode 100644
index 902a584ec..000000000
--- a/assets/static/svg/logo-black-bold.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-black.svg b/assets/static/svg/logo-black.svg
deleted file mode 100644
index abf0fd0c8..000000000
--- a/assets/static/svg/logo-black.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-color-7pt.svg b/assets/static/svg/logo-color-7pt.svg
deleted file mode 100644
index 3b98b188c..000000000
--- a/assets/static/svg/logo-color-7pt.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-filled-7pt.svg b/assets/static/svg/logo-filled-7pt.svg
deleted file mode 100644
index 2ffcd856a..000000000
--- a/assets/static/svg/logo-filled-7pt.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-text-black.svg b/assets/static/svg/logo-text-black.svg
deleted file mode 100644
index 399e0a0f4..000000000
--- a/assets/static/svg/logo-text-black.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-text-white.svg b/assets/static/svg/logo-text-white.svg
deleted file mode 100644
index 3e1d57cd8..000000000
--- a/assets/static/svg/logo-text-white.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-white-5pt.svg b/assets/static/svg/logo-white-5pt.svg
deleted file mode 100644
index ae031c020..000000000
--- a/assets/static/svg/logo-white-5pt.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-white-7pt.svg b/assets/static/svg/logo-white-7pt.svg
deleted file mode 100644
index 7bcb40c32..000000000
--- a/assets/static/svg/logo-white-7pt.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-white-bold.svg b/assets/static/svg/logo-white-bold.svg
deleted file mode 100644
index 721911cfe..000000000
--- a/assets/static/svg/logo-white-bold.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/static/svg/logo-white.svg b/assets/static/svg/logo-white.svg
deleted file mode 100644
index bff665c45..000000000
--- a/assets/static/svg/logo-white.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/templates/index.tmpl b/assets/templates/index.tmpl
index 880c0c573..af212d9e0 100644
--- a/assets/templates/index.tmpl
+++ b/assets/templates/index.tmpl
@@ -21,8 +21,8 @@
-
-
+
+
diff --git a/assets/templates/minimal.tmpl b/assets/templates/minimal.tmpl
index dfef81d1f..8d347495b 100644
--- a/assets/templates/minimal.tmpl
+++ b/assets/templates/minimal.tmpl
@@ -8,8 +8,8 @@
{{ .config.SiteTitle }}
-
-
+
+
diff --git a/assets/templates/rainbow.tmpl b/assets/templates/rainbow.tmpl
index e7744624d..9169dfb87 100644
--- a/assets/templates/rainbow.tmpl
+++ b/assets/templates/rainbow.tmpl
@@ -11,8 +11,8 @@
-
-
+
+
diff --git a/assets/templates/share.tmpl b/assets/templates/share.tmpl
index ea6f4d73c..c08906ca1 100644
--- a/assets/templates/share.tmpl
+++ b/assets/templates/share.tmpl
@@ -23,8 +23,8 @@
-
-
+
+
diff --git a/docker/demo/index.tmpl b/docker/demo/index.tmpl
index c1ce2edbd..38e0c1316 100644
--- a/docker/demo/index.tmpl
+++ b/docker/demo/index.tmpl
@@ -22,8 +22,8 @@
-
-
+
+
diff --git a/frontend/src/component/p-navigation.vue b/frontend/src/component/p-navigation.vue
index e331d2194..70eb30926 100644
--- a/frontend/src/component/p-navigation.vue
+++ b/frontend/src/component/p-navigation.vue
@@ -15,7 +15,7 @@
@click.stop="onLogoClick"
v-show="!drawer"
>
-
+
@@ -32,9 +32,7 @@
-
-

-
+
diff --git a/frontend/src/component/p-video-player.vue b/frontend/src/component/p-video-player.vue
index d6e121ba2..ec83f60c7 100644
--- a/frontend/src/component/p-video-player.vue
+++ b/frontend/src/component/p-video-player.vue
@@ -67,8 +67,8 @@
this.player = new MediaElementPlayer(this.$el, {
videoWidth: this.width,
videoHeight: this.height,
- pluginPath: '/static/build/',
- shimScriptAccess: 'always',
+ pluginPath: "/static/build/",
+ shimScriptAccess: "always",
forceLive: false,
loop: false,
stretching: true,
diff --git a/frontend/src/share/p-navigation.vue b/frontend/src/share/p-navigation.vue
index 1eb4731ba..99c5c9af3 100644
--- a/frontend/src/share/p-navigation.vue
+++ b/frontend/src/share/p-navigation.vue
@@ -13,7 +13,7 @@
class="clickable"
@click.stop.prevent="goHome"
>
-
+
diff --git a/internal/api/album.go b/internal/api/album.go
index 9aa318310..581757fb3 100644
--- a/internal/api/album.go
+++ b/internal/api/album.go
@@ -511,7 +511,7 @@ func DownloadAlbum(router *gin.RouterGroup) {
// type: string Thumbnail type, see photoprism.ThumbnailTypes
func AlbumThumbnail(router *gin.RouterGroup) {
router.GET("/albums/:uid/t/:token/:type", func(c *gin.Context) {
- if InvalidToken(c) {
+ if InvalidPreviewToken(c) {
c.Data(http.StatusForbidden, "image/svg+xml", albumIconSvg)
return
}
diff --git a/internal/api/label.go b/internal/api/label.go
index 2eaaf605f..b3c6d0151 100644
--- a/internal/api/label.go
+++ b/internal/api/label.go
@@ -175,7 +175,7 @@ func DislikeLabel(router *gin.RouterGroup) {
// type: string Thumbnail type, see photoprism.ThumbnailTypes
func LabelThumbnail(router *gin.RouterGroup) {
router.GET("/labels/:uid/t/:token/:type", func(c *gin.Context) {
- if InvalidToken(c) {
+ if InvalidPreviewToken(c) {
c.Data(http.StatusForbidden, "image/svg+xml", labelIconSvg)
return
}
diff --git a/internal/api/photo_thumbnail.go b/internal/api/photo_thumbnail.go
index 065dd95bd..d93ec1cf4 100644
--- a/internal/api/photo_thumbnail.go
+++ b/internal/api/photo_thumbnail.go
@@ -32,7 +32,7 @@ type ByteCache struct {
// type: string Thumbnail type, see photoprism.ThumbnailTypes
func GetThumbnail(router *gin.RouterGroup) {
router.GET("/t/:hash/:token/:type", func(c *gin.Context) {
- if InvalidToken(c) {
+ if InvalidPreviewToken(c) {
c.Data(http.StatusForbidden, "image/svg+xml", brokenIconSvg)
return
}
diff --git a/internal/api/session.go b/internal/api/session.go
index 773e56ff0..a5723e521 100644
--- a/internal/api/session.go
+++ b/internal/api/session.go
@@ -124,15 +124,15 @@ func Auth(id string, resource acl.Resource, action acl.Action) session.Data {
return sess
}
-// InvalidToken returns true if the token is invalid.
-func InvalidToken(c *gin.Context) bool {
+// InvalidPreviewToken returns true if the token is invalid.
+func InvalidPreviewToken(c *gin.Context) bool {
token := c.Param("token")
if token == "" {
token = c.Query("t")
}
- return service.Config().InvalidToken(token)
+ return service.Config().InvalidPreviewToken(token)
}
// InvalidDownloadToken returns true if the token is invalid.
diff --git a/internal/api/video.go b/internal/api/video.go
index 49d23b4d6..084e18a10 100644
--- a/internal/api/video.go
+++ b/internal/api/video.go
@@ -18,7 +18,7 @@ import (
// type: string Video type
func GetVideo(router *gin.RouterGroup) {
router.GET("/videos/:hash/:token/:type", func(c *gin.Context) {
- if InvalidToken(c) {
+ if InvalidPreviewToken(c) {
c.Data(http.StatusForbidden, "image/svg+xml", brokenIconSvg)
return
}
diff --git a/internal/commands/config.go b/internal/commands/config.go
index 61717cbe7..afe80f0be 100644
--- a/internal/commands/config.go
+++ b/internal/commands/config.go
@@ -75,10 +75,10 @@ func configAction(ctx *cli.Context) error {
// Additional path and file names.
fmt.Printf("%-25s %s\n", "static-path", conf.StaticPath())
- fmt.Printf("%-25s %s\n", "static-build-path", conf.StaticBuildPath())
- fmt.Printf("%-25s %s\n", "favicons-path", conf.FaviconsPath())
+ fmt.Printf("%-25s %s\n", "build-path", conf.BuildPath())
+ fmt.Printf("%-25s %s\n", "img-path", conf.ImgPath())
fmt.Printf("%-25s %s\n", "templates-path", conf.TemplatesPath())
- fmt.Printf("%-25s %s\n", "default-template", conf.DefaultTemplate())
+ fmt.Printf("%-25s %s\n", "template-name", conf.TemplateName())
fmt.Printf("%-25s %s\n", "cache-path", conf.CachePath())
fmt.Printf("%-25s %s\n", "temp-path", conf.TempPath())
fmt.Printf("%-25s %s\n", "config-file", conf.ConfigFile())
@@ -100,7 +100,7 @@ func configAction(ctx *cli.Context) error {
// Thumbnails, resampling and download security token.
fmt.Printf("%-25s %s\n", "download-token", conf.DownloadToken())
- fmt.Printf("%-25s %s\n", "thumb-token", conf.PreviewToken())
+ fmt.Printf("%-25s %s\n", "preview-token", conf.PreviewToken())
fmt.Printf("%-25s %s\n", "thumb-filter", conf.ThumbFilter())
fmt.Printf("%-25s %t\n", "thumb-uncached", conf.ThumbUncached())
fmt.Printf("%-25s %d\n", "thumb-size", conf.ThumbSize())
diff --git a/internal/config/auth.go b/internal/config/auth.go
index 6f03dc207..99929fb3a 100644
--- a/internal/config/auth.go
+++ b/internal/config/auth.go
@@ -41,8 +41,8 @@ func (c *Config) DownloadToken() string {
return c.params.DownloadToken
}
-// InvalidToken returns true if the token is invalid.
-func (c *Config) InvalidToken(t string) bool {
+// InvalidPreviewToken returns true if the preview token is invalid.
+func (c *Config) InvalidPreviewToken(t string) bool {
return c.PreviewToken() != t && c.DownloadToken() != t
}
diff --git a/internal/config/client.go b/internal/config/client.go
index f56249837..55255d766 100644
--- a/internal/config/client.go
+++ b/internal/config/client.go
@@ -143,8 +143,8 @@ func (c *Config) PublicConfig() ClientConfig {
Experimental: c.Experimental(),
Thumbnails: Thumbnails,
Colors: colors.All.List(),
- JSHash: fs.Checksum(c.StaticBuildPath() + "/app.js"),
- CSSHash: fs.Checksum(c.StaticBuildPath() + "/app.css"),
+ JSHash: fs.Checksum(c.BuildPath() + "/app.js"),
+ CSSHash: fs.Checksum(c.BuildPath() + "/app.css"),
Clip: txt.ClipDefault,
PreviewToken: "public",
DownloadToken: "public",
@@ -186,8 +186,8 @@ func (c *Config) GuestConfig() ClientConfig {
Thumbnails: Thumbnails,
DownloadToken: c.DownloadToken(),
PreviewToken: c.PreviewToken(),
- JSHash: fs.Checksum(c.StaticBuildPath() + "/share.js"),
- CSSHash: fs.Checksum(c.StaticBuildPath() + "/share.css"),
+ JSHash: fs.Checksum(c.BuildPath() + "/share.js"),
+ CSSHash: fs.Checksum(c.BuildPath() + "/share.css"),
Clip: txt.ClipDefault,
}
@@ -220,8 +220,8 @@ func (c *Config) UserConfig() ClientConfig {
Thumbnails: Thumbnails,
DownloadToken: c.DownloadToken(),
PreviewToken: c.PreviewToken(),
- JSHash: fs.Checksum(c.StaticBuildPath() + "/app.js"),
- CSSHash: fs.Checksum(c.StaticBuildPath() + "/app.css"),
+ JSHash: fs.Checksum(c.BuildPath() + "/app.js"),
+ CSSHash: fs.Checksum(c.BuildPath() + "/app.css"),
Clip: txt.ClipDefault,
Server: NewRuntimeInfo(),
}
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index 9bd7df2b2..eabcb2f29 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -273,7 +273,7 @@ func TestConfig_TensorFlowModelPath(t *testing.T) {
assert.Equal(t, "/go/src/github.com/photoprism/photoprism/assets/nasnet", path)
}
-func TestConfig_HttpTemplatesPath(t *testing.T) {
+func TestConfig_TemplatesPath(t *testing.T) {
ctx := CliTestContext()
c := NewConfig(ctx)
@@ -281,15 +281,7 @@ func TestConfig_HttpTemplatesPath(t *testing.T) {
assert.Equal(t, "/go/src/github.com/photoprism/photoprism/assets/templates", path)
}
-func TestConfig_HttpFaviconsPath(t *testing.T) {
- ctx := CliTestContext()
- c := NewConfig(ctx)
-
- path := c.FaviconsPath()
- assert.Equal(t, "/go/src/github.com/photoprism/photoprism/assets/static/favicons", path)
-}
-
-func TestConfig_HttpStaticPath(t *testing.T) {
+func TestConfig_StaticPath(t *testing.T) {
ctx := CliTestContext()
c := NewConfig(ctx)
@@ -297,14 +289,22 @@ func TestConfig_HttpStaticPath(t *testing.T) {
assert.Equal(t, "/go/src/github.com/photoprism/photoprism/assets/static", path)
}
-func TestConfig_HttpStaticBuildPath(t *testing.T) {
+func TestConfig_BuildPath(t *testing.T) {
ctx := CliTestContext()
c := NewConfig(ctx)
- path := c.StaticBuildPath()
+ path := c.BuildPath()
assert.Equal(t, "/go/src/github.com/photoprism/photoprism/assets/static/build", path)
}
+func TestConfig_ImgPath(t *testing.T) {
+ ctx := CliTestContext()
+ c := NewConfig(ctx)
+
+ path := c.ImgPath()
+ assert.Equal(t, "/go/src/github.com/photoprism/photoprism/assets/static/img", path)
+}
+
func TestConfig_ClientConfig(t *testing.T) {
c := TestConfig()
diff --git a/internal/config/filenames.go b/internal/config/filenames.go
index 2a67dff71..0148aa6ad 100644
--- a/internal/config/filenames.go
+++ b/internal/config/filenames.go
@@ -85,8 +85,8 @@ func (c *Config) CreateDirectories() error {
return createError(c.TensorFlowModelPath(), err)
}
- if err := os.MkdirAll(c.StaticBuildPath(), os.ModePerm); err != nil {
- return createError(c.StaticBuildPath(), err)
+ if err := os.MkdirAll(c.BuildPath(), os.ModePerm); err != nil {
+ return createError(c.BuildPath(), err)
}
if err := os.MkdirAll(filepath.Dir(c.PIDFilename()), os.ModePerm); err != nil {
diff --git a/internal/config/flags.go b/internal/config/flags.go
index 0190adfc0..2220c221a 100644
--- a/internal/config/flags.go
+++ b/internal/config/flags.go
@@ -259,8 +259,8 @@ var GlobalFlags = []cli.Flag{
},
cli.StringFlag{
Name: "preview-token",
- Usage: "`SECRET` url token for thumbnails and video streaming",
- Value: "static",
+ Usage: "`SECRET` url token for preview images and video streaming",
+ Value: "public",
EnvVar: "PHOTOPRISM_PREVIEW_TOKEN",
},
cli.StringFlag{
diff --git a/internal/config/server.go b/internal/config/server.go
index 6bbad9401..b5508a48e 100644
--- a/internal/config/server.go
+++ b/internal/config/server.go
@@ -57,8 +57,8 @@ func (c *Config) TemplateExists(name string) bool {
return fs.FileExists(filepath.Join(c.TemplatesPath(), name))
}
-// DefaultTemplate returns the name of the default template (e.g. index.tmpl).
-func (c *Config) DefaultTemplate() string {
+// TemplateName returns the name of the default template (e.g. index.tmpl).
+func (c *Config) TemplateName() string {
if c.TemplateExists(c.Settings().Templates.Default) {
return c.Settings().Templates.Default
}
@@ -66,17 +66,17 @@ func (c *Config) DefaultTemplate() string {
return "index.tmpl"
}
-// FaviconsPath returns the favicons path.
-func (c *Config) FaviconsPath() string {
- return filepath.Join(c.StaticPath(), "favicons")
-}
-
-// StaticPath returns the static server assets path (//server/static/*).
+// StaticPath returns the static assets path.
func (c *Config) StaticPath() string {
return filepath.Join(c.AssetsPath(), "static")
}
-// StaticBuildPath returns the static build path (//server/static/build/*).
-func (c *Config) StaticBuildPath() string {
+// BuildPath returns the static build path.
+func (c *Config) BuildPath() string {
return filepath.Join(c.StaticPath(), "build")
}
+
+// ImgPath returns the static image path.
+func (c *Config) ImgPath() string {
+ return filepath.Join(c.StaticPath(), "img")
+}
diff --git a/internal/server/routes.go b/internal/server/routes.go
index dc616dcf5..393f750d2 100644
--- a/internal/server/routes.go
+++ b/internal/server/routes.go
@@ -2,6 +2,7 @@ package server
import (
"net/http"
+ "path"
"github.com/gin-gonic/gin"
"github.com/photoprism/photoprism/internal/api"
@@ -9,12 +10,12 @@ import (
)
func registerRoutes(router *gin.Engine, conf *config.Config) {
- // Static favicon file.
- router.StaticFile("/favicon.ico", conf.FaviconsPath()+"/favicon.ico")
-
- // Other static assets like JS and CSS files.
+ // Static assets like js, css and font files.
router.Static("/static", conf.StaticPath())
+ // Site favicon image.
+ router.StaticFile("/favicon.ico", path.Join(conf.ImgPath(), "favicon.ico"))
+
// Rainbow page.
router.GET("/rainbow", func(c *gin.Context) {
clientConfig := conf.PublicConfig()
@@ -147,6 +148,6 @@ func registerRoutes(router *gin.Engine, conf *config.Config) {
// Default HTML page for client-side rendering and routing via VueJS.
router.NoRoute(func(c *gin.Context) {
clientConfig := conf.PublicConfig()
- c.HTML(http.StatusOK, conf.DefaultTemplate(), gin.H{"config": clientConfig})
+ c.HTML(http.StatusOK, conf.TemplateName(), gin.H{"config": clientConfig})
})
}