Commit Graph

740 Commits

Author SHA1 Message Date
Johannes Zellner be384a6f03 Generate self signed certs based on hostname during bootstrap 2014-07-31 11:15:01 -07:00
Johannes Zellner e06227c52d Temporarily disable certificate retrieval from appstore 2014-07-31 10:09:15 -07:00
Johannes Zellner 696f95e0d7 move most settings from yellowtent.conf to the settingsdb 2014-07-31 09:31:28 -07:00
Johannes Zellner 3919bce140 Ignore known hosts warnings for creating base images 2014-07-31 09:31:03 -07:00
Johannes Zellner f92ca8bb03 Move bootstrap script to box
Instead of executing the bootstrap script via ssh,
we now run it once the box boots the first time.
It will update the repo and run the box code, which
needs to contact the appstore in order to get provisioned.
2014-07-31 08:16:35 -07:00
Johannes Zellner 4ef5296cb8 Add initial provisioning route
This will replace the ssh provisioning
and simply sets token, appstore details, and fqdn
It will succeed only once.
2014-07-31 08:13:15 -07:00
Girish Ramakrishnan 297cc122b3 Show naked domain app list as a combo box
Refs #40
2014-07-31 03:04:30 -07:00
Girish Ramakrishnan 5bf88117ae Remove naked domain config on app uninstall
Refs #40
2014-07-31 03:04:08 -07:00
Girish Ramakrishnan dcac24fae5 Parse/Stringify manifest in db code
We store the manifest itself as a string in the database. Everywhere
else in code, it is just a js object.
2014-07-30 23:06:59 -07:00
Girish Ramakrishnan 033dade88b Refresh app status periodically 2014-07-30 22:09:58 -07:00
Girish Ramakrishnan 3f2b45279b Redirect to myapps on app install 2014-07-30 21:57:51 -07:00
Girish Ramakrishnan 1170b0f95f Domain argument is not required 2014-07-30 21:04:03 -07:00
Johannes Zellner dce7a49eb7 Only add user to docker group after installing docker 2014-07-30 17:26:52 -07:00
Girish Ramakrishnan e38a544ef7 Use hyphen based subdomains for apps
Instead of
    appname.username.cloudron.us
we now use
    appname-username.cloudron.us

This allows us to get a wildcard certificate for cloudron.us and the
ssl stuff will work.

The motivation for appname-username instead of username-appname is primarily
UI at this point. We can show a suffix easily on the right side of a line edit.

Fixes #49
2014-07-30 13:52:47 -07:00
Girish Ramakrishnan 5c47eb2d7c Validate app subdomain 2014-07-30 10:10:24 -07:00
Johannes Zellner afda56bea5 Send heartbeat for now only every hour 2014-07-10 22:52:12 -07:00
Johannes Zellner 3dcd938951 Disable nginx init scripts
nginx is handled via supervisor
2014-07-10 22:51:36 -07:00
Johannes Zellner b84f81feb4 Also escape the eval backticks 2014-07-09 13:26:16 -07:00
Johannes Zellner 9aefeaa9fc Escape the shell variables for the init script 2014-07-09 13:13:16 -07:00
Johannes Zellner 45dec6e9df Add convenience script to produce a base image 2014-07-09 11:12:20 -07:00
Johannes Zellner 3437474837 Make the announce init script retry until it succeeds 2014-07-09 10:59:05 -07:00
Johannes Zellner 933d3381b6 Actually send the hostname of the newly created droplet 2014-07-07 10:26:26 -07:00
Johannes Zellner acb6bf12ca Fix typo in base image creation script 2014-07-07 08:10:56 -07:00
Johannes Zellner 171c8c2453 Echo all commands during base image creation 2014-07-07 08:09:22 -07:00
Johannes Zellner 9090a91c14 Enable the init script for bootstrapping 2014-07-03 17:45:49 -07:00
Johannes Zellner ae1f708213 Set default FQDN to os.hostname() 2014-07-03 16:15:49 -07:00
Johannes Zellner 5a6c09b899 Create a base image creation script
As this script is part of the box repo, it is actually
not intended to be run from here, but we need to store it
somewhere for now. The idea is to copy it to a pristine
ubuntu droplet, run it and then create a new base image for
cloudrons off of that droplet.
2014-07-03 16:10:41 -07:00
Girish Ramakrishnan 19b5342af9 Update gitignore 2014-07-02 11:38:48 -07:00
Girish Ramakrishnan daf9d17274 Better debug messages 2014-07-02 11:37:19 -07:00
Girish Ramakrishnan 0ff31a6b2c Refactor uninstall into async.series
async really needs a 'on error continue anyway'.

https://github.com/caolan/async/issues/549
2014-07-02 09:47:11 -07:00
Girish Ramakrishnan 1a8322753b Skip subdomain unregister for dev 2014-07-01 22:14:32 -07:00
Girish Ramakrishnan 3b484dbe51 Reload nginx for config changes instead of restarting
Restarting nginx means that existing connections get dropped. Supervisor
does not support sending arbitrary signals to processes, so we have to
do this the hard way.

Since nginx runs as root, we need a helper sudoers script.

http://stackoverflow.com/questions/13632399/sending-general-signal-to-child-process-of-supervisord
https://www.ruby-forum.com/topic/917257
https://github.com/Supervisor/supervisor/issues/53
https://github.com/Supervisor/supervisor/issues/179
2014-07-01 21:45:36 -07:00
Girish Ramakrishnan 8370356f5d Do not start app if installation failed 2014-07-01 21:45:36 -07:00
Girish Ramakrishnan 3aebd93376 Set NODE_TLS_REJECT_UNAUTHORIZED only for apptask process
apptask module is currently used for setting up naked domain as well
by the main server code.
2014-07-01 20:31:50 -07:00
Girish Ramakrishnan 4e9195c457 better error message 2014-07-01 20:30:26 -07:00
Girish Ramakrishnan 3458f0f068 Use fqdn instead of hostname to generate nginx configs
This change makes it clear that we are really after the fqdn and not the hostname.
The code has been working only because Digital Ocean sets the hostname
to be the FQDN.

What I learnt about hostnames
-----------------------------
The kernel has get/sethostname() and get/setdomainname() system calls.
There is restriction on what can be set as the hostname. init scripts
usually set the contents of /etc/hostname. How hostname is setup depends
on the distribution - it could be the simple name OR the fqdn. CentOS
for example puts the FQDN and ubuntu puts the simple name.

DigitalOcean puts the name of the box in /etc/hostname. So far this has
worked in our favor because os.hostname() which uses gethostname() gave
us the FQDN.

Docker sets only the simple name in /etc/hostname but sets up the
OS host/domain name correctly. This mean os.hostname() does not provide
the FQDN in docker. Altering it is not possible because it requires the
the SYS_ADMIN caps which container don't have (unless --priveliged).

Also, hostname -f first does gethostname(), then does a DNS lookup
using getaddrinfo() or the deprecated getaddressbyname(). Using that IP,
it does a reverse lookup.

The DNS system itself using nsswitch.conf to determine look up order.
The first entry in /etc/hosts file is taken as the domain entry for
reverse lookups.
2014-07-01 20:07:46 -07:00
Johannes Zellner ca262a77de Login user automatically when he creates an admin 2014-06-29 23:20:01 -07:00
Girish Ramakrishnan 21a47ac825 Skip subdomain registration during dev 2014-06-29 18:04:40 -07:00
Johannes Zellner 5ba4f098bb Fixup url in appstatus.html to point to admin 2014-06-29 15:57:08 -07:00
Johannes Zellner 879376d112 Only allow Bearer login for domain and apps routes 2014-06-29 15:21:26 -07:00
Johannes Zellner 6b65bbe969 Do not include bootstrap angular components in appstatus.html 2014-06-29 15:06:47 -07:00
Johannes Zellner e6e6c631b4 Make sure we server appstatus.html correctly when apps are installing 2014-06-29 13:25:02 -07:00
Johannes Zellner 9497417d72 Show myapps as a default route 2014-06-29 12:18:23 -07:00
Johannes Zellner 1729ed5b9c Only allow bearer tokens for /api/v1/user/token
This avoids that the browser is showing a Basic login
dialog if Bearer token is invalid
2014-06-29 12:17:04 -07:00
Johannes Zellner 19980747df Add bootstrap to appstatus.html 2014-06-29 11:26:01 -07:00
Johannes Zellner eea0dcc3f0 Cleanup settings view 2014-06-29 11:21:00 -07:00
Johannes Zellner 84c659a58a Hide User and Volume management 2014-06-29 11:16:11 -07:00
Johannes Zellner 0bc170a27c Remove unused login view and controller 2014-06-29 11:14:07 -07:00
Johannes Zellner 78b1afb45a Use login_callback for oauth login 2014-06-29 11:12:24 -07:00
Girish Ramakrishnan 333fe0e1b8 webadmin: Add Client.getApps and Client.removeApp 2014-06-28 23:30:34 -07:00