Wykres commitów

356 Commity (5e03d70046d97e1d6c8bd2aa2e990d478b9537ac)

Autor SHA1 Wiadomość Data
Rui Carmo 5e03d70046 removed unused import - fixes #94 2019-08-26 13:02:18 +01:00
Rui Carmo 6b336e7d92 changed urls in docs and scripts 2019-08-26 12:23:34 +01:00
Rui Carmo e52cffb377 split nodejs sample into separate repo 2019-08-22 22:27:41 +01:00
Rui Carmo ea5ef420ad split django example to separate repo 2019-08-22 22:15:10 +01:00
Rui Carmo ba3fbd04fd split first python sample to separate repo 2019-08-22 22:07:34 +01:00
Chris McCormick 7d4e7e2cb7 Env UWSGI_INCLUDE_FILE to include custom uwsgi. (#93) 2019-08-22 17:40:00 +01:00
Chris McCormick 57a71474bd Fixed broken logic detecting wsgi workers. (#89)
* Fixed broken logic detecting wsgi workers. #88

* Fix logic errors in jwsgi detection. #88
2019-08-18 09:36:05 +01:00
dependabot[bot] 0d605dbe7b Bump django from 2.1.9 to 2.1.11 in /examples/python-postgres (#87)
Bumps [django](https://github.com/django/django) from 2.1.9 to 2.1.11.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/2.1.9...2.1.11)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-12 07:17:03 +01:00
Chris McCormick 18dcad3d76 Python/Django + Postgres database example (#86)
* Remove --pi hack in favour of pi@HOST.

* Properly deploy systemd startup in bootstrap.

Fixes #71.

* piku-bootstrap using separate ansible playbooks.

* Prefer built-in playbooks in piku-bootstrap.

* Document new piku-bootstrap options.

* Doc piku-bootstrap built-in playbooks usage.

* Move 'using' doc to top.

* Typos + doc fixes in piku-bootstrap.

* Improved built-in playbook detection.

* Added node playbook.

* Documentation tweaks.

* Documentation tweaks.

* Built-in playbook for installing postgres.

* Example Python/Django + Postgres app.
2019-08-12 07:01:27 +01:00
Chris McCormick e321982564 Piku bootstrap extra playbooks (#83)
* Remove --pi hack in favour of pi@HOST.

* Properly deploy systemd startup in bootstrap.

Fixes #71.

* piku-bootstrap using separate ansible playbooks.

* Prefer built-in playbooks in piku-bootstrap.

* Document new piku-bootstrap options.

* Doc piku-bootstrap built-in playbooks usage.

* Move 'using' doc to top.

* Typos + doc fixes in piku-bootstrap.

* Improved built-in playbook detection.

* Added node playbook.

* Documentation tweaks.

* Documentation tweaks.
2019-08-12 07:00:27 +01:00
Chris McCormick 3866de6e17 Usability + nitpick tweaks (#82)
* rm editor conf - appears to be comitted in error.

* Rename to java-spark-app to help users.
2019-08-12 06:59:02 +01:00
Chris McCormick 7a73cd8e3e Stop nginx confs from leaking into LIVE_ENV. #84 (#85) 2019-08-12 06:56:59 +01:00
John Simiyu bfc4f8ce32 Java Support (#81)
* Added support for Java Deployment with Maven

* Added support for Java Deployment with Maven

* @matrixjnr/feature:java support

* @matrixjnr/feature:java support
2019-08-10 22:00:40 +01:00
dependabot[bot] 61a5648214 Bump django from 2.1.10 to 2.1.11 in /examples/python-django (#80)
Bumps [django](https://github.com/django/django) from 2.1.10 to 2.1.11.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/2.1.10...2.1.11)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-06 08:06:27 +01:00
Chris McCormick 90d20dac28 Include a custom nginx config fragment with NGINX_INCLUDE_FILE (#79)
* Refactor common config out of nginx templates.

* A way to inject custom nginx directives.

Setting the ENV variable `NGINX_INCLUDE_FILE` allows the user to specify a
file, relative to the app folder, which will be inserted into the nginx
server config.

This is useful for e.g. overriding a variable. For example to allow
uploads larger than 1Mb the user could create a file called `nginx.conf`
in their app repo containing: `client_max_body_size 8M;` and then set
`NGINX_INCLUDE_FILE=nginx.conf` in the ENV file.

This builds on #77 so that should be merged first.
2019-08-05 09:10:42 +01:00
Chris McCormick dca9342b2e Block access to .git folders (allow if NGINX_ALLOW_GIT_FOLDERS is set) (#78)
* Refactor common config out of nginx templates.

* Block access to .git folders with ENV to allow.

See #76
2019-08-05 09:09:22 +01:00
Chris McCormick afac14862f Refactor common config out of nginx templates. (#77) 2019-08-05 09:09:11 +01:00
Chris McCormick 52f4a1d634 Fix `git remote show` (shim git-upload-pack). (#74) 2019-08-05 09:08:59 +01:00
Chris McCormick 9876ecc2e0 Fix to upgrade node version correctly. (#73)
This patch changes piku to check the installed node version and leave it
if correct.

It also separates the nodeenv install and the npm install steps.

It will also warn the user if they try to change the node version in a
running app, and tells them to stop and then deploy the app again in
order to update the node version.

Fixes #70.
2019-08-05 09:08:48 +01:00
Chris McCormick 29cff3a819 Properly deploy systemd startup in bootstrap. (#72)
Fixes #71.
2019-08-05 09:08:36 +01:00
dWiGhT a5efdf89b5 improvement: allow newlines in ENV files (#69) 2019-08-05 09:08:24 +01:00
Chris McCormick 8a45c1af85 Remove --pi hack in favour of pi@HOST. (#68) 2019-08-05 09:08:10 +01:00
Chris McCormick 85d8be87eb Support pushes to non-master branches. (#75) 2019-08-05 09:07:47 +01:00
Chris McCormick 3778088da7 Don't mangle stdout with header. (#67)
This fix allows you to usefully pipe things from the output of 'piku run' into other scripts.
For example you might pipe a request log into goaccess for analysis.
2019-07-22 13:53:24 +01:00
Rui Carmo b920c85c08
Update and rename raspbian-9.4-stretch.md to raspbian-9.4-stretch-10-buster.md 2019-07-21 16:22:44 +01:00
Rui Carmo cbc8211702
Update README.md 2019-07-21 15:37:55 +01:00
Chris McCormick fc0abee262 If nginx config test fails remove app nginx conf. (#62) 2019-07-14 17:12:43 +01:00
Rui Carmo 9ba6b5828d
Update README.md 2019-07-14 17:08:58 +01:00
Chris McCormick 6556706e4a Documentation and readme updates (#59)
* Updated README with first-timers in mind.

This patch adds information about how to use the  script. It also
re-orders the information in the README so that the most pertinent
information for somebody using it for the first time is at the top.

* Logo proposition.

* Possibly punchier tag line.

* Tagline spacing tweak.

* README fixes.

* Added a note about the examples folder.

* Incorporated @dwightmulcahy suggestion.
2019-07-13 16:30:25 +01:00
Chris McCormick dce587c053 Node improvements and versioning (#58)
* Fix node path insert to not clobber env.

* Tighter check on python venv for uwsgi conf.

* Install NODE_VERSION if nodeenv on PATH.

* Document NODE_VERSION setting.
2019-07-13 16:29:34 +01:00
dependabot[bot] 1b3e471342 Bump django from 2.1.9 to 2.1.10 in /examples/python-django (#57)
Bumps [django](https://github.com/django/django) from 2.1.9 to 2.1.10.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/2.1.9...2.1.10)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-09 11:16:11 +01:00
Chris McCormick 38aae8587b Added example for running wisp app. (#55) 2019-07-07 12:07:49 +01:00
Chris McCormick 9b9059c873 Add node_modules/.bin to node deploy path. (#54)
This change allows for npm installed binaries (such as wisp,
coffeescript, babel, etc.) to be used at deployment and run time.
2019-07-07 12:07:24 +01:00
Chris McCormick 19b301aaba Helper for running piku.py on configured remote. (#56)
This patch adds a little shell script called `piku`.

What it does is check for a git remote called `piku` and then uses that
remote to infer server & app name and SSH in to run piku.py.

Put it on your path and then from any piku configured local repo you can
do things like: `piku restart` and `piku destroy`.
2019-07-07 12:07:09 +01:00
Chris McCormick b5daedb5bc Move release worker to end of deploy. (#50)
* Move release worker to end of deploy.

This matches up with what other PaaS platforms do. This change also
makes the release worker inherit the environment (virtualenv etc.) from
the deploy process, making it easier to run e.g. Django manage.py
commands in the expected context without explicitly entering virtualenv
in the script.

* Update Django example to remove virtualenv.

Now that this happens automatically we don't need to explicitly enter
virtualenv in the script.

* Pass spawn env back through to release worker.

Conflicts:
	piku.py
2019-06-28 12:59:12 +01:00
Chris McCormick a4ded8c994 Nodejs example app (#52)
* Fix node deploy path handling.

This patch uses a temporary symlink to envs/APP/node_modules to force
node to install the modules into the right place even on older node
versions, like v4.2.6 which ships with Unbuntu 16.04.

Apps launching node servers will need to manually set
NODE_PATH="${VIRTUAL_ENV}/node_modules" to have it run correctly, and
in future we should consider setting this in spawn_app (though currently
spawn_app does not know what kind of app it's spawning).

* Add NODE_PATH to spawn env if node env present.

* Added nodejs websocket chat example app.
2019-06-28 12:58:36 +01:00
Chris McCormick e43b318d61 Fix node deploy path handling. (#49)
* Fix node deploy path handling.

This patch uses a temporary symlink to envs/APP/node_modules to force
node to install the modules into the right place even on older node
versions, like v4.2.6 which ships with Unbuntu 16.04.

Apps launching node servers will need to manually set
NODE_PATH="${VIRTUAL_ENV}/node_modules" to have it run correctly, and
in future we should consider setting this in spawn_app (though currently
spawn_app does not know what kind of app it's spawning).

* Add NODE_PATH to spawn env if node env present.
2019-06-28 12:56:37 +01:00
Chris McCormick d26fb6ee1c Clean up acme certs on destroy. (#51)
This will prevent the acme.sh cron job from continuing to request
certificates for apps which have been destroyed.
2019-06-28 12:55:34 +01:00
Chris McCormick 3ce615ec7a No virtualenv in uwsgi config if missing. (#48)
This patch skips adding the 'virtualenv' setting to the uwsgi config if
the project does not have a valid virtualenv.

This allows nodejs projects to run under the 'web' worker correct.
Presumably Go projects will be similarly hampered without this patch.
2019-06-27 07:42:54 +01:00
Chris McCormick 2c1b70b1b9 Ignore removed workers in SCALING file. (#47)
If a worker has been removed from the Procfile it may still have an
entry in the SCALING file on the server which causes a traceback when
the removed worker is attempted to be spawned. With this patch piku
ignores SCALING file entries which do not have a corresponding worker
defined in Procfile.
2019-06-27 07:41:22 +01:00
Chris McCormick 02c9017db9 Generate self-signed cert if acme fails. (#46)
Under certain conditions the acme cert generation will fail and create a
zero-byte certificate. Nginx does not like this so in that case piku.py
will generate a self-signed cert as a fallback with this patch.
2019-06-27 07:41:07 +01:00
Chris McCormick 8c835b28ad Improved AUTO_RESTART to prevent 2x uwsgi bounce. (#45)
The previous implementation of the AUTO_RESTART setting was causing
uwsgi have two separate configs installed one after the other very
quickly, which was causing issues.

This change fixes that by deleting the 'enabled' uwsgi config just
before re-generating it if AUTO_RESTART is true. This has the same basic
effect (reload on change) without the double-triggering of uwsgi reload.
2019-06-27 07:40:52 +01:00
Rui Carmo 8962fa9523
Better Cloudflare API error handling 2019-06-25 11:46:55 +01:00
Chris McCormick 9c913a8d5f Example Django app deployment with Piku. (#43)
This change requires PRs #38 #39 #41 to work properly.
2019-06-23 15:50:24 +01:00
Chris McCormick 8ca63c60de Release worker: provide full env + remove worker. (#39)
* Release worker: provide full env + remove worker.

This change improves the release task pseudo-worker.

 * Provides the full environment (both app env and config env) to the
   release task.

 * Uses a non-zero return value to bail early if release
   phase fails.

* Make ENV_ROOT (venv) accessible to release scripts.
2019-06-23 15:48:47 +01:00
Chris McCormick a9b58917b4 RFC: letsencrypt SSL certificate support (#38)
* Add Let's Encrypt SSL cert support.

This patch has piku use the acme.sh script to request and maintain Let's
Encrypt SSL certs rather than generate self-signed certs.  For it to
work you must install acme.sh as the user piku.  Installation
instructions here: https://github.com/Neilpang/acme.sh#1-how-to-install
The next commit updates piku-bootstrap to install acme.sh by default.

If acme.sh is not installed piku continues to default to a self-signed
certificate.

* Install acme.sh SSL cert wrangler in bootstrap.

The previous commit contains details about usage.
2019-06-23 15:47:58 +01:00
Chris McCormick 0a1dc6cf13 Fix static paths by switching to expandvars(). (#41)
This fixes #40.
2019-06-23 15:44:57 +01:00
Chris McCormick 2e3c56c891 piku-bootstrap script for provisioning a server with piku.py (#23)
* Bootstrap script initial working version.

* Bootstrap: more verbose messaging.

* Bootstrap: working up to piku over SSH.

* Bootstrap: full bootstrap minus nginx.

* Bootstrap: ensure py2 for Ansible.

* Bootstrap: more deps.

* Bootstrap: piku user Ansible tmp to avoid err.

* Bootstrap: local venv source in ~/.piku-bootstrap

* Bootstrap: nginx + incron install.

* Bootstrap: self-install logging and less verbose.

* Bootstrap: special permissions for --pi mode.

* Improved usage + self-install text.
2019-06-20 15:05:45 +01:00
Chris McCormick e424f3d7b5 Alias NGINX_HTTPS_ONLY and add doc. (#28) 2019-06-20 15:05:18 +01:00
Chris McCormick bccf3814a8 Warning should be in yellow. (#32) 2019-06-20 15:03:57 +01:00