From f810358687144fd948651a98e79b721fdfd158dc Mon Sep 17 00:00:00 2001 From: Eric Hanson Date: Tue, 29 Jan 2019 00:33:58 +0000 Subject: [PATCH] remove Docker support (until, or if ever, we convert to docker-compose) --- Dockerfile | 31 ----------- README.md | 114 ++++------------------------------------ docker/supervisord.conf | 34 ------------ docs/quickstart.md | 38 +++----------- install.sh | 26 ++++----- 5 files changed, 25 insertions(+), 218 deletions(-) delete mode 100644 Dockerfile delete mode 100644 docker/supervisord.conf diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 1e9a6a4a..00000000 --- a/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM ubuntu:latest -MAINTAINER Eric Hanson - -# to build: -# docker build -t aquametalabs/aquameta . -# -# to run: -# docker run -dit -p 80:80 -p 5432:5432 --privileged aquametalabs/aquameta -# ^uwsgi ^postgres ^fuse -# -# access PostgreSQL (password 'postgres') with: -# psql -h localhost -p 5432 aquameta -# -# access the ide by browsing to port 80 of the host machine. - -ENV REFRESHED_AT 2018-11-19 - -# copy the repo to /tmp -RUN mkdir -p /tmp/aquameta -COPY . /tmp/aquameta/ - - -USER root -WORKDIR /tmp/aquameta -RUN ./install.sh --silent - - -EXPOSE 80 5432 -# VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"] -# ENTRYPOINT ["/usr/bin/supervisord"] - diff --git a/README.md b/README.md index 4b0b1173..b4323571 100644 --- a/README.md +++ b/README.md @@ -28,123 +28,27 @@ Core Modules Installation ------------ -Aquameta can be installed either via Docker, on an Amazon Ubuntu 16.04 EC2 instance, or from source on your local machine. +Aquameta is designed for installation on a Ubuntu 18.04 instance. Aquameta installs a number of `apt` packages. It works best on a clean install of Ubuntu. We recommend using a KVM instance, or Amazon EC2 instance. -### Docker +1. `git clone https://github.com/aquametalabs/aquameta.git` +2. `cd aquameta` +3. `./install.sh` -To install via Docker, the easiest way is to just pull down the latest image from Docker Hub: +From the installer, follow the instructions. -``` -docker pull aquametalabs/aquameta:0.2.0-rc2 -``` - -Alternately, you can clone the Aquameta git repository and build your own Docker image (which takes about 15 minutes): - -``` -git clone https://github.com/aquametalabs/aquameta.git -cd aquameta/ -docker build -t aquametalabs/aquameta . -``` - -Once you've either pulled or built a Aquameta image, run the container to start it up: - -``` -docker run -dit -p 80:80 -p 5432:5432 --privileged aquametalabs/aquameta:0.2.0-rc2 -``` - -If you wish to use alternate ports, they can be changed in the `docker run` command. - -``` -# run the Aquameta webserver on port 8080, and the PostgreSQL server on port 5433 -sudo docker run -dit -p 8080:80 -p 5433:5432 --privileged aquametalabs/aquameta:0.2.0-rc2 -``` - -Make a note of the container-id that this command outputs. You can use it to -restart the container later, if you restart your computer, to get your data back. - -Once Aquameta is running, browse to `http://localhost/dev` (or whatever -host/port it is installed on) to access the web-based IDE. To access the -PostgreSQL database, use `psql -p 5432 aquameta`. - -Aquameta uses the "long-running container" pattern instead of exporting volumes -at this time, so if you stop the container, just restart it with `docker -restart {container_id}`. - - -### Amazon EC2 - -To install Amazon on Amazon, follow these steps: - -1. Create a new EC2 instance, running Ubuntu 16.04 -2. ssh into your instance with `ssh -i {your_pem_file.pem} ubuntu@{your_ip}` -3. `git clone https://github.com/aquametalabs/aquameta.git` -4. `sudo mkdir /s` -5. `mv ./aquameta /s/aquameta` -6. `cd /s/aquameta` -7. `./install.sh` - -From the installer, follow the instructions. If prompted for any LOCALE settings, just hit OK. - -Once the installer completes, you'll have a instance of Aquameta running. - -### From Source (Advanced) - -To install Aquameta from source, follow the steps in the -[install.sh](https://github.com/aquametalabs/aquameta/blob/master/install.sh) -script. The script is designed to run on an Ubuntu 16.04 server, and will -require some adaptation for different environments. - -Getting Started ---------------- - -Once you have Aquameta running, create a superuser and then you can start building applications. - -### Create a Superuser - -To setup a user, from a shell prompt, open up a database shell with: - -``` -$ psql aquameta -psql (9.6.9) -Type "help" for help. - -aquameta=# select endpoint.register('your_email@example.com'); -``` - -You'll be sent a confirmation code to the email specified. Check your email and copy the code. CHECK YOUR SPAM FOLDER! - -Then confirm the user registration and make the user a PostgreSQL superuser: - -``` -aquameta=# select endpoint.register_confirm('your_email@example.com', '{your confirmation code}'); -aquameta=# select endpoint.superuser('your_email@example.com'); -``` - -You now have a superuser. Browse to http://{your_ip}/login to sign in. - -### Starting Development - -The primary development interface lives at http://{your_ip}/dev. From here you can create bundles and edit their contents. To find out more about how to develop apps in Aquameta, here are the available resources: - -- [Quickstart](docs/quickstart.md) -- [Cheat Sheet](docs/cheatsheet.md) +Development +----------- +The primary development interface lives at http://{your_ip}/dev. From here you can create bundles and edit their contents. For more information, see the [documentation](docs/). Contribute ---------- - Source Code: [github.com/aquametalabs/aquameta](https://github.com/aquametalabs/aquameta) - Issue Tracker: [github.com/aquametalabs/aquameta/issues](https://github.com/aquametalabs/aquameta/issues) -- IRC Channel: `#aquameta` on `irc.freenode.net` - -Support -------- - -If you are having issues, please let us know. -We have a mailing list located at: aquameta-discuss@googlegroups.com License ------- -The project is licensed under the GPL. +The project is licensed under the GPL 3.0. diff --git a/docker/supervisord.conf b/docker/supervisord.conf deleted file mode 100644 index 635393aa..00000000 --- a/docker/supervisord.conf +++ /dev/null @@ -1,34 +0,0 @@ -[supervisord] -nodaemon = true - - -[program:postgres] -user = postgres -; command = /usr/local/bin/pg_ctl -D /var/lib/postgresql/aquameta -l /var/log/postgresql/postgresql.log start -command = /usr/local/bin/postgres -D /var/lib/postgresql/aquameta -c config_file=/var/lib/postgresql/aquameta/postgresql.conf -stdout_events_enabled=true -stderr_events_enabled=true - - -[program:nginx] -#command = /usr/sbin/nginx -#stdout_events_enabled=true -#stderr_events_enabled=true -command=/usr/sbin/nginx -g "daemon off;" -autorestart=true -stopwaitsecs=2 -stopasgroup=true - - -[program:uwsgi] -command = uwsgi --die-on-term --emperor /s/aquameta/extensions/endpoint/servers/uwsgi/conf/uwsgi/aquameta_db.ini -stdout_events_enabled=true -stderr_events_enabled=true - - -[program:postgrefs] -command = /s/aquameta/core/002-filesystem/pgfs/pgfs.py -d aquameta -u postgres /mnt/aquameta - - -[program:sendmail] -command = service sendmail start diff --git a/docs/quickstart.md b/docs/quickstart.md index 44ce1923..c36f5d80 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -2,7 +2,6 @@ This document guides you through the minimal steps to get started with Aquameta. It contains the following steps: -- install Aquameta via Docker - create a new bundle - create a base HTML resource that imports the bundle and calls a widget - create a simple widget @@ -11,36 +10,11 @@ This document guides you through the minimal steps to get started with Aquameta. - commit the changes to the bundle -## 1. Install with Docker -If you don't have Docker installed, [install it](https://docs.docker.com/engine/installation/). Then: - -```bash -$ docker pull aquametalabs/aquameta:0.2.0-rc2 - -# run on standard ports -$ docker run -dit -p 80:80 -p 5432:5432 aquametalabs/aquameta:0.2.0-rc2 - -# run on alternate ports: Webserver on port 8080, PostgreSQL on port 5433 -$ docker run -dit -p 8080:80 -p 5433:5432 aquametalabs/aquameta:0.2.0-rc2 -1c59e82ed50ff4463af35d2cc5435c3086f4d67f0046365b4df505dc91e95d19 -``` - -Your Aquameta instance is now installed. The `docker run` command prints a container-id, which you should take save for running future commands against in the running docker container. For example, to get a bash shell in the container, run: - -```bash -$ docker exec -it 1c59e82ed50ff4463af35d2cc5435c3086f4d67f0046365b4df505dc91e95d19 bash -root@0f84133a577e:/s/aquameta# -``` - -Now that you have a running container, you can access the IDE by browsing to whatever hostname and port you installed it on, at `http://{hostname}:{port}/dev`, for example: - -http://localhost:80/dev - -## 2. Create a Bundle +## 1. Create a Bundle From the `/dev` interface, click "new bundle" and give it a name. Use [Reverse domain name notation](https://en.wikipedia.org/wiki/Reverse_domain_name_notation) to give your bundle a unique name, like `org.flyingmonkeys.myproject`. -## 3. Create a Base Page +## 2. Create a Base Page Applications have a base HTML page, a static resource that bootstraps the app. To create the page, click 'new row', then choose 'Resource', and give the resource a path that starts with a /, like `/myproj`. Here is the minimal base page template: @@ -80,7 +54,7 @@ Here is the minimal base page template: ``` Paste this into the code section of the resource, customize the variables, and hit save (or CTRL-S). -## 4. Create a Main Widget +## 3. Create a Main Widget In our base HTML page, we added to the page the `'myproj:main'` widget. We need to make that widget. Click "New Row" and then "Widget", enter "main" for the name. This will bring up a widget editor. Under the HTML tab, set the HTML to: @@ -91,13 +65,13 @@ Click "New Row" and then "Widget", enter "main" for the name. This will bring u ``` -## 5. View Your App +## 4. View Your App Browse to the page that you created, whatever path you supplied for the Base Page, and you should see your Hello World widget. -## 6. Open the Debugger +## 5. Open the Debugger In the bottom right of your app, you should see the debugger. Check the checkbox, to bring up the list of widgets on the screen. Click into any widget to edit it. -## 7. Commit Changes +## 6. Commit Changes From the `/dev` interface, click the "commit" button, which brings up a list of staged and unstaged changes. Click "stage" for each row to stage for the next commit. Click "commit" to commit the changes, and supply a commit summary. ## Conclusion diff --git a/install.sh b/install.sh index 277ea4f9..4315926d 100755 --- a/install.sh +++ b/install.sh @@ -30,14 +30,11 @@ echo " NOT be run in a production environment." echo " You have been warned." echo " ❤ MGMT." -if [ "$1" != "--silent" ] +read -p "Continue? [y/N]" -n 1 -r +echo # (optional) move to a new line +if ! [[ $REPLY =~ ^[Yy]$ ]] then - read -p "Continue? [y/N]" -n 1 -r - echo # (optional) move to a new line - if ! [[ $REPLY =~ ^[Yy]$ ]] - then - exit 1 - fi + exit 1 fi # set working directory and destination directory @@ -241,8 +238,8 @@ sudo -u postgres psql -c "$REG_SUPERUSER_COMMAND" aquameta echo "New User Registration Scheme" echo "----------------------------" echo "Please select a security scheme:" -echo "a) CLOSED REGISTRATION - No public registration, users must be manually created." -echo "b) OPEN REGISTRATION - Pubic users may register for an account" +echo "a) PRIVATE - No anonymous access, no anonymous user registration" +echo "b) OPEN REGISTRATION - Anonymous users may register for an account and read limited data" until [[ $REPLY =~ ^[AaBb]$ ]]; do read -p "Choice? [a/B] " -n 1 -r @@ -251,14 +248,11 @@ done sudo -u postgres psql -f $SRC/src/privileges/000-general.sql aquameta -if [[ $REPLY =~ ^[Aa]$ ]]; -then - echo "Installing CLOSED registration scheme..." +if [[ $REPLY =~ ^[Aa]$ ]]; then + echo "Installing PRIVATE security scheme..." sudo -u postgres psql -f $SRC/src/privileges/001-anonymous.sql aquameta -else - if [[ $REPLY =~ ^[Bb]$ ]]; - then - echo "Installing OPEN registration scheme..." +else if [[ $REPLY =~ ^[Bb]$ ]]; then + echo "Installing OPEN REGISTRATION scheme..." sudo -u postgres psql -f $SRC/src/privileges/001-anonymous-register.sql aquameta fi fi