java.lang.Object
net.i2p.router.web.FormHandler
net.i2p.router.web.ConfigUpdateHandler

public class ConfigUpdateHandlerextends FormHandler
Handler for router update configuration.
  • Field Details

    • _newsURL

      private String _newsURL
      The URL of the news feed.
    • _refreshFrequency

      private long _refreshFrequency
      Interval between the update checks.
    • _updateURL

      private String _updateURL
      The URL of the update stream.
    • _updatePolicy

      private String _updatePolicy
      The policy for applying the updates.
    • _proxyHost

      private String _proxyHost
      The proxy host for the downloads.
    • _proxyPort

      private String _proxyPort
      The proxy port for the downloads.
    • _updateThroughProxy

      private boolean _updateThroughProxy
      True to download updates through the proxy.
    • _newsThroughProxy

      private boolean _newsThroughProxy
      True to fetch the news through the proxy.
    • _trustedKeys

      private String _trustedKeys
      The signing keys trusted for the updates.
    • _updateUnsigned

      private boolean _updateUnsigned
      True to accept the unsigned updates.
    • _zipURL

      private String _zipURL
      The URL of the i2pzip update stream.
    • _updateDevSU3

      private boolean _updateDevSU3
      True to follow the development stream.
    • _devSU3URL

      private String _devSU3URL
      The URL of the development stream.
    • PROP_NEWS_URL

      public static final String PROP_NEWS_URL
      Property for news URL.
      See Also:
    • DEFAULT_NEWS_URL_SU3

      public static final String DEFAULT_NEWS_URL_SU3
      Current default, i2pnews.i2p, run by echelon

      NOTE: If you change, also change in Android: app/src/main/java/net/i2p/android/apps/NewsFetcher.java.

      See Also:
    • PROP_REFRESH_FREQUENCY

      public static final String PROP_REFRESH_FREQUENCY
      Property for news refresh frequency.
      See Also:
    • DEFAULT_REFRESH_FREQ

      public static final long DEFAULT_REFRESH_FREQ
      Default refresh frequency (36 hours).
      See Also:
    • DEFAULT_REFRESH_FREQUENCY

      public static final String DEFAULT_REFRESH_FREQUENCY
      Default refresh frequency as String.
    • PROP_UPDATE_POLICY

      public static final String PROP_UPDATE_POLICY
      Property for update policy.
      See Also:
    • DEFAULT_UPDATE_POLICY

      public static final String DEFAULT_UPDATE_POLICY
      Default update policy.
      See Also:
    • PROP_SHOULD_PROXY

      public static final String PROP_SHOULD_PROXY
      Property for update through proxy.
      See Also:
    • DEFAULT_SHOULD_PROXY

      public static final boolean DEFAULT_SHOULD_PROXY
      Default for update through proxy.
      See Also:
    • PROP_SHOULD_PROXY_NEWS

      public static final String PROP_SHOULD_PROXY_NEWS
      Property for fetching news through proxy.
      See Also:
    • DEFAULT_SHOULD_PROXY_NEWS

      public static final boolean DEFAULT_SHOULD_PROXY_NEWS
      Default for fetching news through proxy.
      See Also:
    • PROP_PROXY_HOST

      public static final String PROP_PROXY_HOST
      Property for update proxy host.
      See Also:
    • DEFAULT_PROXY_HOST

      public static final String DEFAULT_PROXY_HOST
      Default proxy host.
      See Also:
    • PROP_PROXY_PORT

      public static final String PROP_PROXY_PORT
      Property for update proxy port.
      See Also:
    • DEFAULT_PROXY_PORT_INT

      public static final int DEFAULT_PROXY_PORT_INT
      Default proxy port as int.
      See Also:
    • DEFAULT_PROXY_PORT

      public static final String DEFAULT_PROXY_PORT
      Default proxy port as String.
    • DEFAULT_UPDATE_UNSIGNED

      public static final boolean DEFAULT_UPDATE_UNSIGNED
      Default false.
      See Also:
    • PROP_UPDATE_UNSIGNED

      public static final String PROP_UPDATE_UNSIGNED
      Property for unsigned update flag.
      See Also:
    • PROP_UPDATE_DISABLED

      public static final String PROP_UPDATE_DISABLED
      Default false - use for distros.
      See Also:
    • PROP_ZIP_URL

      public static final String PROP_ZIP_URL
      No default.
      See Also:
    • PROP_UPDATE_URL

      public static final String PROP_UPDATE_URL
      Property for update URL.
      See Also:
    • PROP_UPDATE_DEV_SU3

      public static final String PROP_UPDATE_DEV_SU3
      If true, offer development SU3 builds; default false.
      See Also:
    • PROP_DEV_SU3_URL

      public static final String PROP_DEV_SU3_URL
      If true, the development SU3 URL; no default.
      See Also:
    • DEFAULT_UPDATE_URL

      public static final String DEFAULT_UPDATE_URL
      These are only for .sud and .su2. Do NOT use this for .su3.
      See Also:
    • SU3_CERT_DIR

      private static final String SU3_CERT_DIR
      Directory holding the trusted SU3 signing certificates.
      See Also:
    • USE_SU3_UPDATE

      public static final boolean USE_SU3_UPDATE
      Only enabled if we have trusted public key certificates installed.
    • PROP_TRUSTED_KEYS

      public static final String PROP_TRUSTED_KEYS
      Property for trusted update keys.
      See Also:
  • Constructor Details

    • ConfigUpdateHandler

      public ConfigUpdateHandler()
      ConfigUpdateHandler default constructor.
  • Method Details

    • proxyPort

      public static int proxyPort(I2PAppContext ctx)
      Convenience method for updaters.
      Parameters:
      ctx - the context for retrieving configuration
      Returns:
      the configured value, else the registered HTTP proxy, else the default
    • processForm

      protected void processForm()
      Description copied from class: FormHandler
      Implement this to perform the final processing (in turn, adding formNotice and formError messages, etc)

      Will only be called if _action is non-null and the nonce is valid.

      Specified by:
      processForm in class FormHandler
    • setNewsURL

      public void setNewsURL(String url)
      Record the news URL to fetch.
      Parameters:
      url - the news URL
    • setRefreshFrequency

      public void setRefreshFrequency(String freq)
      Record the interval between update checks.
      Parameters:
      freq - the interval in milliseconds; unparseable input is ignored
    • setUpdateURL

      public void setUpdateURL(String url)
      Record the update URL to fetch.
      Parameters:
      url - the update URL
    • setUpdatePolicy

      public void setUpdatePolicy(String policy)
      Record the policy to apply when an update is offered.
      Parameters:
      policy - the update policy
    • setTrustedKeys

      public void setTrustedKeys(String keys)
      Record the signing keys accepted for update verification.
      Parameters:
      keys - the trusted keys
    • setUpdateThroughProxy

      public void setUpdateThroughProxy(String foo)
      Enable update proxying.
      Parameters:
      foo - ignored; this setter only ever turns the option on
    • setProxyHost

      public void setProxyHost(String host)
      Record the proxy host to fetch through.
      Parameters:
      host - the proxy host
    • setProxyPort

      public void setProxyPort(String port)
      Record the proxy port to fetch through.
      Parameters:
      port - the proxy port
    • setUpdateUnsigned

      public void setUpdateUnsigned(String foo)
      Allow updates to be installed without a signature.
      Parameters:
      foo - ignored; this setter only ever turns the option on
    • setZipURL

      public void setZipURL(String url)
      Record the zip download URL used for unsigned updates.
      Parameters:
      url - the zip URL to download
    • setNewsThroughProxy

      public void setNewsThroughProxy(String foo)
      Set whether to fetch news through proxy.
      Parameters:
      foo - ignored; the value only marks the setting as enabled
    • setUpdateDevSU3

      public void setUpdateDevSU3(String foo)
      Set whether to update development SU3 builds.
      Parameters:
      foo - ignored; the value only marks the setting as enabled
    • setDevSU3URL

      public void setDevSU3URL(String url)
      Set the development SU3 URL.
      Parameters:
      url - the development SU3 zip URL to download