Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kongxiangyiren/gitea-pages
gitea pages 实现
https://github.com/kongxiangyiren/gitea-pages
gitea pages
Last synced: about 1 month ago
JSON representation
gitea pages 实现
- Host: GitHub
- URL: https://github.com/kongxiangyiren/gitea-pages
- Owner: kongxiangyiren
- Created: 2023-12-15T05:19:49.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-23T00:48:10.000Z (10 months ago)
- Last Synced: 2024-02-23T01:39:26.842Z (10 months ago)
- Topics: gitea, pages
- Language: TypeScript
- Homepage:
- Size: 193 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gitea Pages
## 可执行文件下载地址
[github](https://github.com/kongxiangyiren/gitea-pages/releases/latest)
## 注意
1、只支持pages仓库的main分支,对应域名为`<用户名>.`
2、暂不支持自动申请ssl证书
3、在`main`分支根目录创建`.spa`空白文件支持spa项目
## 可执行文件部署
### iis 部署
1、下载gitea-pages-win.exe
[github](https://github.com/kongxiangyiren/gitea-pages/releases/latest)
2、[下载安装 aspNetCore](https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/runtime-aspnetcore-8.0.0-windows-hosting-bundle-installer)
3、双击运行gitea-pages-win.exe
4、修改生成的`config.js`中的`port: 8360` 为`port: process.env.ASPNETCORE_PORT`
如:
```javascript
// 生产环境使用
module.exports = {
// workers: 0, // 进程数(最大为cpu数,0为全部启用)
port: process.env.ASPNETCORE_PORT, // 服务器端口,默认 8360
// pages 服务器域名
pagesDomainName: 'localhost',
// gitea url 结尾不要 /
giteaUrl: 'https://gitea.com',
// user 白名单
whiteList: ['kongxiangyiren'],
// user 黑名单 如果whiteList配置了就失效
blackList: [],
// 缓存文件后缀名,如果匹配设置缓存30天
cacheSuffixName: /.(gif|png|jpe?g|css|js|woff|woff2|ttf|webp|ico)$/i,
// gzip
gzip: {
// gzip开关
enable: true,
// 要压缩的最小响应大小(以字节为单位)。默认为1024字节或1KB。
threshold: 1024
},
// gitee 文件树缓存 响应速度 (文件树缓存为10分钟,如果缓存文件404,将会刷新文件树)
cache: {
type: 'file', // redis 或者 file
// 文件缓存
file: {
gcInterval: 24 * 60 * 60 * 1000 // gc interval
},
// redis 缓存 配置
redis: {
port: 6379,
host: '127.0.0.1',
// username: "default", // needs Redis >= 6
password: '',
db: 0
}
}
};
```5、自行修改`config.js`的其他配置
6、创建web.config
```xml
```
### linux 部署
1、下载gitea-pages-linux
[github](https://github.com/kongxiangyiren/gitea-pages/releases/latest)
2、运行gitea-pages-linux
```sh
./gitea-pages-linux
```3、修改生成的`config.js`
4、 持久运行
```
nohup ./gitea-pages-linux &
```5、 Nginx代理
```nginx
#PROXY-START/
location ^~ /
{
proxy_pass http://127.0.0.1:8360/;
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;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto $scheme;
# proxy_hide_header Upgrade;add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
set $static_gitea_pages 0;
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
set $static_gitea_pages 1;
expires 1m;
}
if ( $static_gitea_pages = 0 )
{
add_header Cache-Control no-cache;
}
}#PROXY-END/
```