-
Notifications
You must be signed in to change notification settings - Fork 8
Configuration Options
This page will help you configure your Galah deployment.
Note the API client is configured very differently from the various other components of Galah like galah.web and Sisyphus. For information on the API client's configuration consult the API docs.
Galah's configuration is housed entirely in a Python file located at /etc/galah/galah.config
(you'll have to make this file and set up the permissions appropriately).
If you are familiar with Python you should feel very comfortable with the configuration format. If not, you shouldn't find it too difficult. Below is a very simple configuration file.
config = {
"web/DEBUG": False,
"web/SECRET_KEY": "it's a secret",
"web/HOST_URL": "https://localhost"
}
The configuration option web/DEBUG
is set to False
, etc.
The global namespace is unique in that every configuration option specified in it will be made available to every component of Galah (go figure). Thus any configuration option that needs to be accessible by more than one component is placed in the global namespace.
- global/CURRENT_VERSION Sets the current version. Used in the footer. Set this and web/SOURCE_HOST if you make modifications to the code. (Default: The current version string, updated with each release)
-
global/SUBMISSION_DIRECTORY The directory that user's submissions are stored in. Ensure that both galah.web and galah.sisyphus have the ability to modify this directory. (Default:
"/var/local/galah/web/submissions/"
) -
global/MONGODB The location and name of the MongoDB database on the network. (Default:
"galah"
) -
global/SISYPHUS_ADDRESS Sisyphus's "address" which can be either a Unix socket (ex:
"ipc:///tmp/sisyphus.sock"
) or a host and port to communicate with via TCP (ex:"tcp://192.168.0.4:9001"
). If the configuration file is read by Sisyphus, he will listen on that socket/host:port. Likewise if the configuration file is read by galah.web she will try to communicate with Sisyphus through that socket/host:port. If you specify a Unix socket and it does not exist, Sisyphus will create it. (Default:"ipc:///tmp/sisyphus.sock"
)
galah.web has a number of configuration options separate from Flask's configuration options, but the bulk of the configuration options available are really configuration options that Flask uses internally. Check out Flask's Builtin Configuration Values for a complete list (when adding the configuration options into galah, make sure to prefix them with web/
).
The most important options are listed here however.
-
web/DEBUG Sets Flask's debug mode. In debug mode, any unhandled exception will present a special error page to the user that allows them to see a stack trace and various other pieces of information related to the exception. The user will also be able to execute arbitrary Python code via a handy interface. Needless to say, if you enable this in anything except a development environment you're asking for your server to be transformed into a block of cheese. To reiterate, SET THIS OPTION TO FALSE IN A PRODUCTION ENVIRONMENT, SERIOUSLY. (Default:
True
) -
web/SECRET_KEY galah.web stores session information inside of cookies that are given to the user to store on their local machine. The cookies are encrypted and signed using a secret key, this secret key in fact. If a user is able to guess the secret key, then they will be able to forge a session and impersonate a user of their choosing. Therefore it is vital that you choose a good secret key. 24 bytes of very random data should serve well as a secret key (you can fire up Python and run
os.urandom(24)
then copy and paste the result into your configuration if you'd like). (Default:"Very Secure key"
) -
web/USE_X_SENDFILE If this is not explicitly set to True, Flask will serve files itself which ends up being very inefficient. If you set this to True, Flask will tell the underlying web server to go ahead and serve static files. Not all web servers support this however, see this section of the Flask documentation for more information. (Default:
False
) -
web/HOST_URL The root URL of the site. This is only used when trying to figure out where to tell Google to redirect to when performing authentication via OAuth2. (Default:
"http://localhost:5000"
) -
web/STUDENT_ARCHIVE_LIFETIME The amount of time to keep archives around that are generated when students click the download button for a submission. (Default:
datetime.timedelta(minutes = 2)
) -
web/SOURCE_HOST The location of a repository containing the source code that is currently running on the system. If you make modifications to the source code, you must make that source code available, and you need to change this configuration option to point to the source code. If you are confused about this, consult the AGPL. (Default:
"https://github.com/brownhead/galah"
) - web/GOOGLE_SERVERSIDE_ID, web/GOOGLE_SERVERSIDE_SECRET, web/GOOGLE_APICLIENT_ID, web/GOOGLE_APICLIENT_SECRET The IDs and secrets generated by Google for use during OAuth2 authentication. Instructions on how to generate these are available in the setup guide. These options are not defined by default, and if any of the four are undefined, OAuth2 is disabled.
-
web/CSRF_ENABLED During load testing this must be set to False, at all other times it should be set to True. (Default:
True
)
-
sisyphus/TEACHER_ARCHIVE_LIFETIME The amount of time to keep archives around that are generated when a teacher or admin users request a tarball of assignments via the
get_archive
API command. (Default:datetime.timedelta(minutes = 2)
)
General
- Home
- User Guide (for admins and teachers)
- Comparison to Similar Software
- Goals and Ideals
- Credits and Contributers
Administration
Development