Changeset 4686
- Timestamp:
- 02/22/07 21:47:00 (2 years ago)
- Files:
-
- wired/branches/p7/Makefile.in (modified) (1 diff)
- wired/branches/p7/man/wired.conf.5 (modified) (1 diff)
- wired/branches/p7/man/wiredctl.1 (modified) (2 diffs)
- wired/branches/p7/run/wired.xml (added)
- wired/branches/p7/wired/messages.c (modified) (3 diffs)
- wired/branches/p7/wired/server.c (modified) (3 diffs)
- wired/branches/p7/wired/settings.c (modified) (2 diffs)
- wired/branches/p7/wired/settings.h (modified) (1 diff)
- wired/branches/p7/wired/trackers.c (modified) (1 diff)
- wired/branches/p7/wired/wired.conf.in (modified) (1 diff)
- wired/branches/p7/wired/wiredctl.in (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wired/branches/p7/Makefile.in
r4537 r4686 129 129 fi 130 130 131 $(INSTALL) -m 644 -o $(WD_USER) -g $(WD_GROUP) $(rundir)/wired.xml $(installdir)/ 131 132 $(INSTALL) -m 755 -o $(WD_USER) -g $(WD_GROUP) $(rundir)/wired $(installdir)/ 132 133 $(INSTALL) -m 755 -o $(WD_USER) -g $(WD_GROUP) $(rundir)/wiredctl $(installdir)/ wired/branches/p7/man/wired.conf.5
r4483 r4686 73 73 .Pp 74 74 Example: banner = banner.png 75 .It Va certificate76 Path to an OpenSSL certificate PEM file. It can be generated by the OpenSSL77 .Xr req 178 program.79 .Pp80 Example: certificate = etc/certificate.pem81 75 .It Va client downloads 82 76 Maximum number of downloads per client. wired/branches/p7/man/wiredctl.1
r4483 r4686 35 35 .Sh SYNOPSIS 36 36 .Nm wiredctl 37 .Ar start | stop | restart | reload | register | index | config | configtest | certificate |status | help37 .Ar start | stop | restart | reload | register | index | config | configtest | status | help 38 38 .Sh DESCRIPTION 39 39 .Nm wiredctl … … 72 72 .It Va configtest 73 73 Runs a configuration syntax test, to verify that the config file will be accepted. 74 .It Va certificate75 Generates a new OpenSSL certificate using76 .Xr req 1 .77 74 .It Va status 78 75 Prints a status summary. wired/branches/p7/wired/messages.c
r4683 r4686 215 215 } 216 216 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")); 218 218 219 219 if(wi_string_length(client->account->password) > 0 && … … 244 244 reply = wi_p7_message_with_name(WI_STR("wired.login.reply"), client->p7_socket); 245 245 wi_p7_message_set_uint32_for_name(reply, client->uid, WI_STR("wired.user.id")); 246 247 246 wd_reply_message(client, reply); 248 247 } … … 254 253 255 254 reply = wi_p7_message_with_name(WI_STR("wired.ping.reply"), client->p7_socket); 256 257 255 wd_reply_message(client, reply); 258 256 } wired/branches/p7/wired/server.c
r4683 r4686 187 187 /* load protocol spec */ 188 188 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); 190 190 191 191 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); 193 193 } 194 194 … … 333 333 334 334 pool = wi_pool_init(wi_pool_alloc()); 335 335 336 336 while(wd_running) { 337 337 /* accept new connection */ … … 436 436 437 437 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 439 442 wd_client_unlock_socket(client); 440 443 } wired/branches/p7/wired/settings.c
r4508 r4686 48 48 { "banlist", WI_SETTINGS_PATH, &wd_settings.banlist }, 49 49 { "banner", WI_SETTINGS_PATH, &wd_settings.banner }, 50 { "certificate", WI_SETTINGS_PATH, &wd_settings.certificate },51 50 { "client downloads", WI_SETTINGS_NUMBER, &wd_settings.clientdownloads }, 52 51 { "client uploads", WI_SETTINGS_NUMBER, &wd_settings.clientuploads }, … … 65 64 { "pid", WI_SETTINGS_PATH, &wd_settings.pid }, 66 65 { "port", WI_SETTINGS_PORT, &wd_settings.port }, 66 { "protocol", WI_SETTINGS_PATH, &wd_settings.protocol }, 67 67 { "register", WI_SETTINGS_BOOL, &wd_settings._register }, 68 68 { "search method", WI_SETTINGS_STRING, &wd_settings.searchmethod }, wired/branches/p7/wired/settings.h
r4508 r4686 85 85 wi_string_t *status; 86 86 wi_string_t *banlist; 87 wi_string_t * certificate;87 wi_string_t *protocol; 88 88 }; 89 89 typedef struct _wd_settings wd_settings_t; wired/branches/p7/wired/trackers.c
r4576 r4686 144 144 tracker->context = wi_socket_context_init(wi_socket_context_alloc()); 145 145 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)) { 147 147 wi_log_warn(WI_STR("Could not set SSL context: %m")); 148 148 149 149 continue; 150 } 150 }*/ 151 151 152 152 path = wi_url_path(url); wired/branches/p7/wired/wired.conf.in
r700 r4686 170 170 banlist = banlist 171 171 172 # Path to an OpenSSL certificate PEM file. See req(1) for information173 # on its format.174 # (default "etc/certificate.pem")175 certificate = etc/certificate.pem176 177 172 # Path to an image file that will be sent to clients as the banner. 178 173 # PNG file format is recommended. Maximum image size is 200x32 pixels. 179 174 # (no default) 180 175 #banner = banner.png 176 177 # Path to the protocol specification 178 # (default "wired.xml") 179 protocol = wired.xml wired/branches/p7/wired/wiredctl.in
r4502 r4686 9 9 # The path to your status file, should be the same as in your wired.conf 10 10 STATUSFILE="@wireddir@/wired.status" 11 12 # The path to your certificate, should be the same as in your wired.conf13 CERTIFICATE="@wireddir@/etc/certificate.pem"14 11 15 12 # The path to your wired binary … … 76 73 echo "$PROG: $CMD: wired (pid $PID) already running" 77 74 exit 1 78 fi79 80 if [ ! -f $CERTIFICATE ]; then81 $0 certificate82 75 fi 83 76 … … 155 148 configtest) 156 149 $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 $CERTIFICATE162 150 ;; 163 151 … … 244 232 *) 245 233 cat <<EOF 246 Usage: wiredctl [start | stop | restart | reload | register | index | config | configtest | certificate |status | help]234 Usage: wiredctl [start | stop | restart | reload | register | index | config | configtest | status | help] 247 235 248 236 start start wired … … 254 242 config show the configuration 255 243 configtest run a configuration syntax test 256 certificate generate a new OpenSSL certificate257 244 status show a status screen 258 245 help show this information
