Blob


1 # Frequently Asked Questions
3 ## How can I report a bug, suggest a feature or send a patch?
5 Just drop an email to <gmid [at] omarpolo [dot] com> or open a GitHub issue/pull request.
7 When reporting a bug please include the relevant information to reproduce the issue you're facing: your configuration file, the gmid version, and your distro.
10 ## How can I define the right MIME types for my files?
12 gmid, like many other servers, uses a list of known file extensions to decide what MIME type use. A few of them are built-in for convenience but it's quite easy to add custom ones:
14 ``` example of how to use the type rule in the configuration file
15 types {
16 application/postscript ps eps ai
17 application/rss+xml rss
19 # it's also possible to just include a file here
20 include "/usr/share/misc/mime.types"
21 }
22 ```
25 ## CGI scripts don't work
27 There may be various reasons for it
29 * make sure the `cgi' rule in the `server' block matches the CGI script
30 * if using a chroot, make sure that all the libraries and executable are available inside the chroot (e.g. sh, python, perl, ...)
33 ## (linux) gmid doesn't seem to work / some tests are failing
35 gmid uses a security feature of the linux kernel called "seccomp".
37 Seccomp allows to define a set of allowed system calls (in layman's term "things that a program can do") and terminate the program if it attempts to do something else. While this is cool, sometimes the kernel developers may add some new system calls, or the libraries used by gmid could start using others system calls to achieve the same thing, so the seccomp filter may need adjustments over the time.
39 Simptoms of a possible failure due seccomp are gmid not seeming to work or hangs/failure as soon as some features of gmid (cgi scripts, reverse proxying, ...) are used.
41 To debug a (supposed) seccomp issue, decomment SC_DEBUG in sandbox.c
43 ```
44 /* uncomment to enable debugging. ONLY FOR DEVELOPMENT */
45 /* #define SC_DEBUG */
46 ```
48 so that it becomes
50 ```
51 /* uncomment to enable debugging. ONLY FOR DEVELOPMENT */
52 #define SC_DEBUG
53 ```
55 then recompile gmid and run the regress suite:
57 ```
58 $ make regress
59 ```
61 If it's indeed a seccomp failure it should print something like the following among the other logs:
63 ```
64 unexpected system call (arch:...,syscall:... @ ...)
65 ```
67 Please attach the `make regress' output, the distro you're using and `uname -m' in the bug report (either on github or via email.)
69 If you're technically inclined, you could also try to write a patch to fix the issue and attach it to the bug report: receiving patches makes me really happy!
71 You can get the syscall name from the numbers by looking in the linux kernel headers. Unfortunately, the exact position differs from distro to distro, but they should be somewhere under /usr/include. Once you know the name of the syscall, you can add it to the list in the `filter' array and reiterate the whole procedure until it works.
73 Providing a patch *is not expected* and *is not a requirement* either. It's just nice to do if you have the skill, time and patience to do so.
75 Don't forget to comment SC_DEBUG after playing with it if you're gonna use the executable.