玩客云-网心云Armbian23.08-Docker-homeassistant-CUPS-网页导航

这篇具有很好参考价值的文章主要介绍了玩客云-网心云Armbian23.08-Docker-homeassistant-CUPS-网页导航。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

文章来源地址https://www.toymoban.com/news/detail-714530.html

榨干玩客云Armbian23.08-Docker-homeassistant-CUPS-网页导航

玩客云-网心云Armbian23.08-Docker-homeassistant-CUPS-网页导航,矿渣,玩客云,homeassistant,ubuntu,python,docker,容器

一、玩客云工具及固件

1、使用工具

烧录工具

  • USB_Burning_Tool_v2.1.6.8
  • Xshell6工具包

2、固件

固件下载地址:https://github.com/hzyitc/armbian-onecloud
armbian来自hzyitc大神编译的
Armbian_23.08.0-trunk_Onecloud_jammy_current_6.1.38.burn.img

二、烧录固件

  • 使用USB_Burning_Tool_v2.1.6.8导入固件armbian固件
    文件-导入烧录包-选择固件Armbian_23.08.0-trunk_Onecloud_jammy_current_6.1.38.burn.img

  • 双公头连接玩客云
    这里使用的是已经刷过其他固件的玩客云

    • 将玩客云(已刷过其他系统的)靠近HDMI口的USB使用双公头线连接到电脑
    • 用针按压restat空的同时,接入电源。
    • 点击开始
    • 等待刷入成功后,点击停止,关闭USB_Burning_Tool_v2.1.6.8拔掉USB,断电接入网络。

三、shell调试及更新系统

Welcome to ARMBIAN! 
Documentation: https://docs.armbian.com | Community: https://forum.armbian.com
IP address: 192.168.3.170
Create root password: ****
Repeat root password: **** # 设置管理员密码
Warning: Weak password, it is too short! # 
Support status: community support (looking for a dedicated maintainer)
Choose default system command shell: # 用第一种方式
1) bash
2) zsh
1 # 这里输入1
Shell: BASH
Creating a new user account. Press <Ctrl-C> to abort
Please provide a username (eg. your first name): ^C # 创建用户 ctrl+C 取消掉不新建用户
Disabling user account creation procedure
root@onecloud:~# 
  • 编辑系统更新源
root@onecloud:~# sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
root@onecloud:~# nano /etc/apt/sources.list 
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-proposed main restricted universe multiverse
  • 对系统进行更新
root@onecloud:~# sudo apt update
root@onecloud:~# sudo apt upgrade -y
  • 接下来设置时间
root@onecloud:~# date -R
Wed, 19 Jul 2023 08:02:33 +0000
root@onecloud:~# cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime
root@onecloud:~# date -R
Wed, 19 Jul 2023 16:02:52 +0800
root@onecloud:~# 

到这里系统的安装就结束了

安装MQTT服务器

sudo apt update
sudo apt install mosquitto mosquitto-clients
# 基本操作
# 检查Mosquitto服务是否正在运行
systemctl status mosquitto
# 手动启动服务
sudo systemctl start mosquitto
#重新启动 Mosquitto 代理
sudo systemctl restart mosquitto
# sudo mosquitto_passwd -c /etc/mosquitto/passwd <username>
sudo mosquitto_passwd -c /etc/mosquitto/passwd tuning
root@onecloud:~# sudo mosquitto_passwd -c /etc/mosquitto/passwd tuning
Password: 
Reenter password:
sudo nano /etc/mosquitto/mosquitto.conf #编辑配置
listener 1883 0.0.0.0
allow_anonymous false
password_file /etc/mosquitto/passwd

安装docker

  • 通过命令安装docker
root@onecloud:~# curl -fsSL https://test.docker.com -o test-docker.sh
root@onecloud:~# sudo sh test-docker.sh
  • docker相关的操作命令
#启动 docker
systemctl start docker  
#设定开机自动启动docker
systemctl enable docker   
#查看docker运行状态
systemctl status docker   
#查看 docker 版本信息
docker version
#把当前用户加入 docker 用户组
sudo usermod -a -G docker root     
#重启 docker 服务
sudo systemctl restart docker 
#将用户在docker用户组中移除,安全!
sudo gpasswd -d root docker
  • 安装中文Docker图形化管理工具FAST OS DOCKER
root@onecloud:~# docker pull wangbinxingkong/fast
root@onecloud:~# mkdir -p /data/fast
root@onecloud:~# docker run --name fast --restart always -p 8081:8081 -d -v /var/run/docker.sock:/var/run/docker.sock -v /etc/docker/:/etc/docker/ -v /data/fast:/fast/data  wangbinxingkong/fast

安装完毕后使用IP:8081就可以访问FAST OS DOCKER初次登录先点击注册按照提示操作即可

安装HomeAssistant

  • 拉取Homeassistant镜像
#拉取hass的最新版镜像
docker pull homeassistant/home-assistant:latest
#创建容器并运行
docker run -d --restart always --name="hass" -v /home/hass/config:/config -p 8123:8123 homeassistant/home-assistant:latest
  • 安装hacs插件
#进入hass目录,安装hacs
docker exec -it hass bash # 通过docker名hass进入hass的bash环境
export http_proxy=http://192.168.3.137:7890 # 这里使用代理下载
export https_proxy=http://192.168.3.137:7890 # 这里使用代理下载
wget -O - https://get.hacs.xyz | bash # 下载hacs插件
# 取消代理
unset http_proxy
unset https_proxy
# 退出hass目录
exit 
systemctl enable docker #设置docker开机自启动
docker update --restart=always hass # 设置homeassistant开机自启动
docker update --restart=always blissful_ellis # 设置portainer开机自启动

安装CUPS打印机服务器

原文参考:https://www.rstk.cn/news/1115055.html
表示感谢

  • 安装cups命令
apt install cups
  • 配置cupsd.conf
 nano /etc/cups/cupsd.conf
# Only listen for connections from the local machine.
Listen localhost:631 改成 Listen 0.0.0.0:631
Listen /run/cups/cups.sock
……省略一部分
# Restrict access to the server...
<Location />
  Order allow,deny
  Allow all    #增加这一行
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow all   #增加这一行
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all   #增加这一行
</Location>

# Restrict access to log files...
<Location /admin/log>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow all   #增加这一行
</Location>

然后Ctrl+X 退出Y保存

  • 安装常用打印机驱动
# HP打印机驱动安装
apt install hplip
# 爱普生打印机驱动安装
apt install printer-driver-escpr
# 兄弟打印机驱动安装
apt install printer-driver-brlaser
# 三星打印机驱动安装
apt install printer-driver-splix
# 高品质打印机驱动合集
apt install printer-driver-gutenprint
……
#安装驱动后需要重启打印服务
systemctl restart cups
  • 添加打印机
浏览器地址栏输入https://ip:631例如https://192.168.3.225:631回车进入CUPS主页
点击Administration 输入账号及密码 进入管理界面 
在Printers栏点击add printer在列表中选择你要安装的打印机点击Continue
或者在在Printers栏点击Find New Printers 中选择你要的打印机点击 Continue
  • 配置自动发现
# 安装发现协议/组织局域网服务
apt install avahi-daemon
# 如果不可用使用下面命令
apt install avahi-daemon avahi-discover libnss-mdn
# 重启CUPS
systemctl restart cups
# 重启avahi-daemon服务
systemctl restart avahi-daemon
# 设置开机自启动
systemctl enable cups
systemctl enable avahi-daemon
# 查看服务启动状态
systemctl status cups
systemctl status avahi-daemon

给玩客云设置导航页

玩客云-网心云Armbian23.08-Docker-homeassistant-CUPS-网页导航,矿渣,玩客云,homeassistant,ubuntu,python,docker,容器

经过上面的操作,我们的玩客云已经基本被榨干了。所以我觉得最后一个工作就是让他开始工作。
那么为了有更好的体验,我需要一个导航页来完善之前所有的工作

  • 安装web服务器
apt install nginx
systemctl enable nginx # 开机自动启动
  • 简单设计一个页面
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>玩客云引导页</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      text-align: center;
      background-image: url("imge/beijing.jpg");
      background-size: cover;
      background-position: center;
      position: relative;
    }
    h1 {
      color: #fff;
      margin-top: 50px;
    }
    .button-container {
      display: flex;
      justify-content: center;
      align-items: center;
      margin-top: 50px;
    }
    .button {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin: 20px;
      padding: 10px;
      background-color: rgba(0, 0, 0, 0.5);
      border-radius: 5px;
      cursor: pointer;
      width: 120px;
      height: 120px;
      transition: transform 0.3s ease-in-out;
    }
    .button:hover {
      transform: scale(1.1);
    }
    .button img {
      width: 60px;
      height: 60px;
      margin-bottom: 10px;
    }
    .button span {
      color: #fff;
      font-size: 14px;
    }
    .time {
      position: absolute;
      bottom: 20px;
      right: 20px;
      background-color: rgba(0, 0, 0, 0.5);
      padding: 10px;
      border-radius: 5px;
      color: #fff;
      font-size: 16px;
    }
  </style>
  <script>
    window.addEventListener('DOMContentLoaded', function() {
      var homeAssistantButton = document.getElementById('homeAssistantButton');
      var dockerButton = document.getElementById('dockerButton');
      var printButton = document.getElementById('printButton');

      homeAssistantButton.addEventListener('click', function() {
        var href = window.location.protocol + '//' + window.location.hostname + ':8123';
        window.location.href = href;
      });

      dockerButton.addEventListener('click', function() {
        var href = window.location.protocol + '//' + window.location.hostname + ':8081';
        window.location.href = href;
      });
      
      printButton.addEventListener('click', function() {
        var href = window.location.protocol + '//' + window.location.hostname + ':631';
        window.location.href = href;
      });

      function updateTime() {
        var now = new Date();
        var hours = now.getHours();
        var minutes = now.getMinutes();
        var seconds = now.getSeconds();
        var timeString = hours.toString().padStart(2, '0') + ':' + minutes.toString().padStart(2, '0') + ':' + seconds.toString().padStart(2, '0');
        var timeElement = document.getElementById('time');
        timeElement.innerText = timeString;
      }

      setInterval(updateTime, 1000);
    });
  </script>
</head>
<body>
  <h1>玩客云引导页</h1>
  <div class="button-container">
    <div class="button" id="homeAssistantButton">
      <img src="imge/homeassistant.png" alt="HomeAssistant">
      <span>HomeAssistant</span>
    </div>
    <div class="button" id="dockerButton">
      <img src="imge/docker.png" alt="Docker">
      <span>Docker管理</span>
    </div>
    <div class="button" id="printButton">
      <img src="imge/print.png" alt="CUPS">
      <span>CUPS打印机</span>
    </div>
  </div>
  <div class="time" id="time"></div>
</body>
</html>

将上面的代码连同imge文件夹图片一同上传到/var/www/html中就可以了
玩客云基本上就没有其他空间供我折腾了。到此我觉得这是我个人觉得它用途的最佳方案。

资料下载

资料内容均来自网络,用于学习使用,如有不妥请联系。
链接:https://pan.baidu.com/s/1E9f-yF6BZoSwipydvEjsQw?pwd=77jd
提取码:77jd

到了这里,关于玩客云-网心云Armbian23.08-Docker-homeassistant-CUPS-网页导航的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 玩客云刷ARMBIAN当服务器过程记录

    1、可以刷成电视+游戏盒子的双系统。也可以刷成单独的电视盒子和游戏盒子。不过因为内存有限放不了多少游戏。还是建议用外置SD卡存储游戏比较合适。 2、刷成Armbian linux系统(可以实现docker、可道云、甜糖等多种功能) 3、最后它还可以刷软路由OpenWrt系统 网上有教程说

    2024年02月05日
    浏览(20)
  • 2.玩客云armbian5.9安装docker

    1.换源 命令:nano /etc/apt/sources.list #用以下内容替换原文件内容 deb https://mirrors.ustc.edu.cn/debian buster main contrib non-free deb https://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free deb https://mirrors.ustc.edu.cn/debian buster-backports main contrib non-free deb

    2024年02月05日
    浏览(38)
  • 玩客云刷机(保姆级教程)ArmBian+Casaos

    最近我发现自己买的玩客云会24小时写我的硬盘,后面了解了一下,玩客云有链克计划,会一直写你的盘,且关不掉,所以我就自己刷了个机,刷成了Armbian,下面就是我的教程 准备材料 一根usb公对公的线,你们可以到淘宝上去买( 注意,一定要是刷机的数据线,不能是充电

    2024年02月08日
    浏览(507)
  • 玩客云刷Armbian带docker详细教程(附所有软件)

    最近在海鲜市场搞了一台几年前的“矿渣”玩客云玩玩,打算刷成一个Linux小主机体验下载器和docker应用,重点是能够锻炼动手能力,撰写此篇,记录一下整个流程。 打个广告: 本人预装了Docker(容器)、portainer(汉化)、qbittorrent(下载器)、宝塔(运维)、MySql5.562、Ng

    2024年02月09日
    浏览(36)
  • 玩客云刷armbian5.9安装最新版青龙

    第一步,线刷底包 拿卡针直接按住电源旁的复位小孔上电即可,如果连接不上,就拆机短接,老板子短接点在被面,V1.3版的玩客云短接点在emmc第4-5个。 第二步,制作U盘5.88,自动刷写进玩客云emmc 首次登录请用putty软件,账号root,密码1234 第三步,制作U盘5.9,命令写入玩客

    2024年02月14日
    浏览(98)
  • 2023最新玩客云刷机armbian,部署docker并配置各种常用容器镜像

    刷机开始 (以下刷机教程部分资料来源于:玩客云刷ARMBIAN系统,装DOCKER、PORTAINER、HOME ASSISTANT和QBITTORRENT教程-HEU8)原网提供的教程需要先刷系统到U盘,再把U盘的系统转移到emmc,但是我下面提供的镜像不需要此操作,注意区分。 用到的工具: 双头USB线一根(买或者自己做,

    2024年02月08日
    浏览(39)
  • 玩客云 线刷Armbian 搭配Alist 阿里云盘 Jellyfin NovaVideoPlayer搞电视墙

    喜欢看电影,买了个投影仪,是这一切折腾的开端。 投影仪虽然有当贝系统,但是想看的电影总是需要**电视会员,那我肯定是不用的。因为有爱腾优的会员,最开始都是使用手机投屏,当呗的投影仪好就好在投屏基本没有广告。然而遇到某些电影,要不就是会员也得加钱点

    2024年02月10日
    浏览(168)
  • 玩客云刷Armbian->安装Docker->安装openwrt 极简教程(成功率99% 拿走不谢)

    直刷包下载地址:https://github.com/hzyitc/armbian-onecloud/releases (建议下载*edge_*.burn.img.xz类型版本的线刷包,线刷步骤很简单,一条双公头数据线就可以,可以参考下其他大神的教程,这里就不做过都介绍 ) 直刷包(备用)下载地址: 直刷包亲测(备用)下载地址:【提取码:

    2024年02月11日
    浏览(24)
  • 玩客云刷Armbian->安装Docker->安装openwrt / 安装青龙面板 极简教程(成功率高 拿走不谢)

    直刷包下载地址:https://github.com/hzyitc/armbian-onecloud/releases (建议下载*edge_*.burn.img.xz类型版本的线刷包,线刷步骤很简单,一条双公头数据线就可以,可以参考下其他大神的教程,这里就不做过都介绍 ) 直刷包(备用)下载地址: 直刷包亲测(备用)下载地址:【提取码:

    2024年02月08日
    浏览(35)
  • 玩客云(赚钱宝3代)刷Armbian 6.1.9系统安装Docker+CasaOS+青龙+Home Assistant

    1.玩客云设备一套【机子、电源适配器、网线】(我的是赚钱宝三代,也就是1.3版本) 2.一条USB公对公的线;电脑支持type接口的话也可以用手机数据线(巧了不是我的电脑支持c口 3.一个USB的U盘(8G以上) 4.十字螺丝刀、镊子、手机取卡针、小翘板、吹风机、带开关的排插 5

    2024年02月04日
    浏览(292)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包