Git Product home page Git Product logo

andex's Introduction

Andex

 ______     __   __     _____     ______     __  __    
/\  __ \   /\ "-.\ \   /\  __-.  /\  ___\   /\_\_\_\   
\ \  __ \  \ \ \-.  \  \ \ \/\ \ \ \  __\   \/_/\_\/_  
 \ \_\ \_\  \ \_\\"\_\  \ \____-  \ \_____\   /\_\/\_\ 
  \/_/\/_/   \/_/ \/_/   \/____/   \/_____/   \/_/\/_/                                                       

Andex (Aliyun Index) 是一个将阿里网盘作为云盘分享的工具

配置文件

路径是运行目录下 ./config.json

{
  "refresh_token": "REFRESH_TOKEN",
  "root_path": "/publicDir",
  "port": "8080",
  "admin_password": "adminPassword",
  "site_name": "Andex云盘"
}
  • refresh_token 阿里云盘 refresh token,获取方法如下

    • (2021-06)
      • 打开 这个地址
      • 输入用户名和密码,点击登录
      • login.do 的返回结果中,去除 bizExt 内容
      • base64 解码,其中会有一个 refresh token 字段
  • root_path 云盘内文件夹的路径,如 /public/Andex, 该路径将会映射到 Andex 首页路径, 默认为 /, 即网盘根目录

  • port 服务运行端口

  • admin_password 管理员密码

  • site_name 网站名称

Feature

  • 根目录文件夹设置
  • 不直接暴露文件夹 id
  • 阿里云盘下载直链获取
  • 网盘 README.md 展示
  • 文件/文件夹下载加密(密码设置)

TODO

  • 提供后台管理/设置/初始化页面
    • README.md 编辑
  • 文件/文件夹下载次数统计
  • ip 防护/黑名单防护

Build

clone 代码之后直接 go build Andex.go 就可以了

构建得到的运行文件为 ./Andex./Andex.exe

运行效果

图片1

图片2

图片3

andex's People

Contributors

ericwyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

andex's Issues

启动报错

macos [go1.16.6 darwin/amd64] 编译后运行会报错:

[Andex-INFO] [0906-084429] DEBUG 模式已打开
[Andex-INFO] [0906-084429] can't find .conf/ path for save db and config
[xorm] [info]  2021/09/06 08:44:29.769851 [SQL] SELECT name FROM sqlite_master WHERE type='table' [] - 1.314727ms
unable to open database file: no such file or directory
[Andex-ERR ] [0906-084429] SYNC TABLE ERROR!!

手动创建 .conf 目录后,执行报错:

[Andex-ERR ] [0906-091027] create .conf/ dir fail
[Andex-INFO] [0906-091027] ==================== 启动配置 Start ====================
[Andex-INFO] [0906-091027] 首次创建 sys conf
[Andex-INFO] [0906-091027] 服务运行端口:8080
用户配置文件已更新
[Andex-INFO] [0906-091028] 运行配置载入完毕
[Andex-INFO] [0906-091028] token 过期时间设置:5400
[Andex-INFO] [0906-091028] 距离上次 token 获取时间已过去:0
[Andex-INFO] [0906-091028]
[Andex-INFO] [0906-091028] 检查 RootPath 设置:/
[Andex-INFO] [0906-091028] 验证文件夹路径:
[Andex-INFO] [0906-091028] 文件夹路径验证成功, FileId:root
[Andex-DBUG] [0906-091028] 无法从已有 pathMap 缓存当中找到根目录 FileId 设置
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x433193b]

goroutine 1 [running]:
github.com/Ericwyn/GoTools/file.OpenFile(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/xxx/go/pkg/mod/github.com/!ericwyn/[email protected]/file/oop.go:55 +0x17b
github.com/Ericwyn/Andex/service.LoadReadmeFile()
	/Users/xxx/tmp/code/Andex/service/conf.go:124 +0x4c
main.loadConfig()
	/Users/xxx/tmp/code/Andex/Andex.go:99 +0x3ba
main.main()
	/Users/xxx/tmp/code/Andex/Andex.go:35 +0xad

看起来在 macos 环境没办法创建目录。

下载打包好的二进制包 linux64.zip,在 linux 环境执行运行报错:

[Andex-INFO] [0906-090142] DEBUG 模式已打开
[Andex-ERR ] [0906-090142] create .conf/ dir fail
[xorm] [info]  2021/09/06 09:01:42.126102 [SQL] SELECT name FROM sqlite_master WHERE type='table' [] - 328.398µs
[xorm] [info]  2021/09/06 09:01:42.126225 [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [andex_path] - 16.861µs
[xorm] [info]  2021/09/06 09:01:42.126361 [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [andex_path] - 13.725µs
[xorm] [info]  2021/09/06 09:01:42.126451 [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [andex_config] - 12.383µs
[xorm] [info]  2021/09/06 09:01:42.126548 [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [andex_config] - 12.844µs
[Andex-INFO] [0906-090142] ==================== 启动配置 Start ====================
[xorm] [info]  2021/09/06 09:01:42.126781 [SQL] SELECT `key`, `value` FROM `andex_config` WHERE `key`=? LIMIT 1 [refreshToken] - 17.522µs
[xorm] [info]  2021/09/06 09:01:42.126898 [SQL] SELECT `key`, `value` FROM `andex_config` WHERE `key`=? LIMIT 1 [authorization] - 25.067µs
[xorm] [info]  2021/09/06 09:01:42.126991 [SQL] SELECT `key`, `value` FROM `andex_config` WHERE `key`=? LIMIT 1 [driveID] - 14.097µs
[xorm] [info]  2021/09/06 09:01:42.127084 [SQL] SELECT `key`, `value` FROM `andex_config` WHERE `key`=? LIMIT 1 [rootPath] - 19.417µs
[xorm] [info]  2021/09/06 09:01:42.127175 [SQL] SELECT `key`, `value` FROM `andex_config` WHERE `key`=? LIMIT 1 [lastGetTokenTime] - 11.381µs
[Andex-INFO] [0906-090142] 服务运行端口:8080
[Andex-INFO] [0906-090142] 从数据库中载入 Authorization
[Andex-INFO] [0906-090142] 运行配置载入完毕
[Andex-INFO] [0906-090142] token 过期时间设置:5400
[Andex-INFO] [0906-090142] 距离上次 token 获取时间已过去:254
[Andex-INFO] [0906-090142]
[Andex-INFO] [0906-090142] 检查 RootPath 设置:/
[Andex-INFO] [0906-090142] 验证文件夹路径:
[Andex-INFO] [0906-090142] 文件夹路径验证成功, FileId:root
[xorm] [info]  2021/09/06 09:01:42.127529 [SQL] SELECT `path`, `name`, `file_id`, `is_dir`, `password` FROM `andex_path` [] - 14.668µs
[Andex-DBUG] [0906-090142] 旧 Root Path -> FileId:root
[Andex-DBUG] [0906-090142] 旧 Root Path -> FileId:root
[Andex-DBUG] [0906-090142] rootPath 设置未变更
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x73b7bb]

goroutine 1 [running]:
github.com/Ericwyn/GoTools/file.OpenFile(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/ericwyn/go/pkg/mod/github.com/!ericwyn/[email protected]/file/oop.go:55 +0x17b
github.com/Ericwyn/Andex/service.LoadReadmeFile()
	/mnt/d/Chaos/go/Andex/service/conf.go:124 +0x4c
main.loadConfig()
	/mnt/d/Chaos/go/Andex/Andex.go:99 +0x3ba
main.main()
	/mnt/d/Chaos/go/Andex/Andex.go:35 +0xad

Linux 可以正常创建目录,后面报错类似前面。报错在读取 README.md 文件:

readmeFile := file.OpenFile(UserConfNow.ReadmePath)

问题时间 2021.09.06,都是最新 release

CentOS Linux release 7.7.1908 运行报错

你好,首先感谢开源!
请问我下载的Linux 64直接运行报错,我大概查了一下百度,说要安装gcc,g++,确认已安装且并未解决;报错详情如下:

[root@node1 ~]# ./Andex

 ______     __   __     _____     ______     __  __
/\  __ \   /\ "-.\ \   /\  __-.  /\  ___\   /\_\_\_\
\ \  __ \  \ \ \-.  \  \ \ \/\ \ \ \  __\   \/_/\_\/_
 \ \_\ \_\  \ \_\\"\_\  \ \____-  \ \_____\   /\_\/\_\
  \/_/\/_/   \/_/ \/_/   \/____/   \/_____/   \/_/\/_/

Welcome to use Andex Version V1.2
Release in https://github.com/Ericwyn/Andex

Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
[Andex-ERR ] [0712-105737] SYNC TABLE ERROR!!
[root@node1 ~]#

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.