Merge branch 'master' into subtree
[nikiroo-utils.git] / bundles / Config.java
CommitLineData
08fe2e33
NR
1package be.nikiroo.fanfix.bundles;
2
3import be.nikiroo.utils.resources.Meta;
ce788468 4import be.nikiroo.utils.resources.Meta.Format;
08fe2e33
NR
5
6/**
7 * The configuration options.
8 *
9 * @author niki
10 */
ce788468 11@SuppressWarnings("javadoc")
08fe2e33 12public enum Config {
5788cc5b
NR
13
14 // Note: all hidden values are subject to be removed in a later version
15
13fdb89a 16 @Meta(description = "The language to use for in the program (example: en-GB, fr-BE...) or nothing for default system language (can be overwritten with the variable $LANG)",//
459b4c28 17 format = Format.LOCALE, list = { "en-GB", "fr-BE" })
08fe2e33 18 LANG, //
13fdb89a
NR
19 @Meta(description = "File format options",//
20 group = true)
21 FILE_FORMAT, //
22 @Meta(description = "How to save non-images documents in the library",//
b7cd9db8 23 format = Format.FIXED_LIST, list = { "INFO_TEXT", "EPUB", "HTML", "TEXT" }, def = "INFO_TEXT")
13fdb89a
NR
24 FILE_FORMAT_NON_IMAGES_DOCUMENT_TYPE, //
25 @Meta(description = "How to save images documents in the library",//
b7cd9db8 26 format = Format.FIXED_LIST, list = { "CBZ", "HTML" }, def = "CBZ")
13fdb89a
NR
27 FILE_FORMAT_IMAGES_DOCUMENT_TYPE, //
28 @Meta(description = "How to save cover images",//
29 format = Format.FIXED_LIST, list = { "PNG", "JPG", "BMP" }, def = "PNG")
30 FILE_FORMAT_IMAGE_FORMAT_COVER, //
31 @Meta(description = "How to save content images",//
32 format = Format.FIXED_LIST, list = { "PNG", "JPG", "BMP" }, def = "JPG")
33 FILE_FORMAT_IMAGE_FORMAT_CONTENT, //
34
35 @Meta(description = "Cache management",//
36 group = true)
37 CACHE, //
7cd006eb
NR
38 @Meta(description = "The directory where to store temporary files; any relative path uses the applciation config directory as base, $HOME notation is supported, / is always accepted as directory separator",//
39 format = Format.DIRECTORY, def = "tmp/")
08fe2e33 40 CACHE_DIR, //
b7cd9db8
NR
41 @Meta(description = "The delay in hours after which a cached resource that is thought to change ~often is considered too old and triggers a refresh delay (or 0 for no cache, or -1 for infinite time)", //
42 format = Format.INT, def = "24")
08fe2e33 43 CACHE_MAX_TIME_CHANGING, //
b7cd9db8
NR
44 @Meta(description = "The delay in hours after which a cached resource that is thought to change rarely is considered too old and triggers a refresh delay (or 0 for no cache, or -1 for infinite time)", //
45 format = Format.INT, def = "720")
08fe2e33 46 CACHE_MAX_TIME_STABLE, //
13fdb89a 47
7cd006eb
NR
48 @Meta(description = "The directory where to get the default story covers; any relative path uses the applciation config directory as base, $HOME notation is supported, / is always accepted as directory separator",//
49 format = Format.DIRECTORY, def = "covers/")
08fe2e33 50 DEFAULT_COVERS_DIR, //
5788cc5b 51 @Meta(description = "The directory where to store the library (can be overriden by the environment variable \"BOOKS_DIR\"; any relative path uses the applciation config directory as base, $HOME notation is supported, / is always accepted as directory separator",//
13fdb89a
NR
52 format = Format.DIRECTORY, def = "$HOME/Books/")
53 LIBRARY_DIR, //
459b4c28
NR
54
55 @Meta(description = "Remote library\nA remote library can be configured to fetch the stories from a remote Fanfix server",//
56 group = true)
57 REMOTE_LIBRARY, //
58 @Meta(description = "Use the remote Fanfix server configured here instead of the local library (if FALSE, the local library will be used instead)",//
59 format = Format.BOOLEAN, def = "false")
60 REMOTE_LIBRARY_ENABLED, //
f433d153 61 @Meta(description = "The remote Fanfix server to connect to (fanfix://, http://, https:// -- if not specified, fanfix:// is assumed)",//
459b4c28
NR
62 format = Format.STRING)
63 REMOTE_LIBRARY_HOST, //
64 @Meta(description = "The port to use for the remote Fanfix server",//
65 format = Format.INT, def = "58365")
66 REMOTE_LIBRARY_PORT, //
67 @Meta(description = "The key is structured: \"KEY|SUBKEY|wl|rw\"\n- \"KEY\" is the actual encryption key (it can actually be empty, which will still encrypt the messages but of course it will be easier to guess the key)\n- \"SUBKEY\" is the (optional) subkey to use to get additional privileges\n- \"wl\" is a special privilege that allows that subkey to ignore white lists\n- \"rw\" is a special privilege that allows that subkey to modify the library, even if it is not in RW (by default) mode\n\nSome examples:\n- \"super-secret\": a normal key, no special privileges\n- \"you-will-not-guess|azOpd8|wl\": a white-list ignoring key\n- \"new-password|subpass|rw\": a key that allows modifications on the library",//
68 format = Format.PASSWORD)
69 REMOTE_LIBRARY_KEY, //
13fdb89a
NR
70
71 @Meta(description = "Network configuration",//
72 group = true)
73 NETWORK, //
74 @Meta(description = "The user-agent to use to download files",//
75 def = "Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0 -- ELinks/0.9.3 (Linux 2.6.11 i686; 80x24) -- Fanfix (https://github.com/nikiroo/fanfix/)")
76 NETWORK_USER_AGENT, //
77 @Meta(description = "The proxy server to use under the format 'user:pass@proxy:port', 'user@proxy:port', 'proxy:port' or ':' alone (system proxy); an empty String means no proxy",//
78 format = Format.STRING, def = "")
79 NETWORK_PROXY, //
80 @Meta(description = "If the last update check was done at least that many days ago, check for updates at startup (-1 for 'no checks')", //
81 format = Format.INT, def = "1")
82 NETWORK_UPDATE_INTERVAL, //
83
84 @Meta(description = "Remote Server configuration\nNote that the key is structured: \"KEY|SUBKEY|wl|rw\"\n- \"KEY\" is the actual encryption key (it can actually be empty, which will still encrypt the messages but of course it will be easier to guess the key)\n- \"SUBKEY\" is the (optional) subkey to use to get additional privileges\n- \"wl\" is a special privilege that allows that subkey to ignore white lists\n- \"rw\" is a special privilege that allows that subkey to modify the library, even if it is not in RW (by default) mode\n\nSome examples:\n- \"super-secret\": a normal key, no special privileges\n- \"you-will-not-guess|azOpd8|wl\": a white-list ignoring key\n- \"new-password|subpass|rw\": a key that allows modifications on the library",//
85 group = true)
86 SERVER, //
f433d153
NR
87 @Meta(description = "Remote Server mode: you can use the fanfix protocol (which is encrypted), http (which is not) or https (which requires a keystore.jks file)",//
88 format = Format.FIXED_LIST, list = { "fanfix", "http", "https" }, def = "fanfix")
89 SERVER_MODE,
b7cd9db8
NR
90 @Meta(description = "The port on which we can start the server (must be a valid port, from 1 to 65535)", //
91 format = Format.INT, def = "58365")
fb25273c 92 SERVER_PORT, //
f433d153
NR
93 @Meta(description = "A keystore.jks file, required to use HTTPS (the server will refuse to start in HTTPS mode without this file)", //
94 format = Format.STRING, def = "")
95 SERVER_SSL_KEYSTORE,
96 @Meta(description = "The pass phrase required to open the keystore.jks file (required for HTTPS mode)", //
97 format = Format.PASSWORD, def = "")
98 SERVER_SSL_KEYSTORE_PASS,
99 @Meta(description = "The encryption key for the server (NOT including a subkey), it cannot contain the pipe character \"|\" but can be empty -- is used to encrypt the traffic in fanfix mode (even if empty, traffic will be encrypted in fanfix mode), and used as a password for HTTP (clear text protocol) and HTTPS modes",//
b7cd9db8 100 format = Format.PASSWORD, def = "")
fb25273c 101 SERVER_KEY, //
b7cd9db8
NR
102 @Meta(description = "Allow write access to the clients (download story, move story...) without RW subkeys", //
103 format = Format.BOOLEAN, def = "true")
fb25273c 104 SERVER_RW, //
c91f1830 105 @Meta(description = "If not empty, only the EXACT listed sources will be available for clients without a WL subkey",//
b7cd9db8 106 array = true, format = Format.STRING, def = "")
fb25273c 107 SERVER_WHITELIST, //
c91f1830
NR
108 @Meta(description = "Those sources will not be available for clients without a BL subkey",//
109 array = true, format = Format.STRING, def = "")
110 SERVER_BLACKLIST, //
f433d153 111 @Meta(description = "The subkeys that the server will allow, including the modes\nA subkey is used as a login for HTTP (clear text protocol) and HTTPS modes", //
b7cd9db8 112 array = true, format = Format.STRING, def = "")
fb25273c 113 SERVER_ALLOWED_SUBKEYS, //
f433d153
NR
114 @Meta(description = "The maximum size of the cache, in MegaBytes, for HTTP and HTTPS servers", //
115 format = Format.INT, def = "100")
116 SERVER_MAX_CACHE_MB,
13fdb89a
NR
117
118 @Meta(description = "DEBUG options",//
119 group = true)
120 DEBUG, //
b7cd9db8
NR
121 @Meta(description = "Show debug information on errors",//
122 format = Format.BOOLEAN, def = "false")
08fe2e33 123 DEBUG_ERR, //
b7cd9db8
NR
124 @Meta(description = "Show debug trace information",//
125 format = Format.BOOLEAN, def = "false")
a8209dd0 126 DEBUG_TRACE, //
13fdb89a
NR
127
128 @Meta(description = "Internal configuration\nThose options are internal to the program and should probably not be changed",//
5788cc5b 129 hidden = true, group = true)
13fdb89a
NR
130 CONF, //
131 @Meta(description = "LaTeX configuration",//
5788cc5b 132 hidden = true, group = true)
13fdb89a 133 CONF_LATEX_LANG, //
b7cd9db8 134 @Meta(description = "LaTeX output language (full name) for \"English\"",//
5788cc5b 135 hidden = true, format = Format.STRING, def = "english")
13fdb89a 136 CONF_LATEX_LANG_EN, //
b7cd9db8 137 @Meta(description = "LaTeX output language (full name) for \"French\"",//
5788cc5b 138 hidden = true, format = Format.STRING, def = "french")
13fdb89a 139 CONF_LATEX_LANG_FR, //
b7cd9db8 140 @Meta(description = "other 'by' prefixes before author name, used to identify the author",//
5788cc5b 141 hidden = true, array = true, format = Format.STRING, def = "\"by\",\"par\",\"de\",\"©\",\"(c)\"")
13fdb89a 142 CONF_BYS, //
b7cd9db8 143 @Meta(description = "List of languages codes used for chapter identification (should not be changed)", //
5788cc5b 144 hidden = true, array = true, format = Format.STRING, def = "\"EN\",\"FR\"")
13fdb89a 145 CONF_CHAPTER, //
b7cd9db8 146 @Meta(description = "Chapter identification string in English, used to identify a starting chapter in text mode",//
5788cc5b 147 hidden = true, format = Format.STRING, def = "Chapter")
13fdb89a 148 CONF_CHAPTER_EN, //
b7cd9db8 149 @Meta(description = "Chapter identification string in French, used to identify a starting chapter in text mode",//
5788cc5b 150 hidden = true, format = Format.STRING, def = "Chapitre")
13fdb89a
NR
151 CONF_CHAPTER_FR, //
152
153 @Meta(description = "YiffStar/SoFurry credentials\nYou can give your YiffStar credentials here to have access to all the stories, though it should not be necessary anymore (some stories used to beblocked for anonymous viewers)",//
154 group = true)
155 LOGIN_YIFFSTAR, //
156 @Meta(description = "Your YiffStar/SoFurry login",//
b7cd9db8 157 format = Format.STRING)
6e06d2cc 158 LOGIN_YIFFSTAR_USER, //
13fdb89a 159 @Meta(description = "Your YiffStar/SoFurry password",//
b7cd9db8 160 format = Format.PASSWORD)
6e06d2cc 161 LOGIN_YIFFSTAR_PASS, //
13fdb89a 162
b7cd9db8
NR
163 @Meta(description = "FimFiction APIKEY credentials\nFimFiction can be queried via an API, but requires an API key to do that. One has been created for this program, but if you have another API key you can set it here. You can also set a login and password instead, in that case, a new API key will be generated (and stored) if you still haven't set one.",//
164 group = true)
f59eafef 165 LOGIN_FIMFICTION_APIKEY, //
b7cd9db8
NR
166 @Meta(description = "The login of the API key used to create a new token from FimFiction", //
167 format = Format.STRING)
315f14ae 168 LOGIN_FIMFICTION_APIKEY_CLIENT_ID, //
b7cd9db8
NR
169 @Meta(description = "The password of the API key used to create a new token from FimFiction", //
170 format = Format.PASSWORD)
315f14ae 171 LOGIN_FIMFICTION_APIKEY_CLIENT_SECRET, //
b7cd9db8
NR
172 @Meta(description = "Do not use the new API, even if we have a token, and force HTML scraping",//
173 format = Format.BOOLEAN, def = "false")
315f14ae 174 LOGIN_FIMFICTION_APIKEY_FORCE_HTML, //
b7cd9db8
NR
175 @Meta(description = "The token required to use the beta APIv2 from FimFiction (see APIKEY_CLIENT_* if you want to generate a new one from your own API key)", //
176 format = Format.PASSWORD, def = "Bearer WnZ5oHlzQoDocv1GcgHfcoqctHkSwL-D")
315f14ae 177 LOGIN_FIMFICTION_APIKEY_TOKEN, //
5cf61f35
NR
178
179 @Meta(description = "e621.net credentials\nYou can give your e621.net credentials here to have access to all the comics and ignore the default blacklist",//
180 group = true)
181 LOGIN_E621, //
182 @Meta(description = "Your e621.net login",//
183 format = Format.STRING)
184 LOGIN_E621_LOGIN, //
185 @Meta(description = "Your e621.net API KEY",//
186 format = Format.PASSWORD)
187 LOGIN_E621_APIKEY, //
08fe2e33 188}