Commit graph

70 commits

Author SHA1 Message Date
Mark Felder cfc8d7aade IPFS uploader: dialyzer fixes
lib/pleroma/uploaders/ipfs.ex:43:no_return
Function put_file/1 has no local return.
________________________________________________________________________________
lib/pleroma/uploaders/ipfs.ex:49:call
The function call will not succeed.

Pleroma.HTTP.post(
  binary(),
  _mp :: %Tesla.Multipart{
    :boundary => binary(),
    :content_type_params => [binary()],
    :parts => [
      %Tesla.Multipart.Part{
        :body => binary(),
        :dispositions => [any()],
        :headers => [any()]
      },
      ...
    ]
  },
  [],
  [{:params, [{:"cid-version", <<49>>}]}]
)

will never return since the success typing is:
(binary(), binary(), [{binary(), binary()}], Keyword.t()) ::
  {:error, _}
  | {:ok,
     %Tesla.Env{
       :__client__ => %Tesla.Client{
         :adapter => nil | {_, _} | {_, _, _},
         :fun => _,
         :post => [any()],
         :pre => [any()]
       },
       :__module__ => atom(),
       :body => _,
       :headers => [{_, _}],
       :method => :delete | :get | :head | :options | :patch | :post | :put | :trace,
       :opts => [{_, _}],
       :query => [{_, _}],
       :status => nil | integer(),
       :url => binary()
     }}

and the contract is
(Pleroma.HTTP.Request.url(), String.t(), Pleroma.HTTP.Request.headers(), :elixir.keyword()) ::
  {:ok, Tesla.Env.t()} | {:error, any()}
2024-05-30 15:14:27 -04:00
Lain Soykaf 3055c1598b IPFSTest: Fix configuration mocking 2024-05-27 17:22:18 +04:00
Lain Soykaf 825b4122a5 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into pleroma-ipfs_uploader 2024-05-27 16:23:40 +04:00
Mark Felder 653b14e1c7 Use config to control Uploader callback timeout 2024-01-22 18:37:13 -05:00
Mark Felder 2061a1d917 Fix invalid type
lib/pleroma/uploaders/uploader.ex:43:unknown_type
Unknown type: Map.t/0.
2024-01-20 17:29:27 -05:00
Lain Soykaf 90a47ca050 S3 Test: Remove global state dependencies 2023-12-11 09:25:05 +04:00
lain e853cfe7c3 Revert "Merge branch 'copyright-bump' into 'develop'"
This reverts merge request !3825
2023-01-02 20:38:50 +00:00
marcin mikołajczak 10886eeaa2 Bump copyright year
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-01-01 12:13:06 +01:00
Claudio Maradonna 254f2ea854
ipfs: remove unused alias
fix analysis job
2022-07-07 06:29:15 +02:00
Claudio Maradonna 98f268e5ec
ipfs: small refactor and more tests 2022-07-07 06:29:15 +02:00
Claudio Maradonna 7c1af86f97
ipfs: refactor final_url generation. add tests for final_url
fix lint
2022-07-07 06:29:13 +02:00
Claudio Maradonna 44659ecd65
ipfs: revert to String.replace for cid placeholder
ipfs: fix lint
2022-07-07 06:29:12 +02:00
Claudio Maradonna 43dfa58ebd
added tests for ipfs uploader. adapted changelog.md accordingly. improved ipfs uploader with external suggestions
fix lint description.exs
2022-07-07 06:29:10 +02:00
Claudio Maradonna fa2a6d5d6b
feat: simple, but not stupid, uploader for IPFS
fix: format fix with credo
2022-07-07 06:29:01 +02:00
Sean King 17aa3644be
Copyright bump for 2022 2022-02-25 23:11:42 -07:00
Alex Gleason 8a5ceb7e53
Remove deps from Uploader behaviour
Speeds up recompilation by limiting compile-time deps
2021-06-01 14:19:45 -05:00
Mark Felder bf9cd4a0e2 Standardize the way we capture and use Mix.env() 2021-02-04 10:13:03 -06:00
Haelwenn (lanodan) Monnier c4439c630f
Bump Copyright to 2021
grep -rl '# Copyright © .* Pleroma' * | xargs sed -i 's;Copyright © .* Pleroma .*;Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>;'
2021-01-13 07:49:50 +01:00
Mark Felder e8bf060e6e Move construction of S3 base URL with optional namespace and bucket to Upload.base_url/0
Now we should have a correct base URL for S3 hosted objects throughout the codebase.
2021-01-08 17:32:42 -06:00
Mark Felder 3c936061d5 Apply Upload.base_url for S3 2021-01-08 17:32:42 -06:00
Alexander Strizhakov a5987155f7
UploadedMedia module name 2020-10-13 16:42:51 +03:00
Alexander Strizhakov 84fbf16161
timeout option moved to gun adapter helper 2020-09-02 10:50:51 +03:00
Alexander Strizhakov c17d83cd73
improvements and fixes for http requests
- fix for gun worker termination in some circumstances
- pool for http clients (ex_aws, tzdata)
- default pool timeouts for gun
- gun retries on gun_down messages
- s3 upload timeout if streaming enabled
2020-09-02 09:04:23 +03:00
Haelwenn (lanodan) Monnier 6da6540036
Bump copyright years of files changed after 2020-01-07
Done via the following command:
git diff fcd5dd259a --stat --name-only | xargs sed -i '/Pleroma Authors/c# Copyright © 2017-2020 Pleroma Authors <https:\/\/pleroma.social\/>'
2020-03-02 06:08:45 +01:00
Roman Chvanikov 88f0eed0f2 Delete attachments when status is deleted 2020-01-12 18:48:58 +00:00
Hakaba Hitoyo 0c9c62509d Remove MDII uploader 2020-01-11 17:19:54 +00:00
Rachel Fae Fox 63af6951fa add tunable for stream uploads, as needed for jortage to work. 2019-09-23 20:38:53 +00:00
Maksim 11d08c2de0 tests for Pleroma.Uploaders 2019-08-10 18:46:26 +00:00
Maksim bb9c539580 Uploader.S3 added support stream uploads 2019-08-10 11:27:59 +00:00
Maksim b6b748d3e7 tests for Uploader with webhook 2019-07-18 12:30:18 +00:00
Egor Kislitsyn 5104f65b69 Wrap error messages into gettext helpers 2019-07-10 18:10:09 +07:00
Egor Kislitsyn 4f42093220 Remove Uploaders.Swift 2019-07-03 14:11:04 +07:00
William Pitcock 9bec891eb4 kill @httpoison 2019-05-25 04:24:21 +00:00
Mark Felder 498bfdf403 Switch to Jason over Poison 2019-05-13 15:37:38 -05:00
Austin Lanari 6c96d68f77 add overriding truncated_namespace condition for truncating paths for digital ocean 2019-03-24 11:32:09 -07:00
Haelwenn (lanodan) Monnier 4b73ca638e
[Credo][CI] Add readability as it’s fixed 2019-03-13 04:26:56 +01:00
Haelwenn (lanodan) Monnier c42d34b2ec
[Credo] fix Credo.Check.Readability.MaxLineLength 2019-03-13 04:26:56 +01:00
Haelwenn (lanodan) Monnier fb82f6fc7c
[Credo] Remove parentesis on argument-less functions 2019-03-13 04:26:56 +01:00
hakabahitoyo b7bc666200 bugfix mdii uploader 2019-02-13 15:46:42 +09:00
Haelwenn (lanodan) Monnier 106f4e7a0f
Credo fixes: parameter consistency 2019-02-09 14:59:20 +01:00
href 4aff4efa8d
Use multiple hackney pools
* federation (ap, salmon)
* media (rich media, media proxy)
* upload (uploader proxy)

Each "part" will stop fighting others ones -- a huge federation outbound
could before make the media proxy fail to checkout a connection in time.

splitted media and uploaded media for the good reason than an upload
pool will have all connections to the same host (the uploader upstream).
it also has a longer default retention period for connections.
2019-01-30 15:06:46 +01:00
kaniini 4a278cd80a Merge branch 's3-namespace' into 'develop'
S3 uploader: support for namespaced bucket

Closes #532

See merge request pleroma/pleroma!699
2019-01-23 13:25:04 +00:00
href f9a3269099
Uploader callback controller 2019-01-21 22:44:14 +01:00
href 97412d9f94
S3 Namespace 2019-01-21 14:42:16 +01:00
William Pitcock 980b5288ed update copyright years to 2019 2018-12-31 15:41:47 +00:00
William Pitcock 2791ce9a1f add license boilerplate to pleroma core 2018-12-23 20:56:42 +00:00
Maksim Pechnikov 074fa790ba fix compile warnings 2018-12-09 20:50:08 +03:00
Maksim Pechnikov 87109482f3 status_code -> status 2018-12-04 14:04:06 +03:00
href 02d3dc6869
Uploads fun, part. 2 2018-11-30 18:02:37 +01:00
href b19597f602
reverse proxy / uploads 2018-11-30 18:00:47 +01:00