| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
--help Show the help.
--keep-pkglist-file Do NOT delete pkg.list file after sending request to segget daemon.
|
|
|
|
| |
+Fix pathes by default
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By default segget daemon will use the following folders for its files:
/etc/seggetd - for config files for seggetd, tuiclient and request tool
/usr/bin - binary files: seggetd, tuiclient, request
/usr/share/seggetd/scripts - for user-side python script files
/usr/share/seggetd/webui - for webui files
/tmp/seggetd/pkg.list - to save distfile list generated by portage and parse it
by request tool to segget daemon
/tmp/seggetd/segments - to store segments
/usr/portage/distfiles - to store ready to use distfiles
/var/log/seggetd - to store log files
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[colors]
Define color scheme for tuiclient.
Avaible colors are:
COLOR_BLACK
COLOR_RED
COLOR_GREEN
COLOR_YELLOW
COLOR_BLUE
COLOR_MAGENTA
COLOR_CYAN
COLOR_WHITE
Defaults:
when tuiclient connected to seggetd:
color_distfile_added_connected_fg=COLOR_WHITE
color_distfile_added_connected_bg=COLOR_BLACK
color_distfile_waiting_connected_fg=COLOR_BLUE
color_distfile_waiting_connected_bg=COLOR_BLACK
color_distfile_script_rejected_connected_fg=COLOR_YELLOW
color_distfile_script_rejected_connected_bg=COLOR_BLACK
color_distfile_downloading_connected_fg=COLOR_CYAN
color_distfile_downloading_connected_bg=COLOR_BLACK
color_distfile_downloaded_connected_fg=COLOR_GREEN
color_distfile_downloaded_connected_bg=COLOR_BLACK
color_distfile_failed_connected_fg=COLOR_RED
color_distfile_failed_connected_bg=COLOR_BLACK
color_distfiles_window_connected_fg=COLOR_WHITE
color_distfiles_window_connected_bg=COLOR_BLACK
color_scroll_window_connected_fg=COLOR_GREEN
color_scroll_window_connected_bg=COLOR_BLACK
color_downloads_connected_fg=COLOR_WHITE
color_downloads_connected_bg=COLOR_BLACK
color_info_connected_fg=COLOR_BLACK
color_info_connected_bg=COLOR_CYAN
color_status_connected_fg=COLOR_GREEN
color_status_connected_bg=COLOR_BLACK
when tuiclient disconnected from seggetd:
color_distfile_added_disconnected_fg=COLOR_WHITE
color_distfile_added_disconnected_bg=COLOR_BLACK
color_distfile_waiting_disconnected_fg=COLOR_WHITE
color_distfile_waiting_disconnected_bg=COLOR_BLACK
color_distfile_script_rejected_disconnected_fg=COLOR_WHITE
color_distfile_script_rejected_disconnected_bg=COLOR_BLACK
color_distfile_downloading_disconnected_fg=COLOR_WHITE
color_distfile_downloading_disconnected_bg=COLOR_BLACK
color_distfile_downloaded_disconnected_fg=COLOR_WHITE
color_distfile_downloaded_disconnected_bg=COLOR_BLACK
color_distfile_failed_disconnected_fg=COLOR_WHITE
color_distfile_failed_disconnected_bg=COLOR_BLACK
color_distfiles_window_disconnected_fg=COLOR_WHITE
color_distfiles_window_disconnected_bg=COLOR_BLACK
color_scroll_window_disconnected_fg=COLOR_WHITE
color_scroll_window_disconnected_bg=COLOR_BLACK
color_downloads_disconnected_fg=COLOR_BLACK
color_downloads_disconnected_bg=COLOR_WHITE
color_info_disconnected_fg=COLOR_WHITE
color_info_disconnected_bg=COLOR_BLACK
color_status_disconnected_fg=COLOR_BLACK
color_status_disconnected_bg=COLOR_RED
|
| |
|
|
|
|
|
|
|
| |
--wait-distfiles=df_name1,df_name2,...,df_nameN
Tuiclient waits until all distfiles are downloaded.
If at least one of the specified distfiles is not in the queue tuiclient will exit immediately.
|
|
|
|
|
|
|
| |
distfiles_dir=/usr/portage/distfiles
segments_dir=/tmp/seggetd/segments
scripts_dir=/usr/share/seggetd/scripts
logs_dir=/var/log/seggetd
|
|
|
|
| |
XMLHttpRequest()
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PROVIDE_MIRROR_TO_OTHERS_URL
Specify url to the provided mirror.
This option is used to generate rss feed.
By default UI_IP is used for this.
Default:
provide_mirror_to_others_url=ui_ip
[rss]
RSS feed provides information on the files added (symlinked)
to PROVIDE_MIRROR_DIR and can be accessed from feedreader
via http://ui_ip:ui_port/rss.xml
RSS_TITLE
Specify a title for the RSS feed
Default:
rss_title=Seggetd feed
RSS_DESCRIPTION
Specify description for the RSS feed
Default:
rss_description=Files downloaded by seggetd and provided in the local mirror
|
|
|
|
|
|
|
|
| |
[ui_server]
tuiclient monitors segget's activity by establishing tcp connection
with segget daemon (ui_server part of it).
Same ip and port are used for WebUI which can be accessed from web
browser via http://ui_ip:ui_port/
|
| |
|
| |
|
|
|
|
|
|
| |
all their mirrors failed consider fetching to be failded.
In such case distfile should be considered failed, since no other options left.
|
| |
|
|
|
|
| |
tuiclient checks distfile status, and returns when distfile is downloaded or not in the queue.
|
|
|
|
|
| |
Provide info on distfiles that are already in the list or just added,
but not in progress (not started yet or already downloaded) to ui_server/tui_clients.
|
|
|
|
| |
Distfiles window shows progress on distfile downloads.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[scripting_and_scheduling]
Segget provides Python scripting functionalyty to support scheduling.
Each time segget tries to start a new connection certain network it calls
a python script (client.py) to accept or reject this connection and
if necessary adjusts its settings.
PYTHON_PATH
Define path to python
Default:
python_path=/usr/bin/python
SCRIPTS_DIR
Define a path to the dir with python scripts. Before establishing connection for
a particular segment via network# segget checks SCRIPTS_DIR.
If SCRIPTS_DIR contains net#.py file, segget will launch schedule() function
from this file to apply settings for connetion and accept or reject this
segment for the moment. net#.py file is a python script file
with a user-writen schedule() function.
It's necessary to import functions before using get("variable"),
set("variable",value), accept_segment() and reject_segment() in schedule().
get() function can obtain values for the following variables:
connection.num, connection.url, connection.max_speed_limit,
network.num, network.mode, network.active_connections_count,
distfile.name, distfile.size, distfile.dld_segments_count,
distfile.segments_count, distfile.active_connections_count,
segment.num, segment.try_num, segment.size, segment.range
set() function can change connection.max_speed_limit, see example:
-----------------EXAMPLE STARTS-----------------
from functions import *
import time;
def schedule():
localtime = time.localtime(time.time());
hour=localtime[3];
# disable downloading distfiles that have size more than 5 000 000 bytes
# from 8-00 to 22-00.
if hour>8 and hour<22 and (get("distfile.size"))>5000000:
print "reject because distfile is too big"
reject_segment()
# set speed limit 50 000 cps for distfiles larger than 1 000 000 bytes
if get("distfile.size")>1000000:
print "limit connection speed"
set(connection.max_speed_limit, 50000)
accept_segment()
-----------------EXAMPLE ENDS-----------------
From example above localtime returns following tuple:
Index Attributes Values
0 tm_year e.i.: 2008
1 tm_mon 1 to 12
2 tm_mday 1 to 31
3 tm_hour 0 to 23
4 tm_min 0 to 59
5 tm_sec 0 to 61 (60 or 61 are leap-seconds)
6 tm_wday 0 to 6 (0 is Monday)
7 tm_yday 1 to 366 (Julian day)
8 tm_isdst -1, 0, 1, -1 means library determines DST
Therefore localtime[3] provides hours.
Segment will be accecpted by default if it was neither accepted nor rejected
during the schedule() function.
sagget saves logs of resulting stdout and stderr in the log folder
separatly for each network. Hence, if there's an error in net3.py file python
error message would be saved to net3_script_stderr.log. Results of print would
be saved in net3_script_stdout.log.
Default:
scripts_dir=./scripts
SCRIPT_SOCKET_PATH
Segget uses AF_UNIX domain sockets for communication with python.
Specify path for the socket on your filesystem.
Default:
script_socket_path=/tmp/segget_script_socket
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DEBUG_LOG_TIME_FORMAT to segget.conf file
GENERAL_LOG_TIME_FORMAT
Set time format for general log as a string containing any combination of
regular characters and special format specifiers. These format specifiers are
replaced by the function to the corresponding values to represent the time
specified in timeptr. They all begin with a percentage (%) sign, and are:
%a Abbreviated weekday name [For example: Thu]
%A Full weekday name [For example: Thursday]
%b Abbreviated month name [For example: Aug]
%B Full month name [For example: August]
%c Date and time representation [For example: Thu Aug 23 14:55:02 2001]
%d Day of the month (01-31) [For example: 23]
%H Hour in 24h format (00-23) [For example: 14]
%I Hour in 12h format (01-12) [For example: 02]
%j Day of the year (001-366) [For example: 235]
%m Month as a decimal number (01-12) [For example: 08]
%M Minute (00-59) [For example: 55]
%p AM or PM designation [For example: PM]
%S Second (00-61) [For example: 02]
%U Week number with the first Sunday
as the first day of week one (00-53) [For example: 33]
%w Weekday as a decimal number with
Sunday as 0 (0-6) [For example: 4]
%W Week number with the first Monday as
the first day of week one (00-53) [For example: 34]
%x Date representation [For example: 08/23/01]
%X Time representation [For example: 14:55:02]
%y Year, last two digits (00-99) [For example: 01]
%Y Year [For example: 2001]
%Z Timezone name or abbreviation [For example: CDT]
%% A % sign [For example: %]
For instace general_log_time_format=Time: %m/%d %X
Default:
general_log_time_format=%m/%d %X
ERROR_LOG_TIME_FORMAT
Set time format for error log as a string containing any combination of
regular characters and special format specifiers. See GENERAL_LOG_TIME_FORMAT
for details on format specifiers.
Default:
error_log_time_format=%m/%d %X
DEBUG_LOG_TIME_FORMAT
Set time format for debug log as a string containing any combination of
regular characters and special format specifiers. See GENERAL_LOG_TIME_FORMAT
for details on format specifiers.
Default:
debug_log_time_format=%m/%d %X
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BIND_LOCAL_PORT
This sets the local port number of the socket used for connection. This option
can be used in combination with BIND_INTERFACE and you are recommended to
use BIND_LOCAL_PORT_RANGE as well when this is set. Set to 0 - to disable
binding. Valid port numbers are 1 - 65535.
Minimum value: 0 (no binding)
Maximum value: 65535
Default:
bind_local_port=0
BIND_LOCAL_PORT_RANGE
If BIND_LOCAL_PORT=0 this option will be ignored.
This is the number of attempts segget should make to find a
working local port number. It starts with the given BIND_LOCAL_PORT and adds
one to the number for each retry. Setting this to 1 or below will make segget
do only one try for the exact port number. Port numbers by nature are scarce
resources that will be busy at times so setting this value to something too
low might cause unnecessary connection setup failures.
Minimum value: 1
Maximum value: 65535
Default:
bind_local_port_range=20
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SYNOPSIS: PROXY_TYPE = 0 | 1 | 2 | 3 | 4 | 5
0 - HTTP
1 - HTTP_1_0
2 - SOCKS4
3 - SOCKS4a
4 - SOCKS5
5 - SOCKS5_HOSTNAME
Specify type of the proxy.
Default:
proxy_type=0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SYNOPSIS: FOLLOW_LOCATION= 0 | 1
A parameter set to 1 tells segget to follow any Location: header that the server
sends as part of an HTTP header. This means that the segget will re-send the
same request on the new location and follow new Location: headers all the way
until no more such headers are returned. MAX_REDIRS can be used to limit the
number of redirects segget will follow.
Default:
follow_location=1
MAX_REDIRS
The set number will be the redirection limit. If that many redirections have
been followed, the next redirect will cause an error. This option only makes
sense if the FOLLOW_LOCATION is used at the same time.
Setting the limit to 0 will make segget refuse any redirect.
Minimum value: 0
Maximum value: 100
Default:
max_redirs=5
|
|
|
|
|
| |
Add option to network#.conf files:
[mode]
|
| |
|
| |
|
|
|
|
|
| |
E.i.:
$request --pkglist-file=/home/user/mypkg.list
|
| |
|
|
|
|
|
|
|
|
|
|
| |
There're 2 queues: proxy_fetcher queue and request_server queue.
Note: Segget processes request_server queue first and if no segment was
chosen switches to proxy_fetcher queue.
Before adding a distifile to any of the queues it's necessary to
check both queues, since distfile may already be in one of them.
|
|
|
|
|
| |
Request tool reads list of distfiles from ./pkg.list file and requests
seggetd daemon to download distfiles from the list.
|
| |
|
|
|
|
|
| |
Arguments are optional. If no arguments provided, segget will run in a daemon
mode and use /etc/seggetd dir to read configuration files.
|
| |
|
| |
|
|
|
|
| |
disable logs.
|
| |
|
| |
|
| |
|