diff --git a/hosts/hetzner-vm/modules/mailserver/postfix.nix b/hosts/hetzner-vm/modules/mailserver/postfix.nix index 0e089b0..84a65f4 100644 --- a/hosts/hetzner-vm/modules/mailserver/postfix.nix +++ b/hosts/hetzner-vm/modules/mailserver/postfix.nix @@ -149,6 +149,8 @@ in { tls_random_source = "dev:/dev/urandom"; + milter_default_action = "quarantine"; + smtpd_milters = [ "unix:/run/opendkim/opendkim.sock" "unix:/run/rspamd/rspamd-milter.sock" diff --git a/hosts/hetzner-vm/profiles/misskey.nix b/hosts/hetzner-vm/profiles/misskey.nix index 9b401ad..a1269d2 100644 --- a/hosts/hetzner-vm/profiles/misskey.nix +++ b/hosts/hetzner-vm/profiles/misskey.nix @@ -67,10 +67,8 @@ in { reloadTriggers = [ misskeyPackage misskeyConfigFile ]; script = '' - #rm -rf /home/misskey/misskey || true mkdir -p /home/misskey/misskey || true rsync -avh ${misskeyPackage}/ /home/misskey/misskey/ --delete --exclude node_modules - #cp -rv ${misskeyPackage} /home/misskey/misskey rm -rf /home/misskey/misskey/.config mkdir /home/misskey/misskey/.config diff --git a/hosts/tablet/profiles/misskey-dev.nix b/hosts/tablet/profiles/misskey-dev.nix new file mode 100644 index 0000000..4c2036e --- /dev/null +++ b/hosts/tablet/profiles/misskey-dev.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: { + services.postgresql = { + enable = true; + ensureUsers = [{ + name = "misskey"; + ensurePermissions."DATABASE misskey" = "ALL PRIVILEGES"; + }]; + ensureDatabases = [ "misskey" ]; + + }; + services.redis.servers."misskey" = { + enable = true; + port = 6379; + }; + networking.firewall.allowedTCPPorts = [ 8024 ]; +} diff --git a/hosts/tablet/tablet.nix b/hosts/tablet/tablet.nix index c5b2c0e..088aa20 100644 --- a/hosts/tablet/tablet.nix +++ b/hosts/tablet/tablet.nix @@ -12,6 +12,7 @@ ./secrets.nix ./profiles/wireguard.nix ./profiles/harry-vpn.nix + ./profiles/misskey-dev.nix ]; home-manager.users.root = { @@ -35,8 +36,6 @@ networking.firewall.enable = true; networking.firewall.allowPing = true; - networking.enableIPv6 = true; - nix.buildMachines = [{ hostName = "buildbox.servers.genderfucked.monster"; system = "x86_64-linux"; diff --git a/overlay/misskey/copy-link-non-monospace.patch b/overlay/misskey/copy-link-non-monospace.patch index d63122f..70982d6 100644 --- a/overlay/misskey/copy-link-non-monospace.patch +++ b/overlay/misskey/copy-link-non-monospace.patch @@ -1,13 +1,59 @@ diff --git a/packages/client/src/scripts/copy-to-clipboard.ts b/packages/client/src/scripts/copy-to-clipboard.ts -index ab13cab..3a7cb2b 100644 +index ab13cab..6dc5b74 100644 --- a/packages/client/src/scripts/copy-to-clipboard.ts +++ b/packages/client/src/scripts/copy-to-clipboard.ts -@@ -5,7 +5,7 @@ export default val => { - // 空div 生成 - const tmp = document.createElement('div'); - // 選択用のタグ生成 +@@ -2,32 +2,27 @@ + * Clipboardに値をコピー(TODO: 文字列以外も対応) + */ + export default val => { +- // 空div 生成 +- const tmp = document.createElement('div'); +- // 選択用のタグ生成 - const pre = document.createElement('pre'); -+ const pre = document.createElement('p'); ++ if (navigator.clipboard) { ++ navigator.clipboard.writeText(String(val)).then(() => { ++ console.log('clipboard: success'); ++ }, (err) => { ++ console.error('clipboard_failure: ', err); ++ }); ++ } else { ++ var textArea = document.createElement("input"); ++ textArea.value = val; ++ textArea.style.top = "0"; ++ textArea.style.left = "0"; ++ textArea.style.position = "fixed"; - // 親要素のCSSで user-select: none だとコピーできないので書き換える - pre.style.webkitUserSelect = 'auto'; +- // 親要素のCSSで user-select: none だとコピーできないので書き換える +- pre.style.webkitUserSelect = 'auto'; +- pre.style.userSelect = 'auto'; +- +- tmp.appendChild(pre).textContent = val; +- +- // 要素を画面外へ +- const s = tmp.style; +- s.position = 'fixed'; +- s.right = '200%'; +- +- // body に追加 +- document.body.appendChild(tmp); +- // 要素を選択 +- document.getSelection().selectAllChildren(tmp); +- +- // クリップボードにコピー +- const result = document.execCommand('copy'); +- +- // 要素削除 +- document.body.removeChild(tmp); +- +- return result; ++ document.body.appendChild(textArea); ++ textArea.focus(); ++ textArea.select(); ++ try { ++ const success = document.execCommand('copy') ? "success" : "failure"; ++ console.log('clipboard: ', success); ++ } catch (err) { ++ console.error('clipboard_failure: ', err); ++ } ++ } + }; diff --git a/overlay/misskey/default.nix b/overlay/misskey/default.nix index e69b254..3b195a7 100644 --- a/overlay/misskey/default.nix +++ b/overlay/misskey/default.nix @@ -16,7 +16,8 @@ in stdenv.mkDerivation { inherit version src; # some of my own personal patches - patches = [ ./copy-link-non-monospace.patch ]; + # copy-link-non-monospace doesn't do much on https, no idea why + patches = [ ./copy-link-non-monospace.patch ./reorder-note-menu.patch ]; installPhase = '' cp -r $src $out diff --git a/overlay/misskey/reorder-note-menu.patch b/overlay/misskey/reorder-note-menu.patch new file mode 100644 index 0000000..9e14bce --- /dev/null +++ b/overlay/misskey/reorder-note-menu.patch @@ -0,0 +1,36 @@ +diff --git a/packages/client/src/scripts/get-note-menu.ts b/packages/client/src/scripts/get-note-menu.ts +index 4826cd7..0d928a4 100644 +--- a/packages/client/src/scripts/get-note-menu.ts ++++ b/packages/client/src/scripts/get-note-menu.ts +@@ -169,7 +169,7 @@ export function getNoteMenu(props: { + function share(): void { + navigator.share({ + title: i18n.t('noteOf', { user: appearNote.user.name }), +- text: appearNote.text, ++ //text: appearNote.text, + url: `${url}/notes/${appearNote.id}`, + }); + } +@@ -209,6 +209,10 @@ export function getNoteMenu(props: { + icon: 'fas fa-copy', + text: i18n.ts.copyContent, + action: copyContent, ++ }, { ++ icon: 'fas fa-share-alt', ++ text: i18n.ts.share, ++ action: share, + }, { + icon: 'fas fa-link', + text: i18n.ts.copyLink, +@@ -220,11 +224,6 @@ export function getNoteMenu(props: { + window.open(appearNote.url || appearNote.uri, '_blank'); + }, + } : undefined, +- { +- icon: 'fas fa-share-alt', +- text: i18n.ts.share, +- action: share, +- }, + instance.translatorAvailable ? { + icon: 'fas fa-language', + text: i18n.ts.translate,