Skip to content
  • Valentin Benozillo's avatar
    software/languagetool: add software release and integration tests · 365c312c
    Valentin Benozillo authored
    
    
    Add the LanguageTool grammar checker as a software release. The
    component downloads the official standalone distribution. Version 6.8
    comes from Maven Central with a pinned MD5 checksum and the top-level
    directory stripped. Maven Central accepts the Python user agent;
    languagetool.org answers with HTTP 403.
    
    The LanguageTool HTTP server has no option to select the bind address,
    and its --public option binds all network interfaces of the machine.
    Add the SlapOSHTTPServer class. The class starts the server on the
    address from the languagetool.host system property. The class stays in
    the org.languagetool.server package because HTTPServerConfig(String[])
    and DatabaseAccess.init() are package-private. Compile the class with
    the new java-jdk-temurin-21 component. The existing component/java-jdk
    is OpenJDK 12 and cannot read Java 17 class files.
    
    The server listens only on the IPv6 address of the instance partition
    on port 8081. The instance starts the server through a wrapper with
    -Xms and -Xmx. Standard output and standard error go to
    var/log/languagetool.log. Add a pidfile and a logrotate entry. The
    logrotate entry sends USR1 to the wrapper, which reopens the log file;
    the JVM ignores the forwarded USR1.
    
    Rename the instance-parameter section to slap-configuration and use the
    serialised slapconfiguration recipe. The monitor template reads the
    partition parameters from this section. Publish monitor-base-url and
    monitor-setup-url with the monitor-publish section.
    
    Add a check_url_available promise for /v2/languages. Add an integration
    test under software/languagetool/test. The test checks the language
    list, a grammar correction and that the server listens only on the
    partition address. Register the test in software/slapos-sr-testing.
    
    Co-Authored-By: default avatarAI agent <ai-agent@noreply>
    365c312c