锐角云 N3450折腾OMV记录

您所在的位置:网站首页 洛宁百姓呼声供热电话 锐角云 N3450折腾OMV记录

锐角云 N3450折腾OMV记录

2023-08-27 17:01| 来源: 网络整理| 查看: 265

    一、安装debian11:

下载nonfree镜像(驱动比较全):Index of /cdimage/unofficial/non-free/cd-including-firmware/11.2.0+nonfree (debian.org)

    二:安装OMV6:    1、安装:

    参考地址:Install OMV6 on Debian 11 (Bullseye) - Guides - openmediavault

    To install OMV6 on an already installed Debian 11 (Bullseye), simply execute the following steps:

cat /etc/apt/sources.list.d/openmediavault.list deb http://packages.openmediavault.org/public shaitan main # deb http://downloads.sourceforge.net/project/openmediavault/packages shaitan main ## Uncomment the following line to add software from the proposed repository. # deb http://packages.openmediavault.org/public shaitan-proposed main # deb http://downloads.sourceforge.net/project/openmediavault/packages shaitan-proposed main ## This software is not part of OpenMediaVault, but is offered by third-party ## developers as a service to OpenMediaVault users. # deb http://packages.openmediavault.org/public shaitan partner # deb http://downloads.sourceforge.net/project/openmediavault/packages shaitan partner EOFexport LANG=C.UTF-8 export DEBIAN_FRONTEND=noninteractive export APT_LISTCHANGES_FRONTEND=none apt-get install --yes gnupg wget -O "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" https://packages.openmediavault.org/public/archive.key apt-key add "/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc" apt-get update apt-get --yes --auto-remove --show-upgraded \ --allow-downgrades --allow-change-held-packages \ --no-install-recommends \ --option DPkg::Options::="--force-confdef" \ --option DPkg::Options::="--force-confold" \ install openmediavault-keyring openmediavault # Populate the database. omv-confdbadm populate # Display the login information. cat /etc/issue    2、安装完成后设置中文环境:

修改/etc/default/locale 文件里,注意,有#号的要去掉。

LANG="en_US.UTF-8" LANGUAGE="en_US:en"

修改为下面内容:

LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh"

在使用的过程中有报错话,那是因为英文包没有被安装,使用下面的命令

sudo dpkg-reconfigure locales

选择zh_CN.UTF-8。。。用空格选中,不要直接敲回车。

选择好之后 重启

     3、设置最低支持smbV1版本

    smb设置里扩展选项增加:server min protocol=NT1

3

    三、安装cupssudo apt install cups

安装常用打印机驱动:

sudo apt install foomatic-db-engine foomatic-db

1.2 修改cupsd.conf

sudo vi /etc/cups/cupsd.conf

cupsd.conf做出以下修改

Listen localhost:631 改成 Listen 0.0.0.0:631 或者注释掉 Listen localhost:631 加上 Port:631 # Restrict access to the server… Order allow,deny Allow @Local //添加此项 # Restrict access to the admin pages… Order allow,deny Allow @Local //添加此项 # Restrict access to configuration files… AuthType Default Require user @SYSTEM Order allow,deny Allow @Local //添加此项

    DPK200H 驱动安装 Epson 24-Pin Series (grayscale)  default设置180DPI

    电脑端安装 Fujitsu DPK200H驱动

    四、安装webdav

     远程改用RaiDrive通过sftp挂载,局域网webdav播放速度比smb快很多。

    参考地址:Linux/Win/OMV5 安装WebDAV服务 - 轶哥 (wyr.me),自己用的是二进制安装

     访问https://github.com/hacdias/webdav/releases/,对应下载作者预编译的二进制版本。

    参考Systemd Example,注册为*unix服务,实现开机自动启动。此步骤有疑问的话,搜索对应操作系统+systemd关键词。

    需要特别注意的是:

二进制文件所在的执行目录需要和Systemd配置文件中的ExecStart目录保持一致。 作者说明了支持JSON, YAML and TOML配置文件格式,因此你需要加上相应后缀,否则配置文件不生效。例如JSON添加.json、YAML添加.yml。

    OMV5(Debian)中二进制文件安装例子(解压提示路径错误,webdav解压到、/usr/bin目录就行):

wget https://github.com/hacdias/webdav/releases/download/v4.1.0/linux-amd64-webdav.tar.gz tar -zxvf linux linux-amd64-webdav.tar.gz vim /etc/systemd/system/webdav.service

webdav.service(注意确保路径/opt/webdav.config.yml下的配置文件已存在):

[Unit] Description=WebDAV server After=network.target [Service] Type=simple User=root ExecStart=/usr/bin/webdav --config /opt/webdav.config.yml Restart=on-failure [Install] WantedBy=multi-user.target

/opt/webdav.config.yml:

# Server related settings address: 0.0.0.0 port: 8080 auth: true tls: false prefix: / # Default user settings (will be merged) scope: . modify: true rules: [] cors: enabled: false credentials: false users: - username: admin password: "{bcrypt}$2a$12$NRf4qBRbBJ0/XR56S7UwaOWzlLIs8fTRDILiC02BGCbbol2g/dw2i" scope: /date modify: true

设置开机启动并启动服务:

systemctl enable webdav systemctl start webdav  关于内网穿透

为NAS搭建内网穿透有很多种方案。

针对SSL证书部署,可以采用:

直接在配置文件中设置tls为true并配置相应的SSL证书地址。 配置文件中保持tls为false,在FRP或其它内网穿透工具中配置HTTPS并加载相应证书。 配置文件中保持tls为false,在FRP或其它内网穿透工具中仅穿透TCP协议(可配置加密和压缩),在公网服务器(FRP或其它内网穿透工具所在的服务器)中配置Nginx反向代理搞定证书问题。

强烈推荐第三个方案,简单也安全。

关于Nginx反向代理的关键配置信息,此webdav服务端作者hacdias已经在README.md中注明。

其它

请大家不要咨询在OMV中如何安装Docker或如何在Portainer中安装webdav之类的问题。此类问题太过于基础(例如后者,可以先进SSH直接执行命令,然后回到Portainer中看Container配置发生了什么变化)。

推荐大家使用Mountain Duck这样的工具挂载带有SSL证书的WebDAV地址,可以实现和OneDrive或Dropbox一样的智能同步功能(始终在此设备上保留、释放空间)。

    五、安装VirtualHere:

    官网:Linux USB Server | VirtualHere

    VirtualHere server install and uninstall script

    VirtualHere server install script for systemd based systems (e.g Raspberry Pi and most modern Linux Distributions).

    Installing default version

    To install the default server version for your architecture, run the following command and enter in your sudo password when prompted.

curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh    Installing optimized or custom version

   To install an optimized or custom version, pass the file name as a script argument. A list of optimized versions is available in the "CPU optimized builds of VirtualHere USB Server for Maximum Performance on your hardware" section of Linux USB Server page.

curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh -s - vhusbdarmpi4    Uninstalling server

    To uninstall the server, run the following command. This script will remove server binary and systemd service, but it will preserve the configuration file.

curl https://raw.githubusercontent.com/virtualhere/script/main/uninstall_server | sudo sh    六、安装syncthing:

官网:GitHub - syncthing/syncthing: Open Source Continuous File Synchronization

要允许系统检查软件包的真实性,您需要提供发行密钥。(此步骤可能需要FQ,如果下载不成功可手动下载到/usr/share/keyrings目录)。

# Add the release PGP keys: sudo curl -s -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg 该频道使用稳定的发布版本进行更新,通常每月的第一个星期二更新一次。stable

# Add the "stable" channel to your APT sources: echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list

最后。

# Update and install syncthing: sudo apt-get update sudo apt-get install syncthing

安装完成后,手动启动服务(最好不用root账户):

sudo systemctl start syncthing@用户名

服务启动后可能打不到配置页。 Syncthing的默认端口是8384,但是一般不推荐,因为网页访问的时候还得手动添加端口号并不方便,其次2019年了,网站还没有SSL总觉得不应当。 Syncthing的配置文件是config.xml,放置于/.config/syncthing中,至于哪个.config取决于你安装时使用的用户了。假如说使用了root用户,那么就在/root/.config/syncthing中。 使用vim打开config.xml后,找到以下配置信息:

     127.0.0.1:8384     k1dnz1Dd0rzTBjjFFh7CXPnrF12C49B1     default 将127.0.0.1改为0.0.0.0 实现访问syncthing的网页

故障 排除 分发包优先于此版本 要确保系统包不会优先于此存储库中的系统包,您需要调整优先级/首选项。

# Increase preference of Syncthing's packages ("pinning") printf "Package: *\nPin: origin apt.syncthing.net\nPin-Priority: 990\n" | sudo tee /etc/apt/preferences.d/syncthing 缺少 HTTPS 方法驱动程序 根据您的发行版,您可能会在运行时看到类似于以下内容的错误:apt-get

E: The method driver /usr/lib/apt/methods/https could not be found. N: Is the package apt-transport-https installed? E: Failed to fetch https://apt.syncthing.net/dists/syncthing/InRelease 如果是这样,请安装该软件包,然后重试:apt-transport-https

sudo apt-get install apt-transport-https 服务器证书验证失败 特别是对于较旧的发行版,您的系统 TLS 证书存储可能已过时。自 2021 年 10 月起,必须安装较新的 Let's Encrypt 根证书,否则您在运行时可能会看到类似于以下内容的错误:apt-get

E: Failed to fetch https://apt.syncthing.net/dists/syncthing/stable/binary-armhf/Packages server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none E: Some index files failed to download. They have been ignored, or old ones used instead. 请确保您使用的是最新版本的软件包,然后重试:ca-certificates sudo apt-get update sudo apt-get upgrade ca-certificates    七、安装transmission:1、安装

默认是root用户操作。

在终端里输入以下命令安装

apt-get install transmission-daemon

安装过程中会顺带把transmission-cli也安装上,所以安装完毕后系统会多出如下一些命令行工具。

transmission-cli: 独立的命令行客户端。 transmission-create: 用来建立.torrent种子文件的命令行工具。 transmission-daemon: 后台守护程序。 transmission-edit: 用来修改.torrent种子文件的announce URL。 transmission-remote: 控制daemon的程序。 transmission-show:查看.torrent文件的信息。 停止transmission的进程,否则修改配置文件无效,执行下面的命令:

systemctl stop transmission-daemon

配置主要是通过修改 /var/lib/transmission-daemon/info/settings.json 文件中的参数来实现的。修改这个配置文件:

vi /var/lib/transmission-daemon/info/settings.json

执行上面的命令会进入到编辑模式里,把以下几个选项改一下即可

“download-dir”: “/down”, #下载目录的绝对路径,根据自己的硬盘情况来设定 “incomplete-dir”: “/down/temp”, #临时文件路径 “rpc-authentication-required”: true, #启用验证 “rpc-bind-address”: “0.0.0.0”, #允许任何IP通过RPC协议访问 “rpc-enabled”: true, #允许通过RPC访问 “rpc-password”: “123456”, #RPC验证密码(保存并启动后daemon会计算并替换为HASH值以增加安全性) “rpc-port”: 9091, #RPC端口 “rpc-username”: “transmission”, #RPC验证用户名 “rpc-whitelist”: “*”, #RPC访问白名单 “rpc-whitelist-enabled”: false, #关闭白名单功能以便公网访问

其他的看官网的wiki,这里不讲

改完以后保存退出,怎么保存退出不会的话,百度一下 nano怎么保存退出。

启动transmission

systemctl start transmission-daemon

此时访问 ip:9091就会看到transmission的登录界面,登陆以后还是很简陋的页面,推荐装一个美化的高级前端。具体做法如下:

wget https://github.com/ronggang/transmission-web-control/raw/master/release/install-tr-control-cn.sh chmod +x install-tr-control-cn.sh ./install-tr-control-cn.sh

    根据脚本提示安装最新版的就可以,然后重新访问 ip:9091 刷新就能看到美化以后的界面了。以上。

    2、迁移任务列表:

    迁移任务主要复制下面两个目录:

/var/lib/transmission-daemon/info/resume /var/lib/transmission-daemon/info/torrents

    迁移配置:

/etc/transmission-daemon/settings.json    八、root用户bash高亮显示

修改~/.bashrc

捕获

修改完成后重新加载.bashrc:

source ~/.bashrc

或者:

. ~/.bashrc


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3