github.com/Azareal/Gosora@v0.0.0-20210729070923-553e66b59003/docs/configuration.md (about) 1 # Configuration 2 3 For configuring the system, Gosora has a file called `config/config.json` which you can tweak to change various behaviours, it also has a few settings in the Setting Manager in the Control Panel. 4 5 The configuration file has five categories you may be familiar with from poring through it's contents. Site, Config, Database, Dev and Plugin. 6 7 Site is for critical settings. 8 9 Config is for lower priority yet still important settings. 10 11 Database contains the credentials for the database (you will be able to pass these via parameters to the binary in a future version). 12 13 Dev is for a few flags which help out with the development of Gosora. 14 15 Plugin which you may not have run into is a category in which plugins can define their own custom configuration settings. 16 17 An example of what the file might look like: https://github.com/Azareal/Gosora/blob/master/config/config_example.json 18 19 Other configuration files: [config/weakpass.json](https://github.com/Azareal/Gosora/blob/master/docs/weak_passwords.md), [config/emoji.json](https://github.com/Azareal/Gosora/blob/master/docs/emoji.md) (WIP) 20 21 # Site 22 23 ShortName - A two or three letter abbreviation of your site's name. Intended for compact spaces where the full name is too long to squeeze in. 24 25 Name - The name of your site, as appears in the title, some theme headers and search engine search results. 26 27 Email - The email address you want to show up in the From: field when Gosora sends emails. May be left blank, if emails are disabled. 28 29 URL - The URL for your site. Please leave out the `http://` or `https://` and the `/` at the end. 30 31 Port - The port you want Gosora to listen on. This will usually be 443 for HTTPS and 80 for HTTP. Gosora will try to bind to both, if you're on HTTPS to redirect users from the HTTP site to the HTTPS one. 32 33 EnableSsl - Determines whether HTTPS is enabled. 34 35 EnableEmails - Determines whether the SMTP mail subsystem is enabled. The experimental plugin sendmail also allows you to send emails without SMTP in a similar style to some languages like PHP, although it only works on Linux and has some issues. 36 37 HasProxy - Brittle, but lets you set whether you're sitting behind a proxy like Cloudflare. Unknown effects with reverse-proxies like Nginx. 38 39 Language - The language you want to use. Defaults to english. Please consult [internationalisation](https://github.com/Azareal/Gosora/blob/master/docs/internationalisation.md) for details. 40 41 # Config 42 43 SslPrivkey - The path to the SSL private key. Example: ./cert/test.key 44 45 SslFullchain - The path to the fullchain SSL certificate. Example: ./cert/test.cert 46 47 SMTPServer - The domain for the SMTP server. May be left blank if EnableEmails is false. 48 49 SMTPUsername - The username for the SMTP server. 50 51 SMTPPassword - The password for the SMTP server. 52 53 SMTPPort - The port for the SMTP server, usually 25 or 465 for full TLS. 54 55 SMTPEnableTLS - Enable TLS to fully encrypt the connection between Gosora and the SMTP server. 56 57 Search - The type of search system to use. Options: disabled, sql (default) 58 59 MaxRequestSizeStr - The maximum size that a request made to Gosora can be. This includes uploads. Example: 5MB 60 61 UserCache - The type of user cache you want to use. You can leave this blank to disable this feature or use `static` for a small in-memory cache. 62 63 TopicCache - The type of topic cache you want to use. You can leave this blank to disable this feature or use `static` for a small in-memory cache. 64 65 ReplyCache - The type of reply cache you want to use. You can leave this blank to disable this feature or use `static` for a small in-memory cache. 66 67 UserCacheCapacity - The maximum number of users you want in the in-memory user cache, if enabled in the UserCache setting. 68 69 TopicCacheCapacity - The maximum number of topics you want in the in-memory topic cache, if enabled in the TopicCache setting. 70 71 ReplyCacheCapacity - The maximum number of replies you want in the in-memory reply cache, if enabled in the ReplyCache setting. 72 73 DefaultPath - The route you want the homepage `/` to default to. Examples: `/topics/` or `/forums/` 74 75 DefaultGroup - The group you want users to be moved to once they're activated. Example: 3 76 77 ActivationGroup - The group you want users to be placed in while they're awaiting activation. Example: 5 78 79 StaffCSS - Classes you want applied to the postbits for staff posts. This setting is deprecated and will likely be replaced with a more generic mechanism in the near future. 80 81 DefaultForum - The default forum for the drop-down in the quick topic creator. Please note that FID 1 is reserved for the default reports forum. Example: 2 82 83 MinifyTemplates - Whether you want the HTML pages to be minified prior to being send to the client. 84 85 BuildSlugs - Whether you want the title appear in the URL. For instance: `/topic/traffic-in-paris.5` versus `/topic/5` 86 87 ServerCount - The number of instances you're running. This setting is currently experimental. 88 89 LastIPCutoff - The number of months which need to pass before the last IP stored for a user is automatically deleted. Capped at 12. 0 defaults to whatever the current default is, currently 3 and -1 disables this feature. 90 91 PostIPCutoff - The number of days which need to pass before the IP data for a post is automatically deleted. 0 defaults to whatever the current default is, currently 90 and -1 disables this feature. 92 93 PollIPCutoff - The number of days which need to pass before the IP data for a poll is automatically deleted. 0 defaults to whatever the current default is, currently 90 and -1 disables this feature. 94 95 DisableIP - Master switch to disable tracking user IPs for any purpose. May not entirely clear already stored data, or data logged by an upstream like a reverse-proxy. Currently doesn't cover net/http ErrorLog. Default: false 96 97 DisableLastIP - Disable storing last IPs for users and purge any existing user last IP data. Default: false 98 99 DisablePostIP - Disable storing post IPs for users and purge any existing post IP data. Default: false 100 101 DisablePollIP - Disable storing poll vote IPs and purge any existing poll vote IP data. Default: false 102 103 DisableRegLog - Disable storing registration events and purge any existing registration event data. Default: false 104 105 LogPruneCutoff - The number of days which need to pass before the login and registration logs are pruned. 0 defaults to whatever the current default is, currently 180 and -1 disables this feature. 106 107 DisableLiveTopicList - This switch allows you to disable the live topic list. Default: false 108 109 DisableJSAntispam - This switch lets you disable the JS anti-spam feature. It may be useful if you primarily get users who for one reason or another have decided to disable JavaScript. Default: false 110 111 LooseHost - Disable host header checks in the router. This may be useful when using a reverse-proxy like Nginx / Apache to stop it white-screening. Default: false 112 113 LoosePort - Disable port match checks in the router. This may be useful when using a reverse-proxy like Nginx / Apache to stop it white-screening. Default: false 114 115 SslSchema - Allow for HTTPS URLs without necessarily using a HTTPS listener. This might be useful if a reverse-proxy or otherwise terminates the SSL / TLS connection instead of Gosora. Default: false 116 117 DisableServerPush - This switch lets you disable the HTTP/2 server push feature. Default: false 118 119 EnableCDNPush - This switch lets you enable the HTTP/2 CDN Server Push feature. This operates by sending a Link header on every request and may also work with reverse-proxies like Nginx for doing HTTP/2 server pushes. 120 121 DisableNoavatarRange - This switch lets you disable the noavatar algorithm which maps IDs to a set ranging from 0 to 50 for better cacheability. Default: false 122 123 DisableDefaultNoavatar - This switch lets you disable the default noavatar algorithm which may intercept noavatars for increased efficiency. Default: false 124 125 DisableAnalytics - This switch lets you disable the analytics subsystem. Default: false 126 127 RefNoTrack - This switch disables tracking the referrers of users who click from another site to your site and the referrers of any requests to resources from other sites as-well. 128 129 RefNoRef - This switch makes it so that if a user clicks on a link, then the incoming site won't know which site they're coming from. 130 131 NoEmbed - Don't expand links into videos or images. Default: false 132 133 ExtraCSPOrigins - Extra origins which may want whitelisted in the default Content Security Policy. 134 135 StaticResBase - The default prefix for static resource files. May be a path or an external domain like a CDN domain. Default: /s/ 136 137 AvatarResBase - The default prefix for avatar files. May be a path or an external domain like a CDN domain. Default: /uploads/ 138 139 NoAvatar - The default avatar to use for users when they don't have their own. The default for this may change in the near future to better utilise HTTP/2. Example: https://api.adorable.io/avatars/{width}/{id}.png 140 141 ItemsPerPage - The number of posts, topics, etc. you want on each page. 142 143 MaxTopicTitleLength - The maximum length that a topic can be. Please note that this measures the number of bytes and may differ from language to language with it being equal to a letter in English and being two bytes in others. 144 145 MaxUsernameLength - The maximum length that a user's name can be. Please note that this measures the number of bytes and may differ from language to language with it being equal to a letter in English and being two bytes in others. 146 147 ReadTimeout - The number of seconds that we are allowed to take to fully read a request. Defaults to 8. 148 149 WriteTimeout - The number of seconds that a route is allowed to run for before the request is automatically terminated. Defaults to 10. 150 151 IdleTimeout - The number of seconds that a Keep-Alive connection will be kept open before being closed. You might to tweak this, if you use Cloudflare or similar. Defaults to 120. 152 153 LogDir - The directory in which logs are stored, with the exception of ops log, until a related bug is resolved. Default: ./logs/ 154 155 DisableSuspLog - Whether suspicious requests are logged in the suspicious request logs. Enabling this may make a site faster. Defaults: false. 156 157 DisableBadRouteLog - Whether requests referencing routes which don't exist should be individually logged. Enabling this may make a site faster. Default: false 158 159 DisableStdout - Stop writing logs to stdout. Default: false. 160 161 DisableStderr - Stop writing errors to stderr. Default: false 162 163 Related: https://support.cloudflare.com/hc/en-us/articles/212794707-General-Best-Practices-for-Load-Balancing-at-your-origin-with-Cloudflare 164 165 166 # Database 167 168 Adapter - The name of the database adapter. `mysql` and `mssql` are options, although mssql may not work properly in the latest version of Gosora. PgSQL support is in the works. 169 170 Host - The host of the database you wish to connect to. Example: localhost 171 172 Username - The username for the database you wish to connect to. Example: root 173 174 Password - The password for the database you wish to connect to. Example: password 175 176 Dbname - The name of the database you want to use. Example: gosora 177 178 Port - The port the database is listening on. Usually 3306 for MySQL. 179 180 TestAdapter - A test version of Adapter. Only used for testing purposes. 181 182 TestHost - A test version of Host. Only used for testing purposes. 183 184 TestUsername - A test version of Username. Only used for testing purposes. 185 186 TestPassword - A test version of Password. Only used for testing purposes. 187 188 TestDbname - A test version of Dbname. Only used for testing purposes. 189 190 TestPort - A test version of Port. Only used for testing purposes. 191 192 # Dev 193 194 DebugMode - Outputs a basic level of information about what Gosora is doing to help ease debugging. 195 196 SuperDebug - Outputs a detailed level of information about what Gosora is doing to help ease debugging. Warning: This may cause severe slowdowns in Gosora. 197 198 TemplateDebug - Output a detailed level of information about what Gosora is doing during the template transpilation step. Warning: Large amounts of information will be dumped into the logs. 199 200 NoFsnotify - Whether you want to disable the file watcher which automatically reloads assets whenever they change.