mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-09-12 21:58:58 -04:00
The thumbnails service is now a stateless image resizer; remove everything the old gRPC-based pipeline needed: - proto definitions and generated code (service + messages) - gRPC server, handler and decorators - JWT transfer token code and the /data HTTP download endpoint - filesystem storage layer and source fetchers (webdav + CS3 imgsource) - duplicated encoding/generator/processor/resolution utilities - the preprocessor packages moved to webdav in the previous commit - dead config fields (Thumbnail struct, GRPC config, unused go-micro client), no-op metrics/instrumentation wrappers, errors package, stale testdata and the Makefile protobuf target Also remove the now-meaningless thumbnails transfer secret generation from opencloud init and point the graph service at the new webdav thumbnail package. The README is rewritten to document the imagor-like push endpoint.
38 lines
1.2 KiB
Go
38 lines
1.2 KiB
Go
package debug
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/opencloud-eu/opencloud/pkg/checks"
|
|
"github.com/opencloud-eu/opencloud/pkg/handlers"
|
|
"github.com/opencloud-eu/opencloud/pkg/service/debug"
|
|
"github.com/opencloud-eu/opencloud/pkg/version"
|
|
)
|
|
|
|
// Server initializes the debug service and server.
|
|
func Server(opts ...Option) (*http.Server, error) {
|
|
options := newOptions(opts...)
|
|
|
|
checkHandler := handlers.NewCheckHandler(
|
|
handlers.NewCheckHandlerConfiguration().
|
|
WithLogger(options.Logger).
|
|
WithCheck("web reachability", checks.NewHTTPCheck(options.Config.HTTP.Addr)),
|
|
)
|
|
|
|
return debug.NewService(
|
|
debug.Logger(options.Logger),
|
|
debug.Name(options.Config.Service.Name),
|
|
debug.Version(version.GetString()),
|
|
debug.Address(options.Config.Debug.Addr),
|
|
debug.Token(options.Config.Debug.Token),
|
|
debug.Pprof(options.Config.Debug.Pprof),
|
|
debug.Zpages(options.Config.Debug.Zpages),
|
|
debug.Health(checkHandler),
|
|
debug.Ready(checkHandler),
|
|
debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins),
|
|
debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods),
|
|
debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders),
|
|
debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials),
|
|
), nil
|
|
}
|