healthreport

command module
v1.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2022 License: MIT Imports: 15 Imported by: 0

README

河海大学健康打卡

build Go Report Card Go Reference

项目使用http请求模拟整个打卡过程,速度很快!
一键打卡,用到就是爽到
云函数版本请访问健康打卡_河海大学版_FC(无服务器版,配置方便,零成本)

注意:此版本适用于研究生健康打卡,本科生健康打卡请转至main 分支

状态

目前,最新版本具有以下特性:

1. 每日自动打卡
2. 一次打卡失败,自动重新尝试,可设置最大打卡尝试次数
3. 日志同步输出到Stderr
4. 版本查询
5. 打卡失败邮件通知推送功能(目前支持STARTTLS/TLS端口+PlainAuth登录到SMTP服务器)
6. 通过环境变量设置http代理(HTTP_PROXY/HTTPS_PROXY均需设置)

安装教程

适用类Unix/windows,想直接使用的,请下载release版本后直接转到使用说明

源码安装依赖Golang-基于golang开发、git-版本管理工具以及make-快速构建,国内使用推荐开启golang的Go module并使用国内的Go proxy服务
推荐使用Goproxy.cn阿里云 Goproxy

安装步骤
  1. 环境配置,以Centos/Debian为例

    • 安装Golang[>= 1.16]: golang.google.cn/doc/install

    • 安装 git、make:

      # Centos
      sudo yum install git make
      
      # Debian/Ubuntu
      sudo apt install git make
      
  2. 通过源码下载、编译

    # 配置Goproxy
    go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct  
    
    # 下载编译
    git clone --depth 1 https://github.com/yin1999/healthreport.git
    cd healthreport
    make # 若没有安装make,可以使用命令: go run _script/make.go 代替
    

使用说明

Docker

应用支持Docker部署,具体使用方法请参考yin199909/healthreport

Linux/Windows
  1. 授予可执行权限(源码编译Windows平台的可以跳过此步)

    chmod +x healthreport
    
  2. 运行

    # example(set punch time as 9:52)
    ./healthreport -u username -p password -t 9:52 -save
    # -save: 保存账户信息至文件,第二次启动程序时可不设置用户名、密码两个参数(仅使用: ./healthreport -t 9:52)
    

    Linux用户可使用systemd(recommend,支持配置开机自启,使用说明)或者screen管理打卡进程

邮件通知
  1. 生成email.json

    ./healthreport -g  # 可使用 '-email' 指定配置文件生成目录
    
  2. 修改email.json中的的配置,具体说明如下:

    to:    收件邮箱(string list)
    SMTP:  SMTP 配置
        username:   SMTP用户名(string)
        password:   SMTP用户密码(string)
        TLS:        是否为TLS端口(bool)
        host:       SMTP服务地址(string)
        port:       SMTP服务端口(需支持STARTTLS/TLS)(int)
    
  3. 重启打卡服务,若提示Email deliver enabled,则邮件通知服务已启用

其它说明
  1. 查看版本信息

    ./healthreport -v
    
  2. 帮助信息(提供程序的所有命令行参数)

    ./healthreport -h
    
  3. 版本更新

    git pull
    make
    
systemd 使用说明

使用前,请先授予可执行权限:

chmod +x ./_script/run.sh
  • 安装服务

    # 
    sudo ./_script/service.sh install <username> <password> [punchTime]
    
    # 若已创建 account.json,可直接使用以下命令安装服务
    sudo ./_script/service.sh install [punchTime]
    
  • 卸载服务

    sudo ./_script/service.sh uninstall
    
  • 启动服务

    sudo systemctl start healthreport.servie
    
  • 设置开机自启

    sudo systemctl enable healthreport.servie
    

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
utils

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL