mirror of
https://github.com/photoprism/photoprism.git
synced 2025-10-06 09:19:33 +08:00

These changes allow you to force the re-creation of existing Unix domain sockets and set the permissions of sockets after they have been created. The flag or variable value for this must be formatted as follows: --http-host="unix:/var/run/photoprism.sock?force=true&mode=660" Signed-off-by: Michael Mayer <michael@photoprism.app>
18 lines
449 B
Go
18 lines
449 B
Go
package api
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/photoprism/photoprism/pkg/net/header"
|
|
)
|
|
|
|
// ClientIP returns the client IP address from the request context or a placeholder if it is unknown.
|
|
func ClientIP(c *gin.Context) (ip string) {
|
|
return header.ClientIP(c)
|
|
}
|
|
|
|
// UserAgent returns the user agent from the request context or an empty string if it is unknown.
|
|
func UserAgent(c *gin.Context) string {
|
|
return header.UserAgent(c)
|
|
}
|