-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add .fcignore and filter unused files
- Loading branch information
Showing
20,537 changed files
with
2,955,670 additions
and
26 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
./web-framework/nodejs/koa-app | ||
./web-framework/nodejs/nest | ||
./web-framework/java/springboot | ||
./example/django-blog | ||
./example/todolist-app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Type: Application | ||
Name: start-discuz | ||
Provider: | ||
- 阿里云 | ||
Version: 0.1.0 | ||
Description: 快速部署一个 Discuz 框架到阿里云函数计算 | ||
HomePage: https://github.com/devsapp/start-web-framework | ||
Tags: | ||
- Web框架 | ||
- Discuz | ||
Category: Web框架 | ||
Service: | ||
函数计算: | ||
Authorities: | ||
- 管理员权限 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 阿里云 Discuz 框架案例 | ||
|
||
- [快速体验](#快速体验) | ||
- [相关命令](#相关命令) | ||
- [依赖过大部署方案](#依赖过大部署方案) | ||
|
||
## 快速体验 | ||
|
||
- 初始化项目:`s init start-discuz` | ||
- 进入项目后部署:`s deploy` | ||
- 部署过程中可能需要阿里云密钥的支持,部署完成之后会获得到临时域名可供测试 | ||
|
||
> 权限与 Yaml 配置可以参考 [FC Yaml 规范文档](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/yaml.md) | ||
## 相关命令 | ||
|
||
由于该框架直接部署在阿里云函数计算平台,所以可以参考函数计算组件相关的命令: | ||
|
||
| 构建&部署 | 可观测性 | 调用&调试 | 发布&配置 | 其他功能 | | ||
| -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- | | ||
| [**部署 deploy**](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/deploy.md) | [指标查询 metrics](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/metrics.md) | [**本地调用 local**](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/local.md) | [**版本 version**](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/version.md) | [**硬盘挂载 nas**](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/nas.md) | | ||
| [**构建 build**](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/build.md) | [日志查询 logs](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/logs.md) | [远程调用 invoke](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/invoke.md) | [**别名 alias**](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/alias.md) | [计划变更 plan](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/plan.md) | | ||
| [移除 remove](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/remove.md) | | [**端云联调 proxied**](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/proxied.md) | [预留 provision](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/provision.md) | [查看函数 info](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/info.md) | | ||
| | | [远程调试 remote](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/remote.md) | [按量资源 ondemand](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/ondemand.md) | [**资源同步 sync**](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/sync.md) | | ||
| | | [内存&并发度探测 eval](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/eval.md) | [层 layer](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/layer.md) | [压测 stress](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/stress.md) | | ||
| | | | | [API 调用 api](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/api.md) | | ||
| | | | | [Fun 项目迁移 fun2s](https://github.com/devsapp/fc/blob/jiangyu-docs/docs/zh/command/fun2s.md) | | ||
|
||
## 依赖过大部署方案 | ||
|
||
函数计算的接口本身默认只支持 50M 的代码包,如果想要部署超过 50M 的代码包,可以考虑: | ||
|
||
1. (50M, 100M] 范围内的代码包,可以: | ||
- 指定 `s.yml` 中的 `ossBucket` 字段(需要是已存在的 Bucket 并且需要和服务同地域),此时通过工具进行部署时,工具会把代码压缩上传到这个指定的 Bucket,然后通过 OSS 的配置方式部署函数; | ||
- 手动将代码压缩上传到对象存储,然后在 `s.yaml` 中指定 `ossBucket` 和 `ossKey` 字段,此时部署函数时,工具会直接通过 OSS 的配置方式部署函数; | ||
2. 大于 100M 的代码包,可以: | ||
- 将 `nasConfig` 配置为 `auto`,然后基于 nas 指令将大文件(可能是训练集/依赖包)传输到 NAS 指定位置,然后配置相应的环境变量到 `s.yml` 中的函数配置中; | ||
- 将非 custom-container 的函数转换成 custom-container,这需要对代码进行一定的改造,并新增 dockerfile,然后创建这个函数(此方式冷启动时间相对其他 runtime 会有一点点的延长); | ||
|
||
|
||
--- | ||
|
||
> - Serverless Devs 项目:https://www.github.com/serverless-devs/serverless-devs | ||
> - Serverless Devs 文档:https://www.github.com/serverless-devs/docs | ||
> - Serverless Devs 钉钉交流群:33947367 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.s | ||
discuz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
set +e | ||
|
||
mkdir -p /tmp/log/nginx/ | ||
mkdir -p /tmp/var/nginx/ | ||
|
||
chown -R www-data:www-data /mnt/auto/discuz | ||
|
||
echo "start php-fpm" | ||
php-fpm7.2 -c /code/root/usr/lib/php/7.2/php.ini-production -y /code/root/etc/php/7.2/fpm/php-fpm.conf | ||
|
||
echo "start nginx" | ||
nginx -c /code/root/etc/nginx/nginx.conf | ||
|
||
sleep 5 | ||
|
||
while true | ||
do | ||
echo "check nginx and php-fpm process ...." | ||
nginx_server=`ps aux | grep nginx | grep -v grep` | ||
if [ ! "$nginx_server" ]; then | ||
echo "restart nginx ..." | ||
nginx -c /code/root/etc/nginx/nginx.conf | ||
fi | ||
php_fpm_server=`ps aux | grep php-fpm | grep -v grep` | ||
if [ ! "$php_fpm_server" ]; then | ||
echo "restart php-fpm ..." | ||
php-fpm7.2 -c /code/root/usr/lib/php/7.2/php.ini-production -y /code/root/etc/php/7.2/fpm/php-fpm.conf | ||
fi | ||
sleep 10 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
/** | ||
* [Discuz!] (C)2001-2099 Comsenz Inc. | ||
* This is NOT a freeware, use is subject to license terms | ||
* | ||
* $Id: admin.php 34285 2013-12-13 03:39:35Z hypowang $ | ||
*/ | ||
|
||
define('IN_ADMINCP', TRUE); | ||
define('NOROBOT', TRUE); | ||
define('ADMINSCRIPT', basename(__FILE__)); | ||
define('CURSCRIPT', 'admin'); | ||
define('HOOKTYPE', 'hookscript'); | ||
define('APPTYPEID', 0); | ||
|
||
|
||
require './source/class/class_core.php'; | ||
require './source/function/function_misc.php'; | ||
require './source/function/function_forum.php'; | ||
require './source/function/function_admincp.php'; | ||
require './source/function/function_cache.php'; | ||
|
||
$discuz = C::app(); | ||
$discuz->init_cron = false; | ||
$discuz->init(); | ||
|
||
$admincp = new discuz_admincp(); | ||
$admincp->core = & $discuz; | ||
$admincp->init(); | ||
|
||
|
||
$admincp_actions_founder = array('templates', 'db', 'founder', 'postsplit', 'threadsplit', 'cloudaddons', 'optimizer'); | ||
$admincp_actions_normal = array('index', 'setting', 'members', 'admingroup', 'usergroups', 'usertag', | ||
'forums', 'threadtypes', 'threads', 'moderate', 'attach', 'smilies', 'recyclebin', 'recyclebinpost', 'prune', 'grid', | ||
'styles', 'addons', 'plugins', 'tasks', 'magics', 'medals', 'announce', 'faq', 'ec', | ||
'tradelog', 'jswizard', 'project', 'counter', 'misc', 'adv', 'logs', 'tools', 'portalperm', 'blogrecyclebin', | ||
'checktools', 'search', 'article', 'block', 'blockstyle', 'blockxml', 'portalcategory', 'blogcategory', 'albumcategory', 'topic', 'credits', | ||
'doing', 'group', 'blog', 'feed', 'album', 'pic', 'comment', 'share', 'click', 'specialuser', 'postsplit', 'threadsplit', 'report', | ||
'district', 'diytemplate', 'verify', 'nav', 'domain', 'postcomment', 'tag', 'connect', 'card', 'portalpermission', 'collection', 'membersplit', 'makehtml'); | ||
|
||
$action = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('action')); | ||
$operation = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('operation')); | ||
$do = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('do')); | ||
$frames = preg_replace('/[^\[A-Za-z0-9_\]]/', '', getgpc('frames')); | ||
lang('admincp'); | ||
$lang = & $_G['lang']['admincp']; | ||
$page = max(1, intval(getgpc('page'))); | ||
$isfounder = $admincp->isfounder; | ||
|
||
if(empty($action) || $frames != null) { | ||
$admincp->show_admincp_main(); | ||
} elseif($action == 'logout') { | ||
$admincp->do_admin_logout(); | ||
dheader("Location: ./index.php"); | ||
} elseif(in_array($action, $admincp_actions_normal) || ($admincp->isfounder && in_array($action, $admincp_actions_founder))) { | ||
if($admincp->allow($action, $operation, $do) || $action == 'index') { | ||
require $admincp->admincpfile($action); | ||
} else { | ||
cpheader(); | ||
cpmsg('action_noaccess', '', 'error'); | ||
} | ||
} else { | ||
cpheader(); | ||
if($action == 'cloudaddons') { | ||
cpmsg('cloudaddons_noaccess', '', 'error'); | ||
} else { | ||
cpmsg('action_noaccess', '', 'error'); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/** | ||
* [Discuz!] (C)2001-2099 Comsenz Inc. | ||
* This is NOT a freeware, use is subject to license terms | ||
* | ||
* $Id: api.php 33591 2013-07-12 06:39:49Z andyzheng $ | ||
*/ | ||
|
||
define('IN_API', true); | ||
define('CURSCRIPT', 'api'); | ||
|
||
$modarray = array('js' => 'javascript/javascript', 'ad' => 'javascript/advertisement'); | ||
|
||
$mod = !empty($_GET['mod']) ? $_GET['mod'] : ''; | ||
if(empty($mod) || !in_array($mod, array('js', 'ad'))) { | ||
exit('Access Denied'); | ||
} | ||
|
||
require_once './api/'.$modarray[$mod].'.php'; | ||
|
||
function loadcore() { | ||
global $_G; | ||
require_once './source/class/class_core.php'; | ||
|
||
$discuz = C::app(); | ||
$discuz->init_cron = false; | ||
$discuz->init_session = false; | ||
$discuz->init(); | ||
} | ||
|
||
?> |
18 changes: 18 additions & 0 deletions
18
web-framework/php/discuz/src/code/discuz/api/addons/channel.htm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset=gbk" /> | ||
<script type="text/javascript"> | ||
var querystring = location.search.substr(1); | ||
if(querystring.indexOf('/') != -1) { | ||
var e = querystring.split('/'); | ||
var url = '../../admin.php?frames=yes&action=cloudaddons&operation=download&addonids=' + e[0] + '&md5hash=' + e[1] + '×tamp=' + e[2]; | ||
try { | ||
top.location.href = url; | ||
} catch(e) {} | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Empty file.
9 changes: 9 additions & 0 deletions
9
web-framework/php/discuz/src/code/discuz/api/addons/zendcheck.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
if(phpversion() >= '5.3') { | ||
include 'zendcheck53.php'; | ||
} else { | ||
include 'zendcheck52.php'; | ||
} | ||
|
||
?> |
3 changes: 3 additions & 0 deletions
3
web-framework/php/discuz/src/code/discuz/api/addons/zendcheck52.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php @Zend; | ||
4123; | ||
/* |
3 changes: 3 additions & 0 deletions
3
web-framework/php/discuz/src/code/discuz/api/addons/zendcheck53.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php @Zend; | ||
3074; | ||
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
Oops, something went wrong.