Blame


1 445816c2 2022-04-07 op # Frequently Asked Questions
2 445816c2 2022-04-07 op
3 445816c2 2022-04-07 op ## How can I report a bug, suggest a feature or send a patch?
4 445816c2 2022-04-07 op
5 445816c2 2022-04-07 op Just drop an email to <gmid [at] omarpolo [dot] com> or open a GitHub issue/pull request.
6 445816c2 2022-04-07 op
7 445816c2 2022-04-07 op When reporting a bug please include the relevant information to reproduce the issue you're facing: your configuration file, the gmid version, your distro version at least.
8 445816c2 2022-04-07 op
9 445816c2 2022-04-07 op
10 445816c2 2022-04-07 op ## How can I define the right MIME types for my files?
11 445816c2 2022-04-07 op
12 445816c2 2022-04-07 op 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:
13 445816c2 2022-04-07 op
14 445816c2 2022-04-07 op ``` example of how to use the type rule in the configuration file
15 445816c2 2022-04-07 op types {
16 445816c2 2022-04-07 op application/postscript ps eps ai
17 445816c2 2022-04-07 op application/rss+xml rss
18 445816c2 2022-04-07 op
19 445816c2 2022-04-07 op # it's also possible to just include a file here
20 445816c2 2022-04-07 op include "/usr/share/misc/mime.types"
21 445816c2 2022-04-07 op }
22 445816c2 2022-04-07 op ```
23 445816c2 2022-04-07 op
24 445816c2 2022-04-07 op
25 445816c2 2022-04-07 op ## CGI scripts don't work
26 445816c2 2022-04-07 op
27 445816c2 2022-04-07 op There may be various reasons for it
28 445816c2 2022-04-07 op
29 445816c2 2022-04-07 op * make sure the `cgi' rule in the `server' block matches the CGI script
30 445816c2 2022-04-07 op * if using a chroot, make sure that all the libraries and executable are available inside the chroot (e.g. sh, python, perl, ...)
31 445816c2 2022-04-07 op
32 445816c2 2022-04-07 op
33 445816c2 2022-04-07 op ## (linux) gmid doesn't seem to work / some tests are failing
34 445816c2 2022-04-07 op
35 445816c2 2022-04-07 op gmid uses a security feature of the linux kernel called "seccomp".
36 445816c2 2022-04-07 op
37 445816c2 2022-04-07 op 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.
38 445816c2 2022-04-07 op
39 445816c2 2022-04-07 op 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.
40 445816c2 2022-04-07 op
41 445816c2 2022-04-07 op To debug a (supposed) seccomp issue, decomment SC_DEBUG in sandbox.c
42 445816c2 2022-04-07 op
43 445816c2 2022-04-07 op ```
44 445816c2 2022-04-07 op /* uncomment to enable debugging. ONLY FOR DEVELOPMENT */
45 445816c2 2022-04-07 op /* #define SC_DEBUG */
46 445816c2 2022-04-07 op ```
47 445816c2 2022-04-07 op
48 445816c2 2022-04-07 op so that it becomes
49 445816c2 2022-04-07 op
50 445816c2 2022-04-07 op ```
51 445816c2 2022-04-07 op /* uncomment to enable debugging. ONLY FOR DEVELOPMENT */
52 445816c2 2022-04-07 op #define SC_DEBUG
53 445816c2 2022-04-07 op ```
54 445816c2 2022-04-07 op
55 445816c2 2022-04-07 op then recompile gmid and run the regress suite:
56 445816c2 2022-04-07 op
57 445816c2 2022-04-07 op ```
58 445816c2 2022-04-07 op $ ./configure
59 445816c2 2022-04-07 op $ make
60 445816c2 2022-04-07 op $ make regress
61 445816c2 2022-04-07 op ```
62 445816c2 2022-04-07 op
63 445816c2 2022-04-07 op If it's indeed a seccomp failure it should print something like:
64 445816c2 2022-04-07 op
65 445816c2 2022-04-07 op ```
66 445816c2 2022-04-07 op unexpected system call (arch:...,syscall:... @ ...)
67 445816c2 2022-04-07 op ```
68 445816c2 2022-04-07 op
69 445816c2 2022-04-07 op Please attach the `make regress' output, the distro you're using and `uname -m' in the bug report (either on github or via email.)
70 445816c2 2022-04-07 op
71 445816c2 2022-04-07 op 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!
72 445816c2 2022-04-07 op
73 445816c2 2022-04-07 op 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/local. 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.
74 445816c2 2022-04-07 op
75 445816c2 2022-04-07 op 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.
76 445816c2 2022-04-07 op
77 445816c2 2022-04-07 op Don't forget to comment SC_DEBUG after playing with it if you're gonna use the executable.