Changeset 4686

Show
Ignore:
Timestamp:
02/22/07 21:47:00 (2 years ago)
Author:
morris
Message:

Add specfication, remove certificate

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wired/branches/p7/Makefile.in

    r4537 r4686  
    129129        fi 
    130130 
     131        $(INSTALL) -m 644 -o $(WD_USER) -g $(WD_GROUP) $(rundir)/wired.xml $(installdir)/ 
    131132        $(INSTALL) -m 755 -o $(WD_USER) -g $(WD_GROUP) $(rundir)/wired $(installdir)/ 
    132133        $(INSTALL) -m 755 -o $(WD_USER) -g $(WD_GROUP) $(rundir)/wiredctl $(installdir)/ 
  • wired/branches/p7/man/wired.conf.5

    r4483 r4686  
    7373.Pp 
    7474Example: banner = banner.png 
    75 .It Va certificate 
    76 Path to an OpenSSL certificate PEM file. It can be generated by the OpenSSL 
    77 .Xr req 1 
    78 program. 
    79 .Pp 
    80 Example: certificate = etc/certificate.pem 
    8175.It Va client downloads 
    8276Maximum number of downloads per client. 
  • wired/branches/p7/man/wiredctl.1

    r4483 r4686  
    3535.Sh SYNOPSIS 
    3636.Nm wiredctl 
    37 .Ar start | stop | restart | reload | register | index | config | configtest | certificate | status | help 
     37.Ar start | stop | restart | reload | register | index | config | configtest | status | help 
    3838.Sh DESCRIPTION 
    3939.Nm wiredctl 
     
    7272.It Va configtest 
    7373Runs a configuration syntax test, to verify that the config file will be accepted. 
    74 .It Va certificate 
    75 Generates a new OpenSSL certificate using 
    76 .Xr req 1 . 
    7774.It Va status 
    7875Prints a status summary. 
  • wired/branches/p7/wired/messages.c

    r4683 r4686  
    215215        } 
    216216         
    217         password = wi_p7_message_string_for_name(message, WI_STR("wired.login.password")); 
     217        password = wi_p7_message_string_for_name(message, WI_STR("wired.user.password")); 
    218218         
    219219        if(wi_string_length(client->account->password) > 0 && 
     
    244244        reply = wi_p7_message_with_name(WI_STR("wired.login.reply"), client->p7_socket); 
    245245        wi_p7_message_set_uint32_for_name(reply, client->uid, WI_STR("wired.user.id")); 
    246  
    247246        wd_reply_message(client, reply); 
    248247} 
     
    254253         
    255254        reply = wi_p7_message_with_name(WI_STR("wired.ping.reply"), client->p7_socket); 
    256          
    257255        wd_reply_message(client, reply); 
    258256} 
  • wired/branches/p7/wired/server.c

    r4683 r4686  
    187187        /* load protocol spec */ 
    188188        if(!wd_p7_spec) { 
    189                 wd_p7_spec = wi_p7_spec_init_with_file(wi_p7_spec_alloc(), WI_STR("wired.xml")); 
     189                wd_p7_spec = wi_p7_spec_init_with_file(wi_p7_spec_alloc(), wd_settings.protocol); 
    190190     
    191191                if(!wd_p7_spec) 
    192                         wi_log_err(WI_STR("Could not load wired.xml: %m")); 
     192                        wi_log_err(WI_STR("Could not load %@: %m"), wd_settings.protocol); 
    193193        } 
    194194 
     
    333333         
    334334        pool = wi_pool_init(wi_pool_alloc()); 
    335  
     335         
    336336        while(wd_running) { 
    337337                /* accept new connection */ 
     
    436436         
    437437        wd_client_lock_socket(client); 
    438         wi_p7_socket_write_message(client->p7_socket, 0.0, message); 
     438 
     439        if(!wi_p7_socket_write_message(client->p7_socket, 0.0, message)) 
     440                wi_log_warn(WI_STR("Could not write to %@: %m"), client->ip); 
     441         
    439442        wd_client_unlock_socket(client); 
    440443} 
  • wired/branches/p7/wired/settings.c

    r4508 r4686  
    4848        { "banlist",                            WI_SETTINGS_PATH,                       &wd_settings.banlist }, 
    4949        { "banner",                                     WI_SETTINGS_PATH,                       &wd_settings.banner }, 
    50         { "certificate",                        WI_SETTINGS_PATH,                       &wd_settings.certificate }, 
    5150        { "client downloads",           WI_SETTINGS_NUMBER,                     &wd_settings.clientdownloads }, 
    5251        { "client uploads",                     WI_SETTINGS_NUMBER,                     &wd_settings.clientuploads }, 
     
    6564        { "pid",                                        WI_SETTINGS_PATH,                       &wd_settings.pid }, 
    6665        { "port",                                       WI_SETTINGS_PORT,                       &wd_settings.port }, 
     66        { "protocol",                           WI_SETTINGS_PATH,                       &wd_settings.protocol }, 
    6767        { "register",                           WI_SETTINGS_BOOL,                       &wd_settings._register }, 
    6868        { "search method",                      WI_SETTINGS_STRING,                     &wd_settings.searchmethod }, 
  • wired/branches/p7/wired/settings.h

    r4508 r4686  
    8585        wi_string_t                                             *status; 
    8686        wi_string_t                                             *banlist; 
    87         wi_string_t                                             *certificate
     87        wi_string_t                                             *protocol
    8888}; 
    8989typedef struct _wd_settings                     wd_settings_t; 
  • wired/branches/p7/wired/trackers.c

    r4576 r4686  
    144144                tracker->context = wi_socket_context_init(wi_socket_context_alloc()); 
    145145                 
    146               if(!wi_socket_context_set_ssl_type(tracker->context, WI_SOCKET_SSL_CLIENT)) { 
     146/*            if(!wi_socket_context_set_ssl_type(tracker->context, WI_SOCKET_SSL_CLIENT)) { 
    147147                        wi_log_warn(WI_STR("Could not set SSL context: %m")); 
    148148                         
    149149                        continue; 
    150                 } 
     150                }*/ 
    151151 
    152152                path = wi_url_path(url); 
  • wired/branches/p7/wired/wired.conf.in

    r700 r4686  
    170170banlist = banlist 
    171171 
    172 # Path to an OpenSSL certificate PEM file. See req(1) for information 
    173 # on its format. 
    174 # (default "etc/certificate.pem") 
    175 certificate = etc/certificate.pem 
    176  
    177172# Path to an image file that will be sent to clients as the banner. 
    178173# PNG file format is recommended. Maximum image size is 200x32 pixels. 
    179174# (no default) 
    180175#banner = banner.png 
     176 
     177# Path to the protocol specification 
     178# (default "wired.xml") 
     179protocol = wired.xml 
  • wired/branches/p7/wired/wiredctl.in

    r4502 r4686  
    99# The path to your status file, should be the same as in your wired.conf 
    1010STATUSFILE="@wireddir@/wired.status" 
    11  
    12 # The path to your certificate, should be the same as in your wired.conf 
    13 CERTIFICATE="@wireddir@/etc/certificate.pem" 
    1411 
    1512# The path to your wired binary 
     
    7673                        echo "$PROG: $CMD: wired (pid $PID) already running" 
    7774                        exit 1 
    78                 fi 
    79  
    80                 if [ ! -f $CERTIFICATE ]; then 
    81                         $0 certificate 
    8275                fi 
    8376 
     
    155148        configtest) 
    156149                $WIRED -t 
    157                 ;; 
    158  
    159         certificate) 
    160                 HOSTNAME=$(hostname) 
    161                 openssl req -x509 -newkey rsa:1024 -subj "/CN=$HOSTNAME" -days 365 -nodes -keyout $CERTIFICATE -out $CERTIFICATE 
    162150                ;; 
    163151 
     
    244232        *) 
    245233                cat <<EOF 
    246 Usage: wiredctl [start | stop | restart | reload | register | index | config | configtest | certificate | status | help] 
     234Usage: wiredctl [start | stop | restart | reload | register | index | config | configtest | status | help] 
    247235 
    248236    start        start wired 
     
    254242    config       show the configuration 
    255243    configtest   run a configuration syntax test 
    256     certificate  generate a new OpenSSL certificate 
    257244    status       show a status screen 
    258245    help         show this information