فهرست منبع

[server] Specify a default for apps.public-albums

local.yaml is only loaded in the local environment, and will not be used in
production. To avoid specifying it in both production and local configurations,
use it as a default specified in the code instead (that's the pattern we're
using in other places too from what I remember, maybe we should refactor that
too, but that's a bigger task not tied to this change).

**Tested by**

On a local dev cluster
- Not specifying anything and ensuring that the default is picked
- Specifying an override in museum.yaml and verifying that is used instead
Manav Rathi 1 سال پیش
والد
کامیت
74b9a2a408
2فایلهای تغییر یافته به همراه6 افزوده شده و 3 حذف شده
  1. 5 2
      server/configurations/local.yaml
  2. 1 1
      server/pkg/repo/public_collection.go

+ 5 - 2
server/configurations/local.yaml

@@ -73,8 +73,11 @@ http:
 
 
 # Specify the base endpoints for various apps
 # Specify the base endpoints for various apps
 apps:
 apps:
-    public-albums: "https://albums.ente.io"
-
+    # Default is https://albums.ente.io
+    #
+    # If you're running a self hosted instance and wish to serve public links,
+    # set this to the URL where your albums web app is running.
+    public-albums:
 
 
 # Database connection parameters
 # Database connection parameters
 db:
 db:

+ 1 - 1
server/pkg/repo/public_collection.go

@@ -23,7 +23,7 @@ type PublicCollectionRepository struct {
 // NewPublicCollectionRepository ..
 // NewPublicCollectionRepository ..
 func NewPublicCollectionRepository(db *sql.DB, albumHost string) *PublicCollectionRepository {
 func NewPublicCollectionRepository(db *sql.DB, albumHost string) *PublicCollectionRepository {
 	if albumHost == "" {
 	if albumHost == "" {
-		panic("albumHost can not be empty")
+		albumHost = "https://albums.ente.io"
 	}
 	}
 	return &PublicCollectionRepository{
 	return &PublicCollectionRepository{
 		DB:        db,
 		DB:        db,