Commit graph

409 commits

Author SHA1 Message Date
tobi
07727753b9
[feature] Clean up/uncache remote media (#407)
* Add whereNotEmptyAndNotNull

* Add GetRemoteOlderThanDays

* Add GetRemoteOlderThanDays

* Add PruneRemote to Manager interface

* Start implementing PruneRemote

* add new attachment + status to tests

* fix up and test GetRemoteOlderThan

* fix bad import

* PruneRemote: return number pruned

* add Cached column to mediaattachment

* update + test pruneRemote

* update mediaTest

* use Cached column

* upstep bun to latest version

* embed structs in mediaAttachment

* migrate mediaAttachment to new format

* don't default cached to true

* select only remote media

* update db dependencies

* step bun back to last working version

* update pruneRemote to use Cached field

* fix storage path of test attachments

* add recache logic to manager

* fix trimmed aspect ratio

* test prune and recache

* return errwithcode

* tidy up different paths for emoji vs attachment

* fix incorrect thumbnail type being stored

* expose TransportController to media processor

* implement tee-ing recached content

* add thoughts of dog to test fedi attachments

* test get remote files

* add comment on PruneRemote

* add postData cleanup to recache

* test thumbnail fetching

* add incredible diagram

* go mod tidy

* buffer pipes for recache streaming

* test for client stops reading after 1kb

* add media-remote-cache-days to config

* add cron package

* wrap logrus so it's available to cron

* start and stop cron jobs gracefully
2022-03-07 11:08:26 +01:00
0hlov3
100f1280a6
[documentation] Creates Docker documentation and docker-compose.yaml (#416)
* exludes docker-volume from exemple/docker-compose

* Adds an docker-compose.yaml example and adds some readme to the
docker.md

* Changes Docker-Compose Example

* Configures docker-compose.yaml and docker.md

* Adds some cosmetics to the Documentation

* Adds UserID:GroupID

* Describes how to create a new user
2022-03-01 14:17:36 +01:00
tobi
1d5e763f68
[packaging] bump to builder 0.0.3 (#418) 2022-02-28 11:48:35 +01:00
tobi
3bc87f2e9c
bump versions (#417) 2022-02-27 13:54:07 +01:00
tobi
6b634de6b2
[packaging] Use buildx for multi-arch Docker builds (#413)
* update drone to create latest manifest

* add .dockerignore file

* use buildx for multi-arch builds
see https://docs.docker.com/buildx/working-with-buildx/

* don't use RUN commands in Dockerfile
this was breaking multi-arch builds
2022-02-27 13:03:37 +01:00
0hlov3
64d9a34c65
Updates Docker Images (#415) 2022-02-27 12:53:30 +01:00
0hlov3
69d70aa677
[feature] Add Docker multi architecture Build and make goreleaser push the images and manifests (#410) 2022-02-26 10:45:23 +01:00
tobi
55b83bea7c
[feature] Add postDataCallbackFunc to allow cleanup (#408) 2022-02-22 13:50:33 +01:00
tobi
15d1e6b3a1
[bugfix] Fix thumbnail image type (#406)
* fix thumbnail content-type

* test fix thumbnail content-type
2022-02-21 11:26:26 +01:00
tobi
a089a98ea9
[feature] Gin enable gzip encoding (#405)
* add gin gzip dependency

* add gzip middleware to router

* go mod tidy
2022-02-19 12:12:41 +01:00
tobi
23034ec145
[feature] Stream files via reader (#404)
* serve files via reader rather than byte slice

* close readcloser when we're done with it

* cast reader to readcloser
2022-02-19 11:44:56 +01:00
Shadowfacts
e55382acd6
Use type=email for email input (#400)
So that mobile devices with software keyboards use the email keyboard
and turn off autocorrect/autocapitalization
2022-02-16 16:16:47 +01:00
Shadowfacts
09d6478d72
[bugfix] Only mark cookies as Secure on https (#398)
Fixes cookies not being stored/sent by Safari when serving over plain http
2022-02-15 16:00:07 +01:00
tobi
dc2421752f
[chore] fix mirror + clean up (#396) 2022-02-14 10:49:20 +01:00
kim
31935ee206
Merge pull request #361 from superseriousbusiness/media_refactor
Refactor media handler to allow async media resolution
2022-02-12 18:27:58 +00:00
tobi
037e8efd5f
[chore] Add nightly mirror to Codeberg.org (#392)
* add mirror pipeline => codeberg

* remove trigger in mirror step

* fix file formatting
2022-02-12 13:55:32 +01:00
tsmethurst
a766b9265b Go mod tidy 2022-02-08 13:39:47 +01:00
tsmethurst
8c0141d103 store and retrieve processState atomically 2022-02-08 13:38:44 +01:00
tsmethurst
dba9ad4348 hopefully fix potential race condition 2022-02-08 13:17:10 +01:00
tsmethurst
c4ece24654 log error on header/avatar fetch fail 2022-02-08 12:37:58 +01:00
tsmethurst
b42b0a667e go fmt 2022-02-08 12:19:54 +01:00
tsmethurst
3301148bb7 merge fixup 2022-02-08 12:17:53 +01:00
tsmethurst
4c294a596a Merge branch 'main' into media_refactor 2022-02-08 12:17:18 +01:00
tsmethurst
e811d03cc9 update outdated comment 2022-02-08 10:08:27 +01:00
tsmethurst
9db58dfd57 add comment explaining store.lock 2022-02-08 10:06:43 +01:00
tobi
40be88ec60
[chore] Drone config update (#383)
* go mod tidy

* reformat triggers

* add drone build status to readme
2022-02-07 15:22:55 +01:00
Forest Johnson
6ed368cbeb
[feature] add authorization to the already-existing authentication (#365)
* add ensureUserIsAuthorizedOrRedirect to /oauth/authorize

* adding authorization (email confirm, account approve, etc) to TokenCheck

* revert un-needed changes to signin.go

* oops what happened here

* error css

* add account.SuspendedAt check

* remove redundant checks from oauth util Authed function

* wip tests

* tests passing

* stop stripping useful information from ErrAlreadyExists

* that feeling of scraping the dryer LINT off the screen

* oops I didn't mean to get rid of this NewTestRouter function

* make tests work with recorder

* re-add ConfigureTemplatesWithGin to handle template path err

Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
2022-02-07 12:04:31 +01:00
tobi
5c9d20cea3
don't bother negotiating Accept for webfinger (#381) 2022-02-06 15:00:57 +01:00
tobi
85b4f96263
if accountDomain isn't set, use Host value instead (#380) 2022-02-06 14:07:38 +01:00
tobi
1b36e85840
[feature] Rework timeline code to make it useful for more than just statuses (#373)
* add preparable and timelineable interfaces

* initialize timeline manager within the processor

* generic renaming

* move status-specific timeline logic into the processor

* refactor timeline to make it useful for more than statuses
2022-02-05 12:47:38 +01:00
Phil Hagelberg
98341a1d4d
[docs] Fix documentation to show --config-path in the right position. (#375)
The current position gets rejected as an unknown argument.
2022-02-03 12:30:06 +01:00
Paul Woolcock
aa34ff1bd9
Fix start command invocation (#372)
When I tried to start the server using the command `./gotosocial server start --config-file ./config.yaml`, I got the following error:

```
root@gotosocial-experiment:/gotosocial# ./gotosocial server start --config-file ./config.yaml
Incorrect Usage: flag provided but not defined: -config-file

NAME:
   gotosocial server start - start the gotosocial server

USAGE:
   gotosocial server start [command options] [arguments...]

OPTIONS:
   --help, -h  show help (default: false)

FATA[0000] flag provided but not defined: -config-file
```

Putting the flag after the `./gotosocial` but before the `server start` seems to work properly
2022-02-01 16:54:26 +01:00
tobi
18e7537393
[bug] Fix OIDC users requiring second approval (#371)
* tidy up NewSignup
* pre-approve users created via OIDC
2022-01-31 16:03:47 +01:00
Forest Johnson
5be8a7a7ea
[bug] Send plaintext emails to fix "message refused: Message is not RFC 2822 compliant" (#366)
* trying to fix "message refused: Message is not RFC 2822 compliant"

* fix "message refused: Message is not RFC 2822 compliant"

550 5.7.1 Delivery not authorized, message refused: Message is not RFC
2822 compliant

* remove silly regex

* lint

* fix tests

* we should use text/template instead of html/template now
2022-01-31 11:46:20 +01:00
tobi
959e38ac5c
[bug] Fix sqlite empty address issue (#370)
* error when empty address has been set for sqlite

* better explain sqlite db-address setting
2022-01-30 17:06:28 +01:00
tobi
66175c8ad9
[bug] Fix minimum description length check (#369)
* add/update tests

* don't check min description length on media create
2022-01-30 16:10:53 +01:00
dependabot[bot]
664927ea58
Bump nanoid from 3.1.25 to 3.2.0 in /web/gotosocial-styling (#364)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.25 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.25...3.2.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-30 15:01:04 +01:00
tobi
e13718148d
[feature] Make Let's Encrypt integration an opt-in feature (#368) 2022-01-30 14:57:33 +01:00
tobi
ec4357485e
[documentation] add ipv6 config for nginx (#367) 2022-01-30 14:35:23 +01:00
tsmethurst
d9a778a795 put store lock file in base of storage 2022-01-29 12:16:12 +01:00
tsmethurst
4e74c84148 update go-store to latest 2022-01-29 12:15:51 +01:00
tsmethurst
9aa364f1eb go mod tidy 2022-01-25 14:33:23 +01:00
tsmethurst
c156602c66 ensure blocking calls to getRemoteAccount before showing stuff to client 2022-01-25 13:48:13 +01:00
tsmethurst
5d9e9e0e7f fix up some account conversion logic 2022-01-25 12:03:25 +01:00
tsmethurst
eba66d3a88 only update account in db if changed 2022-01-25 11:21:22 +01:00
tsmethurst
926b37e271 change getaccount function signature 2022-01-24 18:12:42 +01:00
tsmethurst
a6fb93ae2a ctx => innerctx 2022-01-24 18:12:28 +01:00
tsmethurst
c12520167d use background context w/deadline 2022-01-24 18:12:04 +01:00
tsmethurst
8e6ba1de52 start trying to figure out why this test is failing 2022-01-24 18:11:38 +01:00
tsmethurst
0e7f24ff26 test with disk storage as well 2022-01-24 18:11:27 +01:00