{"id":16752915,"url":"https://github.com/bsutton/tomcat-with-ssl-snap","last_synced_at":"2026-02-28T13:02:54.539Z","repository":{"id":141378473,"uuid":"122141067","full_name":"bsutton/tomcat-with-ssl-snap","owner":"bsutton","description":"A snap (snapcraft) install for Apache Tomcat with SSL activated and managed by Certbot.","archived":false,"fork":false,"pushed_at":"2018-09-12T03:59:12.000Z","size":44,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T00:04:26.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bsutton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-20T01:05:43.000Z","updated_at":"2021-03-09T08:17:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"c69dff48-e72a-4469-bf1d-178877127381","html_url":"https://github.com/bsutton/tomcat-with-ssl-snap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsutton%2Ftomcat-with-ssl-snap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsutton%2Ftomcat-with-ssl-snap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsutton%2Ftomcat-with-ssl-snap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsutton%2Ftomcat-with-ssl-snap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsutton","download_url":"https://codeload.github.com/bsutton/tomcat-with-ssl-snap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248245540,"owners_count":21071510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T02:48:37.458Z","updated_at":"2026-02-28T13:02:49.485Z","avatar_url":"https://github.com/bsutton.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tomcat-with-ssl snap part\n\nTomcat-with-ssl is a remote part that you can use in your own snap to deploy an Apache Tomcat server, your web app and an SSL certificate.\n\nThis remote part takes what is perhaps annd an SSL certificate.\n\n unusual path, in that it has Tomcat expose port 443 directly rather than requiring a web server such as Apache.\n\nThe part is designed to facilitate deploying a SINGLE webapp under Tomcat.\n\nThis part is intended to included in your own snap using the 'after:' clause;\n\nThe end result is a secure web server that takes two lines to install and configure:\n\nsudo snap install yourwebapp\nsudo yourwebapp.getcert \u003cyouremail\u003e \u003cfqdn\u003e\n\nYou can start/stop the tomcat service via:\nsudo snap start yourwebapp\nsudo snap stop yourwebapp\n\nFor full documentation see:\n\nhttps://forum.snapcraft.io/t/remote-part-tomcat-with-ssl/4264\n\nThe default build is based on tomcat 8.5 but you can easily modify the version.\n\nNote: snaps MUST be built on ubuntu 16.04 (or using lxd with a 16.04 image).\n\n# Note: currently if a certificate renewal occurs tomcat will be restarted without warning.\n\n# Credit where credit due\nI based my work on the snap part created by:\nMichael Hall \u003cmhall119@ubuntu.com\u003e\nhttps://github.com/mhall119/tomcat-snap-part.git\n\n#Lets Encrypt\nThe part uses ‘certbot’ from Lets Encrypt to obtain a certificate and renew that certificate as required.\n\nOne current weakness with this implementation is that it checks for an expiring certificate every 15 minutes. When your certificate needs to be renewed, it will renew it immediately AND RESTART Tomcat. This is likely to be problematic for a serious webapp as random restarts are usually not welcome. I will look at improving this in a later release.\n\n# How to use this part\nYou would normally use this snap part from within your own snap \n\n    name: orion-monitor # you probably want to 'snapcraft register \u003cname\u003e'\n    version: '0.1' \n    summary: A java web app.\n    description: |\n      My web app does good things.\n      \n    grade: devel # must be 'stable' to release into candidate/stable channels\n    confinement: devmode # use 'strict' once you have the right plugs and slots\n  \n    apps:\n      tomcat:\n        command: tomcat-launch\n        daemon: simple\n        plugs: [network, network-bind]\n        \n         # used to ran the certbot renewal process.\n      cron:\n        command: cron\n        daemon: simple\n        plugs: [network, network-bind]\n\n      # Used to obtain a certificate post install\n      getcert:\n        command: getcert\n        plugs: [network, network-bind]\n  \n    parts:\n      my-webapp:\n        plugin: maven  # assuming you use maven to build your java code.\n        source: git@github.org:yourusername/yourwebapp.git\n        maven-options:\n          [-DskipTests=true]\n        organize:\n          # rename the generated war so its available from the / rather than requiring a context name\n          war/irrigation-1.0-SNAPSHOT.war : webapps/ROOT.war\n        after: [tomcat-with-ssl]\n\n\n# installing\nTo install your snap\n    \n    sudo snap install \u003cyour snap\u003e\n  \nTomcat will start on port 8080. \n\n# obtain a certificate\n\nYou now need to obtain a certificate:\nRun:\n\n    \u003cyoursnap\u003e.getcert \u003cyour email address\u003e \u003cfqdn\u003e true\n  \nTrue is the default for the final parameter so can be left off.\n\n# use a staging certificate during testing\nRunning getcert obtains a Lets Encrypt certificate.\nBy default it will get a live production certificate.\n\nDuring testing of your app installation process you may want to run with a Lets Encrypt 'Staging' certificate\nas Lets Encrypt has a daily request limit on live certificates (of around five).\n\nTo use a staging certificate add 'false' to the end of the line:\n\n    \u003cyoursnap\u003e.getcert \u003cyour email address\u003e \u003cfqdn\u003e false\n  \n# Certbot\ngetcert uses Lets Encrypts cert bot to obtain the certificates:\n\nCertbot logs to: \n\n    /root/snap/\u003cyoursnap\u003e/current/letsencrypt/logs/letsencrypt.log\n  \n# certificate renewal\nThe snap installs its own 'cron' process which runs every fifteen minutes to check for an expired certificate.\n\nIf the renewal cron detects an expiry certificate it will automatically renew it.\nWhen it renews the certificate it will restart tomcat so it picks up the new certificate.\n\nCurrently this process can trigger at ANY time during the day!\n\nThe cron process logs to:\n\n    /root/snap/\u003cyoursnap\u003e/current/cron/renew.log\n  \n# Tomcat\n\nYou can start/stop/restart tomcat via:\n\n    sudo snap start|stop|restart \u003cyoursnap\u003e.tomcat\n  \n## Tomcat Logs\n\nTomcat logs are contained within the snap and can be found at:\n\n    /var/snap/\u003cyoursnap\u003e/current/logs\n\n\n\ntouched.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsutton%2Ftomcat-with-ssl-snap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsutton%2Ftomcat-with-ssl-snap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsutton%2Ftomcat-with-ssl-snap/lists"}