misskey patches & enable ipv6 for tablet

This commit is contained in:
Chaos 2022-11-29 09:07:25 +00:00
parent 4d356ec79e
commit 96068aa583
No known key found for this signature in database
7 changed files with 111 additions and 13 deletions

View file

@ -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"

View file

@ -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

View file

@ -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 ];
}

View file

@ -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";

View file

@ -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);
+ }
+ }
};

View file

@ -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

View file

@ -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,