diff --git a/.env b/.env index 07de3e215..bf40d7f34 100644 --- a/.env +++ b/.env @@ -12,7 +12,6 @@ VOLTASERVE_WEBDAV_PORT=8082 VOLTASERVE_CONVERSION_PORT=8083 VOLTASERVE_LANGUAGE_PORT=8084 VOLTASERVE_MOSAIC_PORT=8085 -VOLTASERVE_WATERMARK_PORT=8086 # Infrastructure Ports VOLTASERVE_POSTGRES_PORT=26257 diff --git a/README.md b/README.md index 0e5cfb8d8..4ea8c68e2 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Watch the Demo Video

-Handle massive images with mosaic technology, extract insights from documents, stream large videos, protect documents with permissions and watermarks, preview 3D models. collaborate in real-time. +Handle massive images with mosaic technology, extract insights from documents, stream large videos, protect documents with permissions, preview 3D models. collaborate in real-time. ## Getting Started diff --git a/api/.env b/api/.env index 269507fbd..811ba03a1 100644 --- a/api/.env +++ b/api/.env @@ -5,7 +5,6 @@ PUBLIC_UI_URL="http://127.0.0.1:3000" CONVERSION_URL="http://127.0.0.1:8083" LANGUAGE_URL="http://127.0.0.1:8084" MOSAIC_URL="http://127.0.0.1:8085" -WATERMARK_URL="http://127.0.0.1:8086" POSTGRES_URL="postgresql://voltaserve@127.0.0.1:26257/voltaserve" # Security diff --git a/api/client/pipeline_client.go b/api/client/pipeline_client.go index 3183958d1..95103d98a 100644 --- a/api/client/pipeline_client.go +++ b/api/client/pipeline_client.go @@ -30,13 +30,12 @@ func NewPipelineClient() *PipelineClient { } const ( - PipelinePDF = "pdf" - PipelineOffice = "office" - PipelineImage = "image" - PipelineVideo = "video" - PipelineInsights = "insights" - PipelineMosaic = "mosaic" - PipelineWatermark = "watermark" + PipelinePDF = "pdf" + PipelineOffice = "office" + PipelineImage = "image" + PipelineVideo = "video" + PipelineInsights = "insights" + PipelineMosaic = "mosaic" ) type PipelineRunOptions struct { diff --git a/api/client/watermark_client.go b/api/client/watermark_client.go deleted file mode 100644 index c3b840dca..000000000 --- a/api/client/watermark_client.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2023 Anass Bouassaba. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the GNU Affero General Public License v3.0 only, included in the file -// licenses/AGPL.txt. - -package client - -import ( - "bytes" - "fmt" - "io" - "mime/multipart" - "net/http" - "os" - - "github.com/kouprlabs/voltaserve/api/config" - "github.com/kouprlabs/voltaserve/api/log" -) - -type WatermarkClient struct { - config *config.Config -} - -func NewWatermarkClient() *WatermarkClient { - return &WatermarkClient{ - config: config.GetConfig(), - } -} - -type WatermarkCreateOptions struct { - Path string - S3Key string - S3Bucket string - Category string - DateTime string - Username string - Workspace string -} - -func (cl *WatermarkClient) Create(opts WatermarkCreateOptions) error { - file, err := os.Open(opts.Path) - if err != nil { - return err - } - defer func(file *os.File) { - if err := file.Close(); err != nil { - log.GetLogger().Error(err) - } - }(file) - buf := &bytes.Buffer{} - mw := multipart.NewWriter(buf) - w, err := mw.CreateFormFile("file", opts.Path) - if err != nil { - return err - } - if _, err = io.Copy(w, file); err != nil { - return err - } - if err = mw.WriteField("s3_key", opts.S3Key); err != nil { - return err - } - if err = mw.WriteField("s3_bucket", opts.S3Bucket); err != nil { - return err - } - if err = mw.WriteField("category", opts.Category); err != nil { - return err - } - if err = mw.WriteField("date_time", opts.DateTime); err != nil { - return err - } - if err = mw.WriteField("username", opts.Username); err != nil { - return err - } - if err = mw.WriteField("workspace", opts.Workspace); err != nil { - return err - } - if err := mw.Close(); err != nil { - return err - } - req, err := http.NewRequest("POST", fmt.Sprintf("%s/v2/watermarks", cl.config.WatermarkURL), buf) - if err != nil { - return err - } - req.Header.Set("Content-Type", mw.FormDataContentType()) - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - return err - } - defer func(Body io.ReadCloser) { - if err := Body.Close(); err != nil { - log.GetLogger().Error(err) - } - }(resp.Body) - if resp.StatusCode != http.StatusOK { - return fmt.Errorf("request failed with status %d", resp.StatusCode) - } - return nil -} diff --git a/api/config/config.go b/api/config/config.go index bca4a20fb..0694c0920 100644 --- a/api/config/config.go +++ b/api/config/config.go @@ -22,7 +22,6 @@ type Config struct { ConversionURL string LanguageURL string MosaicURL string - WatermarkURL string DatabaseURL string Search SearchConfig Redis RedisConfig @@ -132,7 +131,6 @@ func readURLs(config *Config) { config.ConversionURL = os.Getenv("CONVERSION_URL") config.LanguageURL = os.Getenv("LANGUAGE_URL") config.MosaicURL = os.Getenv("MOSAIC_URL") - config.WatermarkURL = os.Getenv("WATERMARK_URL") config.DatabaseURL = os.Getenv("POSTGRES_URL") } diff --git a/api/docs/index.html b/api/docs/index.html index 0b3ac33cc..c37455bf9 100644 --- a/api/docs/index.html +++ b/api/docs/index.html @@ -12,7 +12,7 @@ margin: 0; } -