分类 电脑 下的文章

roundcube 菜单定制 禁用功能

https://local2.anqun.org/mail/?_task=settings&_action=plugin.password

// don't allow these settings to be overridden by the user
$config['dont_override'] = [];

// List of disabled UI elements/actions
$config['disabled_actions'] = [];

https://local2.anqun.org/mail/?_task=settings&_action=plugin.password
https://local2.anqun.org/mail/?_task=addressbook&_source=1

'mail.delete', 'mail.copy', 'mail.move', 'mail.mark', 'mail.send', 'mail.sendmdn', 'mail.import',

./program/js/app.js:1942
['show', 'reply', 'reply-all', 'reply-list', 'move', 'copy', 'delete', 'open', 'mark', 'edit', 'viewsource', 'bounce', 'print', 'load-attachment', 'download-attachment', 'show-headers', 'hide-headers', 'download', 'forward', 'forward-inline', 'forward-attachment', 'change-format']

class="about" innerClass="inner" onclick="UI.about_dialog(this)" />
<roundcube:button command="compose" type="link" class="compose"

config.dark_mode_support: false
https://github.com/roundcube/roundcubemail/blob/master/skins/elastic/meta.json
"dark_mode_support": true,

POST /mail/?_task=mail&_action=expunge HTTP/2.0" 
POST /mail/ HTTP/2.0" 200 651 "https://local2.anqun.org/mail/?_task=settings&_action=add-folder&
'settings.add-folder', 'settings.preferences','settings.identities','settings.responses',

192.168.1.7 - - [15/Jul/2023:16:17:59 +0800] "GET /mail/?_task=mail&_action=getunread&_page=1&_remote=1&_unlock=0&_=1689409079167 HTTP/2.0" 200 99 "https://local2.anqun.org/mail/?_task=mail&_mbox=Trash
?_task=mail&_mbox=Trash"  folder can not be found

mail._mbox=Trash

dovecot
https://forum.vestacp.com/viewtopic.php?t=11948

<!-- folders list -->
<div id="layout-sidebar" class="listbox" role="navigation" aria-labelledby="aria-label-folderlist">
        <div class="header">
                <a class="button icon back-list-button" href="#back"><span class="inner"><roundcube:label name="back" /></span></a>
                <span class="header-title username"><roundcube:object name="username" /></span>
                <roundcube:button name="folderactions" type="link" title="folderactions" label="actions"
                        class="button icon sidebar-menu" innerclass="inner" data-popup="mailboxoptions-menu" />

1. templates/mail.html
2. /templates/includes/mail-menu.html:2:<div id="mailtoolbar" class="toolbar menu" role="toolbar">
./templates/includes/mail-menu.html:28: <roundcube:container name="toolbar" id="mailtoolbar" />
3. vi /opt/www/roundcubemail/config/config.inc.php
// PLUGINS
// $config['plugins'] = array('managesieve', 'password', 'zipdownload');

// List of disabled UI elements/actions
$config['disabled_actions'] = ['settings', 'addressbook','mail.compose', 'mail.delete', 'mail.copy', 'mail.move', 'mail.mark', 'mail.send', 'mail.sendmdn', 'mail.import','mail.reply', 'mail.reply-all', 'mail.reply-list', 'mail.flagged', 'mail.reply', 'mail.reply-all', 'mail.reply-list', 'mail.move', 'mail.copy', 'mail.delete', 'mail.open', 'mail.mark', 'mail.edit', 'mail.viewsource', 'mail.bounce', 'mail.print', 'mail.load-attachment', 'mail.forward', 'mail.forward-inline', 'mail.forward-attachment', 'about', 'mail.expunge', 'mail.purge', 'mail.folders', 'settings.add-folder','settings.folders','settings.preferences','settings.identities','settings.responses','settings.compose','mail.import-messages'];

// automatically create the above listed default folders on user login
$config['create_default_folders'] = false;

// protect the default folders from renames, deletes, and subscription changes
$config['protect_default_folders'] = false;

https://github.com/roundcube/roundcubemail/blob/3b6c06f697eca916d5756795461a8eea4e397cd2/config/defaults.inc.php

roundcube - 收件箱列表为空 - the list is empty - imap - vsz_limit 256 MB

现象:某个邮箱用户登录到 roundcube webmail,收件箱列表是空的。原先的邮件数约有十万封。

实践:查看 dovecot 的 imap.log ,出现类似 (Out of memory (service imap { vsz_limit=256 MB }, you may need to increase it)) 的字样。按网上的例子,在 /etc/dovecot/dovecot.conf 添加如下内容后,重启 dovecot 服务即可。

service imap {
  vsz_limit = 1024MB
}

参考:https://forum.iredmail.org/topic11051-increasing-vszlimit.html

Windows 11 简体企业90天试用版 - Unattend.xml

DHCP分配IP。

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="windowsPE">
        <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <RunSynchronous>
                <RunSynchronousCommand wcm:action="add">
                    <Order>1</Order>
                    <Path>reg add HKLM\System\Setup\LabConfig /v BypassTPMCheck /t reg_dword /d 0x00000001 /f</Path>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Order>2</Order>
                    <Path>reg add HKLM\System\Setup\LabConfig /v BypassSecureBootCheck /t reg_dword /d 0x00000001 /f</Path>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Order>3</Order>
                    <Path>reg add HKLM\System\Setup\LabConfig /v BypassRAMCheck /t reg_dword /d 0x00000001 /f</Path>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Order>4</Order>
                    <Path>reg add HKLM\System\Setup\LabConfig /v BypassCPUCheck /t reg_dword /d 0x00000001 /f</Path>
                </RunSynchronousCommand>
                <RunSynchronousCommand wcm:action="add">
                    <Order>5</Order>
                    <Path>reg add HKLM\System\Setup\LabConfig /v BypassStorageCheck /t reg_dword /d 0x00000001 /f</Path>
                </RunSynchronousCommand>
            </RunSynchronous>
            <UserData>
                <AcceptEula>true</AcceptEula>
            </UserData>
            <DiskConfiguration>
                <WillShowUI>OnError</WillShowUI>
                <Disk wcm:action="add">
                    <CreatePartitions>
                        <CreatePartition wcm:action="add">
                            <Order>1</Order>
                            <Size>100</Size>
                            <Type>Primary</Type>
                        </CreatePartition>
                        <CreatePartition wcm:action="add">
                            <Extend>true</Extend>
                            <Order>2</Order>
                            <Type>Primary</Type>
                        </CreatePartition>
                    </CreatePartitions>
                    <ModifyPartitions>
                        <ModifyPartition wcm:action="add">
                            <Active>true</Active>
                            <Format>NTFS</Format>
                            <Label>System</Label>
                            <Order>1</Order>
                            <PartitionID>1</PartitionID>
                        </ModifyPartition>
                        <ModifyPartition wcm:action="add">
                            <Order>2</Order>
                            <PartitionID>2</PartitionID>
                            <Label>Windows</Label>
                            <Letter>C</Letter>
                            <Format>NTFS</Format>
                        </ModifyPartition>
                    </ModifyPartitions>
                    <DiskID>0</DiskID>
                    <WillWipeDisk>true</WillWipeDisk>
                </Disk>
            </DiskConfiguration>
            <ImageInstall>
                <OSImage>
                    <InstallTo>
                        <DiskID>0</DiskID>
                        <PartitionID>2</PartitionID>
                    </InstallTo>
                    <InstallFrom>
                        <MetaData wcm:action="add">
                            <Key>/IMAGE/INDEX</Key>
                            <Value>1</Value>
                        </MetaData>
                    </InstallFrom>
                    <WillShowUI>OnError</WillShowUI>
                    <InstallToAvailablePartition>false</InstallToAvailablePartition>
                </OSImage>
            </ImageInstall>
        </component>
        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <SetupUILanguage>
                <UILanguage>en-US</UILanguage>
            </SetupUILanguage>
            <InputLocale>007f:00000804</InputLocale>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <UILanguageFallback>zh-CN</UILanguageFallback>
            <UserLocale>zh-CN</UserLocale>
 </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <UserAccounts>
                <AdministratorPassword>
                    <Value>xin2024</Value>
                </AdministratorPassword>
            </UserAccounts>
            <OOBE>
                <HideEULAPage>true</HideEULAPage>
            <SkipMachineOOBE>true</SkipMachineOOBE>
            <SkipUserOOBE>true</SkipUserOOBE>
            <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
            <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
        <ProtectYourPC>3</ProtectYourPC>
            </OOBE>
        </component>
        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <InputLocale>007f:00000804</InputLocale>
            <SystemLocale>zh-CN</SystemLocale>
            <UILanguage>zh-CN</UILanguage>
            <UserLocale>zh-CN</UserLocale>
        </component>
    </settings>
    <settings pass="offlineServicing">
    </settings>
<settings pass="specialize">
    <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <fDenyTSConnections>false</fDenyTSConnections>
      </component>
      <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <UserAuthentication>0</UserAuthentication>
      </component>
    <component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <FirewallGroups>
            <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
                <Active>true</Active>
                <Group>@FirewallAPI.dll,-28752</Group>
                <Profile>all</Profile>
            </FirewallGroup>
        </FirewallGroups>
    </component>
    <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <RunSynchronous>           
              <RunSynchronousCommand wcm:action="add">
                  <Description>Enable administrator</Description>
                  <Order>1</Order>
                  <Path>net user administrator /active:yes</Path>
                  <WillReboot>OnRequest</WillReboot>
               </RunSynchronousCommand>
        </RunSynchronous>
    </component>
</settings>
    <cpi:offlineImage cpi:source="catalog:c:/distr/7601.17514.101119-1850_x64fre_server_eval_en-us-grmsxeval_en_dvd/sources/install_windows server 2008 r2 serverstandard.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

在 apache 里设置 acme 验证证书的目录

如这里提到的:https://doc.owncloud.com/server/next/admin_manual/installation/letsencrypt/apache.html

我拿来套用的例子:

<VirtualHost *:443>
    ServerName demo.anqun.org

  Alias /.well-known/acme-challenge/ /var/www/acme/.well-known/acme-challenge/
  <Directory "/var/www/acme/.well-known/acme-challenge/">
      Options None
      AllowOverride None
      ForceType text/plain
      RedirectMatch 404 "^(?!/\.well-known/acme-challenge/[\w-]{43}$)"
  </Directory>

 SSLEngine on
 SSLCertificateFile  /root/.acme.sh/demo.anqun.org_ecc/demo.anqun.org.cer
 SSLCertificateKeyFile /root/.acme.sh/demo.anqun.org_ecc/demo.anqun.org.key
 SSLCertificateChainFile  /root/.acme.sh/demo.anqun.org_ecc/ca.cer

</VirtualHost>

<VirtualHost *:80>
  ServerName demo.anqun.org
  Redirect permanent / https://demo.anqun.org/
  Alias /.well-known/acme-challenge/ /var/www/acme/.well-known/acme-challenge/
  <Directory "/var/www/acme/.well-known/acme-challenge/">
      Options None
      AllowOverride None
      ForceType text/plain
      RedirectMatch 404 "^(?!/\.well-known/acme-challenge/[\w-]{43}$)"
  </Directory>
</VirtualHost>

Debian Installer - 启动参数 - 镜像站点的一组信息配置 - mirror/http/hostname

问题:如下例是下载 Debian bookworm 的网络启动文件,再在当前 Linux 系统里用 kexec 启动。

wget http://ftp.cn.debian.org/debian/dists/bullseye/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
wget http://ftp.cn.debian.org/debian/dists/bullseye/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux

kexec --command-line="priority=critical mirror/http/hostname=ftp.cn.debian.org interface=auto  language=en country=US locale=en_US.UTF-8 keymap=us modules=network-console network-console/password=taobao925 network-console/password-again=taobao925 DEBIAN_FRONTEND=text"  --initrd=initrd.gz linux

但在国内阿里云 ECS 里实践操作是失败的,sshd 没成功连接。查看 /var/log/syslog 日志,有如下的信息:

Feb  7 08:06:39 main-menu[259]: (process:1632): udhcpc: lease of 172.30.118.192 obtained from 172.30.127.253, lease time 315360000
Feb  7 08:06:39 main-menu[259]: INFO: Falling back to the package description for brltty-udeb
Feb  7 08:06:39 main-menu[259]: INFO: Falling back to the package description for brltty-udeb
Feb  7 08:06:39 main-menu[259]: INFO: Menu item 'choose-mirror' selected
Feb  7 08:06:39 anna-install: Queueing udeb apt-mirror-setup for later installation
Feb  7 08:06:39 choose-mirror[1719]: DEBUG: command: wget --no-verbose http://deb.debian.org/debian/dists/oldstable/Release -O - | grep -E '^(Suite|Codename|Architectures):'
Feb  7 08:08:50 choose-mirror[1719]: DEBUG: command: wget --no-verbose http://deb.debian.org/debian/dists/stable/Release -O - | grep -E '^(Suite|Codename|Architectures):'
Feb  7 08:08:53 choose-mirror[1719]: DEBUG: command: wget --no-verbose http://deb.debian.org/debian/dists/bookworm/Release -O - | grep -E '^(Suite|Codename|Architectures):'
Feb  7 08:08:59 choose-mirror[1719]: DEBUG: command: wget --no-verbose http://deb.debian.org/debian/dists/testing/Release -O - | grep -E '^(Suite|Codename|Architectures):'
Feb  7 08:11:09 choose-mirror[1719]: DEBUG: command: wget --no-verbose http://deb.debian.org/debian/dists/unstable/Release -O - | grep -E '^(Suite|Codename|Architectures):'
Feb  7 08:13:20 choose-mirror[1719]: INFO: suite/codename set to: stable/bookworm
Feb  7 08:13:20 choose-mirror[1719]: DEBUG: command: wget --no-verbose http://deb.debian.org/debian//dists/bookworm/main/binary-amd64/Release -O - | grep ^Architecture:
Feb  7 08:13:21 anna-install: Queueing udeb bookworm-support for later installation
Feb  7 08:13:21 main-menu[259]: (process:1712): failed: Connection timed out.
Feb  7 08:13:21 main-menu[259]: (process:1712): failed: Network is unreachable.
Feb  7 08:13:21 main-menu[259]: (process:1712): 2024-02-07 08:08:53 URL:http://deb.debian.org/debian/dists/stable/Release [149229/149229] -> "-" [1]
Feb  7 08:13:21 main-menu[259]: (process:1712): 2024-02-07 08:08:59 URL:http://deb.debian.org/debian/dists/bookworm/Release [149229/149229] -> "-" [1]
Feb  7 08:13:21 main-menu[259]: (process:1712): failed: Connection timed out.
Feb  7 08:13:21 main-menu[259]: (process:1712): failed: Network is unreachable.
Feb  7 08:13:21 main-menu[259]: (process:1712): failed: Connection timed out.
Feb  7 08:13:21 main-menu[259]: (process:1712): failed: Network is unreachable.
Feb  7 08:13:21 main-menu[259]: (process:1712): 2024-02-07 08:13:21 URL:http://deb.debian.org/debian//dists/bookworm/main/binary-amd64/Release [116/116] -> "-" [1]
Feb  7 08:13:21 main-menu[259]: INFO: Falling back to the package description for brltty-udeb
Feb  7 08:13:21 main-menu[259]: INFO: Falling back to the package description for brltty-udeb
Feb  7 08:13:21 main-menu[259]: INFO: Menu item 'download-installer' selected
Feb  7 08:13:21 net-retriever: regular: dists/bookworm/Release /tmp/net-retriever-1776-Release
Feb  7 08:15:31 anna[1774]: failed: Connection timed out.
Feb  7 08:15:31 anna[1774]: failed: Network is unreachable.
Feb  7 08:17:14 anna[1774]: WARNING **: bad d-i Packages file

大概是尝试连接默认的 deb.debian.org 仓库站失败了。搜索得, deb.debian.org 站是由 Fastly 提供的 CDN 站。估计,deb.debian.org 在国内访问有问题。但为什么启动参数里指定的 mirror/http/hostname=ftp.cn.debian.org 无效呢?查看 preseed 文件和说明举例,知道镜像站的配置是有几个参数必须同时指定,如 mirror/country=manual 和 mirror/http/directory=/debian。那么修改一下启动的参数,如 kexec --command-line="priority=critical mirror/country=manual mirror/http/hostname=ftp.cn.debian.org mirror/http/directory=/debian interface=auto locale=en_US.UTF-8 keymap=us modules=network-console network-console/password=taobao925 network-console/password-again=taobao925 DEBIAN_FRONTEND=text" --initrd=initrd.gz linux 就能达到安装时使用 ftp.cn.debian.org 的目的了。

参考: