Commit Graph

305 Commits

Author SHA1 Message Date
Girish Ramakrishnan
b86cfabd17 Do not allocate more than 4GB swap
Also resize existing swap file, if necessary. Note that if the user
allocates more than what we expect, we don't do anything.

Fixes #277
2017-03-24 16:03:30 -07:00
Johannes Zellner
543c9843ba Use df instead of fdisk
some disk types do not contain proper partition tables like on time4vps
the type is simfs. On those fdisk fails to access the partition table,
thus being unable to determine the size of the volume.
df does only return the real usable disk space by the user, thus we
lower the 20GB threshold to 18

Fixes #275
2017-03-22 14:23:59 +01:00
Johannes Zellner
103cb10cad Ignore upstream headers for security headers we set in nginx
Apps like nextcloud set their own security headers ending up with having
them set twice. I am not 100% sure if our headers should win or if we
should not inject headers with nginx if the upstream app sets them already.
This looks like the more permissive case where we simply enforce our
values, regardless what the apps sets.

This also fixes the nextcloud/owncloud security checks which were
failing because the header values were duplicated, which results in
string concatenation of values from same headers.
2017-03-21 14:18:39 +01:00
Girish Ramakrishnan
6a523606ca Revert "Bump version to Nginx IPv6 support."
This reverts commit 5555321cf5.
This reverts commit f087ebbee0.
This reverts commit d04f64d3d4.

Part of #264
2017-03-19 14:25:30 -07:00
Jonah Aragon
f087ebbee0 Add listen [::]:80; for IPv6 redirects. 2017-03-17 19:13:18 +00:00
Jonah Aragon
d04f64d3d4 Add IPv6 listen directives 2017-03-17 19:12:25 +00:00
Girish Ramakrishnan
ae0e4de93e No semicolons in bash code 2017-03-15 15:40:43 -07:00
Johannes Zellner
876ae822b2 Skip splash setup if cloudron domain was not yet setup
This is based on the existence of admin.conf nginx file.
The splash would create/overwrite that file, but it will depend on the
host.cert to be already created, which is only the case after domain
setup.
2017-03-14 10:58:24 +01:00
Girish Ramakrishnan
7e8757a78c grep quietly 2017-03-13 13:52:16 -07:00
Girish Ramakrishnan
3fdc10c523 Parse free and fdisk output with C locale
some vps providers seem to set a different locale by default.
Settings LC_ALL overrides all the other LC_*
2017-03-13 10:36:05 -07:00
Girish Ramakrishnan
81313d1c40 reduce nxdomain caching timeout
the other option is to use "/usr/sbin/unbound-control flush_negative"
on demand
2017-03-09 15:03:14 -08:00
Girish Ramakrishnan
1c36918e92 Done -> Almost done 2017-03-09 10:21:52 -08:00
Girish Ramakrishnan
4b3ef33989 Add some basic secure headers
Part of #249
2017-03-08 22:14:44 -08:00
Johannes Zellner
101a44affd Add authorized_keys.sh 2017-03-07 15:16:18 +01:00
Girish Ramakrishnan
9d52397bcc Move dhparam creation
Now that all cloudrons have the dhparams file, we can generate this
*after* restoring from backup and if required.
2017-03-01 15:25:20 -08:00
Girish Ramakrishnan
3a5000ab1d Detect loop support on linode correctly
We don't need any of the loop logic since it seems scaleway
also supports automatically this now
2017-02-15 15:40:19 -08:00
Girish Ramakrishnan
7f4f525551 dhparams.pem must be part of backup 2017-02-14 14:12:03 -08:00
Johannes Zellner
1d5465f21e Update the ssl ciphers and add dhparams.pem
Fixes #218
2017-02-13 00:28:22 +01:00
Girish Ramakrishnan
9e2850ffad setup: do not restart mysql unnecessarily 2017-02-08 07:53:55 -08:00
Girish Ramakrishnan
19c665d747 docker daemon is deprecated 2017-02-06 11:33:10 -08:00
Girish Ramakrishnan
cd31e12bec Do not includeSubdomains in HSTS
This prevents one from redirecting to some http-only subdomain.
For example, surfer in naked domain redirects to www subdomain
(which is on github pages...)
2017-02-02 00:05:56 -08:00
Girish Ramakrishnan
0cee6de476 Check if cloudron.conf file exists 2017-01-31 01:53:06 -08:00
Girish Ramakrishnan
7b547e7ae9 Revert scaleway specific overlay2 support
This reverts commit 16d65d3665.

Rainloop app breaks with overlay2
2017-01-30 15:43:42 -08:00
Girish Ramakrishnan
16d65d3665 Use overlay2 for scaleway
https://github.com/scaleway/image-ubuntu/issues/68
2017-01-30 14:01:29 -08:00
Girish Ramakrishnan
ccb340cf80 Use systemd drop in to configure docker
The built-in service files get overwritten by updates

Fixes #203
2017-01-30 12:41:07 -08:00
Girish Ramakrishnan
56b0f57e11 Move unbound systemd config to separate file 2017-01-30 12:39:19 -08:00
Girish Ramakrishnan
08ffa99c78 Use %s instead of %d
awk's %d behaves differently with mawk (scaleway) and gawk (do)

Fixes #200
2017-01-30 10:24:26 -08:00
Girish Ramakrishnan
ddf5c51737 Make it 90 instead 2017-01-26 15:45:07 -08:00
Girish Ramakrishnan
88fc7ca915 move the files and not the directory
... because box is a btrfs subvolume
2017-01-26 14:16:27 -08:00
Girish Ramakrishnan
ebd3a15140 always restart nginx 2017-01-25 12:04:52 -08:00
Girish Ramakrishnan
d93edc6375 box.service: start after nginx 2017-01-25 11:28:31 -08:00
Girish Ramakrishnan
f142d34f83 Move box data out of appdata volume
This lets us restore the box if the app volume becomes full

Fixes #186
2017-01-24 13:48:09 -08:00
Girish Ramakrishnan
357ca55dec remove unused var 2017-01-24 10:41:58 -08:00
Girish Ramakrishnan
d7a8731027 remove unused var 2017-01-24 10:41:38 -08:00
Girish Ramakrishnan
9117c7d141 Use $USER 2017-01-24 10:32:32 -08:00
Johannes Zellner
db8db430b9 Avoid warning from systemd by reloading the daemon after chaning journald config 2017-01-23 11:01:02 +01:00
Johannes Zellner
c0b2b1c26d Escape shell vars in the unbound unit file 2017-01-23 10:27:23 +01:00
Johannes Zellner
7da20e95e3 Use a proper systemd unit file for unbound
Part of #191
2017-01-23 10:14:20 +01:00
Girish Ramakrishnan
f30f90e6be Stop mail container before moving the dirs 2017-01-22 21:57:34 -08:00
Girish Ramakrishnan
7f05b48bd7 Revert "Migrate mail data after downloading restore data"
This reverts commit e7c399c36a.
2017-01-22 02:42:14 -08:00
Girish Ramakrishnan
e7c399c36a Migrate mail data after downloading restore data
This allows us to be backward compatible
2017-01-21 23:33:57 -08:00
Girish Ramakrishnan
d84666fb43 Move mail data out of box
This will help us with putting a size on box data

Mail container version is bumped because we want to recreate it

Part of #186
2017-01-20 20:22:08 -08:00
Girish Ramakrishnan
1eb33099af dkim directory is now automatically created in cloudron.js 2017-01-20 15:18:03 -08:00
Johannes Zellner
6eafac2cad Do not rely on fdisk's human readable unit output
Using the bytes output will fix an issue where the disk size is reported
either as terrabyte or also megabyte.
So far we disallowed 1TB disks but allowed 20MB disks.
2017-01-19 13:53:50 +01:00
Girish Ramakrishnan
804947f039 use dir mount instead of file mount
file mounting is fraught with problems wrt change notifications.

first, we must be carefule that the inode does not change.

second, changes outside container do not result in fs events inside the container.
haraka cache settings files and relies on fs events. So, even
though the file gets updated inside the container, haraka doesn't
see it.

https://github.com/docker/docker/issues/15793
2017-01-17 23:59:23 -08:00
Girish Ramakrishnan
d45927cdf4 unbound: listen on 0.0.0.0 2017-01-13 15:22:54 -08:00
Girish Ramakrishnan
055e41ac90 Make unbound reply on cloudron network
Because of the docker upgrade, dnsbl queries are failing again
since we are not using the unbound server from the containers.

For some reason, docker cannot query 127.0.0.1 (https://github.com/docker/docker/issues/14627).

Make unbound listed on the cloudron network and let docker proxy
DNS calls to unbound (docker always use the embedded DNS server
when using UDN).

See also #130
2017-01-12 19:28:23 -08:00
Johannes Zellner
1c9f2495e3 Show the detailed backup progress during update
Fixes #157
2017-01-12 16:00:34 +01:00
Girish Ramakrishnan
b4477d26b7 Reload the docker service file 2017-01-11 15:40:16 -08:00
Girish Ramakrishnan
ce0afb3d80 Explicitly specify the storage driver as devicemapper
For reasons unknown, the images build by the buildbot (which currently
uses btrfs), does not work with devicemapper.

Existing cloudrons with aufs will not be affected because docker will
just ignore it.

devmapper: Base device already exists and has filesystem xfs on it. User specified filesystem will be ignored.

Existing AUFS users can move to devicemapper either by restoring to
a new cloudron (recommended) OR
* systemctl stop box
* systemctl stop docker
* rm -rf /var/lib/docker
* Edit /home/yellowtent/data/INFRA_VERSION. Change the "version" field to "1"
* systemctl start docker
* systemctl start box # this will download images all over

Fixes #182
2017-01-11 14:53:11 -08:00