| | @@ -1804,15 +1804,17 @@ |
| 1804 | 1804 | ** settings. |
| 1805 | 1805 | */ |
| 1806 | 1806 | const char *db_setting_inop_rhs(){ |
| 1807 | 1807 | Blob x; |
| 1808 | 1808 | int i; |
| 1809 | + int nSetting; |
| 1810 | + const Setting *aSetting = setting_info(&nSetting); |
| 1809 | 1811 | const char *zSep = ""; |
| 1810 | 1812 | |
| 1811 | 1813 | blob_zero(&x); |
| 1812 | 1814 | blob_append_sql(&x, "("); |
| 1813 | | - for(i=0; aSetting[i].name; i++){ |
| 1815 | + for(i=0; i<nSetting; i++){ |
| 1814 | 1816 | blob_append_sql(&x, "%s%Q", zSep/*safe-for-%s*/, aSetting[i].name); |
| 1815 | 1817 | zSep = ","; |
| 1816 | 1818 | } |
| 1817 | 1819 | blob_append_sql(&x, ")"); |
| 1818 | 1820 | return blob_sql_text(&x); |
| | @@ -2735,11 +2737,10 @@ |
| 2735 | 2737 | } |
| 2736 | 2738 | } |
| 2737 | 2739 | db_finalize(&q); |
| 2738 | 2740 | } |
| 2739 | 2741 | |
| 2740 | | - |
| 2741 | 2742 | #if INTERFACE |
| 2742 | 2743 | /* |
| 2743 | 2744 | ** Define all settings, which can be controlled via the set/unset |
| 2744 | 2745 | ** command. |
| 2745 | 2746 | ** |
| | @@ -2760,100 +2761,399 @@ |
| 2760 | 2761 | int forceTextArea; /* Force using a text area for display? */ |
| 2761 | 2762 | const char *def; /* Default value */ |
| 2762 | 2763 | }; |
| 2763 | 2764 | #endif /* INTERFACE */ |
| 2764 | 2765 | |
| 2765 | | -const Setting aSetting[] = { |
| 2766 | | - { "access-log", 0, 0, 0, 0, "off" }, |
| 2767 | | - { "admin-log", 0, 0, 0, 0, "off" }, |
| 2766 | +/* |
| 2767 | +** SETTING: access-log boolean default=off |
| 2768 | +** |
| 2769 | +** When the access-log setting is enabled, all login attempts (successful |
| 2770 | +** and unsuccessful) on the web interface are recorded in the "access" table |
| 2771 | +** of the repository. |
| 2772 | +*/ |
| 2773 | +/* |
| 2774 | +** SETTING: admin-log boolean default=off |
| 2775 | +** |
| 2776 | +** When the admin-log setting is enabled, configuration changes are recorded |
| 2777 | +** in the "admin_log" table of the repository. |
| 2778 | +*/ |
| 2768 | 2779 | #if defined(_WIN32) |
| 2769 | | - { "allow-symlinks", 0, 0, 1, 0, "off" }, |
| 2770 | | -#else |
| 2771 | | - { "allow-symlinks", 0, 0, 1, 0, "on" }, |
| 2772 | | -#endif |
| 2773 | | - { "auto-captcha", "autocaptcha", 0, 0, 0, "on" }, |
| 2774 | | - { "auto-hyperlink", 0, 0, 0, 0, "on", }, |
| 2775 | | - { "auto-shun", 0, 0, 0, 0, "on" }, |
| 2776 | | - { "autosync", 0, 0, 0, 0, "on" }, |
| 2777 | | - { "autosync-tries", 0, 16, 0, 0, "1" }, |
| 2778 | | - { "binary-glob", 0, 40, 1, 0, "" }, |
| 2779 | | -#if defined(_WIN32) || defined(__CYGWIN__) || defined(__DARWIN__) || \ |
| 2780 | | - defined(__APPLE__) |
| 2781 | | - { "case-sensitive", 0, 0, 0, 0, "off" }, |
| 2782 | | -#else |
| 2783 | | - { "case-sensitive", 0, 0, 0, 0, "on" }, |
| 2784 | | -#endif |
| 2785 | | - { "clean-glob", 0, 40, 1, 0, "" }, |
| 2786 | | - { "clearsign", 0, 0, 0, 0, "off" }, |
| 2787 | | - { "crlf-glob", 0, 40, 1, 0, "" }, |
| 2788 | | - { "crnl-glob", 0, 40, 1, 0, "" }, |
| 2789 | | - { "default-perms", 0, 16, 0, 0, "u" }, |
| 2790 | | - { "diff-binary", 0, 0, 0, 0, "on" }, |
| 2791 | | - { "diff-command", 0, 40, 0, 0, "" }, |
| 2792 | | - { "dont-push", 0, 0, 0, 0, "off" }, |
| 2793 | | - { "dotfiles", 0, 0, 1, 0, "off" }, |
| 2794 | | - { "editor", 0, 32, 0, 0, "" }, |
| 2795 | | - { "empty-dirs", 0, 40, 1, 0, "" }, |
| 2796 | | - { "encoding-glob", 0, 40, 1, 0, "" }, |
| 2780 | +/* |
| 2781 | +** SETTING: allow-symlinks boolean default=off versionable |
| 2782 | +** Allows symbolic links in the repository when enabled. |
| 2783 | +*/ |
| 2784 | +#endif |
| 2785 | +#if !defined(_WIN32) |
| 2786 | +/* |
| 2787 | +** SETTING: allow-symlinks boolean default=on versionable |
| 2788 | +** Allows symbolic links in the repository when enabled. |
| 2789 | +*/ |
| 2790 | +#endif |
| 2791 | +/* |
| 2792 | +** SETTING: auto-captcha boolean default=on variable=autocaptcha |
| 2793 | +** If enabled, the /login page provides a button that will automatically |
| 2794 | +** fill in the captcha password. This makes things easier for human users, |
| 2795 | +** at the expense of also making logins easier for malecious robots. |
| 2796 | +*/ |
| 2797 | +/* |
| 2798 | +** SETTING: auto-hyperlink boolean default=on |
| 2799 | +** Use javascript to enable hyperlinks on web pages |
| 2800 | +** for all users (regardless of the "h" privilege) if the |
| 2801 | +** User-Agent string in the HTTP header look like it came |
| 2802 | +** from real person, not a spider or bot. |
| 2803 | +*/ |
| 2804 | +/* |
| 2805 | +** SETTING: auto-shun boolean default=on |
| 2806 | +** If enabled, automatically pull the shunning list |
| 2807 | +** from a server to which the client autosyncs. |
| 2808 | +*/ |
| 2809 | +/* |
| 2810 | +** SETTING: autosync width=16 default=on |
| 2811 | +** This setting can take either a boolean value or "pullonly" |
| 2812 | +** If enabled, automatically pull prior to commit |
| 2813 | +** or update and automatically push after commit or |
| 2814 | +** tag or branch creation. If the value is "pullonly" |
| 2815 | +** then only pull operations occur automatically. |
| 2816 | +*/ |
| 2817 | +/* |
| 2818 | +** SETTING: autosync-tries width=16 default=1 |
| 2819 | +** If autosync is enabled setting this to a value greater |
| 2820 | +** than zero will cause autosync to try no more than this |
| 2821 | +** number of attempts if there is a sync failure. |
| 2822 | +*/ |
| 2823 | +/* |
| 2824 | +** SETTING: binary-glob width=40 versionable |
| 2825 | +** The VALUE of this setting is a comma or newline-separated list of |
| 2826 | +** GLOB patterns that should be treated as binary files |
| 2827 | +** for committing and merging purposes. Example: *.jpg |
| 2828 | +*/ |
| 2829 | +#if defined(_WIN32)||defined(__CYGWIN__)||defined(__DARWIN__) |
| 2830 | +/* |
| 2831 | +** SETTING: case-sensitive boolean default=off |
| 2832 | +** If TRUE, the files whose names differ only in case |
| 2833 | +** are considered distinct. If FALSE files whose names |
| 2834 | +** differ only in case are the same file. Defaults to |
| 2835 | +** TRUE for unix and FALSE for Cygwin, Mac and Windows. |
| 2836 | +*/ |
| 2837 | +#endif |
| 2838 | +#if !(defined(_WIN32)||defined(__CYGWIN__)||defined(__DARWIN__)) |
| 2839 | +/* |
| 2840 | +** SETTING: case-sensitive boolean default=on |
| 2841 | +** If TRUE, the files whose names differ only in case |
| 2842 | +** are considered distinct. If FALSE files whose names |
| 2843 | +** differ only in case are the same file. Defaults to |
| 2844 | +** TRUE for unix and FALSE for Cygwin, Mac and Windows. |
| 2845 | +*/ |
| 2846 | +#endif |
| 2847 | +/* |
| 2848 | +** STTING: clean-glob width=40 versionable |
| 2849 | +** The VALUE of this setting is a comma or newline-separated list of GLOB |
| 2850 | +** patterns specifying files that the "clean" command will |
| 2851 | +** delete without prompting or allowing undo. |
| 2852 | +** Example: *.a,*.lib,*.o |
| 2853 | +*/ |
| 2854 | +/* |
| 2855 | +** SETTING: clearsign boolean default=off |
| 2856 | +** When enabled, fossil will attempt to sign all commits |
| 2857 | +** with gpg. When disabled, commits will be unsigned. |
| 2858 | +*/ |
| 2859 | +/* |
| 2860 | +** SETTING: crlf-glob width=40 versionable |
| 2861 | +** The value is a comma or newline-separated list of GLOB patterns for |
| 2862 | +** text files in which it is ok to have CR, CR+LF or mixed |
| 2863 | +** line endings. Set to "*" to disable CR+LF checking. |
| 2864 | +** The crnl-glob setting is a compatibility alias. |
| 2865 | +*/ |
| 2866 | +/* |
| 2867 | +** SETTING: crnl-glob width=40 versionable |
| 2868 | +** This is an alias for the crlf-glob setting |
| 2869 | +*/ |
| 2870 | +/* |
| 2871 | +** SETTING: default-perms width=16 default=u |
| 2872 | +** Permissions given automatically to new users. For more |
| 2873 | +** information on permissions see the Users page in Server |
| 2874 | +** Administration of the HTTP UI. |
| 2875 | +*/ |
| 2876 | +/* SETTING: diff-binary boolean default=on |
| 2877 | +** If enabled, permit files that may be binary |
| 2878 | +** or that match the "binary-glob" setting to be used with |
| 2879 | +** external diff programs. If disabled, skip these files. |
| 2880 | +*/ |
| 2881 | +/* |
| 2882 | +** SETTING: diff-command width=40 |
| 2883 | +** The value is an external command to run when performing a diff. |
| 2884 | +** If undefined, the internal text diff will be used. |
| 2885 | +*/ |
| 2886 | +/* |
| 2887 | +** SETTING: dont-push boolean default=off |
| 2888 | +** If enabled, prevent this repository from pushing from client to |
| 2889 | +** server. This can be used as an extra precaution to prevent |
| 2890 | +** accidental pushes to a public server from a private clone. |
| 2891 | +*/ |
| 2892 | +/* |
| 2893 | +** SETTING: dotfiles boolean versionable default=off |
| 2894 | +** If enabled, include --dotfiles option for all compatible commands. |
| 2895 | +*/ |
| 2896 | +/* |
| 2897 | +** SETTING: editor width=32 |
| 2898 | +** The value is an external command that will launch the |
| 2899 | +** text editor command used for check-in comments. |
| 2900 | +*/ |
| 2901 | +/* |
| 2902 | +** SETTING: empty-dirs width=40 versionable |
| 2903 | +** The value is a comma or newline-separated list of pathnames. On |
| 2904 | +** update and checkout commands, if no file or directory |
| 2905 | +** exists with that name, an empty directory will be |
| 2906 | +** created. |
| 2907 | +*/ |
| 2908 | +/* |
| 2909 | +** SETTING: encoding-glob width=40 versionable |
| 2910 | +** The value is a comma or newline-separated list of GLOB |
| 2911 | +** patterns specifying files that the "commit" command will |
| 2912 | +** ignore when issuing warnings about text files that may |
| 2913 | +** use another encoding than ASCII or UTF-8. Set to "*" |
| 2914 | +** to disable encoding checking. |
| 2915 | +*/ |
| 2797 | 2916 | #if defined(FOSSIL_ENABLE_EXEC_REL_PATHS) |
| 2798 | | - { "exec-rel-paths", 0, 0, 0, 0, "on" }, |
| 2799 | | -#else |
| 2800 | | - { "exec-rel-paths", 0, 0, 0, 0, "off" }, |
| 2917 | +/* |
| 2918 | +** SETTING: exec-rel-paths boolean default=on |
| 2919 | +** When executing certain external commands (e.g. diff and |
| 2920 | +** gdiff), use relative paths. |
| 2921 | +*/ |
| 2922 | +#endif |
| 2923 | +#if !defined(FOSSIL_ENABLE_EXEC_REL_PATHS) |
| 2924 | +/* |
| 2925 | +** SETTING: exec-rel-paths boolean default=off |
| 2926 | +** When executing certain external commands (e.g. diff and |
| 2927 | +** gdiff), use relative paths. |
| 2928 | +*/ |
| 2801 | 2929 | #endif |
| 2802 | | - { "gdiff-command", 0, 40, 0, 0, "gdiff" }, |
| 2803 | | - { "gmerge-command", 0, 40, 0, 0, "" }, |
| 2804 | | - { "hash-digits", 0, 5, 0, 0, "10" }, |
| 2805 | | - { "http-port", 0, 16, 0, 0, "8080" }, |
| 2806 | | - { "https-login", 0, 0, 0, 0, "off" }, |
| 2807 | | - { "ignore-glob", 0, 40, 1, 0, "" }, |
| 2808 | | - { "keep-glob", 0, 40, 1, 0, "" }, |
| 2809 | | - { "localauth", 0, 0, 0, 0, "off" }, |
| 2810 | | - { "main-branch", 0, 40, 0, 0, "trunk" }, |
| 2811 | | - { "manifest", 0, 5, 1, 0, "" }, |
| 2812 | | - { "max-loadavg", 0, 25, 0, 0, "0.0" }, |
| 2813 | | - { "max-upload", 0, 25, 0, 0, "250000" }, |
| 2814 | | - { "mtime-changes", 0, 0, 0, 0, "on" }, |
| 2930 | +/* |
| 2931 | +** SETTING; gdiff-command width=40 default=gdiff |
| 2932 | +** The value is an external command to run when performing a graphical |
| 2933 | +** diff. If undefined, text diff will be used. |
| 2934 | +*/ |
| 2935 | +/* |
| 2936 | +** SETTING: gmerge-command width=40 |
| 2937 | +** The value is a graphical merge conflict resolver command operating |
| 2938 | +** on four files. Examples: |
| 2939 | +** |
| 2940 | +** kdiff3 "%baseline" "%original" "%merge" -o "%output" |
| 2941 | +** xxdiff "%original" "%baseline" "%merge" -M "%output" |
| 2942 | +** meld "%baseline" "%original" "%merge" "%output" |
| 2943 | +*/ |
| 2944 | +/* |
| 2945 | +** SETTING: hash-digits width=5 default=10 |
| 2946 | +** The number of hexadecimal digits of the SHA3 hash to display. |
| 2947 | +*/ |
| 2948 | +/* |
| 2949 | +** SETTING: http-port width=16 default=8080 |
| 2950 | +** The default TCP/IP port number to use by the "server" |
| 2951 | +** and "ui" commands. |
| 2952 | +*/ |
| 2953 | +/* |
| 2954 | +** SETTING: https-login boolean default=off |
| 2955 | +** If true, then the Fossil web server will redirect unencrypted |
| 2956 | +** login screeen requests to HTTPS. |
| 2957 | +*/ |
| 2958 | +/* |
| 2959 | +** SETTING: ignore-glob width=40 versionable |
| 2960 | +** The value is a comma or newline-separated list of GLOB |
| 2961 | +** patterns specifying files that the "add", "addremove", |
| 2962 | +** "clean", and "extra" commands will ignore. |
| 2963 | +** |
| 2964 | +** Example: *.log customCode.c notes.txt |
| 2965 | +*/ |
| 2966 | +/* |
| 2967 | +** SETTING: keep-glob width=40 versionable |
| 2968 | +** The value is a comma or newline-separated list of GLOB |
| 2969 | +** patterns specifying files that the "clean" command will keep |
| 2970 | +*/ |
| 2971 | +/* |
| 2972 | +** SETTING: localauth boolean default=off |
| 2973 | +** If enabled, require that HTTP connections from |
| 2974 | +** 127.0.0.1 be authenticated by password. If |
| 2975 | +** false, all HTTP requests from localhost have |
| 2976 | +** unrestricted access to the repository. |
| 2977 | +*/ |
| 2978 | +/* |
| 2979 | +** SETTING: main-branch width=40 default=trunk |
| 2980 | +** The value is the primary branch for the project. |
| 2981 | +*/ |
| 2982 | +/* |
| 2983 | +** SETTING: manifest width=5 versionable |
| 2984 | +** If enabled, automatically create files "manifest" and "manifest.uuid" |
| 2985 | +** in every checkout. |
| 2986 | +** |
| 2987 | +** Optionally use combinations of characters 'r' for "manifest", |
| 2988 | +** 'u' for "manifest.uuid" and 't' for "manifest.tags". The SQLite |
| 2989 | +** and Fossil repositories both require manifests. |
| 2990 | +*/ |
| 2991 | +/* |
| 2992 | +** SETTING: max-loadavg width=25 default=0.0 |
| 2993 | +** Some CPU-intensive web pages (ex: /zip, /tarball, /blame) |
| 2994 | +** are disallowed if the system load average goes above this |
| 2995 | +** value. "0.0" means no limit. This only works on unix. |
| 2996 | +** Only local settings of this value make a difference since |
| 2997 | +** when running as a web-server, Fossil does not open the |
| 2998 | +** global configuration database. |
| 2999 | +*/ |
| 3000 | +/* |
| 3001 | +** SETTING: max-upload width=25 default=250000 |
| 3002 | +** A limit on the size of uplink HTTP requests. |
| 3003 | +*/ |
| 3004 | +/* |
| 3005 | +** SETTING: mtime-changes boolean default=on |
| 3006 | +** Use file modification times (mtimes) to detect when |
| 3007 | +** files have been modified. If disabled, all managed files |
| 3008 | +** are hashed to detect changes, which can be slow for large |
| 3009 | +** projects. |
| 3010 | +*/ |
| 2815 | 3011 | #if FOSSIL_ENABLE_LEGACY_MV_RM |
| 2816 | | - { "mv-rm-files", 0, 0, 0, 0, "off" }, |
| 2817 | | -#endif |
| 2818 | | - { "pgp-command", 0, 40, 0, 0, "gpg --clearsign -o " }, |
| 2819 | | - { "proxy", 0, 32, 0, 0, "off" }, |
| 2820 | | - { "relative-paths", 0, 0, 0, 0, "on" }, |
| 2821 | | - { "repo-cksum", 0, 0, 0, 0, "on" }, |
| 2822 | | - { "self-register", 0, 0, 0, 0, "off" }, |
| 2823 | | - { "ssh-command", 0, 40, 0, 0, "" }, |
| 2824 | | - { "ssl-ca-location", 0, 40, 0, 0, "" }, |
| 2825 | | - { "ssl-identity", 0, 40, 0, 0, "" }, |
| 2826 | | -#ifdef FOSSIL_ENABLE_TCL |
| 2827 | | - { "tcl", 0, 0, 0, 0, "off" }, |
| 2828 | | - { "tcl-setup", 0, 40, 1, 1, "" }, |
| 2829 | | -#endif |
| 2830 | | -#ifdef FOSSIL_ENABLE_TH1_DOCS |
| 2831 | | - { "th1-docs", 0, 0, 0, 0, "off" }, |
| 3012 | +/* |
| 3013 | +** SETTING: mv-rm-files boolean default=off |
| 3014 | +** If enabled, the "mv" and "rename" commands will also move |
| 3015 | +** the associated files within the checkout -AND- the "rm" |
| 3016 | +** and "delete" commands will also remove the associated |
| 3017 | +** files from within the checkout. |
| 3018 | +*/ |
| 3019 | +#endif |
| 3020 | +/* |
| 3021 | +** SETTING; pgp-command width=40 |
| 3022 | +** DEFAULT: gpg --clearsign -o |
| 3023 | +** |
| 3024 | +** Command used to clear-sign manifests at check-in. |
| 3025 | +*/ |
| 3026 | +/* |
| 3027 | +** SETTING: proxy width=32 default=off |
| 3028 | +** URL of the HTTP proxy. If undefined or "off" then |
| 3029 | +** the "http_proxy" environment variable is consulted. |
| 3030 | +** If the http_proxy environment variable is undefined |
| 3031 | +** then a direct HTTP connection is used. |
| 3032 | +*/ |
| 3033 | +/* |
| 3034 | +** SETTING: relative-paths boolean default=on |
| 3035 | +** When showing changes and extras, report paths relative |
| 3036 | +** to the current working directory. |
| 3037 | +*/ |
| 3038 | +/* |
| 3039 | +** SETTING: repo-cksum boolean default=on |
| 3040 | +** Compute checksums over all files in each checkout as a double-check |
| 3041 | +** of correctness. Disable this on large repositories for a performance |
| 3042 | +** improvement. |
| 3043 | +*/ |
| 3044 | +/* |
| 3045 | +** SETTING: self-register boolean default=off |
| 3046 | +** Allow users to register themselves through the HTTP UI. |
| 3047 | +** This is useful if you want to see other names than |
| 3048 | +** "Anonymous" in e.g. ticketing system. On the other hand |
| 3049 | +** users can not be deleted. |
| 3050 | +*/ |
| 3051 | +/* |
| 3052 | +** SETTING: ssh-command width=40 |
| 3053 | +** The command used to talk to a remote machine with the "ssh://" protocol. |
| 3054 | +*/ |
| 3055 | +/* |
| 3056 | +** SETTING: ssl-ca-location width=40 |
| 3057 | +** The full pathname to a file containing PEM encoded |
| 3058 | +** CA root certificates, or a directory of certificates |
| 3059 | +** with filenames formed from the certificate hashes as |
| 3060 | +** required by OpenSSL. |
| 3061 | +** |
| 3062 | +** If set, this will override the OS default list of |
| 3063 | +** OpenSSL CAs. If unset, the default list will be used. |
| 3064 | +** Some platforms may add additional certificates. |
| 3065 | +** Checking your platform behaviour is required if the |
| 3066 | +** exact contents of the CA root is critical for your |
| 3067 | +** application. |
| 3068 | +*/ |
| 3069 | +/* |
| 3070 | +** SETTING: ssl-identity width=40 |
| 3071 | +** The full pathname to a file containing a certificate |
| 3072 | +** and private key in PEM format. Create by concatenating |
| 3073 | +** the certificate and private key files. |
| 3074 | +** |
| 3075 | +** This identity will be presented to SSL servers to |
| 3076 | +** authenticate this client, in addition to the normal |
| 3077 | +** password authentication. |
| 3078 | +*/ |
| 3079 | +#ifdef FOSSIL_ENABLE_TCL |
| 3080 | +/* |
| 3081 | +** SETTING: tcl boolean default=off |
| 3082 | +** If enabled Tcl integration commands will be added to the TH1 |
| 3083 | +** interpreter, allowing arbitrary Tcl expressions and |
| 3084 | +** scripts to be evaluated from TH1. Additionally, the Tcl |
| 3085 | +** interpreter will be able to evaluate arbitrary TH1 |
| 3086 | +** expressions and scripts. |
| 3087 | +*/ |
| 3088 | +/* |
| 3089 | +** SETTING: tcl-setup width=40 versionable block-text |
| 3090 | +** This is the setup script to be evaluated after creating |
| 3091 | +** and initializing the Tcl interpreter. By default, this |
| 3092 | +** is empty and no extra setup is performed. |
| 3093 | +*/ |
| 3094 | +#endif /* FOSSIL_ENABLE_TCL */ |
| 3095 | +#ifdef FOSSIL_ENABLE_TH1_DOCS |
| 3096 | +/* |
| 3097 | +** SETTING: th1-docs boolean default=off |
| 3098 | +** If enabled, this allows embedded documentation files to contain |
| 3099 | +** arbitrary TH1 scripts that are evaluated on the server. If native |
| 3100 | +** Tcl integration is also enabled, this setting has the |
| 3101 | +** potential to allow anybody with check-in privileges to |
| 3102 | +** do almost anything that the associated operating system |
| 3103 | +** user account could do. Extreme caution should be used |
| 3104 | +** when enabling this setting. |
| 3105 | +*/ |
| 2832 | 3106 | #endif |
| 2833 | 3107 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 2834 | | - { "th1-hooks", 0, 0, 0, 0, "off" }, |
| 3108 | +/* |
| 3109 | +** SETTING: th1-hooks boolean default=off |
| 3110 | +** If enabled, special TH1 commands will be called before and |
| 3111 | +** after any Fossil command or web page. |
| 3112 | +*/ |
| 2835 | 3113 | #endif |
| 2836 | | - { "th1-setup", 0, 40, 1, 1, "" }, |
| 2837 | | - { "th1-uri-regexp", 0, 40, 1, 0, "" }, |
| 2838 | | - { "uv-sync", 0, 0, 0, 0, "off" }, |
| 2839 | | - { "web-browser", 0, 32, 0, 0, "" }, |
| 2840 | | - { 0,0,0,0,0,0 } |
| 2841 | | -}; |
| 3114 | +/* |
| 3115 | +** SETTING: th1-setup width=40 versionable block-text |
| 3116 | +** This is the setup script to be evaluated after creating |
| 3117 | +** and initializing the TH1 interpreter. By default, this |
| 3118 | +** is empty and no extra setup is performed. |
| 3119 | +*/ |
| 3120 | +/* |
| 3121 | +** SETTING: th1-uri-regexp width=40 versionable |
| 3122 | +** Specify which URI's are allowed in HTTP requests from |
| 3123 | +** TH1 scripts. If empty, no HTTP requests are allowed |
| 3124 | +** whatsoever. |
| 3125 | +*/ |
| 3126 | +/* |
| 3127 | +** SETTING: uv-sync boolean default=off |
| 3128 | +** If true, automatically send unversioned files as part |
| 3129 | +** of a "fossil clone" or "fossil sync" command. The |
| 3130 | +** default is false, in which case the -u option is |
| 3131 | +** needed to clone or sync unversioned files. |
| 3132 | +*/ |
| 3133 | +/* |
| 3134 | +** SETTING: web-browser width=30 |
| 3135 | +** A shell command used to launch your preferred |
| 3136 | +** web browser when given a URL as an argument. |
| 3137 | +** Defaults to "start" on windows, "open" on Mac, |
| 3138 | +** and "firefox" on Unix. |
| 3139 | +*/ |
| 2842 | 3140 | |
| 2843 | 3141 | /* |
| 2844 | 3142 | ** Look up a control setting by its name. Return a pointer to the Setting |
| 2845 | 3143 | ** object, or NULL if there is no such setting. |
| 2846 | 3144 | ** |
| 2847 | 3145 | ** If allowPrefix is true, then the Setting returned is the first one for |
| 2848 | 3146 | ** which zName is a prefix of the Setting name. |
| 2849 | 3147 | */ |
| 2850 | | -const Setting *db_find_setting(const char *zName, int allowPrefix){ |
| 3148 | +Setting *db_find_setting(const char *zName, int allowPrefix){ |
| 2851 | 3149 | int lwr, mid, upr, c; |
| 2852 | 3150 | int n = (int)strlen(zName) + !allowPrefix; |
| 3151 | + int nSetting; |
| 3152 | + const Setting *aSetting = setting_info(&nSetting); |
| 2853 | 3153 | lwr = 0; |
| 2854 | | - upr = count(aSetting)-2; |
| 3154 | + upr = nSetting - 1; |
| 2855 | 3155 | while( upr>=lwr ){ |
| 2856 | 3156 | mid = (upr+lwr)/2; |
| 2857 | 3157 | c = fossil_strncmp(zName, aSetting[mid].name, n); |
| 2858 | 3158 | if( c<0 ){ |
| 2859 | 3159 | upr = mid - 1; |
| | @@ -2863,269 +3163,40 @@ |
| 2863 | 3163 | if( allowPrefix ){ |
| 2864 | 3164 | while( mid>lwr && fossil_strncmp(zName, aSetting[mid-1].name, n)==0 ){ |
| 2865 | 3165 | mid--; |
| 2866 | 3166 | } |
| 2867 | 3167 | } |
| 2868 | | - return &aSetting[mid]; |
| 3168 | + return (Setting*)&aSetting[mid]; |
| 2869 | 3169 | } |
| 2870 | 3170 | } |
| 2871 | 3171 | return 0; |
| 2872 | 3172 | } |
| 2873 | 3173 | |
| 2874 | 3174 | /* |
| 2875 | 3175 | ** COMMAND: settings |
| 2876 | 3176 | ** COMMAND: unset* |
| 2877 | 3177 | ** |
| 2878 | | -** Usage: %fossil settings ?PROPERTY? ?VALUE? ?OPTIONS? |
| 2879 | | -** or: %fossil unset PROPERTY ?OPTIONS? |
| 3178 | +** Usage: %fossil settings ?SETTING? ?VALUE? ?OPTIONS? |
| 3179 | +** or: %fossil unset SETTING ?OPTIONS? |
| 2880 | 3180 | ** |
| 2881 | | -** The "settings" command with no arguments lists all properties and their |
| 2882 | | -** values. With just a property name it shows the value of that property. |
| 2883 | | -** With a value argument it changes the property for the current repository. |
| 3181 | +** The "settings" command with no arguments lists all settings and their |
| 3182 | +** values. With just a SETTING name it shows the current value of that setting. |
| 3183 | +** With a VALUE argument it changes the property for the current repository. |
| 2884 | 3184 | ** |
| 2885 | 3185 | ** Settings marked as versionable are overridden by the contents of the |
| 2886 | 3186 | ** file named .fossil-settings/PROPERTY in the check-out root, if that |
| 2887 | 3187 | ** file exists. |
| 2888 | 3188 | ** |
| 2889 | | -** The "unset" command clears a property setting. |
| 2890 | | -** |
| 2891 | | -** |
| 2892 | | -** access-log If enabled, record successful and failed login attempts |
| 2893 | | -** in the "accesslog" table. Default: off |
| 2894 | | -** |
| 2895 | | -** admin-log If enabled, record configuration changes in the |
| 2896 | | -** "admin_log" table. Default: off |
| 2897 | | -** |
| 2898 | | -** allow-symlinks If enabled, don't follow symlinks, and instead treat |
| 2899 | | -** (versionable) them as symlinks on Unix. Has no effect on Windows |
| 2900 | | -** (existing links in repository created on Unix become |
| 2901 | | -** plain-text files with link destination path inside). |
| 2902 | | -** Default: on (Unix), off (Windows) |
| 2903 | | -** |
| 2904 | | -** auto-captcha If enabled, the Login page provides a button to |
| 2905 | | -** fill in the captcha password. Default: on |
| 2906 | | -** |
| 2907 | | -** auto-hyperlink Use javascript to enable hyperlinks on web pages |
| 2908 | | -** for all users (regardless of the "h" privilege) if the |
| 2909 | | -** User-Agent string in the HTTP header look like it came |
| 2910 | | -** from real person, not a spider or bot. Default: on |
| 2911 | | -** |
| 2912 | | -** auto-shun If enabled, automatically pull the shunning list |
| 2913 | | -** from a server to which the client autosyncs. |
| 2914 | | -** Default: on |
| 2915 | | -** |
| 2916 | | -** autosync If enabled, automatically pull prior to commit |
| 2917 | | -** or update and automatically push after commit or |
| 2918 | | -** tag or branch creation. If the value is "pullonly" |
| 2919 | | -** then only pull operations occur automatically. |
| 2920 | | -** Default: on |
| 2921 | | -** |
| 2922 | | -** autosync-tries If autosync is enabled setting this to a value greater |
| 2923 | | -** than zero will cause autosync to try no more than this |
| 2924 | | -** number of attempts if there is a sync failure. |
| 2925 | | -** Default: 1 |
| 2926 | | -** |
| 2927 | | -** binary-glob The VALUE is a comma or newline-separated list of |
| 2928 | | -** (versionable) GLOB patterns that should be treated as binary files |
| 2929 | | -** for committing and merging purposes. Example: *.jpg |
| 2930 | | -** |
| 2931 | | -** case-sensitive If TRUE, the files whose names differ only in case |
| 2932 | | -** are considered distinct. If FALSE files whose names |
| 2933 | | -** differ only in case are the same file. Defaults to |
| 2934 | | -** TRUE for unix and FALSE for Cygwin, Mac and Windows. |
| 2935 | | -** |
| 2936 | | -** clean-glob The VALUE is a comma or newline-separated list of GLOB |
| 2937 | | -** (versionable) patterns specifying files that the "clean" command will |
| 2938 | | -** delete without prompting or allowing undo. |
| 2939 | | -** Example: *.a,*.lib,*.o |
| 2940 | | -** |
| 2941 | | -** clearsign When enabled, fossil will attempt to sign all commits |
| 2942 | | -** with gpg. When disabled (the default), commits will |
| 2943 | | -** be unsigned. Default: off |
| 2944 | | -** |
| 2945 | | -** crlf-glob A comma or newline-separated list of GLOB patterns for |
| 2946 | | -** (versionable) text files in which it is ok to have CR, CR+LF or mixed |
| 2947 | | -** line endings. Set to "*" to disable CR+LF checking. |
| 2948 | | -** The crnl-glob setting is a compatibility alias. |
| 2949 | | -** |
| 2950 | | -** default-perms Permissions given automatically to new users. For more |
| 2951 | | -** information on permissions see Users page in Server |
| 2952 | | -** Administration of the HTTP UI. Default: u. |
| 2953 | | -** |
| 2954 | | -** diff-binary If TRUE (the default), permit files that may be binary |
| 2955 | | -** or that match the "binary-glob" setting to be used with |
| 2956 | | -** external diff programs. If FALSE, skip these files. |
| 2957 | | -** |
| 2958 | | -** diff-command External command to run when performing a diff. |
| 2959 | | -** If undefined, the internal text diff will be used. |
| 2960 | | -** |
| 2961 | | -** dont-push Prevent this repository from pushing from client to |
| 2962 | | -** server. Useful when setting up a private branch. |
| 2963 | | -** |
| 2964 | | -** dotfiles Include --dotfiles option for all compatible commands. |
| 2965 | | -** (versionable) |
| 2966 | | -** |
| 2967 | | -** editor Text editor command used for check-in comments. |
| 2968 | | -** |
| 2969 | | -** empty-dirs A comma or newline-separated list of pathnames. On |
| 2970 | | -** (versionable) update and checkout commands, if no file or directory |
| 2971 | | -** exists with that name, an empty directory will be |
| 2972 | | -** created. |
| 2973 | | -** |
| 2974 | | -** encoding-glob The VALUE is a comma or newline-separated list of GLOB |
| 2975 | | -** (versionable) patterns specifying files that the "commit" command will |
| 2976 | | -** ignore when issuing warnings about text files that may |
| 2977 | | -** use another encoding than ASCII or UTF-8. Set to "*" |
| 2978 | | -** to disable encoding checking. |
| 2979 | | -** |
| 2980 | | -** exec-rel-paths When executing certain external commands (e.g. diff and |
| 2981 | | -** gdiff), use relative paths. |
| 2982 | | -** |
| 2983 | | -** gdiff-command External command to run when performing a graphical |
| 2984 | | -** diff. If undefined, text diff will be used. |
| 2985 | | -** |
| 2986 | | -** gmerge-command A graphical merge conflict resolver command operating |
| 2987 | | -** on four files. |
| 2988 | | -** Ex: kdiff3 "%baseline" "%original" "%merge" -o "%output" |
| 2989 | | -** Ex: xxdiff "%original" "%baseline" "%merge" -M "%output" |
| 2990 | | -** Ex: meld "%baseline" "%original" "%merge" "%output" |
| 2991 | | -** |
| 2992 | | -** hash-digits The number of hexadecimal digits of the SHA1 hash to |
| 2993 | | -** display. (Default: 10; Minimum: 6) |
| 2994 | | -** |
| 2995 | | -** http-port The TCP/IP port number to use by the "server" |
| 2996 | | -** and "ui" commands. Default: 8080 |
| 2997 | | -** |
| 2998 | | -** https-login Send login credentials using HTTPS instead of HTTP |
| 2999 | | -** even if the login page request came via HTTP. |
| 3000 | | -** |
| 3001 | | -** ignore-glob The VALUE is a comma or newline-separated list of GLOB |
| 3002 | | -** (versionable) patterns specifying files that the "add", "addremove", |
| 3003 | | -** "clean", and "extra" commands will ignore. |
| 3004 | | -** Example: *.log customCode.c notes.txt |
| 3005 | | -** |
| 3006 | | -** keep-glob The VALUE is a comma or newline-separated list of GLOB |
| 3007 | | -** (versionable) patterns specifying files that the "clean" command will |
| 3008 | | -** keep. |
| 3009 | | -** |
| 3010 | | -** localauth If enabled, require that HTTP connections from |
| 3011 | | -** 127.0.0.1 be authenticated by password. If |
| 3012 | | -** false, all HTTP requests from localhost have |
| 3013 | | -** unrestricted access to the repository. |
| 3014 | | -** |
| 3015 | | -** main-branch The primary branch for the project. Default: trunk |
| 3016 | | -** |
| 3017 | | -** manifest If set to a true boolean value, automatically create |
| 3018 | | -** (versionable) files "manifest" and "manifest.uuid" in every checkout. |
| 3019 | | -** Optionally use combinations of characters 'r' |
| 3020 | | -** for "manifest", 'u' for "manifest.uuid" and 't' for |
| 3021 | | -** "manifest.tags". The SQLite and Fossil repositories |
| 3022 | | -** both require manifests. Default: off. |
| 3023 | | -** |
| 3024 | | -** max-loadavg Some CPU-intensive web pages (ex: /zip, /tarball, /blame) |
| 3025 | | -** are disallowed if the system load average goes above this |
| 3026 | | -** value. "0.0" means no limit. This only works on unix. |
| 3027 | | -** Only local settings of this value make a difference since |
| 3028 | | -** when running as a web-server, Fossil does not open the |
| 3029 | | -** global configuration database. |
| 3030 | | -** |
| 3031 | | -** max-upload A limit on the size of uplink HTTP requests. The |
| 3032 | | -** default is 250000 bytes. |
| 3033 | | -** |
| 3034 | | -** mtime-changes Use file modification times (mtimes) to detect when |
| 3035 | | -** files have been modified. (Default "on".) |
| 3036 | | -** |
| 3037 | | -** mv-rm-files If enabled (and Fossil was compiled with legacy "mv/rm" |
| 3038 | | -** support), the "mv" and "rename" commands will also move |
| 3039 | | -** the associated files within the checkout -AND- the "rm" |
| 3040 | | -** and "delete" commands will also remove the associated |
| 3041 | | -** files from within the checkout. Default: off. |
| 3042 | | -** |
| 3043 | | -** pgp-command Command used to clear-sign manifests at check-in. |
| 3044 | | -** The default is "gpg --clearsign -o ". |
| 3045 | | -** |
| 3046 | | -** proxy URL of the HTTP proxy. If undefined or "off" then |
| 3047 | | -** the "http_proxy" environment variable is consulted. |
| 3048 | | -** If the http_proxy environment variable is undefined |
| 3049 | | -** then a direct HTTP connection is used. |
| 3050 | | -** |
| 3051 | | -** relative-paths When showing changes and extras, report paths relative |
| 3052 | | -** to the current working directory. Default: "on" |
| 3053 | | -** |
| 3054 | | -** repo-cksum Compute checksums over all files in each checkout |
| 3055 | | -** as a double-check of correctness. Defaults to "on". |
| 3056 | | -** Disable on large repositories for a performance |
| 3057 | | -** improvement. |
| 3058 | | -** |
| 3059 | | -** self-register Allow users to register themselves through the HTTP UI. |
| 3060 | | -** This is useful if you want to see other names than |
| 3061 | | -** "Anonymous" in e.g. ticketing system. On the other hand |
| 3062 | | -** users can not be deleted. Default: off. |
| 3063 | | -** |
| 3064 | | -** ssh-command Command used to talk to a remote machine with |
| 3065 | | -** the "ssh://" protocol. |
| 3066 | | -** |
| 3067 | | -** ssl-ca-location The full pathname to a file containing PEM encoded |
| 3068 | | -** CA root certificates, or a directory of certificates |
| 3069 | | -** with filenames formed from the certificate hashes as |
| 3070 | | -** required by OpenSSL. |
| 3071 | | -** If set, this will override the OS default list of |
| 3072 | | -** OpenSSL CAs. If unset, the default list will be used. |
| 3073 | | -** Some platforms may add additional certificates. |
| 3074 | | -** Checking your platform behaviour is required if the |
| 3075 | | -** exact contents of the CA root is critical for your |
| 3076 | | -** application. |
| 3077 | | -** |
| 3078 | | -** ssl-identity The full pathname to a file containing a certificate |
| 3079 | | -** and private key in PEM format. Create by concatenating |
| 3080 | | -** the certificate and private key files. |
| 3081 | | -** This identity will be presented to SSL servers to |
| 3082 | | -** authenticate this client, in addition to the normal |
| 3083 | | -** password authentication. |
| 3084 | | -** |
| 3085 | | -** tcl If enabled (and Fossil was compiled with Tcl support), |
| 3086 | | -** Tcl integration commands will be added to the TH1 |
| 3087 | | -** interpreter, allowing arbitrary Tcl expressions and |
| 3088 | | -** scripts to be evaluated from TH1. Additionally, the Tcl |
| 3089 | | -** interpreter will be able to evaluate arbitrary TH1 |
| 3090 | | -** expressions and scripts. Default: off. |
| 3091 | | -** |
| 3092 | | -** tcl-setup This is the setup script to be evaluated after creating |
| 3093 | | -** (versionable) and initializing the Tcl interpreter. By default, this |
| 3094 | | -** is empty and no extra setup is performed. |
| 3095 | | -** |
| 3096 | | -** th1-docs WARNING: If enabled (and Fossil was compiled with TH1 |
| 3097 | | -** support for embedded documentation files), this allows |
| 3098 | | -** embedded documentation files to contain arbitrary TH1 |
| 3099 | | -** scripts that are evaluated on the server. If native |
| 3100 | | -** Tcl integration is also enabled, this setting has the |
| 3101 | | -** potential to allow anybody with check-in privileges to |
| 3102 | | -** do almost anything that the associated operating system |
| 3103 | | -** user account could do. Extreme caution should be used |
| 3104 | | -** when enabling this setting. Default: off. |
| 3105 | | -** |
| 3106 | | -** th1-hooks If enabled (and Fossil was compiled with support for TH1 |
| 3107 | | -** hooks), special TH1 commands will be called before and |
| 3108 | | -** after any Fossil command or web page. Default: off. |
| 3109 | | -** |
| 3110 | | -** th1-setup This is the setup script to be evaluated after creating |
| 3111 | | -** (versionable) and initializing the TH1 interpreter. By default, this |
| 3112 | | -** is empty and no extra setup is performed. |
| 3113 | | -** |
| 3114 | | -** th1-uri-regexp Specify which URI's are allowed in HTTP requests from |
| 3115 | | -** (versionable) TH1 scripts. If empty, no HTTP requests are allowed |
| 3116 | | -** whatsoever. The default is an empty string. |
| 3117 | | -** |
| 3118 | | -** uv-sync If true, automatically send unversioned files as part |
| 3119 | | -** of a "fossil clone" or "fossil sync" command. The |
| 3120 | | -** default is false, in which case the -u option is |
| 3121 | | -** needed to clone or sync unversioned files. |
| 3122 | | -** |
| 3123 | | -** web-browser A shell command used to launch your preferred |
| 3124 | | -** web browser when given a URL as an argument. |
| 3125 | | -** Defaults to "start" on windows, "open" on Mac, |
| 3126 | | -** and "firefox" on Unix. |
| 3189 | +** The "unset" command clears a setting. |
| 3190 | +** |
| 3191 | +** Settings can have both a "local" repository-only value and "global" value |
| 3192 | +** that applies to all repositories. The local values are stored in the |
| 3193 | +** "config" table of the repository and the global values are stored in the |
| 3194 | +** $HOME/.fossil file on unix or in the %LOCALAPPDATA%/_fossil file on Windows. |
| 3195 | +** If both a local and a global value exists for a setting, the local value |
| 3196 | +** takes precedence. This command normally operates on the local settings. |
| 3197 | +** Use the --global option to change global settings. |
| 3127 | 3198 | ** |
| 3128 | 3199 | ** Options: |
| 3129 | 3200 | ** --global set or unset the given property globally instead of |
| 3130 | 3201 | ** setting or unsetting it for the open repository only. |
| 3131 | 3202 | ** |
| | @@ -3136,10 +3207,12 @@ |
| 3136 | 3207 | void setting_cmd(void){ |
| 3137 | 3208 | int i; |
| 3138 | 3209 | int globalFlag = find_option("global","g",0)!=0; |
| 3139 | 3210 | int exactFlag = find_option("exact",0,0)!=0; |
| 3140 | 3211 | int unsetFlag = g.argv[1][0]=='u'; |
| 3212 | + int nSetting; |
| 3213 | + const Setting *aSetting = setting_info(&nSetting); |
| 3141 | 3214 | find_repository_option(); |
| 3142 | 3215 | verify_all_options(); |
| 3143 | 3216 | db_open_config(1, 0); |
| 3144 | 3217 | if( !globalFlag ){ |
| 3145 | 3218 | db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0); |
| | @@ -3149,23 +3222,12 @@ |
| 3149 | 3222 | } |
| 3150 | 3223 | if( unsetFlag && g.argc!=3 ){ |
| 3151 | 3224 | usage("PROPERTY ?-global?"); |
| 3152 | 3225 | } |
| 3153 | 3226 | |
| 3154 | | - /* Verify that the aSetting[] entries are in sorted order. This is |
| 3155 | | - ** necessary for the binary search in db_find_setting() to work correctly. |
| 3156 | | - */ |
| 3157 | | - for(i=1; aSetting[i].name; i++){ |
| 3158 | | - if( fossil_strcmp(aSetting[i-1].name, aSetting[i].name)>=0 ){ |
| 3159 | | - fossil_panic("Internal Error: aSetting[] entries for \"%s\"" |
| 3160 | | - " and \"%s\" are out of order.", |
| 3161 | | - aSetting[i-1].name, aSetting[i].name); |
| 3162 | | - } |
| 3163 | | - } |
| 3164 | | - |
| 3165 | 3227 | if( g.argc==2 ){ |
| 3166 | | - for(i=0; aSetting[i].name; i++){ |
| 3228 | + for(i=0; i<nSetting; i++){ |
| 3167 | 3229 | print_setting(&aSetting[i]); |
| 3168 | 3230 | } |
| 3169 | 3231 | }else if( g.argc==3 || g.argc==4 ){ |
| 3170 | 3232 | const char *zName = g.argv[2]; |
| 3171 | 3233 | int n = (int)strlen(zName); |
| 3172 | 3234 | |