" future output will be lost.\n"
" --dir=<directory-name> - Name of the directory relative to the user's\n"
" home directory to serve data from.\n"
- " Defaults to: storage\n"
+ " Defaults to: remotestorage\n"
+ " --static=<directory> - Directory from which to serve static files.\n"
+ " Defaults to: /var/www/krsd\n"
" --pid-file=<file> - Write PID to given file.\n"
" --stop - Stop a running rs-serve process. The process\n"
" is identified by the PID file specified via\n"
char *rs_pid_file_path = NULL;
char *rs_home_serve_root = NULL;
int rs_home_serve_root_len = 0;
+char *rs_static_dir = NULL;
+int rs_static_dir_len = 0;
int rs_stop_other = 0;
char *rs_auth_uri = NULL;
int rs_auth_uri_len = 0;
{ "detach", no_argument, 0, 'd' },
{ "help", no_argument, 0, 'h' },
{ "version", no_argument, 0, 'v' },
+ { "static", required_argument, 0, 0 },
#if 0
{ "auth-uri", required_argument, 0, 0 },
#endif
rs_home_serve_root[--len] = 0;
}
rs_home_serve_root_len = len;
+ } else if(strcmp(arg_name, "static") == 0) { // --static=<dirname>
+ rs_static_dir = optarg;
+ int len = strlen(rs_static_dir);
+ if(rs_static_dir[len - 1] == '/') {
+ // strip trailing slash.
+ rs_static_dir[--len] = 0;
+ }
+ rs_static_dir = len;
#if 0
} else if(strcmp(arg_name, "auth-uri") == 0) { // --auth-uri=<uri-template>
rs_auth_uri = optarg;
}
if(rs_home_serve_root == NULL) {
- rs_home_serve_root = "storage";
- rs_home_serve_root_len = 7;
+ rs_home_serve_root = "remotestorage";
+ rs_home_serve_root_len = 13;
+ }
+
+ if(rs_static_dir == NULL) {
+ rs_static_dir = "/var/www/krsd";
+ rs_static_dir_len = 13;
}
if(rs_stop_other) {