Changeset cfd84bd
- Timestamp:
- Mar 15, 2018 3:50:33 PM (3 years ago)
- Branches:
- master
- Children:
- 144147d
- Parents:
- 1de82a68
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java
r1de82a68 rcfd84bd 1059 1059 } 1060 1060 1061 // set this before we check the data dir 1062 if (areFilesPublic() != filesPublic) { 1063 _config.setProperty(PROP_FILES_PUBLIC, Boolean.toString(filesPublic)); 1064 _util.setFilesPublic(filesPublic); 1065 if (filesPublic) 1066 addMessage(_t("New files will be publicly readable")); 1067 else 1068 addMessage(_t("New files will not be publicly readable")); 1069 changed = true; 1070 } 1071 1061 1072 if (dataDir != null && !dataDir.equals(getDataDir().getAbsolutePath())) { 1062 1073 dataDir = DataHelper.stripHTML(dataDir.trim()); 1063 File dd = new File(dataDir);1074 File dd = areFilesPublic() ? new File(dataDir) : new SecureDirectory(dataDir); 1064 1075 if (!dd.isAbsolute()) { 1065 1076 addMessage(_t("Data directory must be an absolute path") + ": " + dataDir); 1066 } else if (!dd.exists()) { 1067 addMessage(_t("Data directory does not exist") + ": " + dataDir); 1077 } else if (!dd.exists() && !dd.mkdirs()) { 1078 // save this tag for now, may need it again 1079 if (false) 1080 addMessage(_t("Data directory does not exist") + ": " + dataDir); 1081 addMessage(_t("Data directory cannot be created") + ": " + dataDir); 1068 1082 } else if (!dd.isDirectory()) { 1069 1083 addMessage(_t("Not a directory") + ": " + dataDir); … … 1197 1211 } // reconnect || changed options 1198 1212 1199 if (areFilesPublic() != filesPublic) {1200 _config.setProperty(PROP_FILES_PUBLIC, Boolean.toString(filesPublic));1201 _util.setFilesPublic(filesPublic);1202 if (filesPublic)1203 addMessage(_t("New files will be publicly readable"));1204 else1205 addMessage(_t("New files will not be publicly readable"));1206 changed = true;1207 }1208 1209 1213 if (shouldAutoStart() != autoStart) { 1210 1214 _config.setProperty(PROP_AUTO_START, Boolean.toString(autoStart)); -
apps/i2psnark/java/src/org/klomp/snark/web/BasicServlet.java
r1de82a68 rcfd84bd 40 40 import net.i2p.util.ByteCache; 41 41 import net.i2p.util.Log; 42 import net.i2p.util.SecureFile; 42 43 import net.i2p.util.SystemVersion; 43 44 … … 114 115 if (rb!=null) 115 116 { 116 File f = new File(rb);117 File f = new SecureFile(rb); 117 118 setResourceBase(f); 118 119 } … … 125 126 * Files are served from here 126 127 */ 127 protected void setResourceBase(File base) throws UnavailableException {128 protected synchronized void setResourceBase(File base) throws UnavailableException { 128 129 if (!base.isDirectory()) { 129 _log. log(Log.CRIT,"Configured i2psnark directory " + base + " does not exist");130 throw new UnavailableException("Resource base does not exist: " + base);130 _log.error("Configured i2psnark directory " + base + " does not exist"); 131 //throw new UnavailableException("Resource base does not exist: " + base); 131 132 } 132 133 _resourceBase = base; -
apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
r1de82a68 rcfd84bd 378 378 if (pageOne) { 379 379 out.write("</div><div id=\"lowersection\">\n"); 380 writeAddForm(out, req); 381 writeSeedForm(out, req, sortedTrackers); 380 boolean canWrite; 381 synchronized(this) { 382 canWrite = _resourceBase.canWrite(); 383 } 384 if (canWrite) { 385 writeAddForm(out, req); 386 writeSeedForm(out, req, sortedTrackers); 387 } 382 388 writeConfigLink(out); 383 389 // end of lowersection div … … 693 699 if (total == 0) { 694 700 out.write("<tr class=\"snarkTorrentNoneLoaded\">" + 695 "<td colspan=\"11\"><i>"); 696 out.write(_t("No torrents loaded.")); 697 out.write("</i></td></tr>\n"); 701 "<td colspan=\"11\">"); 702 synchronized(this) { 703 File dd = _resourceBase; 704 if (!dd.exists() && !dd.mkdirs()) { 705 out.write(_t("Data directory cannot be created") + ": " + DataHelper.escapeHTML(dd.toString())); 706 } else if (!dd.isDirectory()) { 707 out.write(_t("Not a directory") + ": " + DataHelper.escapeHTML(dd.toString())); 708 } else if (!dd.canRead()) { 709 out.write(_t("Unreadable") + ": " + DataHelper.escapeHTML(dd.toString())); 710 } else if (!dd.canWrite()) { 711 out.write(_t("No write permissions for data directory") + ": " + DataHelper.escapeHTML(dd.toString())); 712 } else { 713 out.write(_t("No torrents loaded.")); 714 } 715 } 716 out.write("</td></tr>\n"); 698 717 } else /** if (snarks.size() > 1) */ { 699 718 out.write("<tfoot><tr>\n" + -
apps/i2psnark/web.xml
r1de82a68 rcfd84bd 52 52 53 53 <error-page> 54 <error-code>403</error-code>55 <location>/.error</location>56 </error-page>57 <error-page>58 54 <error-code>404</error-code> 59 55 <location>/.error</location> -
history.txt
r1de82a68 rcfd84bd 1 2018-03-15 zzz 2 * i2psnark: Start even if data directory not found (ticket #2166) 3 1 4 2018-03-14 zzz 2 5 * Console: … … 5 8 - Add error handler to webapps (ticket #2155) 6 9 * i2ptunnel: Hide links to webapps that are not runnning (ticket #2161) 7 * SusDNS: Translate svg image text (ticket #1749) 10 * SusiDNS: Translate svg image text (ticket #1749) 11 * SusiMail: Shorten URLs 8 12 9 13 2018-03-12 zzz 10 * Susi mail: Fix up compose.js (ticket #2176)14 * SusiMail: Fix up compose.js (ticket #2176) 11 15 12 16 2018-03-11 zzz -
router/java/src/net/i2p/router/RouterVersion.java
r1de82a68 rcfd84bd 19 19 public final static String ID = "Monotone"; 20 20 public final static String VERSION = CoreVersion.VERSION; 21 public final static long BUILD = 1 8;21 public final static long BUILD = 19; 22 22 23 23 /** for example "-test" */
Note: See TracChangeset
for help on using the changeset viewer.