diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..68dd225 --- /dev/null +++ b/404.html @@ -0,0 +1,906 @@ + + + + + + + + + + + + + + + + + + + Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ +

404 - Not found

+ +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/FAQ.html b/FAQ.html new file mode 100644 index 0000000..5b858e4 --- /dev/null +++ b/FAQ.html @@ -0,0 +1,954 @@ + + + + + + + + + + + + + + + + + + + + + + + FAQ - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

FAQ

+

Q: Why piku?

+

A: Partly because it's started out on the Raspberry Pi, because it's Japanese onomatopeia for 'twitch' or 'jolt', and because we knew the name would be cute and amusing.

+

Q: Why Python/why not Go?

+

A: We actually thought about doing this in Go right off the bat, but click is so cool and we needed to have uwsgi running anyway, so we caved in. But possible future directions are likely to take something like suture and port this across (or just use Caddy), doing away with uwsgi altogether.

+

Go also (at the time) did not have a way to vendor dependencies that we were comfortable with, and that is also why Go support fell behind. Hopefully that will change soon.

+

Q: Does it run under Python 3?

+

A: Right now, it only runs on Python 3, even though it can deploy apps written in both major versions. It began its development using 2.7 and usingclick for abstracting the simpler stuff, and we eventually switched over to 3.5 once it was supported in Debian Stretch and Raspbian since we wanted to make installing it on the Raspberry Pi as simple as possible.

+

Q: Why not just use dokku?

+

A: We used dokku daily for many projects. But it relied on a number of x64 containers that needed to be completely rebuilt for ARM, and when we decided we needed something like this (March 2016) that was barely possible - docker itself was not fully baked for ARM yet, and people were at the time just starting to get herokuish and buildstep to build on ARM.

+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/assets/external/fonts.googleapis.com/css.49ea35f2.css b/assets/external/fonts.googleapis.com/css.49ea35f2.css new file mode 100644 index 0000000..8187a64 --- /dev/null +++ b/assets/external/fonts.googleapis.com/css.49ea35f2.css @@ -0,0 +1,594 @@ +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc3CsTKlA.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc-CsTKlA.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc2CsTKlA.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc5CsTKlA.woff2) format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc1CsTKlA.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc0CsTKlA.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc6CsQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xFIzIFKw.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xMIzIFKw.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xEIzIFKw.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xLIzIFKw.woff2) format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xHIzIFKw.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xGIzIFKw.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xIIzI.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic3CsTKlA.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic-CsTKlA.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic2CsTKlA.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic5CsTKlA.woff2) format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic1CsTKlA.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic0CsTKlA.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic6CsQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2) format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 300; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBBc4.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu72xKOzY.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu5mxKOzY.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7mxKOzY.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4WxKOzY.woff2) format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7WxKOzY.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7GxKOzY.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxK.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2) format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2) format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBBc4.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlYIw.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-UlYIw.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlYIw.woff2) format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlYIw.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlYIw.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ul.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlYIw.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-UlYIw.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlYIw.woff2) format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlYIw.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlYIw.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto Mono'; + font-style: italic; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ul.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0mf0h.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0mf0h.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0mf0h.woff2) format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0mf0h.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0mf0h.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 400; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0mQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0mf0h.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0mf0h.woff2) format('woff2'); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0mf0h.woff2) format('woff2'); + unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0mf0h.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0mf0h.woff2) format('woff2'); + unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 700; + font-display: fallback; + src: url(../fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0mQ.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc-CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc-CsTKlA.woff2 new file mode 100644 index 0000000..943c5a0 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc-CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc0CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc0CsTKlA.woff2 new file mode 100644 index 0000000..2bfc2ce Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc0CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc1CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc1CsTKlA.woff2 new file mode 100644 index 0000000..b2391b9 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc1CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc2CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc2CsTKlA.woff2 new file mode 100644 index 0000000..a4699c7 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc2CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc3CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc3CsTKlA.woff2 new file mode 100644 index 0000000..bfcc76f Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc3CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc5CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc5CsTKlA.woff2 new file mode 100644 index 0000000..d4ec189 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc5CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc6CsQ.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc6CsQ.woff2 new file mode 100644 index 0000000..22c57b0 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TjASc6CsQ.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic-CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic-CsTKlA.woff2 new file mode 100644 index 0000000..d2f30b5 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic-CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic0CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic0CsTKlA.woff2 new file mode 100644 index 0000000..c88b8ae Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic0CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic1CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic1CsTKlA.woff2 new file mode 100644 index 0000000..6363b1c Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic1CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic2CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic2CsTKlA.woff2 new file mode 100644 index 0000000..dd5a4a2 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic2CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic3CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic3CsTKlA.woff2 new file mode 100644 index 0000000..6abf54d Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic3CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic5CsTKlA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic5CsTKlA.woff2 new file mode 100644 index 0000000..c8091bc Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic5CsTKlA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic6CsQ.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic6CsQ.woff2 new file mode 100644 index 0000000..a56a6ed Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOjCnqEu92Fr1Mu51TzBic6CsQ.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xEIzIFKw.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xEIzIFKw.woff2 new file mode 100644 index 0000000..508baef Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xEIzIFKw.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xFIzIFKw.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xFIzIFKw.woff2 new file mode 100644 index 0000000..9213da0 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xFIzIFKw.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xGIzIFKw.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xGIzIFKw.woff2 new file mode 100644 index 0000000..ef920e5 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xGIzIFKw.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xHIzIFKw.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xHIzIFKw.woff2 new file mode 100644 index 0000000..9a378af Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xHIzIFKw.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xIIzI.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xIIzI.woff2 new file mode 100644 index 0000000..e1b7a79 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xIIzI.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xLIzIFKw.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xLIzIFKw.woff2 new file mode 100644 index 0000000..e0d3c43 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xLIzIFKw.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xMIzIFKw.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xMIzIFKw.woff2 new file mode 100644 index 0000000..dd587a2 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOkCnqEu92Fr1Mu51xMIzIFKw.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2 new file mode 100644 index 0000000..9d7fb7f Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBBc4.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBBc4.woff2 new file mode 100644 index 0000000..6068138 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBBc4.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2 new file mode 100644 index 0000000..b289f00 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2 new file mode 100644 index 0000000..87711c0 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2 new file mode 100644 index 0000000..0f6e60b Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2 new file mode 100644 index 0000000..91231c9 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2 new file mode 100644 index 0000000..c009987 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2 new file mode 100644 index 0000000..1bb7737 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBBc4.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBBc4.woff2 new file mode 100644 index 0000000..771fbec Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBBc4.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2 new file mode 100644 index 0000000..cb9bfa7 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2 new file mode 100644 index 0000000..a0d68e2 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2 new file mode 100644 index 0000000..6399552 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2 new file mode 100644 index 0000000..94ab5fb Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2 new file mode 100644 index 0000000..3c45011 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4WxKOzY.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4WxKOzY.woff2 new file mode 100644 index 0000000..fc71d94 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4WxKOzY.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxK.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxK.woff2 new file mode 100644 index 0000000..020729e Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxK.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu5mxKOzY.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu5mxKOzY.woff2 new file mode 100644 index 0000000..47da362 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu5mxKOzY.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu72xKOzY.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu72xKOzY.woff2 new file mode 100644 index 0000000..22ddee9 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu72xKOzY.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7GxKOzY.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7GxKOzY.woff2 new file mode 100644 index 0000000..8a8de61 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7GxKOzY.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7WxKOzY.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7WxKOzY.woff2 new file mode 100644 index 0000000..6284d2e Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7WxKOzY.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7mxKOzY.woff2 b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7mxKOzY.woff2 new file mode 100644 index 0000000..72ce0e9 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7mxKOzY.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0mf0h.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0mf0h.woff2 new file mode 100644 index 0000000..022274d Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0mf0h.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0mf0h.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0mf0h.woff2 new file mode 100644 index 0000000..48edd1b Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0mf0h.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0mf0h.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0mf0h.woff2 new file mode 100644 index 0000000..cb41535 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0mf0h.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0mQ.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0mQ.woff2 new file mode 100644 index 0000000..1d988a3 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0mQ.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0mf0h.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0mf0h.woff2 new file mode 100644 index 0000000..11e6a46 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0mf0h.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0mf0h.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0mf0h.woff2 new file mode 100644 index 0000000..50fb8e7 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0mf0h.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlYIw.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlYIw.woff2 new file mode 100644 index 0000000..1f1c97f Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlYIw.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlYIw.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlYIw.woff2 new file mode 100644 index 0000000..1623005 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlYIw.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlYIw.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlYIw.woff2 new file mode 100644 index 0000000..6f232c3 Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlYIw.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ul.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ul.woff2 new file mode 100644 index 0000000..a3e5aef Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ul.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlYIw.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlYIw.woff2 new file mode 100644 index 0000000..f73f27d Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlYIw.woff2 differ diff --git a/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-UlYIw.woff2 b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-UlYIw.woff2 new file mode 100644 index 0000000..135d06e Binary files /dev/null and b/assets/external/fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-UlYIw.woff2 differ diff --git a/assets/external/unpkg.com/iframe-worker/shim.js b/assets/external/unpkg.com/iframe-worker/shim.js new file mode 100644 index 0000000..5f1e232 --- /dev/null +++ b/assets/external/unpkg.com/iframe-worker/shim.js @@ -0,0 +1 @@ +"use strict";(()=>{function c(s,n){parent.postMessage(s,n||"*")}function d(...s){return s.reduce((n,e)=>n.then(()=>new Promise(r=>{let t=document.createElement("script");t.src=e,t.onload=r,document.body.appendChild(t)})),Promise.resolve())}var o=class extends EventTarget{constructor(e){super();this.url=e;this.m=e=>{e.source===this.w&&(this.dispatchEvent(new MessageEvent("message",{data:e.data})),this.onmessage&&this.onmessage(e))};this.e=(e,r,t,i,m)=>{if(r===`${this.url}`){let a=new ErrorEvent("error",{message:e,filename:r,lineno:t,colno:i,error:m});this.dispatchEvent(a),this.onerror&&this.onerror(a)}};let r=document.createElement("iframe");r.hidden=!0,document.body.appendChild(this.iframe=r),this.w.document.open(),this.w.document.write(` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Contributing

+

piku is a stable project, but we welcome contributions that:

+
    +
  • Help us move beyond Python 3.8+ (which is the current target due to Linux LTS distribution alignment)
  • +
  • Help us do better automated testing
  • +
  • Improve documentation (some docs are a bit old by now)
  • +
  • Help us deploy piku in various Linux distributions and environments (check the sister repositories in the project)
  • +
  • Provide sample deployments of common applications (again, check the sister repositories in the project)
  • +
  • Allow us to better support more language runtimes
  • +
  • Allow us to support different web servers or process supervisors (Caddy springs to mind as a popular alternative for small VPSes)
  • +
+

Code Size / Style

+

By its very nature, piku is a very small program. By today's standards of all-encompassing solutions this may seem strange, but it would benefit from being kept that way.

+
    +
  • Small and focused PRs. Please don't include changes that don't address the subject of your PR.
  • +
  • Follow the style of importing functions directly e.g. from os.path import abspath
  • +
  • Follow PEP8.
  • +
+

So please keep that in mind when contributing.

+

For instance, if your runtime or framework needs additional setup, it might be better to contribute an utility script to run in a release entry in the Procfile rather than patching piku.py--but do hack at it if that is the best way to achieve it.

+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/community/examples.html b/community/examples.html new file mode 100644 index 0000000..40df2a0 --- /dev/null +++ b/community/examples.html @@ -0,0 +1,1169 @@ + + + + + + + + + + + + + + + + + + + + + + + Example Applications - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Example Applications

+

Besides the bundled examples, there are a number of community-contributed examples that can be deployed using piku.

+

They are meant to be illustrative of the kinds of applications that can be deployed using piku, and are not meant to be exhaustive.

+

Pre-built Apps and Tools

+
    +
  • avahi-aliases, a tool for announcing multiple hostnames on the same IP address via Avahi/mDNS/Bonjour.
  • +
  • Node-RED
  • +
  • Gitea
  • +
  • WebDAV, a simple WebDAV server
  • +
  • SnapDrop, a simple LAN file sharing application using Express.
  • +
+

Phoenix

+ +

Python

+ +

Ruby on Rails

+ +

NodeJS

+ +

Java

+ +

Clojure

+ +

Bare Metal C

+ + + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/community/index.html b/community/index.html new file mode 100644 index 0000000..a1a99a4 --- /dev/null +++ b/community/index.html @@ -0,0 +1,979 @@ + + + + + + + + + + + + + + + + + + + + + + + Community - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/configuration/env.html b/configuration/env.html new file mode 100644 index 0000000..29cbaa1 --- /dev/null +++ b/configuration/env.html @@ -0,0 +1,1268 @@ + + + + + + + + + + + + + + + + + + + + + + + ENV Variables - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

ENV Variables

+

You can configure deployment settings by placing special variables in an ENV file deployed with your app. This file should be placed in the root of your app's directory, and can look something like this:

+
# variables are global and can be replaced
+SETTING1=True
+SETTING2=${SETTING1}/Maybe
+
+# addr:port
+PORT=9080
+BIND_ADDRESS=0.0.0.0
+
+# the max number the worker will process
+RANGE=10
+
+# worker sleep interval between prints
+INTERVAL=1
+
+

Runtime Settings

+
    +
  • PIKU_AUTO_RESTART (boolean, defaults to true): Piku will restart all workers every time the app is deployed. You can set it to 0/false if you prefer to deploy first and then restart your workers separately.
  • +
+

Python

+
    +
  • PYTHON_VERSION (int): Forces Python 3
  • +
+
+

Warning

+

This is mostly deprecated (since piku now runs solely on Python 3.x), but is kept around for legacy compatibility.

+
+

Node

+
    +
  • NODE_VERSION: installs a particular version of node for your app if nodeenv is found on the path. Optional; if not specified, the system-wide node package is used.
  • +
+
+

Note

+

you will need to stop and re-deploy the app to change the node version in a running app.

+
+

Network Settings

+
    +
  • BIND_ADDRESS: IP address to which your app will bind (typically 127.0.0.1)
  • +
  • PORT: TCP port for your app to listen in (if deploying your own web listener).
  • +
  • DISABLE_IPV6 (boolean): if set to true, it will remove IPv6-specific items from the nginx config, which will accept only IPv4 connections
  • +
+

uWSGI Settings

+
    +
  • UWSGI_MAX_REQUESTS (integer): set the max-requests option to determine how many requests a worker will receive before it's recycled.
  • +
  • UWSGI_LISTEN (integer): set the listen queue size.
  • +
  • UWSGI_PROCESSES (integer): set the processes count.
  • +
  • UWSGI_ENABLE_THREADS (boolean): set the enable-threads option.
  • +
  • UWSGI_LOG_MAXSIZE (integer): set the log-maxsize.
  • +
  • UWSGI_LOG_X_FORWARDED_FOR (boolean): set the log-x-forwarded-for option.
  • +
  • UWSGI_GEVENT: enable the Python 2 gevent plugin
  • +
  • UWSGI_ASYNCIO (integer): enable the Python 2/3 asyncio plugin and set the number of tasks
  • +
  • UWSGI_INCLUDE_FILE: a uwsgi config file in the app's dir to include - useful for including custom uwsgi directives.
  • +
  • UWSGI_IDLE (integer): set the cheap, idle and die-on-idle options to have workers spawned on demand and killed after n seconds of inactivity.
  • +
+
+

Note

+

UWSGI_IDLE applies to all the workers, so if you have UWSGI_PROCESSES set to 4, they will all be killed simultaneously. Support for progressive scaling of workers via cheaper and similar uWSGI configurations will be added in the future.

+
+

nginx Settings

+
    +
  • NGINX_SERVER_NAME: set the virtual host name associated with your app
  • +
  • NGINX_STATIC_PATHS (string, comma separated list): set an array of /url:path values that will be served directly by nginx
  • +
  • NGINX_CLOUDFLARE_ACL (boolean, defaults to false): activate an ACL allowing access only from Cloudflare IPs
  • +
  • NGINX_HTTPS_ONLY (boolean, defaults to false): tell nginx to auto-redirect non-SSL traffic to SSL site.
  • +
+
+

Note

+

if used with Cloudflare, NGINX_HTTPS_ONLY will cause an infinite redirect loop - keep it set to false, use NGINX_CLOUDFLARE_ACL instead and add a Cloudflare Page Rule to "Always Use HTTPS" for your server (use domain.name/* to match all URLs).

+
+

nginx Caching

+

When NGINX_CACHE_PREFIXES is set, nginx will cache requests for those URL prefixes to the running application (uwsgi-like or web workers) and reply on its own for NGINX_CACHE_TIME to the outside. This is meant to be used for compute-intensive operations like resizing images or providing large chunks of data that change infrequently (like a sitemap).

+

The behavior of the cache can be controlled with the following variables:

+
    +
  • NGINX_CACHE_PREFIXES (string, comma separated list): set an array of /url values that will be cached by nginx
  • +
  • NGINX_CACHE_SIZE (integer, defaults to 1): set the maximum size of the nginx cache, in GB
  • +
  • NGINX_CACHE_TIME (integer, defaults to 3600): set the amount of time (in seconds) that valid backend replies (200 304) will be cached.
  • +
  • NGINX_CACHE_REDIRECTS (integer, defaults to 3600): set the amount of time (in seconds) that backend redirects (301 307) will be cached.
  • +
  • NGINX_CACHE_ANY (integer, defaults to 3600): set the amount of time (in seconds) that any other replies (other than errors) will be cached.
  • +
  • NGINX_CACHE_CONTROL (integer, defaults to 3600): set the amount of time (in seconds) for cache control headers (Cache-Control "public, max-age=3600")
  • +
  • NGINX_CACHE_EXPIRY (integer, defaults to 86400): set the amount of time (in seconds) that cache entries will be kept on disk.
  • +
  • NGINX_CACHE_PATH (string, detaults to ~piku/.piku/<appname>/cache): location for the nginx cache data.
  • +
+
+

Note

+

NGINX_CACHE_PATH will be completely managed by nginx and cannot be removed by Piku when the application is destroyed. This is because nginx sets the ownership for the cache to be exclusive to itself, and the piku user cannot remove that file tree. So you will either need to clean it up manually after destroying the app or store it in a temporary filesystem (or set the piku user to the same UID as www-data, which is not recommended).

+
+

Right now, there is no provision for cache revalidation (i.e., nginx asking your backend if the cache entries are still valid), since that requires active application logic that varies depending on the runtime--nginx will only ask your backend for new content when NGINX_CACHE_TIME elapses. If you require that kind of behavior, that is still possible via NGINX_INCLUDE_FILE.

+

Also, keep in mind that using nginx caching with a static website worker will not work (and there's no point to it either).

+

nginx Overrides

+
    +
  • NGINX_INCLUDE_FILE: a file in the app's dir to include in nginx config server section - useful for including custom nginx directives.
  • +
  • NGINX_ALLOW_GIT_FOLDERS: (boolean) allow access to .git folders (default: false, blocked)
  • +
+

Acme Settings

+
    +
  • ACME_ROOT_CA: set the certificate authority that Acme should use to generate public ssl certificates (string, default: letsencrypt.org)
  • +
+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/configuration/index.html b/configuration/index.html new file mode 100644 index 0000000..a75f053 --- /dev/null +++ b/configuration/index.html @@ -0,0 +1,999 @@ + + + + + + + + + + + + + + + + + + + + + + + Configuring Applications - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Configuring Applications

+

A minimal piku app has a root directory structure similar to this:

+
ENV
+Procfile
+app.py
+worker.py
+requirements.txt
+
+

+ + ENV + + + Procfile + +

+

Configuration Files

+

piku relies on two configuration files shipped with your app to determine how to run it: ENV and Procfile.

+
    +
  • The ENV file contains environment variables that allow you to configure both piku and your app, following the 12-factor app approach.
  • +
  • The Procfile tells piku what kind of workers to run
  • +
+

Runtime Detection

+

Besides ENV and Procfile, piku also looks for runtime-specific files in the root of your app's directory:

+
    +
  • If there's a requirements.txt file at the top level, then the app is assumed to require Python.
  • +
  • If there's a Gemfile at the top level, then the app is assumed to require Ruby.
  • +
  • If there's a package.json file at the top level, then the app is assumed to require Node.js.
  • +
  • If there's a pom.xml or a build.gradle file at the top level, then the app is assumed to require Java.
  • +
  • If there's a deps.edn or project.clj file at the top level, then the app is assumed to require Clojure.
  • +
  • If there's a Godeps file at the top level, then the app is assumed to require Go.
  • +
+
+

Info

+

go.mod support is currently in development.

+
+

These are not exclusive, however. There is also a sample Phoenix app that demonstrates how to add support for additional runtimes.

+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/configuration/procfile.html b/configuration/procfile.html new file mode 100644 index 0000000..28bbcb1 --- /dev/null +++ b/configuration/procfile.html @@ -0,0 +1,1183 @@ + + + + + + + + + + + + + + + + + + + + + + + Procfile format - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Procfile format

+

piku supports a Heroku-like Procfile that you provide to indicate how to run one or more application processes (what Heroku calls "dynos"):

+
web: embedded_server --port $PORT
+worker: background_worker
+
+

Worker Types

+

piku supports six different kinds of worker processes:

+

# A module to be loaded by uwsgi to serve HTTP requests
+wsgi: module.submodule:app
+# A background worker, using the default name
+worker: python long_running_script.py
+# Another worker with a different name
+fetcher: python fetcher.py
+# Simple cron expression: minute [0-59], hour [0-23], day [0-31], month [1-12], weekday [1-7] (starting Monday, no ranges allowed on any field)
+cron: 0 0 * * * python midnight_cleanup.py
+release: python initial_cleanup.py
+
+Each of these has slightly different features:

+

wsgi

+

wsgi workers are Python-specific and must be specified in the format dotted.module:entry_point. uwsgi will load the specified module and call the entry_point function to start the application, handling all the HTTP requests directly (your Python code will run the handlers, but will run as a part of the uwsgi process).

+

uwsgi will automatically spawn multiple workers for you, and you can control the number of workers via the UWSGI_PROCESSES environment variable.

+

Also, in this mode uwsgi will talk to nginx via a Unix socket, so you don't need to worry about the HTTP server at all.

+

web

+

web workers can be literally any executable that uwsgi can run and that will serve HTTP requests. They must (by convention) honor the PORT environment variable, so that the nginx reverse proxy can talk to them.

+

worker

+

worker processes are just standard processes that run in the background. They can actually have arbitrary names, and the idea is that they would perform any tasks your app requires that isn't directly related to serving web pages.

+

static

+

static workers are simply a way to direct nginx to mount the first argument as a static path and serve it directly. This is useful for serving (and caching) static files directly from your app, without having to go through application code.

+
+

Note

+

See nginx caching for more information on how to configure nginx to serve static files.

+
+

cron

+

A cron worker is a process that runs at a specific time (or intervals), using a simplified crontab expression preceding the command to be run (e.g. cron: */5 * * * * python batch.py to run a batch every 5 minutes)

+
+

Warning

+

crontab expressions are simplified and do not support ranges or lists, only single values, splits and * (wildcard).

+
+

preflight

+

preflight is a special "worker" that is run once before the app is deployed and dependencies are installed (can be useful for cleanups, like resetting caches, removing older versions of files, etc).

+

release

+

release which is a special worker that is run once when the app is deployed, after installing dependencies (can be useful for build steps).

+

Any worker will be automatically respawned upon failure ([uWSGI][uwsgi] will automatically shun/throttle crashy workers).

+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/design/index.html b/design/index.html new file mode 100644 index 0000000..c20d434 --- /dev/null +++ b/design/index.html @@ -0,0 +1,1089 @@ + + + + + + + + + + + + + + + + + + + + + + + Design - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Design

+

The idea behind piku is that it provides the simplest possible way to deploy web apps or services. Simplicity comes at the expense of features, of course, and this document tries to capture the trade-offs.

+

Core values

+
    +
  • Run on low end devices.
  • +
  • Accessible to hobbyists and K-12 schools.
  • +
  • ~1500 lines readable code.
  • +
  • Functional code style.
  • +
  • Few (single?) dependencies
  • +
  • 12 factor app.
  • +
  • Simplify user experience.
  • +
  • Cover 80% of common use cases.
  • +
  • Sensible defaults for all features.
  • +
  • Leverage distro packages in Raspbian/Debian/Ubuntu (Alpine and RHEL support is WIP)
  • +
  • Leverage standard tooling (git, ssh, uwsgi, nginx).
  • +
  • Preserve backwards compatibility where possible
  • +
+

Why uWSGI

+

Using uWSGI in emperor mode gives us the following features for free:

+
    +
  • Painless Python WSGI and virtualenv integration
  • +
  • Process monitoring, restarting, basic resource limiting, etc.
  • +
  • Basic security scaffolding, beginning with the ability to define uid/gid on a per-app basis (if necessary)
  • +
+

Application packaging

+

An app is simply a git repository with some additional files on the top level, the most important of which is the Procfile.

+

ENV settings

+

Since piku is targeted at 12 Factor apps, it allows you to set environment variables in a number of ways, the simplest of which is by adding an ENV file to your repository:

+
SETTING1=foo
+# piku supports comments and variable expansion
+SETTING2=${SETTING1}/bar
+# if this isn't defined, piku will assign a random TCP port
+PORT=9080
+
+

See configuration for a full list of environment variables that can also be set.

+

Environment variables can be changed after deployment using the config:set command.

+

Runtime detection

+

piku follows a very simple set of rules to determine what kind of runtime is required, outlined in the configuration section

+

Application isolation

+

Application isolation can be tackled at several levels, the most relevant of which being:

+
    +
  • OS/process isolation
  • +
  • Runtime/library isolation
  • +
+

For 1.0, all applications run under the same uid, under separate branches of the same filesystem, and without any resource limiting.

+

Ways to improve upon that (short of full containerisation) typically entail the use of a chroot jail environment (which is available under most POSIX systems in one form or another) or Linux kernel namespaces - both of which are supported by uWSGI (which can also handle resource limiting to a degree).

+

As to runtime isolation, piku only provides virtualenv support until 1.0. Python apps can run under Python 2 or 3 depending on the setting of PYTHON_VERSION, but will always use pre-installed interpreters (Go, Node and Java support will share these limitations in each major version).

+

Internals

+

piku uses two git repositories for each app: a bare repository for client push, and a clone for deployment (which is efficient in terms of storage since git tries to use hardlinks on local clones whenever possible).

+

This separation makes it easier to cope with long/large deployments and restore apps to a pristine condition, since the app will only go live after the deployment clone is reset (via git checkout -f).

+

Components

+

This diagram outlines how its components interact:

+
graph TD
+    subgraph "systemd"
+        nginx([nginx])
+        sshd([sshd])
+        uwsgi([uwsgi])
+    end
+    uwsgi-->vassal([vassal])
+    vassal-.->uwsgi.ini
+    sshd-->piku([piku.py])-->repo[git repo]
+    Procfile-->uwsgi.ini
+    an-->app
+    repo---app
+    repo---ENV
+    repo---requirements.txt
+    repo---Procfile
+    requirements.txt-->virtualenv
+    uwsgi.ini-->virtualenv
+    ENV-->an
+    ENV-->uwsgi.ini
+    nginx-.-mn[master<br>nginx.conf]
+    mn-.-an[app<br>nginx.conf]
+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/design/plugins.html b/design/plugins.html new file mode 100644 index 0000000..8e75f7d --- /dev/null +++ b/design/plugins.html @@ -0,0 +1,977 @@ + + + + + + + + + + + + + + + + + + + + + + + Plugins - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Plugins

+ +

Thanks to jsenin, piku currently has experimental support for external plugins via #129.

+

Plugins are inserted into the commands listing and can perform arbitrary actions. At this moment there are no official plugins, but here is an example file that should be placed at ~/.piku/plugins/postgres/__init__.py that could contain the commands to manage a Postgres database:

+
import click
+
+@click.group()
+def postgres():
+    """Postgres command plugin"""
+    pass
+
+@postgres.command("postgres:create")
+@click.argument('name')
+@click.argument('user')
+@click.argument('password')
+def postgres_create():
+    """Postgres create a database"""
+    pass
+
+@postgres.command("postgres:drop")
+@click.argument('name')
+def postgres_drop():
+    """Postgres drops a database"""
+    pass
+
+@postgres.command("postgres:import")
+@click.argument('name')
+def postgres_drop():
+    """Postgres import a database"""
+    pass
+
+@postgres.command("postgres:dump")
+@click.argument('name')
+def postgres_drop():
+    """Postgres dumps a database SQL"""
+    pass
+
+def cli_commands():
+    return postgres
+
+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/features.html b/features.html new file mode 100644 index 0000000..5f16f1a --- /dev/null +++ b/features.html @@ -0,0 +1,1106 @@ + + + + + + + + + + + + + + + + + + + + + + + Features - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Features

+

Workflow

+

piku supports a Heroku-like workflow:

+
    +
  • Create a git SSH remote pointing to your piku server with the app name as repo name: + git remote add piku piku@yourserver:appname.
  • +
  • Push your code: git push piku master (or if you want to push a different branch than the current one use git push piku release-branch-name).
  • +
  • piku determines the runtime and installs the dependencies for your app (building whatever's required).
  • +
  • For Python, it segregates each app's dependencies into a virtualenv.
  • +
  • For Go, it defines a separate GOPATH for each app.
  • +
  • For Node, it installs whatever is in package.json into node_modules.
  • +
  • For Java, it builds your app depending on either pom.xml or build.gradle file.
  • +
  • For Clojure, it can use either leiningen or the Clojure CLI and a deps.edn file.
  • +
  • For Ruby, it does bundle install of your gems in an isolated folder.
  • +
  • It then looks at a Procfile and starts the relevant workers using uwsgi as a generic process manager.
  • +
  • You can optionally also specify a release worker which is run once when the app is deployed.
  • +
  • You can then remotely change application settings (config:set) or scale up/down worker processes (ps:scale).
  • +
  • You can also bake application and nginx settings into an ENV configuration file.
  • +
+

You can also deploy a gh-pages style static site using a static worker type, with the root path as the argument, and run a release task to do some processing on the server after git push.

+

Virtual Hosts and SSL

+

piku has full virtual host support - i.e., you can host multiple apps on the same VPS and use DNS aliases to access them via different hostnames.

+

piku will also set up either a private certificate or obtain one via Let's Encrypt to enable SSL.

+

If you are on a LAN and are accessing piku from macOS/iOS/Linux clients, you can try using piku/avahi-aliases to announce different hosts for the same IP address via Avahi/mDNS/Bonjour.

+

Caching and Static Paths

+

Besides static sites, piku also supports directly mapping specific URL prefixes to filesystem paths (to serve static assets) or caching back-end responses (to remove load from applications).

+

These features are configured by setting appropriate values in the ENV file.

+

Supported Platforms

+

piku is intended to work in any POSIX-like environment where you have Python, nginx, uwsgi and ssh: it has been deployed on Linux, FreeBSD, [Cygwin][cygwin] and the [Windows Subsystem for Linux][wsl].

+

As a baseline, it began its development on an original 256MB Rasbperry Pi Model B, and still runs reliably on it.

+

But its main use is as a micro-PaaS to run applications on cloud servers with both Intel and ARM CPUs, with either Debian or Ubuntu Linux as target platforms.

+

Supported Runtimes

+

piku currently supports apps written in Python, Node, Clojure, Java and a few other languages (like Go) in the works.

+

But as a general rule, if it can be invoked from a shell, it can be run inside piku.

+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/get b/get new file mode 100644 index 0000000..f7025c9 --- /dev/null +++ b/get @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +echo "Downloading piku-bootstrap here." +curl -s https://raw.githubusercontent.com/piku/piku-bootstrap/master/piku-bootstrap > piku-bootstrap +chmod 755 piku-bootstrap +echo "Now you can install Piku on `hostname` like this:" +echo "./piku-bootstrap install" diff --git a/img/demo.svg b/img/demo.svg new file mode 100644 index 0000000..abfb4d0 --- /dev/null +++ b/img/demo.svg @@ -0,0 +1,44 @@ + + + + + + + + + + $ $ l $ ls $ ls $ ls - $ ls -a $ ls -al $ c $ ca $ cat $ cat $ cat E $ cat ENV INTERVAL=1 INTERVAL=1$ $ C $ $ c $ ca $ cat $ cat $ cat P $ cat Pr $ cat Procfile $ ls -altotal 56drwxr-xr-x@ 11 rcarmo staff 352 May 22 19:03 .drwx------+ 22 rcarmo staff 704 May 22 18:56 ..-rw-r--r--@ 1 rcarmo staff 91 Jul 24 2018 ENV-rw-r--r--@ 1 rcarmo staff 63 May 21 21:21 Procfile-rw-r--r--@ 1 rcarmo staff 508 May 21 22:26 README.md-rw-r--r--@ 1 rcarmo staff 456 May 21 22:22 clock.py-rw-r--r--@ 1 rcarmo staff 1038 Jul 24 2018 main.py-rw-r--r--@ 1 rcarmo staff 19 May 21 21:22 requirements.txtdrwxr-xr-x@ 4 rcarmo staff 128 Feb 3 2018 staticdrwxr-xr-x@ 3 rcarmo staff 96 Feb 3 2018 views-rw-r--r--@ 1 rcarmo staff 146 Jun 17 2018 worker.py$ cat ENV PORT=9080BIND_ADDRESS=0.0.0.0RANGE=10SETTING1=TrueSETTING2=${SETTING1}/MaybeINTERVAL=1$ $ cat Procfile $ g $ gi $ git $ git $ git i $ git in $ git ini $ git init $ git init wsgi: main:appworker: python worker.pyclock: python clock.py$ git init . $ git init .$ git a $ git ad $ git ad $ git ad d $ git ad $ git ad $ git add $ git add Initialized empty Git repository in /Users/rcarmo/Desktop/python_example/.git/$ git add . $ git c $ git co $ git com $ git comm $ git commi $ git commit $ git commit $ git commit - $ git commit -a $ git commit -a $ git commit -a - $ git commit -a -m $ git commit -a -m $ git commit -a -m " $ git commit -a -m "i $ git commit -a -m "in $ git commit -a -m "ini $ git commit -a -m "init $ git commit -a -m "initi $ git commit -a -m "initia $ git commit -a -m "initial $ git commit -a -m "initial $ git commit -a -m "initial c $ git commit -a -m "initial co $ git commit -a -m "initial com $ git commit -a -m "initial comm $ git commit -a -m "initial commi $ git commit -a -m "initial commit $ git add . $ git commit -a -m "initial commit" $ git commit -a -m "initial commit"[master (root-commit) 816b8c8] initial commit$ git r $ git re $ git rem $ git remo $ git remot $ git remote $ git remote $ git remote a $ git remote ad $ git remote add $ git remote add $ git remote add p $ git remote add pi $ git remote add pik $ git remote add piku $ git remote add piku $ git remote add piku p $ git remote add piku pi $ git remote add piku pik $ git remote add piku piku $ git remote add piku piku@ $ git remote add piku piku@l $ git remote add piku piku@la $ git remote add piku piku@lab $ git remote add piku piku@lab. $ git remote add piku piku@lab.l $ git remote add piku piku@lab.la $ git remote add piku piku@lab.lan $ git remote add piku piku@lab.lan: $ git remote add piku piku@lab.lan:p $ git remote add piku piku@lab.lan:py $ git remote add piku piku@lab.lan:pyt $ git remote add piku piku@lab.lan:pyth $ git remote add piku piku@lab.lan:pytho $ git remote add piku piku@lab.lan:python $ git remote add piku piku@lab.lan:python_ $ git remote add piku piku@lab.lan:python_e $ git remote add piku piku@lab.lan:python_ex $ git remote add piku piku@lab.lan:python_exa $ git remote add piku piku@lab.lan:python_exam $ git remote add piku piku@lab.lan:python_examp $ git remote add piku piku@lab.lan:python_exampl 11 files changed, 978 insertions(+) create mode 100644 ENV create mode 100644 Procfile create mode 100644 README.md create mode 100644 clock.py create mode 100644 main.py create mode 100644 requirements.txt create mode 100644 static/css/normalize.css create mode 100644 static/css/skeleton.css create mode 100644 static/favicon.ico create mode 100644 views/base.tpl create mode 100644 worker.py$ git remote add piku piku@lab.lan:python_example $ git p $ git pu $ git pus $ git push $ git push $ git push p $ git push pi $ git push pik $ git push piku $ git push piku $ git push piku p $ git push piku py $ git push piku pyt $ git push piku pyth $ git push piku pytho $ git push piku python $ git push piku python_ $ git push piku python_e $ git push piku python_ex $ git push piku python_e $ git push piku python_ $ git push piku python $ git push piku pytho $ git push piku pyth $ git push piku pyt $ git push piku py $ git push piku p $ git push piku $ git push piku m $ git push piku ma $ git push piku mas $ git push piku mast $ git push piku maste $ git remote add piku piku@lab.lan:python_example$ git push piku master $ git push piku master Enumerating objects: 16, done.Counting objects: 100% (16/16), done.Delta compression using up to 4 threadsCompressing objects: 50% (7/14) Writing objects: 62% (10/16) Compressing objects: 100% (14/14), done.Writing objects: 81% (13/16) Writing objects: 100% (16/16), 11.23 KiB | 5.61 MiB/s, done.Total 16 (delta 0), reused 0 (delta 0)remote: -----> Creating app 'python_example' remote: -----> Deploying app 'python_example' remote: Your branch is up-to-date with 'origin/master'. remote: -----> Python app detected. remote: -----> Creating virtualenv for 'python_example' remote: Already using interpreter /usr/bin/python3 remote: Using base prefix '/usr' remote: New python executable in /home/piku/.piku/envs/python_example/bin/python3 remote: Also creating executable in /home/piku/.piku/envs/python_example/bin/python remote: Installing setuptools, pkg_resources, pip, wheel...done. remote: -----> Running pip for 'python_example' remote: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple remote: Collecting bottle (from -r /home/piku/.piku/apps/python_example/requirements.txt (line 1)) remote: Using cached https://files.pythonhosted.org/packages/47/f1/666d2522c8eda26488315d7ee8882d848710b23d408ed4ced35d750d6e20/bottle-0.12.16-py3-none-any.whl remote: Collecting APScheduler (from -r /home/piku/.piku/apps/python_example/requirements.txt (line 2)) remote: Using cached https://files.pythonhosted.org/packages/93/09/ffc2ed85fa578cd0d4428e9c421407e5d91a4464bbaa44f789941416ae42/APScheduler-3.6.0-py2.py3-none-any.whl remote: Requirement already satisfied: setuptools>=0.7 in ./lib/python3.5/site-packages (from APScheduler->-r /home/piku/.piku/apps/python_example/requirements.txt (line 2)) (41.0.1) remote: Collecting pytz (from APScheduler->-r /home/piku/.piku/apps/python_example/requirements.txt (line 2)) remote: Using cached https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl remote: Collecting tzlocal>=1.2 (from APScheduler->-r /home/piku/.piku/apps/python_example/requirements.txt (line 2)) remote: Using cached https://www.piwheels.org/simple/tzlocal/tzlocal-1.5.1-py3-none-any.whl remote: Collecting six>=1.4.0 (from APScheduler->-r /home/piku/.piku/apps/python_example/requirements.txt (line 2)) remote: Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whremote: Installing collected packages: bottle, pytz, tzlocal, six, APScheduler remote: Successfully installed APScheduler-3.6.0 bottle-0.12.16 pytz-2019.1 six-1.12.0 tzlocal-1.5.1 remote: -----> nginx NGINX_IPV4_ADDRESS set to 0.0.0.0 remote: -----> nginx NGINX_IPV6_ADDRESS set to [::] remote: -----> spawning 'python_example:wsgi.1' remote: -----> nginx will talk to uWSGI via 0.0.0.0:9080 remote: -----> spawning 'python_example:worker.1' remote: -----> spawning 'python_example:clock.1' $ s $ ss $ ssh $ ssh $ ssh p $ ssh pi $ ssh pik $ ssh piku $ ssh piku@ $ ssh piku@l $ ssh piku@la $ ssh piku@lab $ ssh piku@lab. $ ssh piku@lab.l $ ssh piku@lab.la To lab.lan:python_example * [new branch] master -> master$ ssh piku@lab.lan $ ssh piku@lab.lanOptions: --help Show this message and exit.Commands: apps List apps, e.g.: piku apps config Show config, e.g.: piku config <app> config:get e.g.: piku config:get <app> FOO config:live e.g.: piku config:live <app> config:set e.g.: piku config:set <app> FOO=bar BAZ=quux config:unset e.g.: piku config:unset <app> FOO deploy e.g.: piku deploy <app> destroy e.g.: piku destroy <app> git-hook INTERNAL: Post-receive git hook git-receive-pack INTERNAL: Handle git pushes for an app logs Tail running logs, e.g: piku logs <app> ps Show process count, e.g: piku ps <app> ps:scale e.g.: piku ps:scale <app> <proc>=<count> restart Restart an app: piku restart <app> run e.g.: piku run <app> ls -- -al setup Initialize environment setup:ssh Set up a new SSH key (use - for stdin) stop Stop an app, e.g: piku stop <app>$ ssh piku@lab.lan $ ssh piku@lab.lan a $ ssh piku@lab.lan ap $ ssh piku@lab.lan app Connection to lab.lan closed.$ ssh piku@lab.lan apps $ ssh piku@lab.lan apps$ ssh piku@lab.lan app $ ssh piku@lab.lan ap $ ssh piku@lab.lan a $ ssh piku@lab.lan $ ssh piku@lab.lan l $ ssh piku@lab.lan lo $ ssh piku@lab.lan log $ ssh piku@lab.lan logs $ ssh piku@lab.lan logs $ ssh piku@lab.lan logs p $ ssh piku@lab.lan logs py $ ssh piku@lab.lan logs pyt $ ssh piku@lab.lan logs pyth $ ssh piku@lab.lan logs pytho $ ssh piku@lab.lan logs python $ ssh piku@lab.lan logs python_ $ ssh piku@lab.lan logs python_e $ ssh piku@lab.lan logs python_ex $ ssh piku@lab.lan logs python_exa $ ssh piku@lab.lan logs python_exam $ ssh piku@lab.lan logs python_examp $ ssh piku@lab.lan logs python_exampl node_expresspython_example$ ssh piku@lab.lan logs python_example $ ssh piku@lab.lan logs python_example wsgi.1 | detected binary path: /usr/bin/uwsgi-corewsgi.1 | chdir() to /home/piku/.piku/apps/python_examplewsgi.1 | your processes number limit is 7345wsgi.1 | your memory page size is 4096 byteswsgi.1 | detected max file descriptor number: 1024wsgi.1 | lock engine: pthread robust mutexeswsgi.1 | thunder lock: disabled (you can enable it with --thunder-lock)wsgi.1 | uwsgi socket 0 bound to TCP address 0.0.0.0:9080 fd 6wsgi.1 | Python version: 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516]wsgi.1 | Set PythonHome to /home/piku/.piku/envs/python_examplewsgi.1 | Python main interpreter initialized at 0x94e5e0wsgi.1 | python threads support enabledwsgi.1 | your server socket listen backlog is limited to 16 connectionswsgi.1 | your mercy for graceful operations on workers is 60 secondswsgi.1 | mapped 173056 bytes (169 KB) for 4 coreswsgi.1 | *** Operational MODE: threaded ***wsgi.1 | WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x94e5e0 pid: 14736 (default app)wsgi.1 | *** uWSGI is running in multiple interpreter mode ***wsgi.1 | spawned uWSGI master process (pid: 14736)wsgi.1 | spawned uWSGI worker 1 (pid: 14741, cores: 4)clock.1 | clock source: unixclock.1 | pcre jit disabledclock.1 | detected number of CPU cores: 4clock.1 | current working directory: /home/piku/.piku/uwsgi-enabledclock.1 | detected binary path: /usr/bin/uwsgi-coreclock.1 | chdir() to /home/piku/.piku/apps/python_exampleclock.1 | your processes number limit is 7345clock.1 | your memory page size is 4096 bytesclock.1 | detected max file descriptor number: 1024clock.1 | lock engine: pthread robust mutexesclock.1 | thunder lock: disabled (you can enable it with --thunder-lock)clock.1 | your mercy for graceful operations on workers is 60 secondsclock.1 | *** Operational MODE: no-workers ***clock.1 | !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!clock.1 | no request plugin is loaded, you will not be able to manage requests.clock.1 | you may need to install the package for your language of choice, or simply load it with --plugin.clock.1 | !!!!!!!!!!! END OF WARNING !!!!!!!!!!clock.1 | spawned uWSGI master process (pid: 14734)clock.1 | [uwsgi-daemons] spawning "python clock.py" (uid: 1001 gid: 33)clock.1 | starting schedulerworker.1 | 1worker.1 | 2worker.1 | 3worker.1 | 4worker.1 | 5worker.1 | 6worker.1 | 7worker.1 | 8worker.1 | 9worker.1 | [uwsgi-daemons] respawning "python worker.py" (uid: 1001 gid: 33)worker.1 | 0^C ^C$ ^C$ ssh piku@lab.lan logs python_example ^C$ ssh piku@lab.lan logs ^C$ ssh piku@lab.lan ^C$ ssh piku@lab.lan p ^C$ ssh piku@lab.lan ps ^C$ ssh piku@lab.lan ps: ^C$ ssh piku@lab.lan ps:s ^C$ ssh piku@lab.lan ps:sc ^C$ ssh piku@lab.lan ps:sca ^C$ ssh piku@lab.lan ps:scal ^C$ ssh piku@lab.lan ps:scale ^C$ ssh piku@lab.lan ps:scale ^C$ ssh piku@lab.lan ps:scale p ^C$ ssh piku@lab.lan ps:scale py ^C$ ssh piku@lab.lan ps:scale pyt ^C$ ssh piku@lab.lan ps:scale pyth ^C$ ssh piku@lab.lan ps:scale pytho ^C$ ssh piku@lab.lan ps:scale python ^C$ ssh piku@lab.lan ps:scale python_ ^C$ ssh piku@lab.lan ps:scale python_e ^C$ ssh piku@lab.lan ps:scale python_ex ^C$ ssh piku@lab.lan ps:scale python_exa ^C$ ssh piku@lab.lan ps:scale python_exam ^C$ ssh piku@lab.lan ps:scale python_examp ^C$ ssh piku@lab.lan ps:scale python_exampl ^C$ ssh piku@lab.lan ps:scale python_example ^C$ ssh piku@lab.lan ps:scale python_example ^C$ ssh piku@lab.lan ps:scale python_example w ^C$ ssh piku@lab.lan ps:scale python_example wo ^C$ ssh piku@lab.lan ps:scale python_example wor ^C$ ssh piku@lab.lan ps:scale python_example work ^C$ ssh piku@lab.lan ps:scale python_example worke ^C$ ssh piku@lab.lan ps:scale python_example worker ^C$ ssh piku@lab.lan ps:scale python_example worker= ^C$ ssh piku@lab.lan ps:scale python_example worker=4 ^C$ ssh piku@lab.lan ps:scale python_example worker=4 -----> Deploying app 'python_example'Your branch is up-to-date with 'origin/master'.-----> Python app detected.-----> nginx NGINX_IPV4_ADDRESS set to 0.0.0.0-----> nginx NGINX_IPV6_ADDRESS set to [::]-----> spawning 'python_example:worker.2'-----> spawning 'python_example:worker.3'$ ssh piku@lab.lan ps:scale python_example worker=4 -----> spawning 'python_example:worker.4'$ ssh piku@lab.lan logs python_example $ ssh piku@lab.lan logs python_example worker.4 | clock source: unixworker.4 | pcre jit disabledworker.4 | detected number of CPU cores: 4worker.4 | current working directory: /home/piku/.piku/uwsgi-enabledworker.4 | detected binary path: /usr/bin/uwsgi-coreworker.4 | chdir() to /home/piku/.piku/apps/python_exampleworker.4 | your processes number limit is 7345worker.4 | your memory page size is 4096 bytesworker.4 | detected max file descriptor number: 1024worker.4 | lock engine: pthread robust mutexesworker.4 | thunder lock: disabled (you can enable it with --thunder-lock)worker.4 | your mercy for graceful operations on workers is 60 secondsworker.4 | *** Operational MODE: no-workers ***worker.4 | !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!worker.4 | no request plugin is loaded, you will not be able to manage requests.worker.4 | you may need to install the package for your language of choice, or sworker.4 | !!!!!!!!!!! END OF WARNING !!!!!!!!!!worker.4 | spawned uWSGI master process (pid: 15155)worker.4 | [uwsgi-daemons] spawning "python worker.py" (uid: 1001 gid: 33)worker.4 | 0worker.3 | clock source: unixworker.3 | pcre jit disabledworker.3 | detected number of CPU cores: 4worker.3 | current working directory: /home/piku/.piku/uwsgi-enabledworker.3 | detected binary path: /usr/bin/uwsgi-coreworker.3 | chdir() to /home/piku/.piku/apps/python_exampleworker.3 | your processes number limit is 7345worker.3 | your memory page size is 4096 bytesworker.3 | detected max file descriptor number: 1024worker.3 | lock engine: pthread robust mutexesworker.3 | thunder lock: disabled (you can enable it with --thunder-lock)worker.3 | your mercy for graceful operations on workers is 60 secondsworker.3 | *** Operational MODE: no-workers ***worker.3 | !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!worker.3 | no request plugin is loaded, you will not be able to manage requests.worker.3 | you may need to install the package for your language of choice, or sworker.3 | !!!!!!!!!!! END OF WARNING !!!!!!!!!!worker.3 | spawned uWSGI master process (pid: 15160)worker.3 | [uwsgi-daemons] spawning "python worker.py" (uid: 1001 gid: 33)worker.3 | 0worker.2 | clock source: unixworker.2 | pcre jit disabledworker.2 | detected number of CPU cores: 4worker.2 | current working directory: /home/piku/.piku/uwsgi-enabledworker.2 | detected binary path: /usr/bin/uwsgi-coreworker.2 | chdir() to /home/piku/.piku/apps/python_exampleworker.2 | your processes number limit is 7345worker.2 | your memory page size is 4096 bytesworker.2 | detected max file descriptor number: 1024worker.2 | lock engine: pthread robust mutexesworker.2 | thunder lock: disabled (you can enable it with --thunder-lock)worker.2 | your mercy for graceful operations on workers is 60 secondsworker.2 | *** Operational MODE: no-workers ***worker.2 | !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!worker.2 | no request plugin is loaded, you will not be able to manage requests.worker.2 | you may need to install the package for your language of choice, or sworker.2 | !!!!!!!!!!! END OF WARNING !!!!!!!!!!worker.2 | spawned uWSGI master process (pid: 15154)worker.2 | [uwsgi-daemons] spawning "python worker.py" (uid: 1001 gid: 33)worker.2 | 0worker.4 | 1worker.3 | 1worker.2 | 1worker.4 | 2worker.3 | 2worker.2 | 2worker.4 | 3worker.3 | 3worker.2 | 3worker.4 | 4worker.3 | 4worker.2 | 4worker.4 | 5worker.3 | 5worker.2 | 5worker.4 | 6worker.3 | 6worker.2 | 6worker.4 | 7worker.3 | 7worker.2 | 7^C$ ssh piku@lab.lan d ^C$ ssh piku@lab.lan de ^C$ ssh piku@lab.lan des ^C$ ssh piku@lab.lan dest ^C$ ssh piku@lab.lan destr ^C$ ssh piku@lab.lan destro ^C$ ssh piku@lab.lan destroy ^C$ ssh piku@lab.lan destroy ^C$ ssh piku@lab.lan destroy p ^C$ ssh piku@lab.lan destroy py ^C$ ssh piku@lab.lan destroy pyt ^C$ ssh piku@lab.lan destroy pyth ^C$ ssh piku@lab.lan destroy pytho ^C$ ssh piku@lab.lan destroy python ^C$ ssh piku@lab.lan destroy python_ ^C$ ssh piku@lab.lan destroy python_e ^C$ ssh piku@lab.lan destroy python_ex ^C$ ssh piku@lab.lan destroy python_exa ^C$ ssh piku@lab.lan destroy python_exam ^C$ ssh piku@lab.lan destroy python_examp ^C$ ssh piku@lab.lan destroy python_exampl worker.4 | 8worker.3 | 8worker.2 | 8^C$ ssh piku@lab.lan destroy python_example ^C$ ssh piku@lab.lan destroy python_example Removing folder '/home/piku/.piku/apps/python_example'Removing folder '/home/piku/.piku/repos/python_example'Removing folder '/home/piku/.piku/envs/python_example'Removing folder '/home/piku/.piku/logs/python_example'Removing file '/home/piku/.piku/uwsgi-available/python_example_clock.1.ini'Removing file '/home/piku/.piku/uwsgi-available/python_example_worker.1.ini'Removing file '/home/piku/.piku/uwsgi-available/python_example_worker.2.ini'Removing file '/home/piku/.piku/uwsgi-available/python_example_worker.4.ini'Removing file '/home/piku/.piku/uwsgi-available/python_example_worker.3.ini'Removing file '/home/piku/.piku/uwsgi-available/python_example_wsgi.1.ini'Removing file '/home/piku/.piku/uwsgi-enabled/python_example_clock.1.ini'Removing file '/home/piku/.piku/uwsgi-enabled/python_example_worker.1.ini'Removing file '/home/piku/.piku/uwsgi-enabled/python_example_worker.2.ini'Removing file '/home/piku/.piku/uwsgi-enabled/python_example_worker.4.ini'Removing file '/home/piku/.piku/uwsgi-enabled/python_example_worker.3.ini'Removing file '/home/piku/.piku/uwsgi-enabled/python_example_wsgi.1.ini'$ $ exit + diff --git a/img/icon.png b/img/icon.png new file mode 100644 index 0000000..81d9bf0 Binary files /dev/null and b/img/icon.png differ diff --git a/img/logo.svg b/img/logo.svg new file mode 100644 index 0000000..7d0b925 --- /dev/null +++ b/img/logo.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + typeface: Varela Roundcolor: #ff2a2a + + diff --git a/img/piku.svg b/img/piku.svg new file mode 100644 index 0000000..16c42ad --- /dev/null +++ b/img/piku.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..f199894 --- /dev/null +++ b/index.html @@ -0,0 +1,1091 @@ + + + + + + + + + + + + + + + + + + + + + Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

+

piku, inspired by dokku, allows you do git push deployments to your own servers, no matter how small they are.

+

+ + Installing + + + Using/Features + + + Managing and Monitoring + + + Examples + + + Web App Tutorial + +

+

Demo

+

asciicast

+

Workflow

+

piku supports a Heroku-like workflow:

+
    +
  • Create a git SSH remote pointing to your piku server with the app name as repo name: + git remote add piku piku@yourserver:appname.
  • +
  • Push your code: git push piku master (or if you want to push a different branch than the current one use git push piku release-branch-name).
  • +
  • piku determines the runtime and installs the dependencies for your app (building whatever's required).
  • +
  • It then looks at a Procfile and starts matching worker processes.
  • +
  • You can optionally also specify a release worker which is run once when the app is deployed.
  • +
  • You can then remotely change application settings (config:set) or scale up/down worker processes (ps:scale).
  • +
  • You can also bake application and nginx settings into an ENV configuration file.
  • +
+

You can also deploy a gh-pages style static site using a static worker type, with the root path as the argument, and run a release task to do some processing on the server after git push.

+

Project Activity

+

piku is considered STABLE. It is actively maintained, but "actively" here means the feature set is pretty much done, so it is only updated when new language runtimes are added or reproducible bugs crop up.

+

It currently requires Python 3.7 or above, since even though 3.8+ is now the baseline Python 3 version in Ubuntu LTS 20.04 and Debian 11 has already moved on to 3.9, there are no substantial differences between those versions.

+

Deprecation Notices

+

Since most of its users run it on LTS distributions, there is no rush to introduce disruption. The current plan is to throw up a warning for older runtimes and do regression testing for 3.7-3.12 (replacing the current bracket of tests from 3.5 to 3.8), and make sure we also cover Ubuntu 22.04, Debian 11 and Fedora 37+.

+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/install/INSTALL-centos-9.html b/install/INSTALL-centos-9.html new file mode 100644 index 0000000..7289027 --- /dev/null +++ b/install/INSTALL-centos-9.html @@ -0,0 +1,1152 @@ + + + + + + + + + + + + + + + + + + + + + + + Installation on CentOS 9 - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Installation on CentOS 9

+
+

Note

+

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

+
+

All steps done as root (or add sudo if you prefer).

+

Dependencies

+

Before installing piku, you need to install the following packages:

+
dnf in -y ansible-core ansible-collection-ansible-posix ansible-collection-ansible-utils nginx nodejs npm openssl postgresql postgresql-server postgresql-contrib python3 python3-pip uwsgi uwsgi-logger-file uwsgi-logger-systemd
+pip install click
+
+

Set up the piku user

+
adduser --groups nginx piku
+# copy & setup piku.py
+su - piku -c "wget https://raw.githubusercontent.com/piku/piku/master/piku.py && python3 ~/piku.py setup"
+
+

Set up SSH access

+

See INSTALL.md

+

uWSGI Configuration

+

FYI The uWSGI Emperor – multi-app deployment

+
mv /home/piku/.piku/uwsgi/uwsgi.ini /etc/uwsgi.d/piku.ini # linking alone increases the host attack service if one can get inside the piku user or one of its apps, so moving is safer
+chown piku:piku /etc/uwsgi.d/piku.ini # In Tyrant mode (set by default in /etc/uwsgi.ini) the Emperor will run the vassal using the UID/GID of the vassal configuration file
+systemctl restart uwsgi
+journalctl -feu uwsgi # see logs
+
+

nginx Configuration

+

FYI Setting up and configuring NGINX

+
echo "include /home/piku/.piku/nginx/*.conf;" > /etc/nginx/conf.d/piku.conf
+systemctl restart nginx
+journalctl -feu nginx # see logs
+
+

Set up systemd.path to reload nginx upon config changes

+
# Set up systemd.path to reload nginx upon config changes
+su -
+git clone https://github.com/piku/piku.git # need a copy of some files
+cp -v piku/piku-nginx.{path,service} /etc/systemd/system/
+systemctl enable piku-nginx.{path,service}
+systemctl start piku-nginx.path
+# Check the status of piku-nginx.service
+systemctl status piku-nginx.path # should return `active: active (waiting)`
+
+

Notes

+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/install/INSTALL-other.html b/install/INSTALL-other.html new file mode 100644 index 0000000..addbc8f --- /dev/null +++ b/install/INSTALL-other.html @@ -0,0 +1,1451 @@ + + + + + + + + + + + + + + + + + + + + + + + Installation on other platforms - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Installation on other platforms

+
+

Note

+

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

+
+

Dependencies

+

Before running piku for the first time, you need to install the following Python packages at the system level:

+

Raspbian Jessie, Debian 8, Ubuntu 16.04

+
sudo apt-get install git python3-virtualenv python3-pip
+sudo pip3 install -U click
+
+

Raspbian Wheezy

+
sudo apt-get install git python3
+sudo easy_install3 -U pip3
+sudo pip3 install -U click virtualenv
+
+

These may or may not be installed already (click usually isn't). For Raspbian Wheezy this is the preferred approach, since current apt packages are fairly outdated.

+

Set up the piku user, Set up SSH access

+

See INSTALL.md

+

uWSGI Installation (Debian Linux variants, any architecture)

+

uWSGI can be installed in a variety of fashions. These instructions cover both pre-packaged and source installs depending on your system.

+

Raspbian Jessie, Debian 8

+
+

Warning

+

These OS releases are no longer supported and these instructions are kept for reference purposes only.

+
+

In Raspbian Jessie, Debian 8 and other systemd distributions where uWSGI is already available pre-compiled (but split into a number of plugins), do the following:

+

# At the time of this writing, this installs uwsgi 2.0.7 on Raspbian Jessie.
+# You can also install uwsgi-plugins-all if you want to get runtime support for other languages
+sudo apt-get install uwsgi uwsgi-plugin-python3
+# refer to our executable using a link, in case there are more versions installed
+sudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku
+# disable the standard uwsgi startup script
+sudo systemctl disable uwsgi
+
+# add our own startup script
+sudo cp /tmp/uwsgi-piku.service /etc/systemd/system/
+sudo systemctl enable uwsgi-piku
+sudo systemctl start uwsgi-piku
+
+# check it's running
+sudo systemctl status uwsgi-piku.service
+
+Important Note: Make sure you run piku.py setup as outlined above before starting the service.

+

Also, please note that uwsgi-piku.service, as provided, creates a /run/uwsgi-piku directory for it to place socket files and sundry. This is not actually used at the moment, since the uwsgi socket file is placed inside the piku user directory for consistency across OS distributions. This will be cleaned up in a later release.

+

Raspbian Wheezy

+
+

Warning

+

This OS release is no longer supported and these instructions are kept for reference purposes only.

+
+

Since Raspbian Wheezy is a fairly old distribution by now, its uwsgi-* packages are completely outdated (and depend on Python 2.6), so we have to compile and install our own version, as well as using an old-style init script to have it start automatically upon boot.

+

sudo apt-get install build-essential python-dev libpcre3-dev
+# At the time of this writing, this installs 2.0.12
+sudo pip install uwsgi
+# refer to our executable using a link, in case there are more versions installed
+sudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku
+
+# set up our init script
+sudo cp /tmp/uwsgi-piku.dist /etc/init.d/uwsgi-piku
+sudo chmod +x /etc/init.d/uwsgi-piku
+sudo update-rc.d uwsgi-piku defaults
+sudo service uwsgi-piku start
+
+Important Note: Make sure you run python3 piku.py setup as outlined above before starting the service.

+

Ubuntu 14.04 LTS

+
+

Warning

+

This OS release is no longer supported and these instructions are kept for reference purposes only.

+
+

This is a mix of both the above, and should change soon when we get 16.04. If you have trouble, install uWSGI via pip instead.

+
# At the time of this writing, this installs uwsgi 1.9.17 on Ubuntu 14.04 LTS.
+# You can also install uwsgi-plugins-all if you want to get runtime support for other languages
+sudo apt-get install uwsgi uwsgi-plugin-python3
+# refer to our executable using a link, in case there are more versions installed
+sudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku
+
+# set up our init script
+sudo cp /tmp/uwsgi-piku.dist /etc/init.d/uwsgi-piku
+sudo chmod +x /etc/init.d/uwsgi-piku
+sudo update-rc.d uwsgi-piku defaults
+sudo service uwsgi-piku start
+
+

nginx Installation (Raspbian 8, Ubuntu 16.04)

+
+

Warning

+

These OS releases are no longer supported and these instructions are kept for reference purposes only.

+
+
+

Warning

+

There is a bug in nginx 1.6.2 under Raspbian 8 that causes it to try to allocate around a gigabyte of RAM when using SSL with SPDY. I seriously recommend using Ubuntu instead, if you can, or disabling SSL altogether.

+
+
sudo apt-get install nginx
+# Set up nginx to pick up our config files
+sudo cp /tmp/nginx.default.dist /etc/nginx/sites-available/default
+# Set up systemd.path to reload nginx upon config changes
+sudo cp ./piku-nginx.{path, service} /etc/systemd/system/
+sudo systemctl enable piku-nginx.{path,service}
+sudo systemctl start piku-nginx.path
+# Check the status of piku-nginx.service
+systemctl status piku-nginx.path # should return `Active: active (waiting)`
+# Restart NGINX
+sudo systemctl restart nginx
+
+

Java 8 Installation (All Debian Linux variants, on Raspberry Pi)

+
+

Warning

+

OpenJDK 8 is no longer shipping with most distributions and these instructions are kept for reference purposes only.

+
+

To be able to deploy Java apps, we're going to need to install Java (and, since we're going to be doing so on ARM, it's best to use Oracle's runtime). To do that, we're going to use the webupd8team PPA, which has a (cross-platform) Java installer.

+

First, get rid of OpenJDK and import the PPA key:

+
sudo apt-get remove openjdk*
+sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com EEA14886
+
+

Raspbian Jessie

+
+

Warning

+

This OS release is no longer supported and these instructions are kept for reference purposes only.

+
+

For Jessie, we're going to use the trusty version of the installer:

+
sudo tee /etc/apt/sources.list.d/webupd8team.list
+deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main 
+deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
+^D
+
+

Ubuntu 16.04 for ARM

+
+

Warning

+

This OS release is no longer supported and these instructions are kept for reference purposes only.

+
+

For Xenial, we're going to use its own version:

+
sudo tee /etc/apt/sources.list.d/webupd8team.list
+deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main 
+deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
+^D
+
+

Now perform the actual install:

+
sudo apt-get update
+sudo apt-get install oracle-java8-installer oracle-java8-set-default
+
+

Go Installation (All Debian Linux variants, on Raspberry Pi)

+
+

This is EXPERIMENTAL and may not work at all.

+
+

Raspbian Wheezy/Jessie

+
+

Warning

+

Wheezy and Jessie are no longer supported and these instructions are kept for reference purposes only.

+
+

Since Raspbian's Go compiler is version 1.0.2, we need something more up-to-date.

+
    +
  1. Get an ARM 6 binary tarball
  2. +
  3. Unpack it under the piku user like such:
  4. +
+
sudo su - piku
+tar -zxvf /tmp/go1.5.3.linux-arm.tar.gz
+# remove unnecessary files
+rm -rf go/api go/blog go/doc go/misc go/test
+
+
    +
  1. Give it a temporary GOPATH and install godep:
  2. +
+
sudo su - piku
+GOROOT=$HOME/go GOPATH=$HOME/gopath PATH=$PATH:$HOME/go/bin go get github.com/tools/godep
+# temporary workaround until this is fixed in godep or Go 1.7(?)
+GOROOT=$HOME/go GOPATH=$HOME/gopath PATH=$PATH:$HOME/go/bin go get golang.org/x/sys/unix
+
+

TODO: complete this.

+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/install/INSTALL-raspbian-9.4-stretch-10-buster.html b/install/INSTALL-raspbian-9.4-stretch-10-buster.html new file mode 100644 index 0000000..363bb72 --- /dev/null +++ b/install/INSTALL-raspbian-9.4-stretch-10-buster.html @@ -0,0 +1,1176 @@ + + + + + + + + + + + + + + + + + + + + + + + Installation on Raspbian Stretch or Buster - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Installation on Raspbian Stretch or Buster

+
+

Note

+

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

+
+

piku setup is simplified in modern Debian versions, since it can take advantage of some packaging improvements in uWSGI and does not require a custom systemd service. However, Stretch still ships with Python 3.5, which means it's not an ideal environment for new deployments on both Intel and ARM devices (Buster, in turn, ships with Python 3.7).

+

Setting up your Raspberry Pi

+

Download and install Raspbian onto an SD card.

+

After you install it is recommended that you do the following to update your installation to the latest available software.

+
# update apt-get
+sudo apt-get update
+
+# upgrade all software
+sudo apt-get upgrade
+
+

Configure your installation. It is recommended that Change Password from the default and setup Locale Options (Locale and Timezone) and EXPAND FILESYSTEM. You will also want to Enable SSH. +

# configure your installation
+sudo raspi-config
+

+

At this point it is a good idea to sudo shutdown -h now and make a backup image of the card.

+

Dependencies

+

Before installing piku, you need to install the following packages:

+
sudo apt-get install -y build-essential certbot git \
+    libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev nginx \
+    python-certbot-nginx python-dev python-pip python-virtualenv \
+    python3-dev python3-pip python3-click python3-virtualenv \
+    uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python \
+    uwsgi-plugin-python uwsgi-plugin-python3 uwsgi-plugin-tornado-python \
+    uwsgi-plugin-lua5.1 uwsgi-plugin-lua5.2 uwsgi-plugin-luajit
+
+

Set up the piku user, Set up SSH access

+

See INSTALL.md

+

uWSGI Configuration

+

uWSGI in Stretch and Buster requires very little configuration, since it is already properly packaged. All you need to do is create a symlink to the piku configuration file in /etc/uwsgi/apps-enabled:

+
sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini
+sudo systemctl restart uwsgi
+
+

nginx Configuration

+

piku requires you to edit /etc/nginx/sites-available/default to the following, so it can inject new site configurations into nginx:

+
server {
+    listen 80 default_server;
+    listen [::]:80 default_server;
+    root /var/www/html;
+    index index.html index.htm;
+    server_name _;
+    location / {
+        try_files $uri $uri/ =404;
+    }
+}
+# replace `PAAS_USERNAME` with the username you created.
+include /home/PAAS_USERNAME/.piku/nginx/*.conf;
+
+

Set up systemd.path to reload nginx upon config changes

+
# Set up systemd.path to reload nginx upon config changes
+sudo cp ./piku-nginx.{path, service} /etc/systemd/system/
+sudo systemctl enable piku-nginx.{path,service}
+sudo systemctl start piku-nginx.path
+# Check the status of piku-nginx.service
+systemctl status piku-nginx.path # should return `Active: active (waiting)`
+# Restart NGINX
+sudo systemctl restart nginx
+
+

Notes

+
+

This file was last updated on June 2019

+
+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/install/INSTALL-ubuntu-16.04.html b/install/INSTALL-ubuntu-16.04.html new file mode 100644 index 0000000..6bec3be --- /dev/null +++ b/install/INSTALL-ubuntu-16.04.html @@ -0,0 +1,989 @@ + + + + + + + + + + + + + + + + + + + + + + + Ubuntu 16.04 - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Ubuntu 16.04

+
+

Note

+

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

+
+
sudo apt-get update
+sudo apt-get -y dist-upgrade
+sudo apt-get -y autoremove
+sudo apt-get install -y tmux vim htop fail2ban uwsgi uwsgi-plugin-python uwsgi-plugin-python3 uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python uwsgi-plugin-tornado-python nginx libxml2-dev libxslt1-dev python-dev zlib1g-dev build-essential git python3-virtualenv python3-pip python3-click
+sudo pip3 install -U click pip
+sudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data piku
+
+# move to /tmp and grab our distribution files
+cd /tmp
+wget https://raw.githubusercontent.com/piku/piku/master/piku.py
+wget https://raw.githubusercontent.com/piku/piku/master/piku-nginx.path
+wget https://raw.githubusercontent.com/piku/piku/master/piku-nginx.service
+wget https://raw.githubusercontent.com/piku/piku/master/nginx.default.dist
+wget https://raw.githubusercontent.com/piku/piku/master/uwsgi-piku.service
+# Set up nginx to pick up our config files
+sudo cp /tmp/nginx.default.dist /etc/nginx/sites-available/default
+# Set up systemd.path to reload nginx upon config changes
+sudo cp ./piku-nginx.{path, service} /etc/systemd/system/
+sudo systemctl enable piku-nginx.{path,service}
+sudo systemctl start piku-nginx.path
+# Restart NGINX
+sudo systemctl restart nginx
+sudo cp /tmp/uwsgi-piku.service /etc/systemd/system/
+# refer to our executable using a link, in case there are more versions installed
+sudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku
+# disable the standard uwsgi startup script
+sudo systemctl disable uwsgi
+sudo systemctl enable uwsgi-piku
+sudo su - piku
+mkdir ~/.ssh
+chmod 700 ~/.ssh
+# now copy the piku script to this user account
+cp /tmp/piku.py ~/piku.py
+python3 piku.py setup
+# Now import your SSH key using setup:ssh
+
+sudo systemctl start uwsgi-piku
+
+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/install/INSTALL-ubuntu-18.04-bionic.html b/install/INSTALL-ubuntu-18.04-bionic.html new file mode 100644 index 0000000..6cb5304 --- /dev/null +++ b/install/INSTALL-ubuntu-18.04-bionic.html @@ -0,0 +1,1144 @@ + + + + + + + + + + + + + + + + + + + + + + + Installation on Ubuntu 18.04 LTS (Bionic) - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Installation on Ubuntu 18.04 LTS (Bionic)

+
+

Note

+

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

+
+

piku setup is simplified in Bionic, since it can take advantage of some packaging improvements in uWSGI and does not require a custom systemd service. Since Bionic also ships with Python 3.6, this is an ideal environment for new deployments on both Intel and ARM devices.

+

Dependencies

+

Before installing piku, you need to install the following packages:

+
sudo apt-get update
+sudo apt-get install -y build-essential certbot git \
+    libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev nginx \
+    python-certbot-nginx python-dev python-pip python-virtualenv \
+    python3-dev python3-pip python3-click python3-virtualenv \
+    uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python \
+    uwsgi-plugin-python uwsgi-plugin-python3 uwsgi-plugin-tornado-python
+
+

Set up the piku user, Set up SSH access

+

See INSTALL.md

+

uWSGI Configuration

+

uWSGI requires very little configuration, since it is already properly packaged. All you need to do is place a link to the piku configuration file in /etc/uwsgi/apps-enabled:

+
sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini
+sudo systemctl restart uwsgi
+
+

nginx Configuration

+

piku requires you to edit /etc/nginx/sites-available/default to the following, so it can inject new site configurations into nginx:

+
server {
+    listen 80 default_server;
+    listen [::]:80 default_server;
+    root /var/www/html;
+    index index.html index.htm;
+    server_name _;
+    location / {
+        try_files $uri $uri/ =404;
+    }
+}
+# replace `PAAS_USERNAME` with the username you created.
+include /home/PAAS_USERNAME/.piku/nginx/*.conf;
+
+

Set up systemd.path to reload nginx upon config changes

+
# Set up systemd.path to reload nginx upon config changes
+sudo cp ./piku-nginx.{path, service} /etc/systemd/system/
+sudo systemctl enable piku-nginx.{path,service}
+sudo systemctl start piku-nginx.path
+# Check the status of piku-nginx.service
+systemctl status piku-nginx.path # should return `Active: active (waiting)`
+# Restart NGINX
+sudo systemctl restart nginx
+
+

Notes

+
+

This file was last updated on November 2018

+
+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/install/INSTALL-ubuntu-22.04-jammy.html b/install/INSTALL-ubuntu-22.04-jammy.html new file mode 100644 index 0000000..4e8f2cd --- /dev/null +++ b/install/INSTALL-ubuntu-22.04-jammy.html @@ -0,0 +1,1144 @@ + + + + + + + + + + + + + + + + + + + + + + + Installation on Ubuntu 22.04 LTS (Jammy) - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Installation on Ubuntu 22.04 LTS (Jammy)

+
+

Note

+

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

+
+

piku setup is simplified in Jammy, since it can take advantage of some packaging improvements in uWSGI and does not require a custom systemd service. Since Jammy also ships with Python 3.10, this is an ideal environment for new deployments on both Intel and ARM devices.

+

Dependencies

+

Before installing piku, you need to install the following packages:

+
sudo apt-get update
+sudo apt-get install -y build-essential certbot git \
+    libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev nginx \
+    python3-certbot-nginx \
+    python3-dev python3-pip python3-click python3-virtualenv \
+    uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python3 \
+    uwsgi-plugin-python3 uwsgi-plugin-tornado-python3
+
+

Set up the piku user, Set up SSH access

+

See INSTALL.md

+

uWSGI Configuration

+

uWSGI requires very little configuration, since it is already properly packaged. All you need to do is place a link to the piku configuration file in /etc/uwsgi/apps-enabled:

+
sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini
+sudo systemctl restart uwsgi
+
+

nginx Configuration

+

piku requires you to edit /etc/nginx/sites-available/default to the following, so it can inject new site configurations into nginx:

+
server {
+    listen 80 default_server;
+    listen [::]:80 default_server;
+    root /var/www/html;
+    index index.html index.htm;
+    server_name _;
+    location / {
+        try_files $uri $uri/ =404;
+    }
+}
+# replace `PAAS_USERNAME` with the username you created.
+include /home/PAAS_USERNAME/.piku/nginx/*.conf;
+
+

Set up systemd.path to reload nginx upon config changes

+
# Set up systemd.path to reload nginx upon config changes
+sudo cp ./piku-nginx.{path, service} /etc/systemd/system/
+sudo systemctl enable piku-nginx.{path,service}
+sudo systemctl start piku-nginx.path
+# Check the status of piku-nginx.service
+systemctl status piku-nginx.path # should return `Active: active (waiting)`
+# Restart NGINX
+sudo systemctl restart nginx
+
+

Notes

+
+

This file was last updated on November 2018

+
+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/install/RASPBERRY_PI_QUICKSTART.html b/install/RASPBERRY_PI_QUICKSTART.html new file mode 100644 index 0000000..2a3e238 --- /dev/null +++ b/install/RASPBERRY_PI_QUICKSTART.html @@ -0,0 +1,1062 @@ + + + + + + + + + + + + + + + + + + + + + Setting up a Raspberry Pi Piku Server from Scratch - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Setting up a Raspberry Pi Piku Server from Scratch

+
+

Warning

+

These instructions are correct as of April 1st 2016. Quite a bit has changed since then in Raspberry Pi land, so you may need to adjust them accordingly.

+
+

Start by flashing a SD card with the latest Raspbian Jessie Lite image.

+

Do this in your Raspberry Pi as 'pi' user

+

Boot it, launch raspi-config to perform (at least) the following configuration:

+
# as 'pi' user
+sudo raspi-config
+
+
    +
  • 1) expand filesystem
  • +
  • 2) change default user password
  • +
  • 3) set up memory split as you wish (for a headless server, 16MB for GPU)
  • +
+

Optionally:

+
    +
  • 4) set up over-clocking.
  • +
+

Secure your install

+

Delete the existing SSH keys and recreate them (why? read this).

+
# as 'pi' user
+sudo rm -v /etc/ssh/ssh_host_*
+sudo dpkg-reconfigure openssh-server
+sudo reboot
+
+

This will recreate the server keys. Next, update your system:

+
# as 'pi' user
+sudo apt update
+sudo apt upgrade
+
+

Install required packages

+

As of April 2016, the shipping versions with Raspbian are recent enough to run piku:

+

# as 'pi' user
+sudo apt install -y python-virtualenv python-pip git uwsgi uwsgi-plugin-python nginx
+sudo pip install -U click
+sudo reboot
+
+ Meanwhile, go get the goodies while Raspberry Pi is rebooting

+

(We assume you know about ssh keys and have one "at hand", you'll need to copy it)

+

Clone the piku repo somewhere and copy files to your Raspberry Pi

+
# as yourself in your desktop/laptop computer
+scp piku.py uwsgi-piku.service nginx.default.dist pi@your_machine:/tmp
+scp your_public_ssh_key.pub pi@your_machine:/tmp
+
+

Back to the Pi

+

Prepare uWSGI (part one): +

# as 'pi' user
+sudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku
+sudo systemctl disable uwsgi
+sudo cp /tmp/uwsgi-piku.service /etc/systemd/system/
+sudo systemctl daemon-reload
+sudo systemctl enable uwsgi-piku
+

+

Prepare nginx:

+
sudo apt-get install nginx
+# Set up nginx to pick up our config files
+sudo cp /tmp/nginx.default.dist /etc/nginx/sites-available/default
+# Set up systemd.path to reload nginx upon config changes
+sudo cp ./piku-nginx.{path, service} /etc/systemd/system/
+sudo systemctl enable piku-nginx.{path,service}
+sudo systemctl start piku-nginx.path
+# Check the status of piku-nginx.service
+systemctl status piku-nginx.path # should return `Active: active (waiting)`
+# Restart NGINX
+sudo systemctl restart nginx
+
+

Create 'piku' user and set it up

+
# as 'pi' user
+sudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data piku
+sudo su - piku
+# this is now done as 'piku' user
+mkdir ~/.ssh
+chmod 700 ~/.ssh
+cp /tmp/piku.py ~/piku.py
+python piku.py setup
+python piku.py setup:ssh /tmp/id_rsa.pub
+# return to 'pi' user
+exit
+
+

Prepare uWSGI (part two):

+

# as 'pi' user
+sudo systemctl start uwsgi-piku
+sudo systemctl status uwsgi-piku.service
+
+If you're still here, odds are your Pi is ready for work

+

Testing

+

Go back to your machine and try these commands:

+
# as yourself in your desktop/laptop computer
+ssh piku@your_machine
+
+Usage: piku.py [OPTIONS] COMMAND [ARGS]...
+
+  The smallest PaaS you've ever seen
+
+Options:
+  --help  Show this message and exit.
+
+Commands:
+  apps              List applications
+  config            Show application configuration
+  config:get        Retrieve a configuration setting
+  config:live       Show live configuration settings
+  config:set        Set a configuration setting
+  deploy            Deploy an application
+  destroy           Destroy an application
+  disable           Disable an application
+  enable            Enable an application
+  logs              Tail an application log
+  ps                Show application worker count
+  ps:scale          Show application configuration
+  restart           Restart an application
+  setup             Initialize paths
+  setup:ssh         Set up a new SSH key
+Connection to your_machine closed.
+
+

If you find any bugs with this quickstart guide, please let Luis Correia know ;)

+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/install/index.html b/install/index.html new file mode 100644 index 0000000..9b6a4ce --- /dev/null +++ b/install/index.html @@ -0,0 +1,1109 @@ + + + + + + + + + + + + + + + + + + + + + + + Installation - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Installation

+

TL;DR:

+

To install it on your server, ssh in as root and run this:

+
curl https://piku.github.io/get | sh
+
+

Installation Methods

+

piku requires Python 3, uWSGI, ssh, and a Linux distribution that runs systemd, such as Raspbian Jessie/Debian 8+/Ubuntu/Fedora/CentOS.

+

There are 3 main ways to install piku on a server:

+
    +
  1. +

    Use piku-bootstrap to do it if your server is already provisioned (that is what the TL;DR command does)

    +
  2. +
  3. +

    Use cloud-init to do it automatically at VPS build time (see the cloud-init repository, which has examples for most common cloud providers)

    +
  4. +
  5. +

    Manually: Follow the guide below or one of the platform-specfic guides.

    +
  6. +
+

There is also an Ansible playbook.

+
+

Contributing

+

If you are running piku on specific Linux versions, feel free to contribute your own instructions.

+
+

Generic Installation Steps

+

Set up the piku user

+

piku requires a separate user account to run. To create a new user with the right group membership (we're using the built-in www-data group because it's generally thought of as a less-privileged group), enter the following command:

+
# pick a username
+export PAAS_USERNAME=piku
+# create it
+sudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data $PAAS_USERNAME
+# copy & setup piku.py
+sudo su - $PAAS_USERNAME -c "wget https://raw.githubusercontent.com/piku/piku/master/piku.py && python3 ~/piku.py setup"
+
+

The setup output should be something like this:

+
Creating '/home/piku/.piku/apps'.
+Creating '/home/piku/.piku/repos'.
+Creating '/home/piku/.piku/envs'.
+Creating '/home/piku/.piku/uwsgi'.
+Creating '/home/piku/.piku/uwsgi-available'.
+Creating '/home/piku/.piku/uwsgi-enabled'.
+Creating '/home/piku/.piku/logs'.
+Setting '/home/piku/piku.py' as executable.
+
+

Set up ssh access

+

If you don't have an ssh public key (or never used one before), you need to create one. The following instructions assume you're running some form of UNIX on your own machine (Windows users should check the documentation for their ssh client, unless you have Cygwin installed).

+

On your own machine, issue the ssh-keygen command and follow the prompts:

+
ssh-keygen 
+
+Generating public/private rsa key pair.
+Enter file in which to save the key (/home/youruser/.ssh/id_rsa): 
+Created directory '/home/youruser/.ssh'.
+Enter passphrase (empty for no passphrase): 
+Enter same passphrase again: 
+Your identification has been saved in /home/youruser/.ssh/id_rsa.
+Your public key has been saved in /home/youruser/.ssh/id_rsa.pub.
+The key fingerprint is:
+85:29:07:cb:de:ad:be:ef:42:65:00:c8:d2:6b:9e:ff youruser@yourlaptop.lan
+The key's randomart image is:
++--[ RSA 2048]----+
+<...>
++-----------------+
+
+

Copy the resulting id_rsa.pub (or equivalent, just make sure it's the public file) to your piku server and do the following:

+
sudo su - piku
+python3 piku.py setup:ssh /tmp/id_rsa.pub
+
+Adding key '85:29:07:cb:de:ad:be:ef:42:65:00:c8:d2:6b:9e:ff'.
+
+

Now if you look at .ssh/authorized_keys, you should see something like this:

+
sudo su - piku
+cat .ssh/authorized_keys
+
+command="FINGERPRINT=85:29:07:cb:de:ad:be:ef:42:65:00:c8:d2:6b:9e:ff NAME=default /home/piku/piku.py $SSH_ORIGINAL_COMMAND",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhTYZi/qeJBKgU3naI8FNjQgeMYnMsEtqrOmUc4lJoPNH2qBUTNkzwThGqsBm2HNLPURWMiEifBqF+kRixMud67Co7Zs9ys7pwFXkJB9bbZasd2JCGfVZ4UYXHnvgejSWkLAV/4bObhsbP2vWOmbbm91Cwn+PGJgoiW08yrd45lsDmgv9cUAJS3e8LkgVELvIDg49yM5ArB88oxwMEoUgWU2OniHmH0o1zw5I8WXHRhHOjb8cGsdTYfXEizRKKRTM2Mu6dKRt1GNL0UbWi8iS3uJHGD3AcQ4ApdMl5X0gTixKHponStOrSMy19/ltuIy8Sjr7KKPxz07ikMYr7Vpcp youruser@yourlaptop.lan
+
+

This line is what enables you to ssh (and perform git over ssh operations) to the piku user without a password, verifying your identity via your public key, restricting what can be done remotely and passing on to piku itself the commands you'll be issuing.

+

Test

+

From your machine, do:

+
ssh piku@pi.lan
+
+Usage: piku.py [OPTIONS] COMMAND [ARGS]...
+
+  The smallest PaaS you've ever seen
+
+Options:
+  --help  Show this message and exit.
+
+Commands:
+  apps              List applications
+  config            Show application configuration
+  config:get        Retrieve a configuration setting
+  config:live       Show live configuration settings
+  config:set        Set a configuration setting
+  deploy            Deploy an application
+  destroy           Destroy an application
+  disable           Disable an application
+  enable            Enable an application
+  logs              Tail an application log
+  ps                Show application worker count
+  ps:scale          Show application configuration
+  restart           Restart an application
+  setup             Initialize paths
+  setup:ssh         Set up a new SSH key
+Connection to pi.lan closed.
+
+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/manage.html b/manage.html new file mode 100644 index 0000000..1879bb7 --- /dev/null +++ b/manage.html @@ -0,0 +1,1055 @@ + + + + + + + + + + + + + + + + + + + + + + + Manage - Piku + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ +
+ + + + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Manage

+

Managing your Piku apps

+

To make life easier you can also install the piku helper into your path (e.g. ~/bin):

+
curl https://raw.githubusercontent.com/piku/piku/master/piku > ~/bin/piku && chmod 755 ~/bin/piku
+
+

This shell script simplifies working with multiple piku remotes and applications:

+
    +
  • If you cd into a project folder that has a git remote called piku the helper will infer the remote server and app name and use them automatically:
  • +
+
$ piku logs
+$ piku config:set MYVAR=12
+$ piku stop
+$ piku deploy
+$ piku destroy
+$ piku # <- show available remote and local commands
+
+
    +
  • If you are starting a new project, piku init will download example Procfile and ENV files into the current folder:
  • +
+
$ piku init
+Wrote ./ENV file.
+Wrote ./Procfile.
+
+
    +
  • The piku helper also lets you pass settings to the underlying SSH command: -t to run interactive commands remotely, and -A to proxy authentication credentials in order to do remote git pulls.
  • +
+

For instance, here's how to use the -t flag to obtain a bash shell in the app directory of one of your piku apps:

+
$ piku -t run bash
+Piku remote operator.
+Server: piku@cloud.mccormickit.com
+App: dashboard
+
+piku@piku:~/.piku/apps/dashboard$ ls
+data  ENV  index.html  package.json  package-lock.json  Procfile  server.wisp
+
+

Monitoring

+

Besides using the logs command, there is a sample monitoring application to keep tabs on resource usage.

+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+
+
+
+ +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/search/search_index.js b/search/search_index.js new file mode 100644 index 0000000..0dd3536 --- /dev/null +++ b/search/search_index.js @@ -0,0 +1 @@ +var __index = {"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"index.html","title":"Home","text":"

piku, inspired by dokku, allows you do git push deployments to your own servers, no matter how small they are.

Installing Using/Features Managing and Monitoring Examples Web App Tutorial

"},{"location":"index.html#demo","title":"Demo","text":""},{"location":"index.html#workflow","title":"Workflow","text":"

piku supports a Heroku-like workflow:

You can also deploy a gh-pages style static site using a static worker type, with the root path as the argument, and run a release task to do some processing on the server after git push.

"},{"location":"index.html#project-activity","title":"Project Activity","text":"

piku is considered STABLE. It is actively maintained, but \"actively\" here means the feature set is pretty much done, so it is only updated when new language runtimes are added or reproducible bugs crop up.

It currently requires Python 3.7 or above, since even though 3.8+ is now the baseline Python 3 version in Ubuntu LTS 20.04 and Debian 11 has already moved on to 3.9, there are no substantial differences between those versions.

"},{"location":"index.html#deprecation-notices","title":"Deprecation Notices","text":"

Since most of its users run it on LTS distributions, there is no rush to introduce disruption. The current plan is to throw up a warning for older runtimes and do regression testing for 3.7-3.12 (replacing the current bracket of tests from 3.5 to 3.8), and make sure we also cover Ubuntu 22.04, Debian 11 and Fedora 37+.

"},{"location":"FAQ.html","title":"FAQ","text":"

Q: Why piku?

A: Partly because it's started out on the Raspberry Pi, because it's Japanese onomatopeia for 'twitch' or 'jolt', and because we knew the name would be cute and amusing.

Q: Why Python/why not Go?

A: We actually thought about doing this in Go right off the bat, but click is so cool and we needed to have uwsgi running anyway, so we caved in. But possible future directions are likely to take something like suture and port this across (or just use Caddy), doing away with uwsgi altogether.

Go also (at the time) did not have a way to vendor dependencies that we were comfortable with, and that is also why Go support fell behind. Hopefully that will change soon.

Q: Does it run under Python 3?

A: Right now, it only runs on Python 3, even though it can deploy apps written in both major versions. It began its development using 2.7 and usingclick for abstracting the simpler stuff, and we eventually switched over to 3.5 once it was supported in Debian Stretch and Raspbian since we wanted to make installing it on the Raspberry Pi as simple as possible.

Q: Why not just use dokku?

A: We used dokku daily for many projects. But it relied on a number of x64 containers that needed to be completely rebuilt for ARM, and when we decided we needed something like this (March 2016) that was barely possible - docker itself was not fully baked for ARM yet, and people were at the time just starting to get herokuish and buildstep to build on ARM.

"},{"location":"features.html","title":"Features","text":""},{"location":"features.html#workflow","title":"Workflow","text":"

piku supports a Heroku-like workflow:

You can also deploy a gh-pages style static site using a static worker type, with the root path as the argument, and run a release task to do some processing on the server after git push.

"},{"location":"features.html#virtual-hosts-and-ssl","title":"Virtual Hosts and SSL","text":"

piku has full virtual host support - i.e., you can host multiple apps on the same VPS and use DNS aliases to access them via different hostnames.

piku will also set up either a private certificate or obtain one via Let's Encrypt to enable SSL.

If you are on a LAN and are accessing piku from macOS/iOS/Linux clients, you can try using piku/avahi-aliases to announce different hosts for the same IP address via Avahi/mDNS/Bonjour.

"},{"location":"features.html#caching-and-static-paths","title":"Caching and Static Paths","text":"

Besides static sites, piku also supports directly mapping specific URL prefixes to filesystem paths (to serve static assets) or caching back-end responses (to remove load from applications).

These features are configured by setting appropriate values in the ENV file.

"},{"location":"features.html#supported-platforms","title":"Supported Platforms","text":"

piku is intended to work in any POSIX-like environment where you have Python, nginx, uwsgi and ssh: it has been deployed on Linux, FreeBSD, [Cygwin][cygwin] and the [Windows Subsystem for Linux][wsl].

As a baseline, it began its development on an original 256MB Rasbperry Pi Model B, and still runs reliably on it.

But its main use is as a micro-PaaS to run applications on cloud servers with both Intel and ARM CPUs, with either Debian or Ubuntu Linux as target platforms.

"},{"location":"features.html#supported-runtimes","title":"Supported Runtimes","text":"

piku currently supports apps written in Python, Node, Clojure, Java and a few other languages (like Go) in the works.

But as a general rule, if it can be invoked from a shell, it can be run inside piku.

"},{"location":"manage.html","title":"Manage","text":""},{"location":"manage.html#managing-your-piku-apps","title":"Managing your Piku apps","text":"

To make life easier you can also install the piku helper into your path (e.g. ~/bin):

curl https://raw.githubusercontent.com/piku/piku/master/piku > ~/bin/piku && chmod 755 ~/bin/piku\n

This shell script simplifies working with multiple piku remotes and applications:

$ piku logs\n$ piku config:set MYVAR=12\n$ piku stop\n$ piku deploy\n$ piku destroy\n$ piku # <- show available remote and local commands\n
$ piku init\nWrote ./ENV file.\nWrote ./Procfile.\n

For instance, here's how to use the -t flag to obtain a bash shell in the app directory of one of your piku apps:

$ piku -t run bash\nPiku remote operator.\nServer: piku@cloud.mccormickit.com\nApp: dashboard\n\npiku@piku:~/.piku/apps/dashboard$ ls\ndata  ENV  index.html  package.json  package-lock.json  Procfile  server.wisp\n
"},{"location":"manage.html#monitoring","title":"Monitoring","text":"

Besides using the logs command, there is a sample monitoring application to keep tabs on resource usage.

"},{"location":"community/index.html","title":"Community","text":"

There is an active discussion forum for piku where you can ask questions, share your deployments, and discuss new features, and we have a published roadmap.

"},{"location":"community/index.html#linuxconf-talk","title":"LinuxConf Talk","text":""},{"location":"community/index.html#references","title":"References","text":"

Contributing Examples

"},{"location":"community/contributing.html","title":"Contributing","text":"

piku is a stable project, but we welcome contributions that:

"},{"location":"community/contributing.html#code-size-style","title":"Code Size / Style","text":"

By its very nature, piku is a very small program. By today's standards of all-encompassing solutions this may seem strange, but it would benefit from being kept that way.

So please keep that in mind when contributing.

For instance, if your runtime or framework needs additional setup, it might be better to contribute an utility script to run in a release entry in the Procfile rather than patching piku.py--but do hack at it if that is the best way to achieve it.

"},{"location":"community/examples.html","title":"Example Applications","text":"

Besides the bundled examples, there are a number of community-contributed examples that can be deployed using piku.

They are meant to be illustrative of the kinds of applications that can be deployed using piku, and are not meant to be exhaustive.

"},{"location":"community/examples.html#pre-built-apps-and-tools","title":"Pre-built Apps and Tools","text":""},{"location":"community/examples.html#phoenix","title":"Phoenix","text":""},{"location":"community/examples.html#python","title":"Python","text":""},{"location":"community/examples.html#ruby-on-rails","title":"Ruby on Rails","text":""},{"location":"community/examples.html#nodejs","title":"NodeJS","text":""},{"location":"community/examples.html#java","title":"Java","text":""},{"location":"community/examples.html#clojure","title":"Clojure","text":""},{"location":"community/examples.html#bare-metal-c","title":"Bare Metal C","text":""},{"location":"configuration/index.html","title":"Configuring Applications","text":"

A minimal piku app has a root directory structure similar to this:

ENV\nProcfile\napp.py\nworker.py\nrequirements.txt\n

ENV Procfile

"},{"location":"configuration/index.html#configuration-files","title":"Configuration Files","text":"

piku relies on two configuration files shipped with your app to determine how to run it: ENV and Procfile.

"},{"location":"configuration/index.html#runtime-detection","title":"Runtime Detection","text":"

Besides ENV and Procfile, piku also looks for runtime-specific files in the root of your app's directory:

Info

go.mod support is currently in development.

These are not exclusive, however. There is also a sample Phoenix app that demonstrates how to add support for additional runtimes.

"},{"location":"configuration/env.html","title":"ENV Variables","text":"

You can configure deployment settings by placing special variables in an ENV file deployed with your app. This file should be placed in the root of your app's directory, and can look something like this:

# variables are global and can be replaced\nSETTING1=True\nSETTING2=${SETTING1}/Maybe\n\n# addr:port\nPORT=9080\nBIND_ADDRESS=0.0.0.0\n\n# the max number the worker will process\nRANGE=10\n\n# worker sleep interval between prints\nINTERVAL=1\n
"},{"location":"configuration/env.html#runtime-settings","title":"Runtime Settings","text":""},{"location":"configuration/env.html#python","title":"Python","text":"

Warning

This is mostly deprecated (since piku now runs solely on Python 3.x), but is kept around for legacy compatibility.

"},{"location":"configuration/env.html#node","title":"Node","text":"

Note

you will need to stop and re-deploy the app to change the node version in a running app.

"},{"location":"configuration/env.html#network-settings","title":"Network Settings","text":""},{"location":"configuration/env.html#uwsgi-settings","title":"uWSGI Settings","text":"

Note

UWSGI_IDLE applies to all the workers, so if you have UWSGI_PROCESSES set to 4, they will all be killed simultaneously. Support for progressive scaling of workers via cheaper and similar uWSGI configurations will be added in the future.

"},{"location":"configuration/env.html#nginx-settings","title":"nginx Settings","text":"

Note

if used with Cloudflare, NGINX_HTTPS_ONLY will cause an infinite redirect loop - keep it set to false, use NGINX_CLOUDFLARE_ACL instead and add a Cloudflare Page Rule to \"Always Use HTTPS\" for your server (use domain.name/* to match all URLs).

"},{"location":"configuration/env.html#nginx-caching","title":"nginx Caching","text":"

When NGINX_CACHE_PREFIXES is set, nginx will cache requests for those URL prefixes to the running application (uwsgi-like or web workers) and reply on its own for NGINX_CACHE_TIME to the outside. This is meant to be used for compute-intensive operations like resizing images or providing large chunks of data that change infrequently (like a sitemap).

The behavior of the cache can be controlled with the following variables:

Note

NGINX_CACHE_PATH will be completely managed by nginx and cannot be removed by Piku when the application is destroyed. This is because nginx sets the ownership for the cache to be exclusive to itself, and the piku user cannot remove that file tree. So you will either need to clean it up manually after destroying the app or store it in a temporary filesystem (or set the piku user to the same UID as www-data, which is not recommended).

Right now, there is no provision for cache revalidation (i.e., nginx asking your backend if the cache entries are still valid), since that requires active application logic that varies depending on the runtime--nginx will only ask your backend for new content when NGINX_CACHE_TIME elapses. If you require that kind of behavior, that is still possible via NGINX_INCLUDE_FILE.

Also, keep in mind that using nginx caching with a static website worker will not work (and there's no point to it either).

"},{"location":"configuration/env.html#nginx-overrides","title":"nginx Overrides","text":""},{"location":"configuration/env.html#acme-settings","title":"Acme Settings","text":""},{"location":"configuration/procfile.html","title":"Procfile format","text":"

piku supports a Heroku-like Procfile that you provide to indicate how to run one or more application processes (what Heroku calls \"dynos\"):

web: embedded_server --port $PORT\nworker: background_worker\n
"},{"location":"configuration/procfile.html#worker-types","title":"Worker Types","text":"

piku supports six different kinds of worker processes:

# A module to be loaded by uwsgi to serve HTTP requests\nwsgi: module.submodule:app\n# A background worker, using the default name\nworker: python long_running_script.py\n# Another worker with a different name\nfetcher: python fetcher.py\n# Simple cron expression: minute [0-59], hour [0-23], day [0-31], month [1-12], weekday [1-7] (starting Monday, no ranges allowed on any field)\ncron: 0 0 * * * python midnight_cleanup.py\nrelease: python initial_cleanup.py\n
Each of these has slightly different features:

"},{"location":"configuration/procfile.html#wsgi","title":"wsgi","text":"

wsgi workers are Python-specific and must be specified in the format dotted.module:entry_point. uwsgi will load the specified module and call the entry_point function to start the application, handling all the HTTP requests directly (your Python code will run the handlers, but will run as a part of the uwsgi process).

uwsgi will automatically spawn multiple workers for you, and you can control the number of workers via the UWSGI_PROCESSES environment variable.

Also, in this mode uwsgi will talk to nginx via a Unix socket, so you don't need to worry about the HTTP server at all.

"},{"location":"configuration/procfile.html#web","title":"web","text":"

web workers can be literally any executable that uwsgi can run and that will serve HTTP requests. They must (by convention) honor the PORT environment variable, so that the nginx reverse proxy can talk to them.

"},{"location":"configuration/procfile.html#worker","title":"worker","text":"

worker processes are just standard processes that run in the background. They can actually have arbitrary names, and the idea is that they would perform any tasks your app requires that isn't directly related to serving web pages.

"},{"location":"configuration/procfile.html#static","title":"static","text":"

static workers are simply a way to direct nginx to mount the first argument as a static path and serve it directly. This is useful for serving (and caching) static files directly from your app, without having to go through application code.

Note

See nginx caching for more information on how to configure nginx to serve static files.

"},{"location":"configuration/procfile.html#cron","title":"cron","text":"

A cron worker is a process that runs at a specific time (or intervals), using a simplified crontab expression preceding the command to be run (e.g. cron: */5 * * * * python batch.py to run a batch every 5 minutes)

Warning

crontab expressions are simplified and do not support ranges or lists, only single values, splits and * (wildcard).

"},{"location":"configuration/procfile.html#preflight","title":"preflight","text":"

preflight is a special \"worker\" that is run once before the app is deployed and dependencies are installed (can be useful for cleanups, like resetting caches, removing older versions of files, etc).

"},{"location":"configuration/procfile.html#release","title":"release","text":"

release which is a special worker that is run once when the app is deployed, after installing dependencies (can be useful for build steps).

Any worker will be automatically respawned upon failure ([uWSGI][uwsgi] will automatically shun/throttle crashy workers).

"},{"location":"design/index.html","title":"Design","text":"

The idea behind piku is that it provides the simplest possible way to deploy web apps or services. Simplicity comes at the expense of features, of course, and this document tries to capture the trade-offs.

"},{"location":"design/index.html#core-values","title":"Core values","text":""},{"location":"design/index.html#why-uwsgi","title":"Why uWSGI","text":"

Using uWSGI in emperor mode gives us the following features for free:

"},{"location":"design/index.html#application-packaging","title":"Application packaging","text":"

An app is simply a git repository with some additional files on the top level, the most important of which is the Procfile.

"},{"location":"design/index.html#env-settings","title":"ENV settings","text":"

Since piku is targeted at 12 Factor apps, it allows you to set environment variables in a number of ways, the simplest of which is by adding an ENV file to your repository:

SETTING1=foo\n# piku supports comments and variable expansion\nSETTING2=${SETTING1}/bar\n# if this isn't defined, piku will assign a random TCP port\nPORT=9080\n

See configuration for a full list of environment variables that can also be set.

Environment variables can be changed after deployment using the config:set command.

"},{"location":"design/index.html#runtime-detection","title":"Runtime detection","text":"

piku follows a very simple set of rules to determine what kind of runtime is required, outlined in the configuration section

"},{"location":"design/index.html#application-isolation","title":"Application isolation","text":"

Application isolation can be tackled at several levels, the most relevant of which being:

For 1.0, all applications run under the same uid, under separate branches of the same filesystem, and without any resource limiting.

Ways to improve upon that (short of full containerisation) typically entail the use of a chroot jail environment (which is available under most POSIX systems in one form or another) or Linux kernel namespaces - both of which are supported by uWSGI (which can also handle resource limiting to a degree).

As to runtime isolation, piku only provides virtualenv support until 1.0. Python apps can run under Python 2 or 3 depending on the setting of PYTHON_VERSION, but will always use pre-installed interpreters (Go, Node and Java support will share these limitations in each major version).

"},{"location":"design/index.html#internals","title":"Internals","text":"

piku uses two git repositories for each app: a bare repository for client push, and a clone for deployment (which is efficient in terms of storage since git tries to use hardlinks on local clones whenever possible).

This separation makes it easier to cope with long/large deployments and restore apps to a pristine condition, since the app will only go live after the deployment clone is reset (via git checkout -f).

"},{"location":"design/index.html#components","title":"Components","text":"

This diagram outlines how its components interact:

graph TD\n    subgraph \"systemd\"\n        nginx([nginx])\n        sshd([sshd])\n        uwsgi([uwsgi])\n    end\n    uwsgi-->vassal([vassal])\n    vassal-.->uwsgi.ini\n    sshd-->piku([piku.py])-->repo[git repo]\n    Procfile-->uwsgi.ini\n    an-->app\n    repo---app\n    repo---ENV\n    repo---requirements.txt\n    repo---Procfile\n    requirements.txt-->virtualenv\n    uwsgi.ini-->virtualenv\n    ENV-->an\n    ENV-->uwsgi.ini\n    nginx-.-mn[master<br>nginx.conf]\n    mn-.-an[app<br>nginx.conf]
"},{"location":"design/plugins.html","title":"Plugins","text":"

Thanks to jsenin, piku currently has experimental support for external plugins via #129.

Plugins are inserted into the commands listing and can perform arbitrary actions. At this moment there are no official plugins, but here is an example file that should be placed at ~/.piku/plugins/postgres/__init__.py that could contain the commands to manage a Postgres database:

import click\n\n@click.group()\ndef postgres():\n    \"\"\"Postgres command plugin\"\"\"\n    pass\n\n@postgres.command(\"postgres:create\")\n@click.argument('name')\n@click.argument('user')\n@click.argument('password')\ndef postgres_create():\n    \"\"\"Postgres create a database\"\"\"\n    pass\n\n@postgres.command(\"postgres:drop\")\n@click.argument('name')\ndef postgres_drop():\n    \"\"\"Postgres drops a database\"\"\"\n    pass\n\n@postgres.command(\"postgres:import\")\n@click.argument('name')\ndef postgres_drop():\n    \"\"\"Postgres import a database\"\"\"\n    pass\n\n@postgres.command(\"postgres:dump\")\n@click.argument('name')\ndef postgres_drop():\n    \"\"\"Postgres dumps a database SQL\"\"\"\n    pass\n\ndef cli_commands():\n    return postgres\n
"},{"location":"install/index.html","title":"Installation","text":""},{"location":"install/index.html#tldr","title":"TL;DR:","text":"

To install it on your server, ssh in as root and run this:

curl https://piku.github.io/get | sh\n
"},{"location":"install/index.html#installation-methods","title":"Installation Methods","text":"

piku requires Python 3, uWSGI, ssh, and a Linux distribution that runs systemd, such as Raspbian Jessie/Debian 8+/Ubuntu/Fedora/CentOS.

There are 3 main ways to install piku on a server:

  1. Use piku-bootstrap to do it if your server is already provisioned (that is what the TL;DR command does)

  2. Use cloud-init to do it automatically at VPS build time (see the cloud-init repository, which has examples for most common cloud providers)

  3. Manually: Follow the guide below or one of the platform-specfic guides.

There is also an Ansible playbook.

Contributing

If you are running piku on specific Linux versions, feel free to contribute your own instructions.

"},{"location":"install/index.html#generic-installation-steps","title":"Generic Installation Steps","text":""},{"location":"install/index.html#set-up-the-piku-user","title":"Set up the piku user","text":"

piku requires a separate user account to run. To create a new user with the right group membership (we're using the built-in www-data group because it's generally thought of as a less-privileged group), enter the following command:

# pick a username\nexport PAAS_USERNAME=piku\n# create it\nsudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data $PAAS_USERNAME\n# copy & setup piku.py\nsudo su - $PAAS_USERNAME -c \"wget https://raw.githubusercontent.com/piku/piku/master/piku.py && python3 ~/piku.py setup\"\n

The setup output should be something like this:

Creating '/home/piku/.piku/apps'.\nCreating '/home/piku/.piku/repos'.\nCreating '/home/piku/.piku/envs'.\nCreating '/home/piku/.piku/uwsgi'.\nCreating '/home/piku/.piku/uwsgi-available'.\nCreating '/home/piku/.piku/uwsgi-enabled'.\nCreating '/home/piku/.piku/logs'.\nSetting '/home/piku/piku.py' as executable.\n
"},{"location":"install/index.html#set-up-ssh-access","title":"Set up ssh access","text":"

If you don't have an ssh public key (or never used one before), you need to create one. The following instructions assume you're running some form of UNIX on your own machine (Windows users should check the documentation for their ssh client, unless you have Cygwin installed).

On your own machine, issue the ssh-keygen command and follow the prompts:

ssh-keygen \n\nGenerating public/private rsa key pair.\nEnter file in which to save the key (/home/youruser/.ssh/id_rsa): \nCreated directory '/home/youruser/.ssh'.\nEnter passphrase (empty for no passphrase): \nEnter same passphrase again: \nYour identification has been saved in /home/youruser/.ssh/id_rsa.\nYour public key has been saved in /home/youruser/.ssh/id_rsa.pub.\nThe key fingerprint is:\n85:29:07:cb:de:ad:be:ef:42:65:00:c8:d2:6b:9e:ff youruser@yourlaptop.lan\nThe key's randomart image is:\n+--[ RSA 2048]----+\n<...>\n+-----------------+\n

Copy the resulting id_rsa.pub (or equivalent, just make sure it's the public file) to your piku server and do the following:

sudo su - piku\npython3 piku.py setup:ssh /tmp/id_rsa.pub\n\nAdding key '85:29:07:cb:de:ad:be:ef:42:65:00:c8:d2:6b:9e:ff'.\n

Now if you look at .ssh/authorized_keys, you should see something like this:

sudo su - piku\ncat .ssh/authorized_keys\n\ncommand=\"FINGERPRINT=85:29:07:cb:de:ad:be:ef:42:65:00:c8:d2:6b:9e:ff NAME=default /home/piku/piku.py $SSH_ORIGINAL_COMMAND\",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhTYZi/qeJBKgU3naI8FNjQgeMYnMsEtqrOmUc4lJoPNH2qBUTNkzwThGqsBm2HNLPURWMiEifBqF+kRixMud67Co7Zs9ys7pwFXkJB9bbZasd2JCGfVZ4UYXHnvgejSWkLAV/4bObhsbP2vWOmbbm91Cwn+PGJgoiW08yrd45lsDmgv9cUAJS3e8LkgVELvIDg49yM5ArB88oxwMEoUgWU2OniHmH0o1zw5I8WXHRhHOjb8cGsdTYfXEizRKKRTM2Mu6dKRt1GNL0UbWi8iS3uJHGD3AcQ4ApdMl5X0gTixKHponStOrSMy19/ltuIy8Sjr7KKPxz07ikMYr7Vpcp youruser@yourlaptop.lan\n

This line is what enables you to ssh (and perform git over ssh operations) to the piku user without a password, verifying your identity via your public key, restricting what can be done remotely and passing on to piku itself the commands you'll be issuing.

"},{"location":"install/index.html#test","title":"Test","text":"

From your machine, do:

ssh piku@pi.lan\n\nUsage: piku.py [OPTIONS] COMMAND [ARGS]...\n\n  The smallest PaaS you've ever seen\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  apps              List applications\n  config            Show application configuration\n  config:get        Retrieve a configuration setting\n  config:live       Show live configuration settings\n  config:set        Set a configuration setting\n  deploy            Deploy an application\n  destroy           Destroy an application\n  disable           Disable an application\n  enable            Enable an application\n  logs              Tail an application log\n  ps                Show application worker count\n  ps:scale          Show application configuration\n  restart           Restart an application\n  setup             Initialize paths\n  setup:ssh         Set up a new SSH key\nConnection to pi.lan closed.\n
"},{"location":"install/INSTALL-centos-9.html","title":"Installation on CentOS 9","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

All steps done as root (or add sudo if you prefer).

"},{"location":"install/INSTALL-centos-9.html#dependencies","title":"Dependencies","text":"

Before installing piku, you need to install the following packages:

dnf in -y ansible-core ansible-collection-ansible-posix ansible-collection-ansible-utils nginx nodejs npm openssl postgresql postgresql-server postgresql-contrib python3 python3-pip uwsgi uwsgi-logger-file uwsgi-logger-systemd\npip install click\n
"},{"location":"install/INSTALL-centos-9.html#set-up-the-piku-user","title":"Set up the piku user","text":"
adduser --groups nginx piku\n# copy & setup piku.py\nsu - piku -c \"wget https://raw.githubusercontent.com/piku/piku/master/piku.py && python3 ~/piku.py setup\"\n
"},{"location":"install/INSTALL-centos-9.html#set-up-ssh-access","title":"Set up SSH access","text":"

See INSTALL.md

"},{"location":"install/INSTALL-centos-9.html#uwsgi-configuration","title":"uWSGI Configuration","text":"

FYI The uWSGI Emperor \u2013 multi-app deployment

mv /home/piku/.piku/uwsgi/uwsgi.ini /etc/uwsgi.d/piku.ini # linking alone increases the host attack service if one can get inside the piku user or one of its apps, so moving is safer\nchown piku:piku /etc/uwsgi.d/piku.ini # In Tyrant mode (set by default in /etc/uwsgi.ini) the Emperor will run the vassal using the UID/GID of the vassal configuration file\nsystemctl restart uwsgi\njournalctl -feu uwsgi # see logs\n
"},{"location":"install/INSTALL-centos-9.html#nginx-configuration","title":"nginx Configuration","text":"

FYI Setting up and configuring NGINX

echo \"include /home/piku/.piku/nginx/*.conf;\" > /etc/nginx/conf.d/piku.conf\nsystemctl restart nginx\njournalctl -feu nginx # see logs\n
"},{"location":"install/INSTALL-centos-9.html#set-up-systemdpath-to-reload-nginx-upon-config-changes","title":"Set up systemd.path to reload nginx upon config changes","text":"
# Set up systemd.path to reload nginx upon config changes\nsu -\ngit clone https://github.com/piku/piku.git # need a copy of some files\ncp -v piku/piku-nginx.{path,service} /etc/systemd/system/\nsystemctl enable piku-nginx.{path,service}\nsystemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `active: active (waiting)`\n
"},{"location":"install/INSTALL-centos-9.html#notes","title":"Notes","text":""},{"location":"install/INSTALL-other.html","title":"Installation on other platforms","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

"},{"location":"install/INSTALL-other.html#dependencies","title":"Dependencies","text":"

Before running piku for the first time, you need to install the following Python packages at the system level:

"},{"location":"install/INSTALL-other.html#raspbian-jessie-debian-8-ubuntu-1604","title":"Raspbian Jessie, Debian 8, Ubuntu 16.04","text":"
sudo apt-get install git python3-virtualenv python3-pip\nsudo pip3 install -U click\n
"},{"location":"install/INSTALL-other.html#raspbian-wheezy","title":"Raspbian Wheezy","text":"
sudo apt-get install git python3\nsudo easy_install3 -U pip3\nsudo pip3 install -U click virtualenv\n

These may or may not be installed already (click usually isn't). For Raspbian Wheezy this is the preferred approach, since current apt packages are fairly outdated.

"},{"location":"install/INSTALL-other.html#set-up-the-piku-user-set-up-ssh-access","title":"Set up the piku user, Set up SSH access","text":"

See INSTALL.md

"},{"location":"install/INSTALL-other.html#uwsgi-installation-debian-linux-variants-any-architecture","title":"uWSGI Installation (Debian Linux variants, any architecture)","text":"

uWSGI can be installed in a variety of fashions. These instructions cover both pre-packaged and source installs depending on your system.

"},{"location":"install/INSTALL-other.html#raspbian-jessie-debian-8","title":"Raspbian Jessie, Debian 8","text":"

Warning

These OS releases are no longer supported and these instructions are kept for reference purposes only.

In Raspbian Jessie, Debian 8 and other systemd distributions where uWSGI is already available pre-compiled (but split into a number of plugins), do the following:

# At the time of this writing, this installs uwsgi 2.0.7 on Raspbian Jessie.\n# You can also install uwsgi-plugins-all if you want to get runtime support for other languages\nsudo apt-get install uwsgi uwsgi-plugin-python3\n# refer to our executable using a link, in case there are more versions installed\nsudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku\n# disable the standard uwsgi startup script\nsudo systemctl disable uwsgi\n\n# add our own startup script\nsudo cp /tmp/uwsgi-piku.service /etc/systemd/system/\nsudo systemctl enable uwsgi-piku\nsudo systemctl start uwsgi-piku\n\n# check it's running\nsudo systemctl status uwsgi-piku.service\n
Important Note: Make sure you run piku.py setup as outlined above before starting the service.

Also, please note that uwsgi-piku.service, as provided, creates a /run/uwsgi-piku directory for it to place socket files and sundry. This is not actually used at the moment, since the uwsgi socket file is placed inside the piku user directory for consistency across OS distributions. This will be cleaned up in a later release.

"},{"location":"install/INSTALL-other.html#raspbian-wheezy_1","title":"Raspbian Wheezy","text":"

Warning

This OS release is no longer supported and these instructions are kept for reference purposes only.

Since Raspbian Wheezy is a fairly old distribution by now, its uwsgi-* packages are completely outdated (and depend on Python 2.6), so we have to compile and install our own version, as well as using an old-style init script to have it start automatically upon boot.

sudo apt-get install build-essential python-dev libpcre3-dev\n# At the time of this writing, this installs 2.0.12\nsudo pip install uwsgi\n# refer to our executable using a link, in case there are more versions installed\nsudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku\n\n# set up our init script\nsudo cp /tmp/uwsgi-piku.dist /etc/init.d/uwsgi-piku\nsudo chmod +x /etc/init.d/uwsgi-piku\nsudo update-rc.d uwsgi-piku defaults\nsudo service uwsgi-piku start\n
Important Note: Make sure you run python3 piku.py setup as outlined above before starting the service.

"},{"location":"install/INSTALL-other.html#ubuntu-1404-lts","title":"Ubuntu 14.04 LTS","text":"

Warning

This OS release is no longer supported and these instructions are kept for reference purposes only.

This is a mix of both the above, and should change soon when we get 16.04. If you have trouble, install uWSGI via pip instead.

# At the time of this writing, this installs uwsgi 1.9.17 on Ubuntu 14.04 LTS.\n# You can also install uwsgi-plugins-all if you want to get runtime support for other languages\nsudo apt-get install uwsgi uwsgi-plugin-python3\n# refer to our executable using a link, in case there are more versions installed\nsudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku\n\n# set up our init script\nsudo cp /tmp/uwsgi-piku.dist /etc/init.d/uwsgi-piku\nsudo chmod +x /etc/init.d/uwsgi-piku\nsudo update-rc.d uwsgi-piku defaults\nsudo service uwsgi-piku start\n
"},{"location":"install/INSTALL-other.html#nginx-installation-raspbian-8-ubuntu-1604","title":"nginx Installation (Raspbian 8, Ubuntu 16.04)","text":"

Warning

These OS releases are no longer supported and these instructions are kept for reference purposes only.

Warning

There is a bug in nginx 1.6.2 under Raspbian 8 that causes it to try to allocate around a gigabyte of RAM when using SSL with SPDY. I seriously recommend using Ubuntu instead, if you can, or disabling SSL altogether.

sudo apt-get install nginx\n# Set up nginx to pick up our config files\nsudo cp /tmp/nginx.default.dist /etc/nginx/sites-available/default\n# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `Active: active (waiting)`\n# Restart NGINX\nsudo systemctl restart nginx\n
"},{"location":"install/INSTALL-other.html#java-8-installation-all-debian-linux-variants-on-raspberry-pi","title":"Java 8 Installation (All Debian Linux variants, on Raspberry Pi)","text":"

Warning

OpenJDK 8 is no longer shipping with most distributions and these instructions are kept for reference purposes only.

To be able to deploy Java apps, we're going to need to install Java (and, since we're going to be doing so on ARM, it's best to use Oracle's runtime). To do that, we're going to use the webupd8team PPA, which has a (cross-platform) Java installer.

First, get rid of OpenJDK and import the PPA key:

sudo apt-get remove openjdk*\nsudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com EEA14886\n
"},{"location":"install/INSTALL-other.html#raspbian-jessie","title":"Raspbian Jessie","text":"

Warning

This OS release is no longer supported and these instructions are kept for reference purposes only.

For Jessie, we're going to use the trusty version of the installer:

sudo tee /etc/apt/sources.list.d/webupd8team.list\ndeb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main \ndeb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main\n^D\n
"},{"location":"install/INSTALL-other.html#ubuntu-1604-for-arm","title":"Ubuntu 16.04 for ARM","text":"

Warning

This OS release is no longer supported and these instructions are kept for reference purposes only.

For Xenial, we're going to use its own version:

sudo tee /etc/apt/sources.list.d/webupd8team.list\ndeb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main \ndeb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main\n^D\n

Now perform the actual install:

sudo apt-get update\nsudo apt-get install oracle-java8-installer oracle-java8-set-default\n
"},{"location":"install/INSTALL-other.html#go-installation-all-debian-linux-variants-on-raspberry-pi","title":"Go Installation (All Debian Linux variants, on Raspberry Pi)","text":"

This is EXPERIMENTAL and may not work at all.

"},{"location":"install/INSTALL-other.html#raspbian-wheezyjessie","title":"Raspbian Wheezy/Jessie","text":"

Warning

Wheezy and Jessie are no longer supported and these instructions are kept for reference purposes only.

Since Raspbian's Go compiler is version 1.0.2, we need something more up-to-date.

  1. Get an ARM 6 binary tarball
  2. Unpack it under the piku user like such:
sudo su - piku\ntar -zxvf /tmp/go1.5.3.linux-arm.tar.gz\n# remove unnecessary files\nrm -rf go/api go/blog go/doc go/misc go/test\n
  1. Give it a temporary GOPATH and install godep:
sudo su - piku\nGOROOT=$HOME/go GOPATH=$HOME/gopath PATH=$PATH:$HOME/go/bin go get github.com/tools/godep\n# temporary workaround until this is fixed in godep or Go 1.7(?)\nGOROOT=$HOME/go GOPATH=$HOME/gopath PATH=$PATH:$HOME/go/bin go get golang.org/x/sys/unix\n

TODO: complete this.

"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html","title":"Installation on Raspbian Stretch or Buster","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

piku setup is simplified in modern Debian versions, since it can take advantage of some packaging improvements in uWSGI and does not require a custom systemd service. However, Stretch still ships with Python 3.5, which means it's not an ideal environment for new deployments on both Intel and ARM devices (Buster, in turn, ships with Python 3.7).

"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#setting-up-your-raspberry-pi","title":"Setting up your Raspberry Pi","text":"

Download and install Raspbian onto an SD card.

After you install it is recommended that you do the following to update your installation to the latest available software.

# update apt-get\nsudo apt-get update\n\n# upgrade all software\nsudo apt-get upgrade\n

Configure your installation. It is recommended that Change Password from the default and setup Locale Options (Locale and Timezone) and EXPAND FILESYSTEM. You will also want to Enable SSH.

# configure your installation\nsudo raspi-config\n

At this point it is a good idea to sudo shutdown -h now and make a backup image of the card.

"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#dependencies","title":"Dependencies","text":"

Before installing piku, you need to install the following packages:

sudo apt-get install -y build-essential certbot git \\\n    libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev nginx \\\n    python-certbot-nginx python-dev python-pip python-virtualenv \\\n    python3-dev python3-pip python3-click python3-virtualenv \\\n    uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python \\\n    uwsgi-plugin-python uwsgi-plugin-python3 uwsgi-plugin-tornado-python \\\n    uwsgi-plugin-lua5.1 uwsgi-plugin-lua5.2 uwsgi-plugin-luajit\n
"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#set-up-the-piku-user-set-up-ssh-access","title":"Set up the piku user, Set up SSH access","text":"

See INSTALL.md

"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#uwsgi-configuration","title":"uWSGI Configuration","text":"

uWSGI in Stretch and Buster requires very little configuration, since it is already properly packaged. All you need to do is create a symlink to the piku configuration file in /etc/uwsgi/apps-enabled:

sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini\nsudo systemctl restart uwsgi\n
"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#nginx-configuration","title":"nginx Configuration","text":"

piku requires you to edit /etc/nginx/sites-available/default to the following, so it can inject new site configurations into nginx:

server {\n    listen 80 default_server;\n    listen [::]:80 default_server;\n    root /var/www/html;\n    index index.html index.htm;\n    server_name _;\n    location / {\n        try_files $uri $uri/ =404;\n    }\n}\n# replace `PAAS_USERNAME` with the username you created.\ninclude /home/PAAS_USERNAME/.piku/nginx/*.conf;\n
"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#set-up-systemdpath-to-reload-nginx-upon-config-changes","title":"Set up systemd.path to reload nginx upon config changes","text":"
# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `Active: active (waiting)`\n# Restart NGINX\nsudo systemctl restart nginx\n
"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#notes","title":"Notes","text":"

This file was last updated on June 2019

"},{"location":"install/INSTALL-ubuntu-16.04.html","title":"Ubuntu 16.04","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

sudo apt-get update\nsudo apt-get -y dist-upgrade\nsudo apt-get -y autoremove\nsudo apt-get install -y tmux vim htop fail2ban uwsgi uwsgi-plugin-python uwsgi-plugin-python3 uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python uwsgi-plugin-tornado-python nginx libxml2-dev libxslt1-dev python-dev zlib1g-dev build-essential git python3-virtualenv python3-pip python3-click\nsudo pip3 install -U click pip\nsudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data piku\n\n# move to /tmp and grab our distribution files\ncd /tmp\nwget https://raw.githubusercontent.com/piku/piku/master/piku.py\nwget https://raw.githubusercontent.com/piku/piku/master/piku-nginx.path\nwget https://raw.githubusercontent.com/piku/piku/master/piku-nginx.service\nwget https://raw.githubusercontent.com/piku/piku/master/nginx.default.dist\nwget https://raw.githubusercontent.com/piku/piku/master/uwsgi-piku.service\n# Set up nginx to pick up our config files\nsudo cp /tmp/nginx.default.dist /etc/nginx/sites-available/default\n# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Restart NGINX\nsudo systemctl restart nginx\nsudo cp /tmp/uwsgi-piku.service /etc/systemd/system/\n# refer to our executable using a link, in case there are more versions installed\nsudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku\n# disable the standard uwsgi startup script\nsudo systemctl disable uwsgi\nsudo systemctl enable uwsgi-piku\nsudo su - piku\nmkdir ~/.ssh\nchmod 700 ~/.ssh\n# now copy the piku script to this user account\ncp /tmp/piku.py ~/piku.py\npython3 piku.py setup\n# Now import your SSH key using setup:ssh\n\nsudo systemctl start uwsgi-piku\n
"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html","title":"Installation on Ubuntu 18.04 LTS (Bionic)","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

piku setup is simplified in Bionic, since it can take advantage of some packaging improvements in uWSGI and does not require a custom systemd service. Since Bionic also ships with Python 3.6, this is an ideal environment for new deployments on both Intel and ARM devices.

"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#dependencies","title":"Dependencies","text":"

Before installing piku, you need to install the following packages:

sudo apt-get update\nsudo apt-get install -y build-essential certbot git \\\n    libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev nginx \\\n    python-certbot-nginx python-dev python-pip python-virtualenv \\\n    python3-dev python3-pip python3-click python3-virtualenv \\\n    uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python \\\n    uwsgi-plugin-python uwsgi-plugin-python3 uwsgi-plugin-tornado-python\n
"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#set-up-the-piku-user-set-up-ssh-access","title":"Set up the piku user, Set up SSH access","text":"

See INSTALL.md

"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#uwsgi-configuration","title":"uWSGI Configuration","text":"

uWSGI requires very little configuration, since it is already properly packaged. All you need to do is place a link to the piku configuration file in /etc/uwsgi/apps-enabled:

sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini\nsudo systemctl restart uwsgi\n
"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#nginx-configuration","title":"nginx Configuration","text":"

piku requires you to edit /etc/nginx/sites-available/default to the following, so it can inject new site configurations into nginx:

server {\n    listen 80 default_server;\n    listen [::]:80 default_server;\n    root /var/www/html;\n    index index.html index.htm;\n    server_name _;\n    location / {\n        try_files $uri $uri/ =404;\n    }\n}\n# replace `PAAS_USERNAME` with the username you created.\ninclude /home/PAAS_USERNAME/.piku/nginx/*.conf;\n
"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#set-up-systemdpath-to-reload-nginx-upon-config-changes","title":"Set up systemd.path to reload nginx upon config changes","text":"
# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `Active: active (waiting)`\n# Restart NGINX\nsudo systemctl restart nginx\n
"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#notes","title":"Notes","text":"

This file was last updated on November 2018

"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html","title":"Installation on Ubuntu 22.04 LTS (Jammy)","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

piku setup is simplified in Jammy, since it can take advantage of some packaging improvements in uWSGI and does not require a custom systemd service. Since Jammy also ships with Python 3.10, this is an ideal environment for new deployments on both Intel and ARM devices.

"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#dependencies","title":"Dependencies","text":"

Before installing piku, you need to install the following packages:

sudo apt-get update\nsudo apt-get install -y build-essential certbot git \\\n    libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev nginx \\\n    python3-certbot-nginx \\\n    python3-dev python3-pip python3-click python3-virtualenv \\\n    uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python3 \\\n    uwsgi-plugin-python3 uwsgi-plugin-tornado-python3\n
"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#set-up-the-piku-user-set-up-ssh-access","title":"Set up the piku user, Set up SSH access","text":"

See INSTALL.md

"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#uwsgi-configuration","title":"uWSGI Configuration","text":"

uWSGI requires very little configuration, since it is already properly packaged. All you need to do is place a link to the piku configuration file in /etc/uwsgi/apps-enabled:

sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini\nsudo systemctl restart uwsgi\n
"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#nginx-configuration","title":"nginx Configuration","text":"

piku requires you to edit /etc/nginx/sites-available/default to the following, so it can inject new site configurations into nginx:

server {\n    listen 80 default_server;\n    listen [::]:80 default_server;\n    root /var/www/html;\n    index index.html index.htm;\n    server_name _;\n    location / {\n        try_files $uri $uri/ =404;\n    }\n}\n# replace `PAAS_USERNAME` with the username you created.\ninclude /home/PAAS_USERNAME/.piku/nginx/*.conf;\n
"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#set-up-systemdpath-to-reload-nginx-upon-config-changes","title":"Set up systemd.path to reload nginx upon config changes","text":"
# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `Active: active (waiting)`\n# Restart NGINX\nsudo systemctl restart nginx\n
"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#notes","title":"Notes","text":"

This file was last updated on November 2018

"},{"location":"install/RASPBERRY_PI_QUICKSTART.html","title":"Setting up a Raspberry Pi Piku Server from Scratch","text":"

Warning

These instructions are correct as of April 1st 2016. Quite a bit has changed since then in Raspberry Pi land, so you may need to adjust them accordingly.

Start by flashing a SD card with the latest Raspbian Jessie Lite image.

"},{"location":"install/RASPBERRY_PI_QUICKSTART.html#do-this-in-your-raspberry-pi-as-pi-user","title":"Do this in your Raspberry Pi as 'pi' user","text":"

Boot it, launch raspi-config to perform (at least) the following configuration:

# as 'pi' user\nsudo raspi-config\n

Optionally:

"},{"location":"install/RASPBERRY_PI_QUICKSTART.html#secure-your-install","title":"Secure your install","text":"

Delete the existing SSH keys and recreate them (why? read this).

# as 'pi' user\nsudo rm -v /etc/ssh/ssh_host_*\nsudo dpkg-reconfigure openssh-server\nsudo reboot\n

This will recreate the server keys. Next, update your system:

# as 'pi' user\nsudo apt update\nsudo apt upgrade\n
"},{"location":"install/RASPBERRY_PI_QUICKSTART.html#install-required-packages","title":"Install required packages","text":"

As of April 2016, the shipping versions with Raspbian are recent enough to run piku:

# as 'pi' user\nsudo apt install -y python-virtualenv python-pip git uwsgi uwsgi-plugin-python nginx\nsudo pip install -U click\nsudo reboot\n
Meanwhile, go get the goodies while Raspberry Pi is rebooting

(We assume you know about ssh keys and have one \"at hand\", you'll need to copy it)

Clone the piku repo somewhere and copy files to your Raspberry Pi

# as yourself in your desktop/laptop computer\nscp piku.py uwsgi-piku.service nginx.default.dist pi@your_machine:/tmp\nscp your_public_ssh_key.pub pi@your_machine:/tmp\n
"},{"location":"install/RASPBERRY_PI_QUICKSTART.html#back-to-the-pi","title":"Back to the Pi","text":"

Prepare uWSGI (part one):

# as 'pi' user\nsudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku\nsudo systemctl disable uwsgi\nsudo cp /tmp/uwsgi-piku.service /etc/systemd/system/\nsudo systemctl daemon-reload\nsudo systemctl enable uwsgi-piku\n

Prepare nginx:

sudo apt-get install nginx\n# Set up nginx to pick up our config files\nsudo cp /tmp/nginx.default.dist /etc/nginx/sites-available/default\n# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `Active: active (waiting)`\n# Restart NGINX\nsudo systemctl restart nginx\n

Create 'piku' user and set it up

# as 'pi' user\nsudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data piku\nsudo su - piku\n# this is now done as 'piku' user\nmkdir ~/.ssh\nchmod 700 ~/.ssh\ncp /tmp/piku.py ~/piku.py\npython piku.py setup\npython piku.py setup:ssh /tmp/id_rsa.pub\n# return to 'pi' user\nexit\n

Prepare uWSGI (part two):

# as 'pi' user\nsudo systemctl start uwsgi-piku\nsudo systemctl status uwsgi-piku.service\n
If you're still here, odds are your Pi is ready for work

"},{"location":"install/RASPBERRY_PI_QUICKSTART.html#testing","title":"Testing","text":"

Go back to your machine and try these commands:

# as yourself in your desktop/laptop computer\nssh piku@your_machine\n\nUsage: piku.py [OPTIONS] COMMAND [ARGS]...\n\n  The smallest PaaS you've ever seen\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  apps              List applications\n  config            Show application configuration\n  config:get        Retrieve a configuration setting\n  config:live       Show live configuration settings\n  config:set        Set a configuration setting\n  deploy            Deploy an application\n  destroy           Destroy an application\n  disable           Disable an application\n  enable            Enable an application\n  logs              Tail an application log\n  ps                Show application worker count\n  ps:scale          Show application configuration\n  restart           Restart an application\n  setup             Initialize paths\n  setup:ssh         Set up a new SSH key\nConnection to your_machine closed.\n

If you find any bugs with this quickstart guide, please let Luis Correia know ;)

"}]} \ No newline at end of file diff --git a/search/search_index.json b/search/search_index.json new file mode 100644 index 0000000..2ea9bca --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"index.html","title":"Home","text":"

piku, inspired by dokku, allows you do git push deployments to your own servers, no matter how small they are.

Installing Using/Features Managing and Monitoring Examples Web App Tutorial

"},{"location":"index.html#demo","title":"Demo","text":""},{"location":"index.html#workflow","title":"Workflow","text":"

piku supports a Heroku-like workflow:

You can also deploy a gh-pages style static site using a static worker type, with the root path as the argument, and run a release task to do some processing on the server after git push.

"},{"location":"index.html#project-activity","title":"Project Activity","text":"

piku is considered STABLE. It is actively maintained, but \"actively\" here means the feature set is pretty much done, so it is only updated when new language runtimes are added or reproducible bugs crop up.

It currently requires Python 3.7 or above, since even though 3.8+ is now the baseline Python 3 version in Ubuntu LTS 20.04 and Debian 11 has already moved on to 3.9, there are no substantial differences between those versions.

"},{"location":"index.html#deprecation-notices","title":"Deprecation Notices","text":"

Since most of its users run it on LTS distributions, there is no rush to introduce disruption. The current plan is to throw up a warning for older runtimes and do regression testing for 3.7-3.12 (replacing the current bracket of tests from 3.5 to 3.8), and make sure we also cover Ubuntu 22.04, Debian 11 and Fedora 37+.

"},{"location":"FAQ.html","title":"FAQ","text":"

Q: Why piku?

A: Partly because it's started out on the Raspberry Pi, because it's Japanese onomatopeia for 'twitch' or 'jolt', and because we knew the name would be cute and amusing.

Q: Why Python/why not Go?

A: We actually thought about doing this in Go right off the bat, but click is so cool and we needed to have uwsgi running anyway, so we caved in. But possible future directions are likely to take something like suture and port this across (or just use Caddy), doing away with uwsgi altogether.

Go also (at the time) did not have a way to vendor dependencies that we were comfortable with, and that is also why Go support fell behind. Hopefully that will change soon.

Q: Does it run under Python 3?

A: Right now, it only runs on Python 3, even though it can deploy apps written in both major versions. It began its development using 2.7 and usingclick for abstracting the simpler stuff, and we eventually switched over to 3.5 once it was supported in Debian Stretch and Raspbian since we wanted to make installing it on the Raspberry Pi as simple as possible.

Q: Why not just use dokku?

A: We used dokku daily for many projects. But it relied on a number of x64 containers that needed to be completely rebuilt for ARM, and when we decided we needed something like this (March 2016) that was barely possible - docker itself was not fully baked for ARM yet, and people were at the time just starting to get herokuish and buildstep to build on ARM.

"},{"location":"features.html","title":"Features","text":""},{"location":"features.html#workflow","title":"Workflow","text":"

piku supports a Heroku-like workflow:

You can also deploy a gh-pages style static site using a static worker type, with the root path as the argument, and run a release task to do some processing on the server after git push.

"},{"location":"features.html#virtual-hosts-and-ssl","title":"Virtual Hosts and SSL","text":"

piku has full virtual host support - i.e., you can host multiple apps on the same VPS and use DNS aliases to access them via different hostnames.

piku will also set up either a private certificate or obtain one via Let's Encrypt to enable SSL.

If you are on a LAN and are accessing piku from macOS/iOS/Linux clients, you can try using piku/avahi-aliases to announce different hosts for the same IP address via Avahi/mDNS/Bonjour.

"},{"location":"features.html#caching-and-static-paths","title":"Caching and Static Paths","text":"

Besides static sites, piku also supports directly mapping specific URL prefixes to filesystem paths (to serve static assets) or caching back-end responses (to remove load from applications).

These features are configured by setting appropriate values in the ENV file.

"},{"location":"features.html#supported-platforms","title":"Supported Platforms","text":"

piku is intended to work in any POSIX-like environment where you have Python, nginx, uwsgi and ssh: it has been deployed on Linux, FreeBSD, [Cygwin][cygwin] and the [Windows Subsystem for Linux][wsl].

As a baseline, it began its development on an original 256MB Rasbperry Pi Model B, and still runs reliably on it.

But its main use is as a micro-PaaS to run applications on cloud servers with both Intel and ARM CPUs, with either Debian or Ubuntu Linux as target platforms.

"},{"location":"features.html#supported-runtimes","title":"Supported Runtimes","text":"

piku currently supports apps written in Python, Node, Clojure, Java and a few other languages (like Go) in the works.

But as a general rule, if it can be invoked from a shell, it can be run inside piku.

"},{"location":"manage.html","title":"Manage","text":""},{"location":"manage.html#managing-your-piku-apps","title":"Managing your Piku apps","text":"

To make life easier you can also install the piku helper into your path (e.g. ~/bin):

curl https://raw.githubusercontent.com/piku/piku/master/piku > ~/bin/piku && chmod 755 ~/bin/piku\n

This shell script simplifies working with multiple piku remotes and applications:

$ piku logs\n$ piku config:set MYVAR=12\n$ piku stop\n$ piku deploy\n$ piku destroy\n$ piku # <- show available remote and local commands\n
$ piku init\nWrote ./ENV file.\nWrote ./Procfile.\n

For instance, here's how to use the -t flag to obtain a bash shell in the app directory of one of your piku apps:

$ piku -t run bash\nPiku remote operator.\nServer: piku@cloud.mccormickit.com\nApp: dashboard\n\npiku@piku:~/.piku/apps/dashboard$ ls\ndata  ENV  index.html  package.json  package-lock.json  Procfile  server.wisp\n
"},{"location":"manage.html#monitoring","title":"Monitoring","text":"

Besides using the logs command, there is a sample monitoring application to keep tabs on resource usage.

"},{"location":"community/index.html","title":"Community","text":"

There is an active discussion forum for piku where you can ask questions, share your deployments, and discuss new features, and we have a published roadmap.

"},{"location":"community/index.html#linuxconf-talk","title":"LinuxConf Talk","text":""},{"location":"community/index.html#references","title":"References","text":"

Contributing Examples

"},{"location":"community/contributing.html","title":"Contributing","text":"

piku is a stable project, but we welcome contributions that:

"},{"location":"community/contributing.html#code-size-style","title":"Code Size / Style","text":"

By its very nature, piku is a very small program. By today's standards of all-encompassing solutions this may seem strange, but it would benefit from being kept that way.

So please keep that in mind when contributing.

For instance, if your runtime or framework needs additional setup, it might be better to contribute an utility script to run in a release entry in the Procfile rather than patching piku.py--but do hack at it if that is the best way to achieve it.

"},{"location":"community/examples.html","title":"Example Applications","text":"

Besides the bundled examples, there are a number of community-contributed examples that can be deployed using piku.

They are meant to be illustrative of the kinds of applications that can be deployed using piku, and are not meant to be exhaustive.

"},{"location":"community/examples.html#pre-built-apps-and-tools","title":"Pre-built Apps and Tools","text":""},{"location":"community/examples.html#phoenix","title":"Phoenix","text":""},{"location":"community/examples.html#python","title":"Python","text":""},{"location":"community/examples.html#ruby-on-rails","title":"Ruby on Rails","text":""},{"location":"community/examples.html#nodejs","title":"NodeJS","text":""},{"location":"community/examples.html#java","title":"Java","text":""},{"location":"community/examples.html#clojure","title":"Clojure","text":""},{"location":"community/examples.html#bare-metal-c","title":"Bare Metal C","text":""},{"location":"configuration/index.html","title":"Configuring Applications","text":"

A minimal piku app has a root directory structure similar to this:

ENV\nProcfile\napp.py\nworker.py\nrequirements.txt\n

ENV Procfile

"},{"location":"configuration/index.html#configuration-files","title":"Configuration Files","text":"

piku relies on two configuration files shipped with your app to determine how to run it: ENV and Procfile.

"},{"location":"configuration/index.html#runtime-detection","title":"Runtime Detection","text":"

Besides ENV and Procfile, piku also looks for runtime-specific files in the root of your app's directory:

Info

go.mod support is currently in development.

These are not exclusive, however. There is also a sample Phoenix app that demonstrates how to add support for additional runtimes.

"},{"location":"configuration/env.html","title":"ENV Variables","text":"

You can configure deployment settings by placing special variables in an ENV file deployed with your app. This file should be placed in the root of your app's directory, and can look something like this:

# variables are global and can be replaced\nSETTING1=True\nSETTING2=${SETTING1}/Maybe\n\n# addr:port\nPORT=9080\nBIND_ADDRESS=0.0.0.0\n\n# the max number the worker will process\nRANGE=10\n\n# worker sleep interval between prints\nINTERVAL=1\n
"},{"location":"configuration/env.html#runtime-settings","title":"Runtime Settings","text":""},{"location":"configuration/env.html#python","title":"Python","text":"

Warning

This is mostly deprecated (since piku now runs solely on Python 3.x), but is kept around for legacy compatibility.

"},{"location":"configuration/env.html#node","title":"Node","text":"

Note

you will need to stop and re-deploy the app to change the node version in a running app.

"},{"location":"configuration/env.html#network-settings","title":"Network Settings","text":""},{"location":"configuration/env.html#uwsgi-settings","title":"uWSGI Settings","text":"

Note

UWSGI_IDLE applies to all the workers, so if you have UWSGI_PROCESSES set to 4, they will all be killed simultaneously. Support for progressive scaling of workers via cheaper and similar uWSGI configurations will be added in the future.

"},{"location":"configuration/env.html#nginx-settings","title":"nginx Settings","text":"

Note

if used with Cloudflare, NGINX_HTTPS_ONLY will cause an infinite redirect loop - keep it set to false, use NGINX_CLOUDFLARE_ACL instead and add a Cloudflare Page Rule to \"Always Use HTTPS\" for your server (use domain.name/* to match all URLs).

"},{"location":"configuration/env.html#nginx-caching","title":"nginx Caching","text":"

When NGINX_CACHE_PREFIXES is set, nginx will cache requests for those URL prefixes to the running application (uwsgi-like or web workers) and reply on its own for NGINX_CACHE_TIME to the outside. This is meant to be used for compute-intensive operations like resizing images or providing large chunks of data that change infrequently (like a sitemap).

The behavior of the cache can be controlled with the following variables:

Note

NGINX_CACHE_PATH will be completely managed by nginx and cannot be removed by Piku when the application is destroyed. This is because nginx sets the ownership for the cache to be exclusive to itself, and the piku user cannot remove that file tree. So you will either need to clean it up manually after destroying the app or store it in a temporary filesystem (or set the piku user to the same UID as www-data, which is not recommended).

Right now, there is no provision for cache revalidation (i.e., nginx asking your backend if the cache entries are still valid), since that requires active application logic that varies depending on the runtime--nginx will only ask your backend for new content when NGINX_CACHE_TIME elapses. If you require that kind of behavior, that is still possible via NGINX_INCLUDE_FILE.

Also, keep in mind that using nginx caching with a static website worker will not work (and there's no point to it either).

"},{"location":"configuration/env.html#nginx-overrides","title":"nginx Overrides","text":""},{"location":"configuration/env.html#acme-settings","title":"Acme Settings","text":""},{"location":"configuration/procfile.html","title":"Procfile format","text":"

piku supports a Heroku-like Procfile that you provide to indicate how to run one or more application processes (what Heroku calls \"dynos\"):

web: embedded_server --port $PORT\nworker: background_worker\n
"},{"location":"configuration/procfile.html#worker-types","title":"Worker Types","text":"

piku supports six different kinds of worker processes:

# A module to be loaded by uwsgi to serve HTTP requests\nwsgi: module.submodule:app\n# A background worker, using the default name\nworker: python long_running_script.py\n# Another worker with a different name\nfetcher: python fetcher.py\n# Simple cron expression: minute [0-59], hour [0-23], day [0-31], month [1-12], weekday [1-7] (starting Monday, no ranges allowed on any field)\ncron: 0 0 * * * python midnight_cleanup.py\nrelease: python initial_cleanup.py\n
Each of these has slightly different features:

"},{"location":"configuration/procfile.html#wsgi","title":"wsgi","text":"

wsgi workers are Python-specific and must be specified in the format dotted.module:entry_point. uwsgi will load the specified module and call the entry_point function to start the application, handling all the HTTP requests directly (your Python code will run the handlers, but will run as a part of the uwsgi process).

uwsgi will automatically spawn multiple workers for you, and you can control the number of workers via the UWSGI_PROCESSES environment variable.

Also, in this mode uwsgi will talk to nginx via a Unix socket, so you don't need to worry about the HTTP server at all.

"},{"location":"configuration/procfile.html#web","title":"web","text":"

web workers can be literally any executable that uwsgi can run and that will serve HTTP requests. They must (by convention) honor the PORT environment variable, so that the nginx reverse proxy can talk to them.

"},{"location":"configuration/procfile.html#worker","title":"worker","text":"

worker processes are just standard processes that run in the background. They can actually have arbitrary names, and the idea is that they would perform any tasks your app requires that isn't directly related to serving web pages.

"},{"location":"configuration/procfile.html#static","title":"static","text":"

static workers are simply a way to direct nginx to mount the first argument as a static path and serve it directly. This is useful for serving (and caching) static files directly from your app, without having to go through application code.

Note

See nginx caching for more information on how to configure nginx to serve static files.

"},{"location":"configuration/procfile.html#cron","title":"cron","text":"

A cron worker is a process that runs at a specific time (or intervals), using a simplified crontab expression preceding the command to be run (e.g. cron: */5 * * * * python batch.py to run a batch every 5 minutes)

Warning

crontab expressions are simplified and do not support ranges or lists, only single values, splits and * (wildcard).

"},{"location":"configuration/procfile.html#preflight","title":"preflight","text":"

preflight is a special \"worker\" that is run once before the app is deployed and dependencies are installed (can be useful for cleanups, like resetting caches, removing older versions of files, etc).

"},{"location":"configuration/procfile.html#release","title":"release","text":"

release which is a special worker that is run once when the app is deployed, after installing dependencies (can be useful for build steps).

Any worker will be automatically respawned upon failure ([uWSGI][uwsgi] will automatically shun/throttle crashy workers).

"},{"location":"design/index.html","title":"Design","text":"

The idea behind piku is that it provides the simplest possible way to deploy web apps or services. Simplicity comes at the expense of features, of course, and this document tries to capture the trade-offs.

"},{"location":"design/index.html#core-values","title":"Core values","text":""},{"location":"design/index.html#why-uwsgi","title":"Why uWSGI","text":"

Using uWSGI in emperor mode gives us the following features for free:

"},{"location":"design/index.html#application-packaging","title":"Application packaging","text":"

An app is simply a git repository with some additional files on the top level, the most important of which is the Procfile.

"},{"location":"design/index.html#env-settings","title":"ENV settings","text":"

Since piku is targeted at 12 Factor apps, it allows you to set environment variables in a number of ways, the simplest of which is by adding an ENV file to your repository:

SETTING1=foo\n# piku supports comments and variable expansion\nSETTING2=${SETTING1}/bar\n# if this isn't defined, piku will assign a random TCP port\nPORT=9080\n

See configuration for a full list of environment variables that can also be set.

Environment variables can be changed after deployment using the config:set command.

"},{"location":"design/index.html#runtime-detection","title":"Runtime detection","text":"

piku follows a very simple set of rules to determine what kind of runtime is required, outlined in the configuration section

"},{"location":"design/index.html#application-isolation","title":"Application isolation","text":"

Application isolation can be tackled at several levels, the most relevant of which being:

For 1.0, all applications run under the same uid, under separate branches of the same filesystem, and without any resource limiting.

Ways to improve upon that (short of full containerisation) typically entail the use of a chroot jail environment (which is available under most POSIX systems in one form or another) or Linux kernel namespaces - both of which are supported by uWSGI (which can also handle resource limiting to a degree).

As to runtime isolation, piku only provides virtualenv support until 1.0. Python apps can run under Python 2 or 3 depending on the setting of PYTHON_VERSION, but will always use pre-installed interpreters (Go, Node and Java support will share these limitations in each major version).

"},{"location":"design/index.html#internals","title":"Internals","text":"

piku uses two git repositories for each app: a bare repository for client push, and a clone for deployment (which is efficient in terms of storage since git tries to use hardlinks on local clones whenever possible).

This separation makes it easier to cope with long/large deployments and restore apps to a pristine condition, since the app will only go live after the deployment clone is reset (via git checkout -f).

"},{"location":"design/index.html#components","title":"Components","text":"

This diagram outlines how its components interact:

graph TD\n    subgraph \"systemd\"\n        nginx([nginx])\n        sshd([sshd])\n        uwsgi([uwsgi])\n    end\n    uwsgi-->vassal([vassal])\n    vassal-.->uwsgi.ini\n    sshd-->piku([piku.py])-->repo[git repo]\n    Procfile-->uwsgi.ini\n    an-->app\n    repo---app\n    repo---ENV\n    repo---requirements.txt\n    repo---Procfile\n    requirements.txt-->virtualenv\n    uwsgi.ini-->virtualenv\n    ENV-->an\n    ENV-->uwsgi.ini\n    nginx-.-mn[master<br>nginx.conf]\n    mn-.-an[app<br>nginx.conf]
"},{"location":"design/plugins.html","title":"Plugins","text":"

Thanks to jsenin, piku currently has experimental support for external plugins via #129.

Plugins are inserted into the commands listing and can perform arbitrary actions. At this moment there are no official plugins, but here is an example file that should be placed at ~/.piku/plugins/postgres/__init__.py that could contain the commands to manage a Postgres database:

import click\n\n@click.group()\ndef postgres():\n    \"\"\"Postgres command plugin\"\"\"\n    pass\n\n@postgres.command(\"postgres:create\")\n@click.argument('name')\n@click.argument('user')\n@click.argument('password')\ndef postgres_create():\n    \"\"\"Postgres create a database\"\"\"\n    pass\n\n@postgres.command(\"postgres:drop\")\n@click.argument('name')\ndef postgres_drop():\n    \"\"\"Postgres drops a database\"\"\"\n    pass\n\n@postgres.command(\"postgres:import\")\n@click.argument('name')\ndef postgres_drop():\n    \"\"\"Postgres import a database\"\"\"\n    pass\n\n@postgres.command(\"postgres:dump\")\n@click.argument('name')\ndef postgres_drop():\n    \"\"\"Postgres dumps a database SQL\"\"\"\n    pass\n\ndef cli_commands():\n    return postgres\n
"},{"location":"install/index.html","title":"Installation","text":""},{"location":"install/index.html#tldr","title":"TL;DR:","text":"

To install it on your server, ssh in as root and run this:

curl https://piku.github.io/get | sh\n
"},{"location":"install/index.html#installation-methods","title":"Installation Methods","text":"

piku requires Python 3, uWSGI, ssh, and a Linux distribution that runs systemd, such as Raspbian Jessie/Debian 8+/Ubuntu/Fedora/CentOS.

There are 3 main ways to install piku on a server:

  1. Use piku-bootstrap to do it if your server is already provisioned (that is what the TL;DR command does)

  2. Use cloud-init to do it automatically at VPS build time (see the cloud-init repository, which has examples for most common cloud providers)

  3. Manually: Follow the guide below or one of the platform-specfic guides.

There is also an Ansible playbook.

Contributing

If you are running piku on specific Linux versions, feel free to contribute your own instructions.

"},{"location":"install/index.html#generic-installation-steps","title":"Generic Installation Steps","text":""},{"location":"install/index.html#set-up-the-piku-user","title":"Set up the piku user","text":"

piku requires a separate user account to run. To create a new user with the right group membership (we're using the built-in www-data group because it's generally thought of as a less-privileged group), enter the following command:

# pick a username\nexport PAAS_USERNAME=piku\n# create it\nsudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data $PAAS_USERNAME\n# copy & setup piku.py\nsudo su - $PAAS_USERNAME -c \"wget https://raw.githubusercontent.com/piku/piku/master/piku.py && python3 ~/piku.py setup\"\n

The setup output should be something like this:

Creating '/home/piku/.piku/apps'.\nCreating '/home/piku/.piku/repos'.\nCreating '/home/piku/.piku/envs'.\nCreating '/home/piku/.piku/uwsgi'.\nCreating '/home/piku/.piku/uwsgi-available'.\nCreating '/home/piku/.piku/uwsgi-enabled'.\nCreating '/home/piku/.piku/logs'.\nSetting '/home/piku/piku.py' as executable.\n
"},{"location":"install/index.html#set-up-ssh-access","title":"Set up ssh access","text":"

If you don't have an ssh public key (or never used one before), you need to create one. The following instructions assume you're running some form of UNIX on your own machine (Windows users should check the documentation for their ssh client, unless you have Cygwin installed).

On your own machine, issue the ssh-keygen command and follow the prompts:

ssh-keygen \n\nGenerating public/private rsa key pair.\nEnter file in which to save the key (/home/youruser/.ssh/id_rsa): \nCreated directory '/home/youruser/.ssh'.\nEnter passphrase (empty for no passphrase): \nEnter same passphrase again: \nYour identification has been saved in /home/youruser/.ssh/id_rsa.\nYour public key has been saved in /home/youruser/.ssh/id_rsa.pub.\nThe key fingerprint is:\n85:29:07:cb:de:ad:be:ef:42:65:00:c8:d2:6b:9e:ff youruser@yourlaptop.lan\nThe key's randomart image is:\n+--[ RSA 2048]----+\n<...>\n+-----------------+\n

Copy the resulting id_rsa.pub (or equivalent, just make sure it's the public file) to your piku server and do the following:

sudo su - piku\npython3 piku.py setup:ssh /tmp/id_rsa.pub\n\nAdding key '85:29:07:cb:de:ad:be:ef:42:65:00:c8:d2:6b:9e:ff'.\n

Now if you look at .ssh/authorized_keys, you should see something like this:

sudo su - piku\ncat .ssh/authorized_keys\n\ncommand=\"FINGERPRINT=85:29:07:cb:de:ad:be:ef:42:65:00:c8:d2:6b:9e:ff NAME=default /home/piku/piku.py $SSH_ORIGINAL_COMMAND\",no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhTYZi/qeJBKgU3naI8FNjQgeMYnMsEtqrOmUc4lJoPNH2qBUTNkzwThGqsBm2HNLPURWMiEifBqF+kRixMud67Co7Zs9ys7pwFXkJB9bbZasd2JCGfVZ4UYXHnvgejSWkLAV/4bObhsbP2vWOmbbm91Cwn+PGJgoiW08yrd45lsDmgv9cUAJS3e8LkgVELvIDg49yM5ArB88oxwMEoUgWU2OniHmH0o1zw5I8WXHRhHOjb8cGsdTYfXEizRKKRTM2Mu6dKRt1GNL0UbWi8iS3uJHGD3AcQ4ApdMl5X0gTixKHponStOrSMy19/ltuIy8Sjr7KKPxz07ikMYr7Vpcp youruser@yourlaptop.lan\n

This line is what enables you to ssh (and perform git over ssh operations) to the piku user without a password, verifying your identity via your public key, restricting what can be done remotely and passing on to piku itself the commands you'll be issuing.

"},{"location":"install/index.html#test","title":"Test","text":"

From your machine, do:

ssh piku@pi.lan\n\nUsage: piku.py [OPTIONS] COMMAND [ARGS]...\n\n  The smallest PaaS you've ever seen\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  apps              List applications\n  config            Show application configuration\n  config:get        Retrieve a configuration setting\n  config:live       Show live configuration settings\n  config:set        Set a configuration setting\n  deploy            Deploy an application\n  destroy           Destroy an application\n  disable           Disable an application\n  enable            Enable an application\n  logs              Tail an application log\n  ps                Show application worker count\n  ps:scale          Show application configuration\n  restart           Restart an application\n  setup             Initialize paths\n  setup:ssh         Set up a new SSH key\nConnection to pi.lan closed.\n
"},{"location":"install/INSTALL-centos-9.html","title":"Installation on CentOS 9","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

All steps done as root (or add sudo if you prefer).

"},{"location":"install/INSTALL-centos-9.html#dependencies","title":"Dependencies","text":"

Before installing piku, you need to install the following packages:

dnf in -y ansible-core ansible-collection-ansible-posix ansible-collection-ansible-utils nginx nodejs npm openssl postgresql postgresql-server postgresql-contrib python3 python3-pip uwsgi uwsgi-logger-file uwsgi-logger-systemd\npip install click\n
"},{"location":"install/INSTALL-centos-9.html#set-up-the-piku-user","title":"Set up the piku user","text":"
adduser --groups nginx piku\n# copy & setup piku.py\nsu - piku -c \"wget https://raw.githubusercontent.com/piku/piku/master/piku.py && python3 ~/piku.py setup\"\n
"},{"location":"install/INSTALL-centos-9.html#set-up-ssh-access","title":"Set up SSH access","text":"

See INSTALL.md

"},{"location":"install/INSTALL-centos-9.html#uwsgi-configuration","title":"uWSGI Configuration","text":"

FYI The uWSGI Emperor \u2013 multi-app deployment

mv /home/piku/.piku/uwsgi/uwsgi.ini /etc/uwsgi.d/piku.ini # linking alone increases the host attack service if one can get inside the piku user or one of its apps, so moving is safer\nchown piku:piku /etc/uwsgi.d/piku.ini # In Tyrant mode (set by default in /etc/uwsgi.ini) the Emperor will run the vassal using the UID/GID of the vassal configuration file\nsystemctl restart uwsgi\njournalctl -feu uwsgi # see logs\n
"},{"location":"install/INSTALL-centos-9.html#nginx-configuration","title":"nginx Configuration","text":"

FYI Setting up and configuring NGINX

echo \"include /home/piku/.piku/nginx/*.conf;\" > /etc/nginx/conf.d/piku.conf\nsystemctl restart nginx\njournalctl -feu nginx # see logs\n
"},{"location":"install/INSTALL-centos-9.html#set-up-systemdpath-to-reload-nginx-upon-config-changes","title":"Set up systemd.path to reload nginx upon config changes","text":"
# Set up systemd.path to reload nginx upon config changes\nsu -\ngit clone https://github.com/piku/piku.git # need a copy of some files\ncp -v piku/piku-nginx.{path,service} /etc/systemd/system/\nsystemctl enable piku-nginx.{path,service}\nsystemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `active: active (waiting)`\n
"},{"location":"install/INSTALL-centos-9.html#notes","title":"Notes","text":""},{"location":"install/INSTALL-other.html","title":"Installation on other platforms","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

"},{"location":"install/INSTALL-other.html#dependencies","title":"Dependencies","text":"

Before running piku for the first time, you need to install the following Python packages at the system level:

"},{"location":"install/INSTALL-other.html#raspbian-jessie-debian-8-ubuntu-1604","title":"Raspbian Jessie, Debian 8, Ubuntu 16.04","text":"
sudo apt-get install git python3-virtualenv python3-pip\nsudo pip3 install -U click\n
"},{"location":"install/INSTALL-other.html#raspbian-wheezy","title":"Raspbian Wheezy","text":"
sudo apt-get install git python3\nsudo easy_install3 -U pip3\nsudo pip3 install -U click virtualenv\n

These may or may not be installed already (click usually isn't). For Raspbian Wheezy this is the preferred approach, since current apt packages are fairly outdated.

"},{"location":"install/INSTALL-other.html#set-up-the-piku-user-set-up-ssh-access","title":"Set up the piku user, Set up SSH access","text":"

See INSTALL.md

"},{"location":"install/INSTALL-other.html#uwsgi-installation-debian-linux-variants-any-architecture","title":"uWSGI Installation (Debian Linux variants, any architecture)","text":"

uWSGI can be installed in a variety of fashions. These instructions cover both pre-packaged and source installs depending on your system.

"},{"location":"install/INSTALL-other.html#raspbian-jessie-debian-8","title":"Raspbian Jessie, Debian 8","text":"

Warning

These OS releases are no longer supported and these instructions are kept for reference purposes only.

In Raspbian Jessie, Debian 8 and other systemd distributions where uWSGI is already available pre-compiled (but split into a number of plugins), do the following:

# At the time of this writing, this installs uwsgi 2.0.7 on Raspbian Jessie.\n# You can also install uwsgi-plugins-all if you want to get runtime support for other languages\nsudo apt-get install uwsgi uwsgi-plugin-python3\n# refer to our executable using a link, in case there are more versions installed\nsudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku\n# disable the standard uwsgi startup script\nsudo systemctl disable uwsgi\n\n# add our own startup script\nsudo cp /tmp/uwsgi-piku.service /etc/systemd/system/\nsudo systemctl enable uwsgi-piku\nsudo systemctl start uwsgi-piku\n\n# check it's running\nsudo systemctl status uwsgi-piku.service\n
Important Note: Make sure you run piku.py setup as outlined above before starting the service.

Also, please note that uwsgi-piku.service, as provided, creates a /run/uwsgi-piku directory for it to place socket files and sundry. This is not actually used at the moment, since the uwsgi socket file is placed inside the piku user directory for consistency across OS distributions. This will be cleaned up in a later release.

"},{"location":"install/INSTALL-other.html#raspbian-wheezy_1","title":"Raspbian Wheezy","text":"

Warning

This OS release is no longer supported and these instructions are kept for reference purposes only.

Since Raspbian Wheezy is a fairly old distribution by now, its uwsgi-* packages are completely outdated (and depend on Python 2.6), so we have to compile and install our own version, as well as using an old-style init script to have it start automatically upon boot.

sudo apt-get install build-essential python-dev libpcre3-dev\n# At the time of this writing, this installs 2.0.12\nsudo pip install uwsgi\n# refer to our executable using a link, in case there are more versions installed\nsudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku\n\n# set up our init script\nsudo cp /tmp/uwsgi-piku.dist /etc/init.d/uwsgi-piku\nsudo chmod +x /etc/init.d/uwsgi-piku\nsudo update-rc.d uwsgi-piku defaults\nsudo service uwsgi-piku start\n
Important Note: Make sure you run python3 piku.py setup as outlined above before starting the service.

"},{"location":"install/INSTALL-other.html#ubuntu-1404-lts","title":"Ubuntu 14.04 LTS","text":"

Warning

This OS release is no longer supported and these instructions are kept for reference purposes only.

This is a mix of both the above, and should change soon when we get 16.04. If you have trouble, install uWSGI via pip instead.

# At the time of this writing, this installs uwsgi 1.9.17 on Ubuntu 14.04 LTS.\n# You can also install uwsgi-plugins-all if you want to get runtime support for other languages\nsudo apt-get install uwsgi uwsgi-plugin-python3\n# refer to our executable using a link, in case there are more versions installed\nsudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku\n\n# set up our init script\nsudo cp /tmp/uwsgi-piku.dist /etc/init.d/uwsgi-piku\nsudo chmod +x /etc/init.d/uwsgi-piku\nsudo update-rc.d uwsgi-piku defaults\nsudo service uwsgi-piku start\n
"},{"location":"install/INSTALL-other.html#nginx-installation-raspbian-8-ubuntu-1604","title":"nginx Installation (Raspbian 8, Ubuntu 16.04)","text":"

Warning

These OS releases are no longer supported and these instructions are kept for reference purposes only.

Warning

There is a bug in nginx 1.6.2 under Raspbian 8 that causes it to try to allocate around a gigabyte of RAM when using SSL with SPDY. I seriously recommend using Ubuntu instead, if you can, or disabling SSL altogether.

sudo apt-get install nginx\n# Set up nginx to pick up our config files\nsudo cp /tmp/nginx.default.dist /etc/nginx/sites-available/default\n# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `Active: active (waiting)`\n# Restart NGINX\nsudo systemctl restart nginx\n
"},{"location":"install/INSTALL-other.html#java-8-installation-all-debian-linux-variants-on-raspberry-pi","title":"Java 8 Installation (All Debian Linux variants, on Raspberry Pi)","text":"

Warning

OpenJDK 8 is no longer shipping with most distributions and these instructions are kept for reference purposes only.

To be able to deploy Java apps, we're going to need to install Java (and, since we're going to be doing so on ARM, it's best to use Oracle's runtime). To do that, we're going to use the webupd8team PPA, which has a (cross-platform) Java installer.

First, get rid of OpenJDK and import the PPA key:

sudo apt-get remove openjdk*\nsudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com EEA14886\n
"},{"location":"install/INSTALL-other.html#raspbian-jessie","title":"Raspbian Jessie","text":"

Warning

This OS release is no longer supported and these instructions are kept for reference purposes only.

For Jessie, we're going to use the trusty version of the installer:

sudo tee /etc/apt/sources.list.d/webupd8team.list\ndeb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main \ndeb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main\n^D\n
"},{"location":"install/INSTALL-other.html#ubuntu-1604-for-arm","title":"Ubuntu 16.04 for ARM","text":"

Warning

This OS release is no longer supported and these instructions are kept for reference purposes only.

For Xenial, we're going to use its own version:

sudo tee /etc/apt/sources.list.d/webupd8team.list\ndeb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main \ndeb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main\n^D\n

Now perform the actual install:

sudo apt-get update\nsudo apt-get install oracle-java8-installer oracle-java8-set-default\n
"},{"location":"install/INSTALL-other.html#go-installation-all-debian-linux-variants-on-raspberry-pi","title":"Go Installation (All Debian Linux variants, on Raspberry Pi)","text":"

This is EXPERIMENTAL and may not work at all.

"},{"location":"install/INSTALL-other.html#raspbian-wheezyjessie","title":"Raspbian Wheezy/Jessie","text":"

Warning

Wheezy and Jessie are no longer supported and these instructions are kept for reference purposes only.

Since Raspbian's Go compiler is version 1.0.2, we need something more up-to-date.

  1. Get an ARM 6 binary tarball
  2. Unpack it under the piku user like such:
sudo su - piku\ntar -zxvf /tmp/go1.5.3.linux-arm.tar.gz\n# remove unnecessary files\nrm -rf go/api go/blog go/doc go/misc go/test\n
  1. Give it a temporary GOPATH and install godep:
sudo su - piku\nGOROOT=$HOME/go GOPATH=$HOME/gopath PATH=$PATH:$HOME/go/bin go get github.com/tools/godep\n# temporary workaround until this is fixed in godep or Go 1.7(?)\nGOROOT=$HOME/go GOPATH=$HOME/gopath PATH=$PATH:$HOME/go/bin go get golang.org/x/sys/unix\n

TODO: complete this.

"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html","title":"Installation on Raspbian Stretch or Buster","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

piku setup is simplified in modern Debian versions, since it can take advantage of some packaging improvements in uWSGI and does not require a custom systemd service. However, Stretch still ships with Python 3.5, which means it's not an ideal environment for new deployments on both Intel and ARM devices (Buster, in turn, ships with Python 3.7).

"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#setting-up-your-raspberry-pi","title":"Setting up your Raspberry Pi","text":"

Download and install Raspbian onto an SD card.

After you install it is recommended that you do the following to update your installation to the latest available software.

# update apt-get\nsudo apt-get update\n\n# upgrade all software\nsudo apt-get upgrade\n

Configure your installation. It is recommended that Change Password from the default and setup Locale Options (Locale and Timezone) and EXPAND FILESYSTEM. You will also want to Enable SSH.

# configure your installation\nsudo raspi-config\n

At this point it is a good idea to sudo shutdown -h now and make a backup image of the card.

"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#dependencies","title":"Dependencies","text":"

Before installing piku, you need to install the following packages:

sudo apt-get install -y build-essential certbot git \\\n    libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev nginx \\\n    python-certbot-nginx python-dev python-pip python-virtualenv \\\n    python3-dev python3-pip python3-click python3-virtualenv \\\n    uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python \\\n    uwsgi-plugin-python uwsgi-plugin-python3 uwsgi-plugin-tornado-python \\\n    uwsgi-plugin-lua5.1 uwsgi-plugin-lua5.2 uwsgi-plugin-luajit\n
"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#set-up-the-piku-user-set-up-ssh-access","title":"Set up the piku user, Set up SSH access","text":"

See INSTALL.md

"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#uwsgi-configuration","title":"uWSGI Configuration","text":"

uWSGI in Stretch and Buster requires very little configuration, since it is already properly packaged. All you need to do is create a symlink to the piku configuration file in /etc/uwsgi/apps-enabled:

sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini\nsudo systemctl restart uwsgi\n
"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#nginx-configuration","title":"nginx Configuration","text":"

piku requires you to edit /etc/nginx/sites-available/default to the following, so it can inject new site configurations into nginx:

server {\n    listen 80 default_server;\n    listen [::]:80 default_server;\n    root /var/www/html;\n    index index.html index.htm;\n    server_name _;\n    location / {\n        try_files $uri $uri/ =404;\n    }\n}\n# replace `PAAS_USERNAME` with the username you created.\ninclude /home/PAAS_USERNAME/.piku/nginx/*.conf;\n
"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#set-up-systemdpath-to-reload-nginx-upon-config-changes","title":"Set up systemd.path to reload nginx upon config changes","text":"
# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `Active: active (waiting)`\n# Restart NGINX\nsudo systemctl restart nginx\n
"},{"location":"install/INSTALL-raspbian-9.4-stretch-10-buster.html#notes","title":"Notes","text":"

This file was last updated on June 2019

"},{"location":"install/INSTALL-ubuntu-16.04.html","title":"Ubuntu 16.04","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

sudo apt-get update\nsudo apt-get -y dist-upgrade\nsudo apt-get -y autoremove\nsudo apt-get install -y tmux vim htop fail2ban uwsgi uwsgi-plugin-python uwsgi-plugin-python3 uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python uwsgi-plugin-tornado-python nginx libxml2-dev libxslt1-dev python-dev zlib1g-dev build-essential git python3-virtualenv python3-pip python3-click\nsudo pip3 install -U click pip\nsudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data piku\n\n# move to /tmp and grab our distribution files\ncd /tmp\nwget https://raw.githubusercontent.com/piku/piku/master/piku.py\nwget https://raw.githubusercontent.com/piku/piku/master/piku-nginx.path\nwget https://raw.githubusercontent.com/piku/piku/master/piku-nginx.service\nwget https://raw.githubusercontent.com/piku/piku/master/nginx.default.dist\nwget https://raw.githubusercontent.com/piku/piku/master/uwsgi-piku.service\n# Set up nginx to pick up our config files\nsudo cp /tmp/nginx.default.dist /etc/nginx/sites-available/default\n# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Restart NGINX\nsudo systemctl restart nginx\nsudo cp /tmp/uwsgi-piku.service /etc/systemd/system/\n# refer to our executable using a link, in case there are more versions installed\nsudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku\n# disable the standard uwsgi startup script\nsudo systemctl disable uwsgi\nsudo systemctl enable uwsgi-piku\nsudo su - piku\nmkdir ~/.ssh\nchmod 700 ~/.ssh\n# now copy the piku script to this user account\ncp /tmp/piku.py ~/piku.py\npython3 piku.py setup\n# Now import your SSH key using setup:ssh\n\nsudo systemctl start uwsgi-piku\n
"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html","title":"Installation on Ubuntu 18.04 LTS (Bionic)","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

piku setup is simplified in Bionic, since it can take advantage of some packaging improvements in uWSGI and does not require a custom systemd service. Since Bionic also ships with Python 3.6, this is an ideal environment for new deployments on both Intel and ARM devices.

"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#dependencies","title":"Dependencies","text":"

Before installing piku, you need to install the following packages:

sudo apt-get update\nsudo apt-get install -y build-essential certbot git \\\n    libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev nginx \\\n    python-certbot-nginx python-dev python-pip python-virtualenv \\\n    python3-dev python3-pip python3-click python3-virtualenv \\\n    uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python \\\n    uwsgi-plugin-python uwsgi-plugin-python3 uwsgi-plugin-tornado-python\n
"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#set-up-the-piku-user-set-up-ssh-access","title":"Set up the piku user, Set up SSH access","text":"

See INSTALL.md

"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#uwsgi-configuration","title":"uWSGI Configuration","text":"

uWSGI requires very little configuration, since it is already properly packaged. All you need to do is place a link to the piku configuration file in /etc/uwsgi/apps-enabled:

sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini\nsudo systemctl restart uwsgi\n
"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#nginx-configuration","title":"nginx Configuration","text":"

piku requires you to edit /etc/nginx/sites-available/default to the following, so it can inject new site configurations into nginx:

server {\n    listen 80 default_server;\n    listen [::]:80 default_server;\n    root /var/www/html;\n    index index.html index.htm;\n    server_name _;\n    location / {\n        try_files $uri $uri/ =404;\n    }\n}\n# replace `PAAS_USERNAME` with the username you created.\ninclude /home/PAAS_USERNAME/.piku/nginx/*.conf;\n
"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#set-up-systemdpath-to-reload-nginx-upon-config-changes","title":"Set up systemd.path to reload nginx upon config changes","text":"
# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `Active: active (waiting)`\n# Restart NGINX\nsudo systemctl restart nginx\n
"},{"location":"install/INSTALL-ubuntu-18.04-bionic.html#notes","title":"Notes","text":"

This file was last updated on November 2018

"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html","title":"Installation on Ubuntu 22.04 LTS (Jammy)","text":"

Note

This is a standalone, distribution-specific version of INSTALL.md. You do not need to read or follow the original file, but can refer to it for generic steps like setting up SSH keys (which are assumed to be common knowledge here)

piku setup is simplified in Jammy, since it can take advantage of some packaging improvements in uWSGI and does not require a custom systemd service. Since Jammy also ships with Python 3.10, this is an ideal environment for new deployments on both Intel and ARM devices.

"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#dependencies","title":"Dependencies","text":"

Before installing piku, you need to install the following packages:

sudo apt-get update\nsudo apt-get install -y build-essential certbot git \\\n    libjpeg-dev libxml2-dev libxslt1-dev zlib1g-dev nginx \\\n    python3-certbot-nginx \\\n    python3-dev python3-pip python3-click python3-virtualenv \\\n    uwsgi uwsgi-plugin-asyncio-python3 uwsgi-plugin-gevent-python3 \\\n    uwsgi-plugin-python3 uwsgi-plugin-tornado-python3\n
"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#set-up-the-piku-user-set-up-ssh-access","title":"Set up the piku user, Set up SSH access","text":"

See INSTALL.md

"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#uwsgi-configuration","title":"uWSGI Configuration","text":"

uWSGI requires very little configuration, since it is already properly packaged. All you need to do is place a link to the piku configuration file in /etc/uwsgi/apps-enabled:

sudo ln /home/$PAAS_USERNAME/.piku/uwsgi/uwsgi.ini /etc/uwsgi/apps-enabled/piku.ini\nsudo systemctl restart uwsgi\n
"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#nginx-configuration","title":"nginx Configuration","text":"

piku requires you to edit /etc/nginx/sites-available/default to the following, so it can inject new site configurations into nginx:

server {\n    listen 80 default_server;\n    listen [::]:80 default_server;\n    root /var/www/html;\n    index index.html index.htm;\n    server_name _;\n    location / {\n        try_files $uri $uri/ =404;\n    }\n}\n# replace `PAAS_USERNAME` with the username you created.\ninclude /home/PAAS_USERNAME/.piku/nginx/*.conf;\n
"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#set-up-systemdpath-to-reload-nginx-upon-config-changes","title":"Set up systemd.path to reload nginx upon config changes","text":"
# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `Active: active (waiting)`\n# Restart NGINX\nsudo systemctl restart nginx\n
"},{"location":"install/INSTALL-ubuntu-22.04-jammy.html#notes","title":"Notes","text":"

This file was last updated on November 2018

"},{"location":"install/RASPBERRY_PI_QUICKSTART.html","title":"Setting up a Raspberry Pi Piku Server from Scratch","text":"

Warning

These instructions are correct as of April 1st 2016. Quite a bit has changed since then in Raspberry Pi land, so you may need to adjust them accordingly.

Start by flashing a SD card with the latest Raspbian Jessie Lite image.

"},{"location":"install/RASPBERRY_PI_QUICKSTART.html#do-this-in-your-raspberry-pi-as-pi-user","title":"Do this in your Raspberry Pi as 'pi' user","text":"

Boot it, launch raspi-config to perform (at least) the following configuration:

# as 'pi' user\nsudo raspi-config\n

Optionally:

"},{"location":"install/RASPBERRY_PI_QUICKSTART.html#secure-your-install","title":"Secure your install","text":"

Delete the existing SSH keys and recreate them (why? read this).

# as 'pi' user\nsudo rm -v /etc/ssh/ssh_host_*\nsudo dpkg-reconfigure openssh-server\nsudo reboot\n

This will recreate the server keys. Next, update your system:

# as 'pi' user\nsudo apt update\nsudo apt upgrade\n
"},{"location":"install/RASPBERRY_PI_QUICKSTART.html#install-required-packages","title":"Install required packages","text":"

As of April 2016, the shipping versions with Raspbian are recent enough to run piku:

# as 'pi' user\nsudo apt install -y python-virtualenv python-pip git uwsgi uwsgi-plugin-python nginx\nsudo pip install -U click\nsudo reboot\n
Meanwhile, go get the goodies while Raspberry Pi is rebooting

(We assume you know about ssh keys and have one \"at hand\", you'll need to copy it)

Clone the piku repo somewhere and copy files to your Raspberry Pi

# as yourself in your desktop/laptop computer\nscp piku.py uwsgi-piku.service nginx.default.dist pi@your_machine:/tmp\nscp your_public_ssh_key.pub pi@your_machine:/tmp\n
"},{"location":"install/RASPBERRY_PI_QUICKSTART.html#back-to-the-pi","title":"Back to the Pi","text":"

Prepare uWSGI (part one):

# as 'pi' user\nsudo ln -s `which uwsgi` /usr/local/bin/uwsgi-piku\nsudo systemctl disable uwsgi\nsudo cp /tmp/uwsgi-piku.service /etc/systemd/system/\nsudo systemctl daemon-reload\nsudo systemctl enable uwsgi-piku\n

Prepare nginx:

sudo apt-get install nginx\n# Set up nginx to pick up our config files\nsudo cp /tmp/nginx.default.dist /etc/nginx/sites-available/default\n# Set up systemd.path to reload nginx upon config changes\nsudo cp ./piku-nginx.{path, service} /etc/systemd/system/\nsudo systemctl enable piku-nginx.{path,service}\nsudo systemctl start piku-nginx.path\n# Check the status of piku-nginx.service\nsystemctl status piku-nginx.path # should return `Active: active (waiting)`\n# Restart NGINX\nsudo systemctl restart nginx\n

Create 'piku' user and set it up

# as 'pi' user\nsudo adduser --disabled-password --gecos 'PaaS access' --ingroup www-data piku\nsudo su - piku\n# this is now done as 'piku' user\nmkdir ~/.ssh\nchmod 700 ~/.ssh\ncp /tmp/piku.py ~/piku.py\npython piku.py setup\npython piku.py setup:ssh /tmp/id_rsa.pub\n# return to 'pi' user\nexit\n

Prepare uWSGI (part two):

# as 'pi' user\nsudo systemctl start uwsgi-piku\nsudo systemctl status uwsgi-piku.service\n
If you're still here, odds are your Pi is ready for work

"},{"location":"install/RASPBERRY_PI_QUICKSTART.html#testing","title":"Testing","text":"

Go back to your machine and try these commands:

# as yourself in your desktop/laptop computer\nssh piku@your_machine\n\nUsage: piku.py [OPTIONS] COMMAND [ARGS]...\n\n  The smallest PaaS you've ever seen\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  apps              List applications\n  config            Show application configuration\n  config:get        Retrieve a configuration setting\n  config:live       Show live configuration settings\n  config:set        Set a configuration setting\n  deploy            Deploy an application\n  destroy           Destroy an application\n  disable           Disable an application\n  enable            Enable an application\n  logs              Tail an application log\n  ps                Show application worker count\n  ps:scale          Show application configuration\n  restart           Restart an application\n  setup             Initialize paths\n  setup:ssh         Set up a new SSH key\nConnection to your_machine closed.\n

If you find any bugs with this quickstart guide, please let Luis Correia know ;)

"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..0f8724e --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz new file mode 100644 index 0000000..c793724 Binary files /dev/null and b/sitemap.xml.gz differ