Changeset 6897 in josm


Ignore:
Timestamp:
2014-03-05T18:37:26+01:00 (10 years ago)
Author:
stoecker
Message:

see #9778 - use TLS for JOSM website access

Location:
trunk
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/data_nodist/wms-cache.xsd

    r4183 r6897  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://josm.openstreetmap.de/wms-cache"
    3         xmlns:tns="http://josm.openstreetmap.de/wms-cache" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
     2<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://josm.openstreetmap.de/wms-cache-1.0"
     3        xmlns:tns="http://josm.openstreetmap.de/wms-cache-1.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    44        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    55        xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
  • trunk/src/org/openstreetmap/josm/Main.java

    r6883 r6897  
    110110    /**
    111111     * The JOSM website URL.
    112      * @since 6143
    113      */
    114     public static final String JOSM_WEBSITE = "http://josm.openstreetmap.de";
     112     * @since 6897 (was public from 6143 to 6896)
     113     */
     114    private static final String JOSM_WEBSITE = "http://josm.openstreetmap.de";
    115115
    116116    /**
    117117     * The OSM website URL.
    118      * @since 6453
    119      */
    120     public static final String OSM_WEBSITE = "http://www.openstreetmap.org";
     118     * @since 6897 (was public from 6453 to 6896)
     119     */
     120    private static final String OSM_WEBSITE = "http://www.openstreetmap.org";
    121121
    122122    /**
     
    14841484        return new HashMap<String, Throwable>(NETWORK_ERRORS);
    14851485    }
     1486
     1487    /**
     1488     * Returns the JOSM website URL.
     1489     * @return the josm website URL
     1490     * @since 6897
     1491     */
     1492    public static String getJOSMWebsite() {
     1493        if(Main.pref != null)
     1494            return Main.pref.get("josm.url", JOSM_WEBSITE);
     1495        return JOSM_WEBSITE;
     1496    }
     1497
     1498    /**
     1499     * Returns the JOSM XML URL.
     1500     * @return the josm XML URL
     1501     * @since 6897
     1502     */
     1503    public static String getXMLBase() {
     1504        if(Main.pref != null)
     1505            return Main.pref.get("xml.url", JOSM_WEBSITE);
     1506        return JOSM_WEBSITE;
     1507    }
     1508
     1509    /**
     1510     * Returns the OSM website URL.
     1511     * @return the OSM website URL
     1512     * @since 6897
     1513     */
     1514    public static String getOSMWebsite() {
     1515        if(Main.pref != null)
     1516            return Main.pref.get("osm.url", OSM_WEBSITE);
     1517        return OSM_WEBSITE;
     1518    }
    14861519}
  • trunk/src/org/openstreetmap/josm/actions/AboutAction.java

    r6380 r6897  
    8585        info.add(GBC.glue(0,10), GBC.eol());
    8686        info.add(new JLabel(tr("Homepage")), GBC.std().insets(10,0,10,0));
    87         info.add(new UrlLabel(Main.JOSM_WEBSITE,2), GBC.eol().fill(GBC.HORIZONTAL));
     87        info.add(new UrlLabel(Main.getJOSMWebsite(),2), GBC.eol().fill(GBC.HORIZONTAL));
    8888        info.add(GBC.glue(0,5), GBC.eol());
    8989        info.add(new JLabel(tr("Bug Reports")), GBC.std().insets(10,0,10,0));
  • trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java

    r6889 r6897  
    4848        if (ret.startsWith("http://api.openstreetmap.org/")) {
    4949            ret = ret.substring("http://api.openstreetmap.org/".length());
    50             ret = Main.OSM_WEBSITE + "/" + ret;
     50            ret = Main.getOSMWebsite() + "/" + ret;
    5151        }
    5252        return ret;
     
    6767        if (ret.startsWith("http://api.openstreetmap.org/")) {
    6868            ret = ret.substring("http://api.openstreetmap.org/".length());
    69             ret = Main.OSM_WEBSITE + "/" + ret;
     69            ret = Main.getOSMWebsite() + "/" + ret;
    7070        }
    7171        return ret;
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r6889 r6897  
    13071307     * The default plugin site
    13081308     */
    1309     private static final String[] DEFAULT_PLUGIN_SITE = {Main.JOSM_WEBSITE+"/plugin%<?plugins=>"};
     1309    private static final String[] DEFAULT_PLUGIN_SITE = {Main.getJOSMWebsite()+"/plugin%<?plugins=>"};
    13101310
    13111311    /**
     
    15541554        StringBuilder b = new StringBuilder(
    15551555                "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
    1556                 "<preferences xmlns=\""+Main.JOSM_WEBSITE+"/preferences-1.0\" version=\""+
     1556                "<preferences xmlns=\""+Main.getXMLBase()+"/preferences-1.0\" version=\""+
    15571557                Version.getInstance().getVersion() + "\">\n");
    15581558        SettingToXml toXml = new SettingToXml(b, nopass);
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxConstants.java

    r6143 r6897  
    2626    public static final String META_EXTENSIONS = META_PREFIX + "extensions";
    2727
    28     public static final String JOSM_EXTENSIONS_NAMESPACE_URI = Main.JOSM_WEBSITE + "/gpx-extensions-1.0";
     28    public static final String JOSM_EXTENSIONS_NAMESPACE_URI = Main.getXMLBase() + "/gpx-extensions-1.0";
    2929
    3030    public static List<String> WPT_KEYS = Arrays.asList("ele", "time", "magvar", "geoidheight",
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java

    r6883 r6897  
    2626
    2727    private static final String[] DEFAULT_LAYER_SITES = {
    28         Main.JOSM_WEBSITE+"/maps"
     28        Main.getJOSMWebsite()+"/maps"
    2929    };
    3030
  • trunk/src/org/openstreetmap/josm/data/imagery/types/ProjectionType.java

    r6830 r6897  
    2525 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
    2626 *       &lt;sequence&gt;
    27  *         &lt;element name="entry" type="{http://josm.openstreetmap.de/wms-cache}entry" maxOccurs="unbounded" minOccurs="0"/&gt;
     27 *         &lt;element name="entry" type="{http://josm.openstreetmap.de/wms-cache-1.0}entry" maxOccurs="unbounded" minOccurs="0"/&gt;
    2828 *       &lt;/sequence&gt;
    2929 *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
  • trunk/src/org/openstreetmap/josm/data/imagery/types/WmsCacheType.java

    r6830 r6897  
    2626 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
    2727 *       &lt;sequence&gt;
    28  *         &lt;element name="projection" type="{http://josm.openstreetmap.de/wms-cache}projection" maxOccurs="unbounded" minOccurs="0"/&gt;
     28 *         &lt;element name="projection" type="{http://josm.openstreetmap.de/wms-cache-1.0}projection" maxOccurs="unbounded" minOccurs="0"/&gt;
    2929 *       &lt;/sequence&gt;
    3030 *       &lt;attribute name="tileSize" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
  • trunk/src/org/openstreetmap/josm/data/imagery/types/package-info.java

    r6069 r6897  
    66//
    77
    8 @javax.xml.bind.annotation.XmlSchema(namespace = "http://josm.openstreetmap.de/wms-cache", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
     8@javax.xml.bind.annotation.XmlSchema(namespace = "http://josm.openstreetmap.de/wms-cache-1.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
    99package org.openstreetmap.josm.data.imagery.types;
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java

    r6883 r6897  
    3232     * The default OSM OAuth request token URL.
    3333     */
    34     public static final String DEFAULT_REQUEST_TOKEN_URL = Main.OSM_WEBSITE + "/oauth/request_token";
     34    public static final String DEFAULT_REQUEST_TOKEN_URL = Main.getOSMWebsite() + "/oauth/request_token";
    3535    /**
    3636     * The default OSM OAuth access token URL.
    3737     */
    38     public static final String DEFAULT_ACCESS_TOKEN_URL = Main.OSM_WEBSITE + "/oauth/access_token";
     38    public static final String DEFAULT_ACCESS_TOKEN_URL = Main.getOSMWebsite() + "/oauth/access_token";
    3939    /**
    4040     * The default OSM OAuth authorize URL.
    4141     */
    42     public static final String DEFAULT_AUTHORISE_URL = Main.OSM_WEBSITE + "/oauth/authorize";
     42    public static final String DEFAULT_AUTHORISE_URL = Main.getOSMWebsite() + "/oauth/authorize";
    4343
    4444
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r6869 r6897  
    231231
    232232        /**
    233          * Determines the {@code index}-th key/value/tag (depending on {@code type}) of the {@link Selector.GeneralSelector}.
     233         * Determines the {@code index}-th key/value/tag (depending on {@code type}) of the
     234         * {@link org.openstreetmap.josm.gui.mappaint.mapcss.Selector.GeneralSelector}.
    234235         */
    235236        static String determineArgument(Selector.GeneralSelector matchingSelector, int index, String type) {
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r6889 r6897  
    160160
    161161    private String fixImageLinks(String s) {
    162         Matcher m = Pattern.compile("src=\""+Main.JOSM_WEBSITE+"/browser/trunk(/images/.*?\\.png)\\?format=raw\"").matcher(s);
     162        Matcher m = Pattern.compile("src=\""+Main.getJOSMWebsite()+"/browser/trunk(/images/.*?\\.png)\\?format=raw\"").matcher(s);
    163163        StringBuffer sb = new StringBuffer();
    164164        while (m.find()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java

    r6890 r6897  
    7272                + "<p><strong>" + tr("Examples") + "</strong></p>"
    7373                + "<ul>"
    74                 + "<li><a href=\""+Main.OSM_WEBSITE+"/browse/changesets?open=true\">"+Main.OSM_WEBSITE+"/browse/changesets?open=true</a></li>"
     74                + "<li><a href=\""+Main.getOSMWebsite()+"/browse/changesets?open=true\">"+Main.getOSMWebsite()+"/browse/changesets?open=true</a></li>"
    7575                + "<li><a href=\"http://api.openstreetmap.org/api/0.6/changesets?open=true\">http://api.openstreetmap.org/api/0.6/changesets?open=true</a></li>"
    7676                + "</ul>"
  • trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java

    r6784 r6897  
    2828     */
    2929    public static String getWikiBaseUrl() {
    30         return Main.pref.get("help.baseurl", Main.JOSM_WEBSITE);
     30        return Main.pref.get("help.baseurl", Main.getJOSMWebsite());
    3131    }
    3232
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r6890 r6897  
    230230     * @param monitor
    231231     * @see MemoryTileCache#clear()
    232      * @see OsmFileCacheTileLoader#clearCache(org.openstreetmap.gui.jmapviewer.interfaces.TileSource, org.openstreetmap.gui.jmapviewer.OsmFileCacheTileLoader.TileClearController)
     232     * @see OsmFileCacheTileLoader#clearCache(org.openstreetmap.gui.jmapviewer.interfaces.TileSource, org.openstreetmap.gui.jmapviewer.interfaces.TileClearController)
    233233     */
    234234    void clearTileCache(ProgressMonitor monitor) {
  • trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java

    r6890 r6897  
    679679     * Finds the most suitable resolution for the current zoom level, but prefers
    680680     * higher resolutions. Snaps to values defined in snapLevels.
    681      * @return
     681     * @return best zoom level
    682682     */
    683683    private static double getBestZoom() {
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java

    r6453 r6897  
    4343        JPanel msg = new JPanel(new GridBagLayout());
    4444        msg.add(new JLabel(tr("<html>Upload of unprocessed GPS data as map data is considered harmful.<br>If you want to upload traces, look here:</html>")), GBC.eol());
    45         msg.add(new UrlLabel(Main.OSM_WEBSITE + "/traces", 2), GBC.eop());
     45        msg.add(new UrlLabel(Main.getOSMWebsite() + "/traces", 2), GBC.eop());
    4646        if (!ConditionalOptionPaneUtil.showConfirmationDialog("convert_to_data", Main.parent, msg, tr("Warning"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, JOptionPane.OK_OPTION)) {
    4747            return;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj

    r6896 r6897  
    3030import org.openstreetmap.josm.tools.Utils;
    3131import org.openstreetmap.josm.Main;
     32
     33/*************
     34 * <pre>
     35 * Parser definitions
     36 *
     37 *                       rule
     38 *  _______________________|______________________________
     39 * |                                                      |
     40 *        selector                      declaration
     41 *  _________|___________________   _________|____________
     42 * |                             | |                      |
     43 *
     44 * way|z11-12[highway=residential] { color: red; width: 3 }
     45 *
     46 *    |_____||___________________|   |_________|
     47 *       |            |                   |
     48 *     zoom       condition          instruction
     49 *
     50 * more general:
     51 *
     52 * way|z13-[a=b][c=d]::subpart, way|z-3[u=v]:closed::subpart2 { p1 : val; p2 : val; }
     53 *
     54 * 'val' can be a literal, or an expression like "prop(width, default) + 0.8".
     55 *
     56 * {@literal @media} { ... } queries are supported, following http://www.w3.org/TR/css3-mediaqueries/#syntax
     57 *
     58 *                               media_query
     59 *         ___________________________|_______________________________
     60 *        |                                                           |
     61 * {@literal @media} all and (min-josm-version: 7789) and (max-josm-version: 7790), all and (user-agent: xyz) { ... }
     62 *                |______________________|
     63 *                          |
     64 *                    media_expression
     65 * </pre>
     66 */
    3267
    3368public class MapCSSParser {
     
    112147}
    113148
    114 /*************
    115  * Parser definitions
    116  *
    117  *                       rule
    118  *  _______________________|______________________________
    119  * |                                                      |
    120  *        selector                      declaration
    121  *  _________|___________________   _________|____________
    122  * |                             | |                      |
    123  *
    124  * way|z11-12[highway=residential] { color: red; width: 3 }
    125  *
    126  *    |_____||___________________|   |_________|
    127  *       |            |                   |
    128  *     zoom       condition          instruction
    129  *
    130  * more general:
    131  *
    132  * way|z13-[a=b][c=d]::subpart, way|z-3[u=v]:closed::subpart2 { p1 : val; p2 : val; }
    133  *
    134  * 'val' can be a literal, or an expression like "prop(width, default) + 0.8".
    135  *
    136  * @media { ... } queries are supported, following http://www.w3.org/TR/css3-mediaqueries/#syntax
    137  *
    138  *                               media_query
    139  *         ___________________________|_______________________________
    140  *        |                                                           |
    141  * @media all and (min-josm-version: 7789) and (max-josm-version: 7790), all and (user-agent: xyz) { ... }
    142  *                |______________________|
    143  *                          |
    144  *                    media_expression
    145  */
    146 
    147149int uint() :
    148150{
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r6883 r6897  
    311311
    312312    /**
    313      * Super class of {@link GeneralSelector} and {@link LinkSelector}.
     313     * Super class of {@link org.openstreetmap.josm.gui.mappaint.mapcss.Selector.GeneralSelector} and
     314     * {@link org.openstreetmap.josm.gui.mappaint.mapcss.Selector.LinkSelector}.
    314315     * @since 5841
    315316     */
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java

    r6867 r6897  
    8080                XmlObjectParser parser = new XmlObjectParser(new XmlStyleSourceHandler(this));
    8181                parser.startWithValidation(reader,
    82                         Main.JOSM_WEBSITE+"/mappaint-style-1.0",
     82                        Main.getXMLBase()+"/mappaint-style-1.0",
    8383                        "resource://data/mappaint-style.xsd");
    8484                while (parser.hasNext());
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java

    r6883 r6897  
    8787
    8888        public MapPaintSourceEditor() {
    89             super(SourceType.MAP_PAINT_STYLE, Main.JOSM_WEBSITE+"/styles", styleSourceProviders, true);
     89            super(SourceType.MAP_PAINT_STYLE, Main.getJOSMWebsite()+"/styles", styleSourceProviders, true);
    9090        }
    9191
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java

    r6883 r6897  
    192192
    193193        public TaggingPresetSourceEditor() {
    194             super(SourceType.TAGGING_PRESET, Main.JOSM_WEBSITE+"/presets", presetSourceProviders, true);
     194            super(SourceType.TAGGING_PRESET, Main.getJOSMWebsite()+"/presets", presetSourceProviders, true);
    195195        }
    196196
  • trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTagCheckerRulesPreference.java

    r6806 r6897  
    5858
    5959        public TagCheckerRulesSourceEditor() {
    60             super(SourceType.TAGCHECKER_RULE, Main.JOSM_WEBSITE+"/rules", ruleSourceProviders, false);
     60            super(SourceType.TAGCHECKER_RULE, Main.getJOSMWebsite()+"/rules", ruleSourceProviders, false);
    6161        }
    6262
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java

    r6867 r6897  
    105105
    106106        if (validate) {
    107             parser.startWithValidation(in, Main.JOSM_WEBSITE+"/tagging-preset-1.0", "resource://data/tagging-preset.xsd");
     107            parser.startWithValidation(in, Main.getXMLBase()+"/tagging-preset-1.0", "resource://data/tagging-preset.xsd");
    108108        } else {
    109109            parser.start(in);
  • trunk/src/org/openstreetmap/josm/io/MessageNotifier.java

    r6695 r6897  
    6767                            JPanel panel = new JPanel(new GridBagLayout());
    6868                            panel.add(new JLabel(trn("You have {0} unread message.", "You have {0} unread messages.", unread, unread)), GBC.eol());
    69                             panel.add(new UrlLabel(Main.OSM_WEBSITE + "/user/"+userInfo.getDisplayName()+"/inbox", tr("Click here to see your inbox.")), GBC.eol());
     69                            panel.add(new UrlLabel(Main.getOSMWebsite() + "/user/"+userInfo.getDisplayName()+"/inbox", tr("Click here to see your inbox.")), GBC.eol());
    7070                            panel.setOpaque(false);
    7171                            new Notification().setContent(panel)
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java

    r6798 r6897  
    5858    @Override
    5959    public String[] getUsageExamples() {
    60         return new String[] { "/import?url="+Main.JOSM_WEBSITE+"/browser/josm/trunk/data_nodist/direction-arrows.osm" };
     60        return new String[] { "/import?url="+Main.getJOSMWebsite()+"/browser/josm/trunk/data_nodist/direction-arrows.osm" };
    6161    }
    6262   
  • trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java

    r6797 r6897  
    162162                    tr("You have encountered an error in JOSM. Before you file a bug report " +
    163163                            "make sure you have updated to the latest version of JOSM here:")), GBC.eol());
    164             p.add(new UrlLabel(Main.JOSM_WEBSITE,2), GBC.eop().insets(8,0,0,0));
     164            p.add(new UrlLabel(Main.getJOSMWebsite(),2), GBC.eop().insets(8,0,0,0));
    165165            p.add(new JMultilineLabel(
    166166                    tr("You should also update your plugins. If neither of those help please " +
     
    174174                    tr("Alternatively, if that does not work you can manually fill in the information " +
    175175                            "below at this URL:")), GBC.eol());
    176             p.add(new UrlLabel(Main.JOSM_WEBSITE+"/newticket",2), GBC.eop().insets(8,0,0,0));
     176            p.add(new UrlLabel(Main.getJOSMWebsite()+"/newticket",2), GBC.eop().insets(8,0,0,0));
    177177            if (Utils.copyToClipboard(text)) {
    178178                p.add(new JLabel(tr("(The text has already been copied to your clipboard.)")), GBC.eop());
     
    217217            Utils.close(gzip);
    218218
    219             return new URL(Main.JOSM_WEBSITE+"/josmticket?" +
     219            return new URL(Main.getJOSMWebsite()+"/josmticket?" +
    220220                    "gdata="+Base64.encode(ByteBuffer.wrap(out.toByteArray()), true));
    221221        } catch (IOException e) {
     
    234234        URL url = getBugReportUrl(debugText);
    235235        if (url != null) {
    236             return new UrlLabel(url.toString(), Main.JOSM_WEBSITE+"/josmticket?...", 2);
     236            return new UrlLabel(url.toString(), Main.getJOSMWebsite()+"/josmticket?...", 2);
    237237        }
    238238        return null;
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r6889 r6897  
    304304        double lon = (Math.round(dlon * decimals));
    305305        lon /= decimals;
    306         return Main.OSM_WEBSITE + "/#map="+zoom+"/"+lat+"/"+lon;
     306        return Main.getOSMWebsite() + "/#map="+zoom+"/"+lat+"/"+lon;
    307307    }
    308308}
  • trunk/src/org/openstreetmap/josm/tools/WikiReader.java

    r6642 r6897  
    3030     */
    3131    public WikiReader() {
    32         this.baseurl = Main.pref.get("help.baseurl", Main.JOSM_WEBSITE);
     32        this.baseurl = Main.pref.get("help.baseurl", Main.getJOSMWebsite());
    3333    }
    3434
     
    114114        String b = "";
    115115        String full = "";
     116        String baseurlus = baseurl.replace("https:","http:");
     117        String baseurlse = baseurlus.replace("http:","https:");
    116118        for (String line = in.readLine(); line != null; line = in.readLine()) {
    117119            full += line;
     
    136138                b += line.replaceAll("<img ", "<img border=\"0\" ")
    137139                         .replaceAll("<span class=\"icon\">.</span>", "")
    138                          .replaceAll("href=\"/", "href=\"" + baseurl + "/")
     140                         .replaceAll("href=\"/", "href=\"" + baseurlus + "/")
     141                         .replaceAll("href=\"/", "href=\"" + baseurlse + "/")
    139142                         .replaceAll(" />", ">")
    140143                         + "\n";
Note: See TracChangeset for help on using the changeset viewer.