{"id":20541411,"url":"https://github.com/helloworld-co/flygoose-api","last_synced_at":"2026-03-03T15:01:26.142Z","repository":{"id":224213589,"uuid":"748551025","full_name":"helloworld-Co/flygoose-api","owner":"helloworld-Co","description":"飞鹅项目后端服务","archived":false,"fork":false,"pushed_at":"2024-09-03T14:44:51.000Z","size":103,"stargazers_count":32,"open_issues_count":0,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T08:57:15.927Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/helloworld-Co.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-01-26T08:26:23.000Z","updated_at":"2025-01-24T06:13:24.000Z","dependencies_parsed_at":"2024-11-16T04:45:29.501Z","dependency_job_id":null,"html_url":"https://github.com/helloworld-Co/flygoose-api","commit_stats":null,"previous_names":["helloworld-co/flygoose-api"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/helloworld-Co/flygoose-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helloworld-Co%2Fflygoose-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helloworld-Co%2Fflygoose-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helloworld-Co%2Fflygoose-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helloworld-Co%2Fflygoose-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helloworld-Co","download_url":"https://codeload.github.com/helloworld-Co/flygoose-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helloworld-Co%2Fflygoose-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30050222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T14:38:37.398Z","status":"ssl_error","status_checked_at":"2026-03-03T14:38:06.721Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T01:22:57.227Z","updated_at":"2026-03-03T15:01:26.111Z","avatar_url":"https://github.com/helloworld-Co.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 飞鹅博客部署\n## 一、准备工作\n+ 服务器或者云主机（如果没有，个人PC装个虚拟机也可以用）\n\n## 一、后端部署\n### 1.1 本部署文档环境说明\n+ OS：ubuntu 22.04\n+ MySql 8.0+\n+ CPU制造商为Intel，指令集为x86_64，名称为amd64\n\n\u003e 说明：以下命令，如果使用root账户执行，则无需添加sudo，若是非root账户执行，需要添加sudo，本示例使用非root账户执行\n\n### 1.2 安装辅助工具\n\n```shell\n# apt 包管理工具依赖更新\nsudo apt-get update\n# vim是文本工具 wget是下载flygoose二进制文件使用的\nsudo apt-get install vim wget curl -y\n```\n\n### 1.3 安装和配置MySql（如果你已经有了，请跳过本步骤）\n```shell\n# 安装mysql\nsudo apt-get install mysql-server -y\n# 安装完成后登录\nsudo mysql -u root -p\n```\n因为MySql安装完成后没有密码，当出现以下内容时直接按回车即可\n```shell\nEnter password:\n```\n登录成功就会出现以下\n```shell\nmysql\u003e\n```\n接下来在`mysql\u003e`输入\n```sql\n-- 选中mysql这个数据库\nuse mysql;\n-- 创建用户名为flygoose密码为flygoose的用户 这个账户可以管理任何一个数据库\ncreate user 'flygoose'@'%' identified by 'flygoose';\n-- 授权flygoose这个账户登录\ngrant all privileges on *.* to 'flygoose'@'%' with grant option;\n-- 刷新权限，使上面的配置生效\nflush privileges;\n-- 退出 mysql\u003e\nexit\n```\n退出后就自动回到了系统终端。\n\n### 1.4 配置和启动飞鹅后端服务\n先下载最新版本的飞鹅二进制包\n```shell\n# 我将二进制文件放在了/opt下\ncd /opt\n# 我使用的是linux系统，Intel的CPU，指令集是x86_64 下载的文件是名字中带linux-amd64的\n# wget后面的地址是从github仓库中拿到的 页面地址是：https://github.com/helloworld-Co/flygoose-api/releases\n# 打开页面后选择最新版本 并且选择服务器对应的二进制文件即可\nsudo wget https://github.com/helloworld-Co/flygoose-api/releases/download/tag-2.0-rc1/flygoose-api-linux-amd64-2.0-rc1\n```\n下载完成后整理配置文件\n```shell\ntouch flygoose-config.yml\nvim flygoose-config.yml\n```\n下面开始整理配置文件(若是有与我的配置有出入的，以你的为准，比如有些同学已经有了自己的mysql，用户名、密码、ip等都以你的为准)\n```yaml\n# 服务端口\nhttp:\n  port: 29090\ndatabase:\n  # 数据库类型 取值mysql或postgresql\n  driver: mysql\n  # 数据库IP\n  host: 127.0.0.1\n  # 数据库端口\n  port: 3306\n  # 数据库名称 如果你跳过了安装MySql那一步，这里需要自己创建一下这个数据库，名字可以自己定\n  name: db_flygoose\n  # 用户名\n  user: flygoose\n  # 密码\n  password: flygoose\n```\nvim打开`flygoose-config.yml`后，按键盘上（此时键盘应处于英文状态，中文状态是无法出现效果的）的`i`进入插入数据模式，左下角会出现 `Insert`字样\n然后把上面修改好的配置粘贴进去。然后按`ESC`键，就退出编辑状态，然后输入`:wq`，此时左下角会出现`:wq`，然后按回车，就保存并退出了。\n接下来给下载的二进制文件赋执行权限并启动\n```shell\n# 加执行权限 flygoose-api-linux-amd64-2.0-rc1应替换成你下载的二进制文件的名字\nsudo chmod +x flygoose-api-linux-amd64-2.0-rc1\n# 执行 flygoose-api-linux-amd64-2.0-rc1应替换成你下载的二进制文件的名字\nsudo nohup /opt/flygoose-api-linux-amd64-2.0-rc1 -c /opt/flygoose-config.yml \u0026 \n```\n### 1.5 验证\n使用curl在服务器\n```shell\ncurl localhost:29090/api/health\n```\n或者使用本地浏览器输入`你的服务器ip:29090/api/health`或者POSTMAN使用GET请求`你的服务器ip:29090/api/health`,有下面数据返回即成功。\n```json\n{\"code\":1,\"data\":null,\"message\":\"success\"}\n```\n\n\n\n至此已完成基本的部署\n\n如果你有服务器或者云主机并且具备基本的运维能力，可以继续完成以下配置。\n\n注意：\n\n1. 域名需要一定的RMB\n2. CA证书有些平台免费，有些平台付费\n3. 服务器或者云主机需要一定的RMB\n4. 域名解析的话云服务商大多都有免费的解析可以白嫖\n\n### 1.6 Nginx转发\n\n安装Nginx\n\n配置Nginx转发\n\n### 1.7 域名解析\n\n如果有域名，可以开启HTTPS并解析到你的服务器\n\n### 1.8 Nginx配置HTTPS证书\n\n将你的域名CA证书配置到Nginx\n\n## 附录1 打包命令参考\n\n```shell\n# windows Intel芯片\nGOOS=windows GOARCH=amd64 go build -o flygoose-api-2.0-win-amd64.exe\n# windows 支持arm指令集芯片\nGOOS=windows GOARCH=arm64 go build -o flygoose-api-2.0-win-arm64.exe\n# linux Intel芯片\nGOOS=linux GOARCH=amd64 go build -o flygoose-api-2.0-linux-amd64\n# linux 支持arm指令集芯片，如海思麒麟\nGOOS=linux GOARCH=arm64 go build -o flygoose-api-2.0-linux-arm64\n# mac os 苹果芯片\nGOOS=darwin GOARCH=arm64 go build -o flygoose-api-2.0-darwin-arm64\n# mac os Intel芯片\nGOOS=darwin GOARCH=amd64 go build -o flygoose-api-2.0-darwin-amd64\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelloworld-co%2Fflygoose-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelloworld-co%2Fflygoose-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelloworld-co%2Fflygoose-api/lists"}