Code Monkey home page Code Monkey logo

Comments (20)

Jrohy avatar Jrohy commented on August 24, 2024

原先有trojan的话,会被覆盖掉的,你可以手动下载二进制文件来运行, ./trojan web

from trojan.

onlyJinx avatar onlyJinx commented on August 24, 2024

如果直接运行./trojan web 的话原来的trojan config会保持不变吗? 还有web端的话是由我原来的nginx来负责还是让trojan接管?

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

web端是和二进制文件放一起的。你可以起用./trojan web -p xxx 指定其他端口,而80留个nginx, 让nginx转发过去

from trojan.

onlyJinx avatar onlyJinx commented on August 24, 2024

我试着用你教的方法运行起来了, 但是好像对接不到我已有的trojan,这个有办法解决吗,谢谢

image

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

你的trojan是安装在什么目录呢, https://github.com/trojan-gfw/trojan-quickstart 官方的这个脚本是安装在/usr/local/bin目录下

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

本项目因为要用到全局trojan命令,所以将trojan安装到/usr/bin/trojan/trojan, 而管理程序就放到/usr/local/bin/下面,输入trojan就可以进入管理程序

from trojan.

onlyJinx avatar onlyJinx commented on August 24, 2024

二进制文件放在/etc/trojan/ 下, 那我ln-s 到 /usr/local/bin?
image

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

应该指向这里/usr/bin/trojan/trojan, 可以试试

from trojan.

onlyJinx avatar onlyJinx commented on August 24, 2024

嗯,ln后可以识别版本号了,但是无法添加trojan用户,点击确认没反应, 后台log如下

image

[root@RUO ~]# ./trojan web -p 4544
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.

  • using env: export GIN_MODE=release
  • using code: gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET /auth/check --> trojan/web.Auth.func2 (5 handlers)
[GIN-debug] POST /auth/login --> github.com/appleboy/gin-jwt/v2.(*GinJWTMiddleware).LoginHandler-fm (5 handlers)
[GIN-debug] POST /auth/register --> trojan/web.updateUser (5 handlers)
[GIN-debug] POST /auth/reset_pass --> trojan/web.updateUser (6 handlers)
[GIN-debug] POST /auth/logout --> github.com/appleboy/gin-jwt/v2.(*GinJWTMiddleware).LogoutHandler-fm (6 handlers)
[GIN-debug] POST /auth/refresh_token --> github.com/appleboy/gin-jwt/v2.(*GinJWTMiddleware).RefreshHandler-fm (6 handlers)
[GIN-debug] GET /trojan/user --> trojan/web.userRouter.func1 (6 handlers)
[GIN-debug] POST /trojan/user --> trojan/web.userRouter.func2 (6 handlers)
[GIN-debug] DELETE /trojan/user --> trojan/web.userRouter.func3 (6 handlers)
[GIN-debug] POST /trojan/data --> trojan/web.dataRouter.func1 (6 handlers)
[GIN-debug] DELETE /trojan/data --> trojan/web.dataRouter.func2 (6 handlers)
[GIN-debug] GET /common/version --> trojan/web.commonRouter.func1 (6 handlers)
[GIN-debug] GET /common/serverInfo --> trojan/web.commonRouter.func2 (6 handlers)
[GIN-debug] POST /common/loginInfo --> trojan/web.commonRouter.func3 (6 handlers)
[GIN-debug] Listening and serving HTTP on :4544
open /usr/local/etc/trojan/config.json: no such file or directory

2020/03/31 06:05:56 [Recovery] 2020/03/31 - 06:05:56 panic recovered:
POST /trojan/user HTTP/1.1
Host: ruod.top:4544
Accept: application/json, text/plain, /
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7
Authorization: *
Content-Length: 246
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryog7mVCOtfWo1gI38
Cookie: jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1ODU2NTI3MTUsImlkIjoiYWRtaW4iLCJvcmlnX2lhdCI6MTU4NTY0OTExNX0.rWg0C6vrM5pdh8aAaeqtb2WU-XQ7cC8TDFAnFDV-kpI
Origin: http://ruod.top:4544
Referer: http://ruod.top:4544/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4093.3 Safari/537.36

runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:212 (0x44abe9)
/usr/local/go/src/runtime/signal_unix.go:687 (0x44aa38)
/home/go/trojan/core/server.go:74 (0xa4b88b)
/home/go/trojan/web/controller/user.go:50 (0xa4b871)
/home/go/trojan/web/web.go:29 (0xa4f7e7)
/home/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 (0xa2b1da)
/home/go/pkg/mod/github.com/appleboy/gin-jwt/[email protected]/auth_jwt.go:393 (0xa40660)
/home/go/pkg/mod/github.com/appleboy/gin-jwt/[email protected]/auth_jwt.go:355 (0xa435f3)
/home/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 (0xa2b1da)
/home/go/pkg/mod/github.com/gin-contrib/[email protected]/gzip.go:47 (0xa4c690)
/home/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 (0xa2b1da)
/home/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:83 (0xa3e63f)
/home/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 (0xa2b1da)
/home/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0xa3d770)
/home/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:147 (0xa2b1da)
/home/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:403 (0xa34e52)
/home/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:364 (0xa3455c)
/usr/local/go/src/net/http/server.go:2807 (0x75d8a2)
/usr/local/go/src/net/http/server.go:1895 (0x75921b)
/usr/local/go/src/runtime/asm_amd64.s:1373 (0x464c80)

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

那个trojan配置文件,能否移动下,移动到/usr/local/etc/trojan/,还有mysql有没有安装呢

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

安装了mysql后记得修改trojan配置文件,管理程序是读trojan配置文件来连mysql的

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

你可以用管理程序安装管理那里可以安装mysql,移动完配置文件再来安装

from trojan.

onlyJinx avatar onlyJinx commented on August 24, 2024

请问数据库用mariadb(Centos默认)可以吗?如果用mariadb的话提示链接不上mysql, 还是一定要mysql?
image

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

没测过,最好还是用mysql, 你可以用管理程序本身来安装mysql, 安装管理那里有

from trojan.

onlyJinx avatar onlyJinx commented on August 24, 2024

我发现mysql好大, 400多M, 大伙的trojan-panel用的好像是MariaDB不是mysql, 不知道以后您这个项目会不会支持MariaDB, 如果支持的话到时候再过来玩玩, 谢谢~

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

有空我测下mysql版本和mariadb的兼容性

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

我测了用docker版mariadb 没问题,貌似比mysql要省内存

from trojan.

onlyJinx avatar onlyJinx commented on August 24, 2024

就是说其他的都保持不变,直接把mysql换成mariadb也可以正常用对吧?我改天试一下,谢谢

from trojan.

Jrohy avatar Jrohy commented on August 24, 2024

是的,https://github.com/go-sql-driver/mysql, 只要这个驱动支持的都能连,mysql8也是问题的

from trojan.

onlyJinx avatar onlyJinx commented on August 24, 2024

恩恩,我去试试,有问题再来请教~

from trojan.

Related Issues (20)

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.