Giter Site home page Giter Site logo

yurikoto-api-v1's Introduction

Yurikoto第一版API实现(基于Golang)

使用或自部署本代码请严格遵守AGPL-3.0协议。本仓库代码可供学习使用,但Yurikoto提供的壁纸、台词资源严禁商用

Open Source Helpers Go Report Card Maintainability FOSSA Status

简介

通过go-gin实现的Yurikoto第一版API,如果您有任何建议或改进想法,欢迎提交issue或pr。

Yurikoto主页

自部署指南

环境

以下为Yurikoto官方使用的环境 CentOS 8.2 Nginx 1.17 Go 1.15.7 (服务端可不需要) MySQL 5.7 Redis 6.0.10

数据库

本项目使用gorm进行数据库操作,无需提前创建表等。如需要使用Yurikoto官方数据库,请提交issue并留下您的邮箱以获取数据库备份。

配置文件

根据文件内提示修改config.template.ini并重命名为config.ini

编译

go mod download
SET GOOS=linux
SET GOARCH=amd64
go build

执行上述命令后项目目录会出现可执行文件yurikoto-api-go-v1

运行

将可执行文件与config.inifavicon.ico上传到服务器。在lib/systemd/system下创建yurikoto-api-v1.service,内容如下:

[Unit]
Description=Yurikoto API V1 Service
After=network.target

[Service]
Type=simple
Restart=on-failure
RestartSec=5s
ExecStart=/path/yurikoto-api-go-v1 -c /path/


[Install]
WantedBy=multi-user.target

并将path替换为可执行文件所在目录(ExecStart末尾斜杠需保留)。执行:

systemctl enable yurikoto-api-v1
systemctl start yurikoto-api-v1
systemctl status yurikoto-api-v1

若显示"active"字样,则说明部署成功。

反向代理

location /
{
    proxy_pass http://127.0.0.1:3417;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    
    add_header Access-Control-Allow-Origin *;
    add_header X-Cache $upstream_cache_status;
    
    #Set Nginx Cache
    
    	add_header Cache-Control no-cache;
    expires 12h;
}

License

FOSSA Status

yurikoto-api-v1's People

Contributors

fossabot avatar sexyxlywaol avatar

Watchers

 avatar

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.