Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
helloxz committed Apr 18, 2020
1 parent 06a5270 commit bea6791
Show file tree
Hide file tree
Showing 30 changed files with 4,667 additions and 11 deletions.
12 changes: 6 additions & 6 deletions ccaa
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ fi

case $1 in
'start')
nohup aria2c --conf-path=/etc/ccaa/aria2.conf > /var/log/aria2.log 2>&1 &
nohup /usr/sbin/ccaa_web > /var/log/ccaa_web.log 2>&1 &
nohup filebrowser -c /etc/ccaa/config.json > /var/log/fbrun.log 2>&1 &
nohup sudo -u ccaa aria2c --conf-path=/etc/ccaa/aria2.conf > /var/log/aria2.log 2>&1 &
nohup sudo -u ccaa /usr/sbin/ccaa_web > /var/log/ccaa_web.log 2>&1 &
nohup sudo -u ccaa filebrowser -c /etc/ccaa/config.json > /var/log/fbrun.log 2>&1 &
exit
;;
'stop')
Expand All @@ -34,9 +34,9 @@ case $1 in
kill -9 ${aria2pid}
kill -9 ${ccaa_web_pid}
kill -9 ${filebrowser_pid}
nohup aria2c --conf-path=/etc/ccaa/aria2.conf > /var/log/aria2.log 2>&1 &
nohup /usr/sbin/ccaa_web > /var/log/ccaa_web.log 2>&1 &
nohup filebrowser -c /etc/ccaa/config.json > /var/log/fbrun.log 2>&1 &
nohup sudo -u ccaa aria2c --conf-path=/etc/ccaa/aria2.conf > /var/log/aria2.log 2>&1 &
nohup sudo -u ccaa /usr/sbin/ccaa_web > /var/log/ccaa_web.log 2>&1 &
nohup sudo -u ccaa filebrowser -c /etc/ccaa/config.json > /var/log/fbrun.log 2>&1 &
exit;
;;
'status')
Expand Down
26 changes: 21 additions & 5 deletions ccaa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ function setout(){
else
#更新软件,否则可能make命令无法安装
sudo apt-get update
sudo apt-get install -y curl make bzip2 gzip wget unzip
sudo apt-get install -y curl make bzip2 gzip wget unzip sudo
fi
#创建临时目录
cd
mkdir ./ccaa_tmp
#创建用户和用户组
useradd -M -g ccaa ccaa -s /sbin/nologin
}
#安装Aria2
function install_aria2(){
Expand Down Expand Up @@ -146,6 +148,14 @@ function del_post() {
sudo ufw delete 51413/tcp
fi
}
#添加服务
function add_service() {
if [ -d "/etc/systemd/system" ]
then
cp /etc/ccaa/services/* /etc/systemd/system
systemctl daemon-reload
fi
}
#设置账号密码
function setting(){
cd
Expand Down Expand Up @@ -175,7 +185,7 @@ function setting(){
#替换filebrowser读取路径
sed -i "s%ccaaDown%${downpath}%g" /etc/ccaa/config.json
#替换AriaNg服务器链接
sed -i "s/server_ip/${osip}/g" /etc/ccaa/index.html
sed -i "s/server_ip/${osip}/g" /etc/ccaa/AriaNg/index.html

#更新tracker
bash /etc/ccaa/upbt.sh
Expand All @@ -187,12 +197,18 @@ function setting(){
chmod +x /usr/sbin/ccaa_web

#启动服务
nohup aria2c --conf-path=/etc/ccaa/aria2.conf > /var/log/aria2.log 2>&1 &
nohup sudo -u ccaa aria2c --conf-path=/etc/ccaa/aria2.conf > /var/log/aria2.log 2>&1 &
#nohup caddy -conf="/etc/ccaa/caddy.conf" > /etc/ccaa/caddy.log 2>&1 &
nohup /usr/sbin/ccaa_web > /var/log/ccaa_web.log 2>&1 &
nohup sudo -u ccaa /usr/sbin/ccaa_web > /var/log/ccaa_web.log 2>&1 &
#运行filebrowser
nohup filebrowser -c /etc/ccaa/config.json > /var/log/fbrun.log 2>&1 &
nohup sudo -u ccaa filebrowser -c /etc/ccaa/config.json > /var/log/fbrun.log 2>&1 &

#重置权限
chown -R ccaa:ccaa /etc/ccaa/
chown -R ccaa:ccaa ${downpath}

#注册服务
add_service

echo '-------------------------------------------------------------'
echo "大功告成,请访问: http://${osip}:6080/"
Expand Down
21 changes: 21 additions & 0 deletions ccaa_dir/AriaNg/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016-2020 MaysWind ([email protected])

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions ccaa_dir/AriaNg/css/aria-ng-70e1362684.min.css

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions ccaa_dir/AriaNg/css/bootstrap-3.4.1.min.css

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions ccaa_dir/AriaNg/css/plugins-ccac6fc3fc.min.css

Large diffs are not rendered by default.

Binary file added ccaa_dir/AriaNg/favicon.ico
Binary file not shown.
Binary file added ccaa_dir/AriaNg/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ccaa_dir/AriaNg/fonts/fontawesome-webfont.eot
Binary file not shown.
2,671 changes: 2,671 additions & 0 deletions ccaa_dir/AriaNg/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ccaa_dir/AriaNg/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file added ccaa_dir/AriaNg/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file added ccaa_dir/AriaNg/fonts/fontawesome-webfont.woff2
Binary file not shown.
7 changes: 7 additions & 0 deletions ccaa_dir/AriaNg/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE html><html ng-app="ariaNg" manifest="index.manifest"><head><meta charset="utf-8"><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,minimal-ui" name="viewport"><meta name="mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-title" content="AriaNg"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="msapplication-TileColor" content="#3c4852"><meta name="msapplication-TileImage" content="tileicon.png"><meta name="description" content="AriaNg, a modern web frontend making aria2 easier to use."><meta name="theme-color" content="#3c4852"><meta name="format-detection" content="telephone=no"><title>AriaNg</title><link rel="icon" href="favicon.png"><!--[if IE]><link rel="shortcut icon" href="favicon.ico"><![endif]--><link rel="apple-touch-icon" href="touchicon.png"><link rel="stylesheet" href="css/bootstrap-3.4.1.min.css"><link rel="stylesheet" href="css/plugins-ccac6fc3fc.min.css"><link rel="stylesheet" href="css/aria-ng-70e1362684.min.css"></head><body class="hold-transition skin-aria-ng sidebar-mini fixed"><div class="wrapper" ng-controller="MainController" ng-swipe-left="swipeActions.leftSwipe()" ng-swipe-right="swipeActions.rightSwipe()" ng-swipe-disable-mouse><header class="main-header"><div class="logo"><div class="logo-mini">AriaNg</div><div class="logo-lg" title="AriaNg {{ariaNgVersion}}"><div class="dropdown"><span class="dropdown-toggle" data-toggle="dropdown"><span class="logo-lg-title">AriaNg</span><i class="fa fa-caret-right fa-right-bottom fa-rotate-45 fa-half" aria-hidden="true"></i></span><ul class="dropdown-menu dropdown-menu-right rpcselect-dropdown" role="menu"><li ng-repeat="setting in rpcSettings" ng-class="{'active': setting.isDefault}"><a class="pointer-cursor" ng-click="switchRpcSetting(setting)"><span ng-bind="(setting.rpcAlias ? setting.rpcAlias : setting.rpcHost + ':' + setting.rpcPort)">RPC</span> <i class="fa" ng-class="{'fa-check': setting.isDefault}"></i></a></li></ul></div></div></div><nav class="navbar navbar-static-top" role="navigation"><div class="navbar-toolbar"><ul class="nav navbar-nav"><li><a class="toolbar" title="{{'New' | translate}}" ng-href="#!/new"><i class="fa fa-plus"></i> <span translate>New</span></a></li><li class="divider"></li><li class="disabled" ng-class="{'disabled': !isSpecifiedTaskSelected('paused')}"><a class="toolbar" title="{{'Start' | translate}}" ng-click="changeTasksState('start')"><i class="fa fa-play"></i></a></li><li class="disabled" ng-class="{'disabled': !isSpecifiedTaskSelected('active', 'waiting')}"><a class="toolbar" title="{{'Pause' | translate}}" ng-click="changeTasksState('pause')"><i class="fa fa-pause"></i></a></li><li class="disabled" ng-class="{'disabled': !isTaskSelected() && !isSpecifiedTaskShowing('complete', 'error', 'removed')}"><a class="toolbar dropdown-toggle" data-toggle="dropdown" title="{{'Delete' | translate}}"><i class="fa fa-trash-o"></i> <i class="fa fa-caret-right fa-right-bottom fa-rotate-45 fa-half" aria-hidden="true"></i></a><ul class="dropdown-menu" role="menu"><li ng-if="isTaskSelected()"><a class="pointer-cursor" ng-click="removeTasks()"><span translate>Remove Task</span></a></li><li ng-if="taskContext.enableSelectAll && isSpecifiedTaskShowing('complete', 'error', 'removed')"><a class="pointer-cursor" ng-click="clearStoppedTasks()"><span translate>Clear Stopped Tasks</span></a></li></ul></li><li class="divider"></li><li class="disabled" ng-class="{'disabled': !taskContext.enableSelectAll || !taskContext.list || taskContext.list.length < 1}"><a class="toolbar" title="{{'Select All' | translate}}" ng-click="selectAllTasks()"><i class="fa fa-th-large"></i></a></li><li class="disabled" ng-class="{'disabled': !taskContext.enableSelectAll || !taskContext.list || taskContext.list.length < 1}"><a class="toolbar dropdown-toggle" data-toggle="dropdown" title="{{'Display Order' | translate}}"><i class="fa fa-sort-alpha-asc"></i> <i class="fa fa-caret-right fa-right-bottom fa-rotate-45 fa-half" aria-hidden="true"></i></a><ul class="dropdown-menu" role="menu"><li><a class="pointer-cursor" ng-click="changeDisplayOrder('default:asc')"><span translate>Default</span> <i class="fa" ng-class="{'fa-check': isSetDisplayOrder('default')}"></i></a></li><li><a class="pointer-cursor" ng-click="changeDisplayOrder('name:asc')"><span translate>By File Name</span> <i class="fa" ng-class="{'fa-check': isSetDisplayOrder('name')}"></i></a></li><li><a class="pointer-cursor" ng-click="changeDisplayOrder('size:asc')"><span translate>By File Size</span> <i class="fa" ng-class="{'fa-check': isSetDisplayOrder('size')}"></i></a></li><li><a class="pointer-cursor" ng-click="changeDisplayOrder('percent:desc')"><span translate>By Progress</span> <i class="fa" ng-class="{'fa-check': isSetDisplayOrder('percent')}"></i></a></li><li><a class="pointer-cursor" ng-click="changeDisplayOrder('remain:asc')"><span translate>By Remaining</span> <i class="fa" ng-class="{'fa-check': isSetDisplayOrder('remain')}"></i></a></li><li><a class="pointer-cursor" ng-click="changeDisplayOrder('dspeed:desc')"><span translate>By Download Speed</span> <i class="fa" ng-class="{'fa-check': isSetDisplayOrder('dspeed')}"></i></a></li><li><a class="pointer-cursor" ng-click="changeDisplayOrder('uspeed:desc')"><span translate>By Upload Speed</span> <i class="fa" ng-class="{'fa-check': isSetDisplayOrder('uspeed')}"></i></a></li></ul></li><li class="divider"></li><li><a class="toolbar" title="{{'Help' | translate}}" href="https://github.com/mayswind/AriaNg" target="_blank"><i class="fa fa-question-circle-o"></i></a></li></ul></div><div class="navbar-searchbar hidden-xs"><ul class="nav navbar-nav"><li><input class="form-control" ng-placeholder="('Search' | translate)" title="{{'Search' | translate}}" ng-model="searchContext.text"><div class="form-control-icon"><span class="fa fa-search form-control-feedback"></span></div></li></ul></div></nav></header><aside class="main-sidebar"><section class="sidebar"><ul id="siderbar-menu" class="sidebar-menu" data-widget="tree" data-animation-speed="300"><li class="header" translate>Download</li><li data-href-match="/downloading"><a href="#!/downloading"><i class="fa fa-arrow-circle-o-down"></i> <span ng-bind="('Downloading' | translate) + (globalStat && globalStat.numActive > 0 ? ' (' + globalStat.numActive + ')' : '')">Downloading</span></a></li><li data-href-match="/waiting"><a href="#!/waiting"><i class="fa fa-clock-o"></i> <span ng-bind="('Waiting' | translate) + (globalStat && globalStat.numWaiting > 0 ? ' (' + globalStat.numWaiting + ')' : '')">Waiting</span></a></li><li data-href-match="/stopped"><a href="#!/stopped"><i class="fa fa-check-circle-o"></i> <span ng-bind="('Finished / Stopped' | translate) + (globalStat && globalStat.numStopped > 0 ? ' (' + globalStat.numStopped + ')' : '')">Finished / Stopped</span></a></li><li class="header" translate>Settings</li><li data-href-match="/settings/ariang"><a href="#!/settings/ariang"><i class="fa fa-cog"></i> <span translate>AriaNg Settings</span></a></li><li class="treeview"><a href="javascript:void(0);"><i class="fa fa-cogs"></i> <span translate>Aria2 Settings</span> <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a><ul class="treeview-menu"><li data-href-match="/settings/aria2/basic"><a href="#!/settings/aria2/basic"><span translate>Basic Settings</span></a></li><li data-href-match="/settings/aria2/http-ftp-sftp"><a href="#!/settings/aria2/http-ftp-sftp"><span translate>HTTP/FTP/SFTP Settings</span></a></li><li data-href-match="/settings/aria2/http"><a href="#!/settings/aria2/http"><span translate>HTTP Settings</span></a></li><li data-href-match="/settings/aria2/ftp-sftp"><a href="#!/settings/aria2/ftp-sftp"><span translate>FTP/SFTP Settings</span></a></li><li data-href-match="/settings/aria2/bt"><a href="#!/settings/aria2/bt"><span translate>BitTorrent Settings</span></a></li><li data-href-match="/settings/aria2/metalink"><a href="#!/settings/aria2/metalink"><span translate>Metalink Settings</span></a></li><li data-href-match="/settings/aria2/rpc"><a href="#!/settings/aria2/rpc"><span translate>RPC Settings</span></a></li><li data-href-match="/settings/aria2/advanced"><a href="#!/settings/aria2/advanced"><span translate>Advanced Settings</span></a></li></ul></li><li class="ng-cloak" data-href-match="/debug" ng-if="enableDebugMode()"><a href="#!/debug"><i class="fa fa-wrench"></i> <span translate>AriaNg Debug Console</span></a></li><li data-href-match="/status"><a href="#!/status"><span class="label pull-right" ng-if="globalStatusContext.isEnabled || isCurrentRpcUseWebSocket" ng-class="{'label-primary': taskContext.rpcStatus === 'Connecting', 'label-success': taskContext.rpcStatus === 'Connected', 'label-danger': taskContext.rpcStatus === 'Disconnected'}" ng-bind="taskContext.rpcStatus | translate"></span> <i class="fa fa-server"></i> <span translate>Aria2 Status</span></a></li>
<li>
<a class="toolbar" title="文件管理" href="http://server_ip:6081/" target="_blank">
<i class="fa fa-folder-o"></i> 文件管理
</a>
</li>
</ul></section></aside><div id="content-wrapper" class="content-wrapper"><div id="content-body" class="content-body"><div ng-view cg-busy="{ promise: loadPromise, message: ('Loading' | translate) }"></div></div></div><footer class="main-footer"><nav class="navbar" role="navigation"><div class="navbar-toolbar"><ul class="nav navbar-nav"><li><a data-toggle="push-menu" role="button" title="{{'Toggle Navigation' | translate}}"><i class="fa fa-bars"></i></a></li><li class="divider"></li><li class="dropup"><a class="dropdown-toggle" data-toggle="dropdown" role="button" title="{{'Shortcut' | translate}}"><i class="fa fa-wrench"></i> <span translate>Shortcut</span> <i class="fa fa-caret-right fa-right-bottom fa-rotate-45 fa-half" aria-hidden="true"></i></a><ul class="dropdown-menu" role="menu"><li><a class="pointer-cursor" ng-click="showQuickSettingDialog('globalSpeedLimit', 'Global Rate Limit')"><span translate>Global Rate Limit</span></a></li></ul></li></ul></div><div class="pull-right ng-cloak" ng-if="globalStatusContext.isEnabled"><a class="global-status" title="{{('Click to pin' | translate)}}" ng-pop-chart ng-data="globalStatusContext.data" ng-container="body" ng-placement="top" ng-trigger="click hover" ng-popover-class="global-status-chart"><span class="realtime-speed"><i class="icon-download fa fa-arrow-down"></i> <span ng-bind="(globalStat.downloadSpeed | readableVolume) + '/s'"></span> </span><span class="realtime-speed"><i class="icon-upload fa fa-arrow-up"></i> <span ng-bind="(globalStat.uploadSpeed | readableVolume) + '/s'"></span></span></a></div></nav></footer><ng-setting-dialog setting="quickSettingContext"></ng-setting-dialog></div><script src="js/jquery-3.3.1.min.js"></script><script src="js/angular-packages-1.6.10.min.js"></script><script src="js/bootstrap-3.4.1.min.js"></script><script src="js/moment-with-locales-2.24.0.min.js"></script><script src="js/echarts-common-3.8.5.min.js"></script><script src="js/plugins-cc1df97b8f.min.js"></script><script src="js/aria-ng-da5356c403.min.js"></script></body></html>
23 changes: 23 additions & 0 deletions ccaa_dir/AriaNg/index.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CACHE MANIFEST

CACHE:
css/aria-ng-70e1362684.min.css
css/bootstrap-3.4.1.min.css
css/plugins-ccac6fc3fc.min.css
js/angular-packages-1.6.10.min.js
js/aria-ng-da5356c403.min.js
js/bootstrap-3.4.1.min.js
js/echarts-common-3.8.5.min.js
js/jquery-3.3.1.min.js
js/moment-with-locales-2.24.0.min.js
js/plugins-cc1df97b8f.min.js
fonts/fontawesome-webfont.woff2
index.html

NETWORK:
*

SETTINGS:
prefer-online

# hash: fa5a7f64f538edccc1eecff90ab96dffcbfa73bf7317501f6f3d3023e3a96b2b
Loading

0 comments on commit bea6791

Please sign in to comment.