Fossil SCM

Add the FOSSIL_URI environment variable to the CGI extension mechanism.

drh 2019-08-01 14:17 trunk
Commit 7b2b9d6995fffbe236587963efd6350543f5dc0244b5ba0ad37671e5e085ebcd
--- src/extcgi.c
+++ src/extcgi.c
@@ -49,10 +49,11 @@
4949
"CONTENT_LENGTH",
5050
"CONTENT_TYPE",
5151
"DOCUMENT_ROOT",
5252
"FOSSIL_CAPABILITIES",
5353
"FOSSIL_REPOSITORY",
54
+ "FOSSIL_URI",
5455
"FOSSIL_USER",
5556
"GATEWAY_INTERFACE",
5657
"HTTP_ACCEPT",
5758
/* "HTTP_ACCEPT_ENCODING", // omitted from sub-cgi */
5859
"HTTP_COOKIE",
@@ -204,10 +205,11 @@
204205
if( g.zLogin ){
205206
cgi_replace_parameter("REMOTE_USER", g.zLogin);
206207
cgi_set_parameter_nocopy("FOSSIL_USER", g.zLogin, 0);
207208
}
208209
cgi_set_parameter_nocopy("FOSSIL_REPOSITORY", g.zRepositoryName, 0);
210
+ cgi_set_parameter_nocopy("FOSSIL_URI", g.zTop, 0);
209211
cgi_set_parameter_nocopy("FOSSIL_CAPABILITIES",
210212
db_text("","SELECT fullcap(cap) FROM user WHERE login=%Q",
211213
g.zLogin ? g.zLogin : "nobody"), 0);
212214
cgi_replace_parameter("GATEWAY_INTERFACE","CGI/1.0");
213215
for(i=0; i<sizeof(azCgiEnv)/sizeof(azCgiEnv[0]); i++){
214216
--- src/extcgi.c
+++ src/extcgi.c
@@ -49,10 +49,11 @@
49 "CONTENT_LENGTH",
50 "CONTENT_TYPE",
51 "DOCUMENT_ROOT",
52 "FOSSIL_CAPABILITIES",
53 "FOSSIL_REPOSITORY",
 
54 "FOSSIL_USER",
55 "GATEWAY_INTERFACE",
56 "HTTP_ACCEPT",
57 /* "HTTP_ACCEPT_ENCODING", // omitted from sub-cgi */
58 "HTTP_COOKIE",
@@ -204,10 +205,11 @@
204 if( g.zLogin ){
205 cgi_replace_parameter("REMOTE_USER", g.zLogin);
206 cgi_set_parameter_nocopy("FOSSIL_USER", g.zLogin, 0);
207 }
208 cgi_set_parameter_nocopy("FOSSIL_REPOSITORY", g.zRepositoryName, 0);
 
209 cgi_set_parameter_nocopy("FOSSIL_CAPABILITIES",
210 db_text("","SELECT fullcap(cap) FROM user WHERE login=%Q",
211 g.zLogin ? g.zLogin : "nobody"), 0);
212 cgi_replace_parameter("GATEWAY_INTERFACE","CGI/1.0");
213 for(i=0; i<sizeof(azCgiEnv)/sizeof(azCgiEnv[0]); i++){
214
--- src/extcgi.c
+++ src/extcgi.c
@@ -49,10 +49,11 @@
49 "CONTENT_LENGTH",
50 "CONTENT_TYPE",
51 "DOCUMENT_ROOT",
52 "FOSSIL_CAPABILITIES",
53 "FOSSIL_REPOSITORY",
54 "FOSSIL_URI",
55 "FOSSIL_USER",
56 "GATEWAY_INTERFACE",
57 "HTTP_ACCEPT",
58 /* "HTTP_ACCEPT_ENCODING", // omitted from sub-cgi */
59 "HTTP_COOKIE",
@@ -204,10 +205,11 @@
205 if( g.zLogin ){
206 cgi_replace_parameter("REMOTE_USER", g.zLogin);
207 cgi_set_parameter_nocopy("FOSSIL_USER", g.zLogin, 0);
208 }
209 cgi_set_parameter_nocopy("FOSSIL_REPOSITORY", g.zRepositoryName, 0);
210 cgi_set_parameter_nocopy("FOSSIL_URI", g.zTop, 0);
211 cgi_set_parameter_nocopy("FOSSIL_CAPABILITIES",
212 db_text("","SELECT fullcap(cap) FROM user WHERE login=%Q",
213 g.zLogin ? g.zLogin : "nobody"), 0);
214 cgi_replace_parameter("GATEWAY_INTERFACE","CGI/1.0");
215 for(i=0; i<sizeof(azCgiEnv)/sizeof(azCgiEnv[0]); i++){
216
--- www/serverext.wiki
+++ www/serverext.wiki
@@ -162,19 +162,22 @@
162162
In addition to the standard CGI environment variables listed above,
163163
Fossil adds the following:
164164
165165
* FOSSIL_CAPABILITIES
166166
* FOSSIL_REPOSITORY
167
+ * FOSSIL_URI
167168
* FOSSIL_USER
168169
169170
The FOSSIL_USER string is the name of the logged-in user. This variable
170171
is missing or is an empty string if the user is not logged in. The
171172
FOSSIL_CAPABILITIES string is a list of
172173
[/setup_ulist_notes|Fossil capability letters] that
173174
indicate what permissions the user has on the Fossil repository.
174175
The FOSSIL_REPOSITORY environment variable gives the filename of the
175
-Fossil repository that is running.
176
+Fossil repository that is running. The FOSSIL_URI variable shows the
177
+prefix of the REQUEST_URI that is the Fossil CGI script, or is an
178
+empty string if Fossil is being run by some method other than CGI.
176179
177180
The [https://sqlite.org/src/ext/checklist|checklist application] uses the
178181
FOSSIL_USER environment variable to determine the name of the user and
179182
the FOSSIL_CAPABILITIES variable to determine if the user is allowed to
180183
mark off changes to the checklist. Only users with check-in permission
181184
--- www/serverext.wiki
+++ www/serverext.wiki
@@ -162,19 +162,22 @@
162 In addition to the standard CGI environment variables listed above,
163 Fossil adds the following:
164
165 * FOSSIL_CAPABILITIES
166 * FOSSIL_REPOSITORY
 
167 * FOSSIL_USER
168
169 The FOSSIL_USER string is the name of the logged-in user. This variable
170 is missing or is an empty string if the user is not logged in. The
171 FOSSIL_CAPABILITIES string is a list of
172 [/setup_ulist_notes|Fossil capability letters] that
173 indicate what permissions the user has on the Fossil repository.
174 The FOSSIL_REPOSITORY environment variable gives the filename of the
175 Fossil repository that is running.
 
 
176
177 The [https://sqlite.org/src/ext/checklist|checklist application] uses the
178 FOSSIL_USER environment variable to determine the name of the user and
179 the FOSSIL_CAPABILITIES variable to determine if the user is allowed to
180 mark off changes to the checklist. Only users with check-in permission
181
--- www/serverext.wiki
+++ www/serverext.wiki
@@ -162,19 +162,22 @@
162 In addition to the standard CGI environment variables listed above,
163 Fossil adds the following:
164
165 * FOSSIL_CAPABILITIES
166 * FOSSIL_REPOSITORY
167 * FOSSIL_URI
168 * FOSSIL_USER
169
170 The FOSSIL_USER string is the name of the logged-in user. This variable
171 is missing or is an empty string if the user is not logged in. The
172 FOSSIL_CAPABILITIES string is a list of
173 [/setup_ulist_notes|Fossil capability letters] that
174 indicate what permissions the user has on the Fossil repository.
175 The FOSSIL_REPOSITORY environment variable gives the filename of the
176 Fossil repository that is running. The FOSSIL_URI variable shows the
177 prefix of the REQUEST_URI that is the Fossil CGI script, or is an
178 empty string if Fossil is being run by some method other than CGI.
179
180 The [https://sqlite.org/src/ext/checklist|checklist application] uses the
181 FOSSIL_USER environment variable to determine the name of the user and
182 the FOSSIL_CAPABILITIES variable to determine if the user is allowed to
183 mark off changes to the checklist. Only users with check-in permission
184

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button