25 Commits

Author SHA1 Message Date
nachoparker
36c1f465fc letsencrypt: disable also ncp web certs if OFF
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-21 12:47:38 -06:00
nachoparker
74ed53f2de letsencrypt: hardcode cert name to avoid -0001 paths
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-18 08:01:49 -06:00
nachoparker
35a3a54845 letsencrypt: favor most recent cert if there are many
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-14 11:08:05 -06:00
nachoparker
cc3f3366f1 letsencrypt: keep original cert name
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-10-11 15:55:33 -06:00
Tobias Knöppler
de104a5da8 Make templating safer and more verbose (#1343)
* letsencrypt: fix active status check

Signed-off-by: nachoparker <nacho@ownyourbits.com>

* letsencrypt: take into account duplicate domains ending in -0001

Signed-off-by: nachoparker <nacho@ownyourbits.com>

* letsencrypt: fix renewal with httpsonly enabled

Signed-off-by: nachoparker <nacho@ownyourbits.com>

* fix inverted template logic for docker

Signed-off-by: nachoparker <nacho@ownyourbits.com>

* library.sh: Move templating to separate function

- Backup old file before templating (and restore on failure)
- Use stderr in the template for debug/info output

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* library.sh: Fix syntax error

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* library.sh: Only fallback to default config if explicitly allowed

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Set cert-name

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* nextcloud.conf.sh: Use certificate named ncp-nextcloud if available

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Support multiple, comma separated domains in field "OTHER_DOMAIN"

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* nextcloud.conf.sh: Fix path resolution for certificates

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Improve warning about max trusted domains reached

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Fix max trusted domains check

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Fix splitting of domain string by comma

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Fix splitting of domain string to array

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* adjustments for docker/lxc

Signed-off-by: nachoparker <nacho@ownyourbits.com>

Co-authored-by: nachoparker <nacho@ownyourbits.com>
2021-10-07 13:29:00 -06:00
nachoparker
26edf1f7b0 build: add LXC/LXD support
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-30 22:48:19 -06:00
nachoparker
1046a2413b letsencrypt: fix active status check
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-22 00:48:56 -06:00
nachoparker
f3e3b01ab5 letsencrypt: improve active status check
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-20 09:59:35 -06:00
nachoparker
c10d4bd8fb upgrade to NC21.0.4
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-09-12 16:55:46 -06:00
nachoparker
b8c14093ad letsencrypt: ability to disable it and roll back to self-signed certificates
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-08-09 17:25:55 -06:00
Tobias K
e49203249b nextcloud.conf.sh: Allow any user name for metrics endpoint and fix docker build
Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

nextcloud.conf.sh: Fix apps overwriting each other during templating

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

nextcloud.conf.sh: Make --default mode failsafe (don't expect apps to be installed)

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

nextcloud.conf.sh: Allow any user name for metrics endpoint

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

nextcloudpi/Dockerfile: Copy the templates directory to the container

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

lamp/Dockerfile: Copy the templates directory to the container

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

install.sh: Ensure templates are available before executing nc-nextcloud.sh

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-08-09 17:16:35 -06:00
Tobias Knöppler
b8a990e264
Add ncp-app for prometheus (system) metrics
* metrics.{sh,cfg}: Implement ncp-app for prometheus (system) metrics

letsencrypts.sh, nc-nextcloud.sh, nextcloud.conf.sh: Introduce templating/generator concept to allow multiple ncp apps to edit the same file without conflicts

library.sh: Add convenience function find_app_param

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Remove commented code

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.cfg: Deactivate by default

- Add title, description and remove TODO entries

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.sh: Restart apache after enabling proxy_http

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* update.sh: Update ncp-templates directory during updates

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* update.sh: Copy ncp-templates directory, not just its content

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.sh,update.sh: Disable metrics in docker for now

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.sh: Disable prometheus-node-exporter via systemctl

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.sh: Move apache mod configuration to updates

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.cfg: Remove invalid parameter type

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.sh: Create /etc/default/prometheus-node-exporter via heredoc

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* nextcloud.conf.sh: Prevent template parsing error if metrics.sh is disabled (i.e. on docker)

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* metrics.cfg: Add info directing users to my preconfigured ncp dashboard

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* Various fixes

- metrics.sh: Fix is_active function always returning 1
- metrics.sh: Fix apache2 reload potentially interrupting web ui
- nc-nextcloud.sh: exit if nextcloud.conf templating fails
- various readability and code style improvements

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* letsencrypt.sh: Use consistent return codes in tmpl_letsencrypt_domain

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* nextcloud.conf.sh: Remove obsolete return code escape

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* nextcloud.conf.sh: Ensure that the snakeoil self-signed cert exists before enabling it

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>

* updates/1.36.4.sh: Reload apache in the background instead of restarting it blockingly

Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
2021-08-02 15:12:56 -06:00
nachoparker
20bd14fe7b wizard: fix letsencrypt empty email
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2021-01-17 20:02:26 -07:00
nachoparker
0c538aef3c add notify_admin functionality
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2020-02-04 20:29:03 -07:00
rababerladuseladim
310877f61c Letsencrypt: support second domain (#1025) 2019-11-30 08:47:14 -07:00
nachoparker
5924131f6f fail2ban: fix missing ufw filter
Signed-off-by: nachoparker <nacho@ownyourbits.com>
2019-06-01 11:17:56 -06:00
nachoparker
01cd4215a5 letsencrypt: force renewal by default 2019-04-29 19:59:02 -06:00
nachoparker
b3c7d1375e letsencrypt: switch to apt version 2019-04-29 19:57:40 -06:00
nachoparker
5af854b0d6 letsencrypt: dont return error if notif fails 2019-04-01 18:06:16 -06:00
nachoparker
7e40a70523 letsencrypt: make sure deploy dir exists 2019-03-26 11:46:00 -06:00
nachoparker
38799fd537 letsencrypt: rework notification 2019-03-23 10:27:54 -06:00
nachoparker
9a36ceb422 letsencrypt: use the latest github version 2019-01-27 09:18:07 -07:00
nachoparker
9de1f51a3d build: stop at any error 2019-01-09 21:56:42 -07:00
nachoparker
3c135c22a8 ncp-app tweaks 2019-01-05 23:30:48 -07:00
nachoparker
d5c1f0058b rework to use JSON based cfg and more 2019-01-04 18:14:52 -07:00