WIP: Secure mode #31
Loading…
Reference in a new issue
No description provided.
Delete branch "(deleted):feat/secure-fetch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #29
Commits from https://github.com/misskey-dev/misskey/pull/7709
Used Deepl to translate the original Japanese strings. I tried to correct any grammar mistakes or other potential mistranslations. Please proofread.
6067410213
to664df9a163
also seems like the text for the settings doesn't actually show up in the admin console, don't know that much about vue to know why exactly
Looked through the first commit just to get the idea...
Private mode looks like allowlist federation?
I guess including it also is fine since it's not that lengthy.
Do we already do signing for authorized fetch being enabled elsewhere? (I presume yes since it works).
Yeah there's the
signToActivityPubGet
option which does exactly that.WIP: Secure modeto Secure modeok I got the strings to show up now
Maybe we should remove the
signToActivitypubGet
setting and have it be always on. I think because some masto instances require it, many people have it on anyways? It would remove the kinda weird dependence between the GUI setting and the config file.I think I got everywhere the
signToActivityPubGet
option was referenced.Still haven't done a full review of this yet since it's quite big. On a cursory view of a few more files I noticed there are new Japanese comments, e.g. in
packages/backend/src/queue/processors/inbox.ts
orpackages/backend/src/remote/activitypub/check-fetch.ts
. I would prefer if we could avoid adding new Japanese comments. Remove or translate them to English?First of all I'm not really fond of the idea of both of these modes (see also https://honk.tedunangst.com/u/tedu/h/3PkQ9bJXNBgJ7w7bD8). Not to mention that the current Fediverse "agreement"¹ of HTTP signatures is a huge mess.
¹ Mastdon uses a pretty old version of an RFC draft that is no longer current but now everyone else is stuck with that version.
I'm not really happy with how the pug templates have
unless privatemode
everywhere. I think it would make more sense to not render the template in the first place if you are in private mode? I think you should be able to just skip tonext
in the router as if you didn't find something.@ -0,0 +7,4 @@
import DbResolver from '@/remote/activitypub/db-resolver.js';
import { getApId } from '@/remote/activitypub/type.js';
export default async function checkFetch(req: IncomingMessage): Promise<number> {
If you want you could maybe take a stab at reusing this in
packages/backend/src/queue/processors/inbox.ts
since its essentially the same code for validating a HTTP signature.Not enitrely sure how to extract out the common logic here, may leave it to someone else to handle that.
@ -189,3 +268,4 @@
// emoji
router.get('/emojis/:emoji', async ctx => {
const verify = await checkFetch(ctx.req);
I think emojis are often not proxied by servers so clients will try to load the emoji from the original server. With requiring HTTP signatures even for this that will cause problems.
@ -203,1 +288,3 @@
ctx.set('Cache-Control', 'public, max-age=180');
const meta = await fetchMeta();
if (meta.secureMode || meta.privateMode) {
ctx.set('Cache-Control', 'private, max-age=0, must-revalidate');
Is there a significant difference between this an
no-store
?I think this is a bit too strong. Just because something is private doesn't mean the
max-age
is suddenly zero.Same goes for other cache directives further down and in other files.
What would be a more sensible
Cache-Control
setting?Decided to just change it to
no-store
for now@ -134,0 +148,4 @@
set.secureMode = ps.secureMode;
}
if (ps.mascotImageUrl !== undefined) {
I think you re-added
mascotImageUrl
on accident. We don't have that any more.@ -288,2 +298,4 @@
langs: instance.langs,
tosUrl: instance.ToSUrl,
repositoryUrl: instance.repositoryUrl,
feedbackUrl: instance.feedbackUrl,
We do not have
repositoryUrl
andfeedbackUrl
any more. Same asmascotImageUrl
above.@ -67,6 +96,16 @@ function save() {
});
}
function saveInstance() {
Why is this a separate function and not in the other
save
function?d042603b4f
toe5595ca31c
Secure modeto WIP: Secure modeSuperceded by #169
Pull request closed