Commit Graph

105 Commits

Author SHA1 Message Date
Girish Ramakrishnan
0db4387013 Ensure security updates are enabled
Fixes #346
2017-07-28 20:03:55 -07:00
Girish Ramakrishnan
5697bcf43f Update to node 6.11.1
Fixes a DDoS issue in node

https://nodejs.org/en/blog/vulnerability/july-2017-security-releases/
2017-07-13 09:02:32 -05:00
Girish Ramakrishnan
4881d090f0 disable dnsmasq on ovh 2017-05-16 16:33:43 -07:00
Girish Ramakrishnan
1e90ec95d3 Add -y flag to apt install 2017-04-22 10:23:48 -07:00
Girish Ramakrishnan
cf701b8eb0 Use apt install instead so that deps are installed 2017-04-20 10:37:46 -07:00
Girish Ramakrishnan
9b4e81b476 Fix curl usage 2017-04-20 10:19:00 -07:00
Girish Ramakrishnan
b58fe9edd6 Update docker to CE 17.03
https://docs.docker.com/engine/installation/linux/ubuntu/#install-from-a-package
has helpful instructions.

This should also help use userns at some point (https://github.com/moby/moby/pull/25540)

Fixes #303
2017-04-18 12:22:32 -07:00
Johannes Zellner
b320e15ea7 No need to install btrfs-tools in the base image 2017-04-04 12:34:55 +02:00
Girish Ramakrishnan
e535ffa778 Disable bind9 as it conflicts with unbound
part of #194
2017-03-25 17:36:10 -07:00
Girish Ramakrishnan
4cfbed8273 Use inline docker pgp key
The one from keyserver keeps failing sporadically

https://github.com/docker/docker/issues/13555
https://github.com/docker/docker/issues/20022
http://askubuntu.com/questions/720517/key-server-times-out-while-installing-docker-on-ubuntu-14-04
2017-03-15 18:04:44 -07:00
Girish Ramakrishnan
19c665d747 docker daemon is deprecated 2017-02-06 11:33:10 -08:00
Girish Ramakrishnan
cb09086ae8 Add dmsetup required by docker 2017-02-06 11:32:08 -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
95d7a991dc install grub2 2017-01-30 14:01:33 -08:00
Girish Ramakrishnan
dc309afbbd Add --allow-downgrades
The following packages will be DOWNGRADED:
  docker-engine
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
E: Packages were downgraded and -y was used without --allow-downgrades.
2017-01-30 14:01:32 -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
0be7679619 Hold the docker package
One idea was to use docker binary packages. However, docker binaries
are statically linked and are incompatible with devicemapper.

See https://github.com/docker/docker/issues/14035 for more info.

Holding will let the user turn on automatic updates for non-security
packages as well.

Fixes #183
2017-01-12 01:09:19 -08:00
Girish Ramakrishnan
bbef6c2bc2 Fix docker storage driver detection
When docker is not passed the --storage-driver option, it tries to
auto detect the storage driver. Roughly:
1. If existing storage paths like /var/lib/docker/aufs exist, it will
   choose that driver.

2. It has a priority list of drivers to scan in order (driver.go)
   As it stands the ordering is aufs, btrfs and then devicemapper.

3. Docker will attempt to "init" each driver. aufs, for example,
   tests for insmod'ing aufs and also looks into /proc/filesystems.

The fact that we installed aufs-tools and linux drivers (for aufs
driver) was a programming error since we want docker to use devicemapper.

However, what is curious is why docker still ended up choosing devicemapper
despite having all aufs requirements (as we do not pass --storage-driver explicitly).

The answer is that "apt-get install aufs-tool linux-image-* docker-engine"
can install packages in any order! This means there is a race on how docker
chooses the storage engine. In most cases, since linux-image-* is a big package,
docker gets to install first and ends up using devicemapper since aufs module is not found yet.
For some people, linux-image-* possibly installs first and thus docker
chooses aufs!

Mystery solved.

Part of #183
2017-01-12 01:08:22 -08:00
Girish Ramakrishnan
be59267747 Enable unattended upgrades
This is usually installed and enabled by default

https://help.ubuntu.com/community/AutomaticSecurityUpdates

Note that automatic reboot is not enabled. Not clear if we should be.

Part of #183
2017-01-11 22:36:51 -08:00
Girish Ramakrishnan
588bb2df2f Pull docker images in initialize script
This allows us to move platform.initialize to whenever the domain
is setup. Thus allowing box code to startup faster the first time
around.
2017-01-09 09:22:23 -08:00
Girish Ramakrishnan
503e3d6ff2 Add trailing slash 2016-12-29 14:36:19 -08:00
Girish Ramakrishnan
b1854f82f2 prettify init base image script 2016-12-28 08:59:25 -08:00
Girish Ramakrishnan
7e3a54ff1b force the link for idempotency 2016-12-28 08:59:15 -08:00
Girish Ramakrishnan
61789e3fda Use the installer.sh from the source tarball
This redesigns how update works. installer.sh now rebuild the package,
stops the old code and starts the new code. Importantly, it does not
download the new package, this is left to the caller. cloudron-setup
downloads the code and calls installer.sh of the downloaded code.
Same goes for updater.sh. This means that installer.sh itself is now
easily updatable.

Part of #152
2016-12-28 08:59:07 -08:00
Girish Ramakrishnan
fae0ba5678 Decouple installer from the base image script
This means that the base image does not have the installer anymore
and needs to be copied over.

Part of #152
2016-12-28 08:58:10 -08:00
Girish Ramakrishnan
691f6c7c5c Use docker 1.12.5
Docker uses an embedded DNS server (127.0.0.11) for user defined networks (UDN).

With the latest releases of docker, specifying 127.0.0.1 as --dns makes the
containers resolve 127.0.0.1 _inside_ the container's networking namespace
(not sure how it worked before this).

The next idea was to only specify --dns-search=. but this does not work.
This makes docker setup the containers to use 127.0.0.1 (or 127.0.0.11 for UDN).
In my mind, the UDN case should work but doesn't (not sure why).

So, the solution is to simply go with no --dns or --dns-search. Sadly,
setting dns-search just at container level does not work either :/ Strangely,

    docker run --network=cloudron --dns-search=. appimage  # does not work

    docker run --network=cloudron appimage # works if you manually remove search from /etc/resolv.conf

So clearly, something inside docker triggers when one of the dns* options is set.

This means that #130 has to be fixed at app level (For Go, this means to use the cgo resolver).
2016-12-28 08:57:48 -08:00
Girish Ramakrishnan
f5eb5d545f use node 6.9.2 LTS 2016-12-28 08:57:43 -08:00
Girish Ramakrishnan
103019984b Move firewall setup to container.sh
Part of #152
2016-12-28 08:57:20 -08:00
Girish Ramakrishnan
01126aaeea move ssh configuration to container.sh
Note: appstore requires to be fixed to start the provisioning on port 22

Part of #152
2016-12-28 08:57:13 -08:00
Girish Ramakrishnan
a6ab8ff02f Mount the btrfs user home data in container.sh
This allows it to be configurable easily at some point

Part of #152
2016-12-28 08:56:55 -08:00
Girish Ramakrishnan
b89886a945 Move systemd service creation scripts to container.sh
Part of #152
2016-12-28 08:56:46 -08:00
Girish Ramakrishnan
d12b71f69c move journald configuration to container.sh
Part of #152
2016-12-28 08:56:06 -08:00
Girish Ramakrishnan
53c2ed3c82 configure time in container.sh 2016-12-28 08:55:56 -08:00
Girish Ramakrishnan
148c8e6250 Give user access to system logs in container.sh
Part of #152
2016-12-28 08:55:43 -08:00
Girish Ramakrishnan
c5ca64af50 cloudron-version is cloudron-setup specific 2016-12-28 08:46:40 -08:00
Girish Ramakrishnan
af1e83f12a Remove DO specific grub cmd line
The new DO images have a different label causing DO images to not boot
    root@ubuntu-2gb-sfo1-01:~# e2label /dev/vda1
    cloudimg-rootfs

net.ifnames=0 is used get unpredictable names as per
https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/.
Not sure why we want that.

Not sure about notsc and clocksource.

This change also preserves any existing cmdline
2016-12-22 12:34:23 -08:00
Girish Ramakrishnan
0ec55b0cd4 Unset dns search
This makes sure that the host dns search is not carried over to the
containers

Fixes #130
2016-12-15 14:13:39 -08:00
Johannes Zellner
805125b17f Only reload sshd for caas 2016-12-06 18:41:06 +01:00
Johannes Zellner
0baf092ba4 Ensure we have iptables installed
Fixes #122
2016-12-02 17:13:47 +01:00
Johannes Zellner
7c27f01ab8 Do not automatically enable root ssh access
With our current self-hosting installation process, this
is not longer required. It should be the users responsibility
to gain access to his server. For Cloudron managed hosting,
this does not apply as we always create servers with ssh keys.

Also do not tinker with the sshd configs. The user may choose
to use access via password.

Fixes #104
2016-11-17 16:28:32 +01:00
Girish Ramakrishnan
cde7599f87 Choose default confs
Fixes #92
2016-11-08 15:36:48 +05:30
Johannes
c9e7308f49 Attempt to set kernel params for generic provider
This is useful for running ubuntu on hardware or in virtualbox
2016-11-08 09:35:18 +01:00
Johannes
4668e3a771 Rename box-setup to cloudron-system-setup
This shell script and the associated systemd service
are hooks to setup the system like swap and volumes
It is part of the base image
2016-11-06 14:30:26 +01:00
Johannes
342dd26645 No need to run npm install for the installer anymore 2016-11-06 14:29:41 +01:00
Johannes
8e03295362 Remove the cloudron-installer systemd unit file 2016-11-06 14:29:41 +01:00
Girish Ramakrishnan
7672bc0c40 Add -y to update 2016-10-26 11:07:36 -07:00
Johannes
bd163327be Do not disable nginx service 2016-10-25 13:57:25 +02:00
Johannes
6660ef2ff3 Let the cloudron-version tool resolve the version string 2016-10-25 13:13:04 +02:00
Johannes
dd9c594387 Install cloudron-version tool 2016-10-25 11:27:04 +02:00