remove pyko

This commit is contained in:
Joris Vink 2019-03-21 21:35:24 +01:00
parent 58c2739dee
commit b9a714de65
6 changed files with 0 additions and 164 deletions

6
pyko/.gitignore vendored
View File

@ -1,6 +0,0 @@
*.o
.flavor
.objs
pyko.so
assets.h
cert

View File

@ -1,19 +0,0 @@
# pyko Makefile
BIN=pyko
PREFIX?=/usr/local
INSTALL_DIR=$(PREFIX)/bin
KODEV?=../kodev/kodev
build:
$(KODEV) build
clean:
$(KODEV) clean
install:
install -m 555 $(BIN) $(INSTALL_DIR)/$(BIN)
uninstall:
rm -f $(INSTALL_DIR)/$(BIN)

View File

@ -1,51 +0,0 @@
About
-----
Pyko is a single binary kore build aimed at starting kore python applications
in a more easy and straight forward manner.
Building
--------
This kore application builds with PYTHON=1 and PGSQL=1 automatically.
See the kore README file on what dependencies are required for this.
From the root kore directory run:
```
$ make -C kodev
$ make -C pyko
$ sudo make -C pyko install
```
App layout
----------
Your python application directory must have the following layout:
```
python_app/
kore.conf <- actual kore configuration
__init__.py <- module initialization (binds, worker setup)
handlers.py <- handler code
```
You can easily use the kodev tool from kore to create an application
skeleton that gets you going:
```
$ kodev create -p myapp
$ cd myapp
$ pyko -frn
```
Usage
-----
```
$ pyko -frn python_app
```
```
-f = foreground
-n = skip chroot
-r = skip privilege drop
```
You can run pyko from inside the module directory directly as well.

View File

@ -1,17 +0,0 @@
# pyko build config
single_binary=yes
kore_source=../
kore_flavor=PYTHON=1 PGSQL=1
cflags=-std=c99 -pedantic
cflags=-Wall -Wmissing-declarations -Wshadow
cflags=-Wstrict-prototypes -Wmissing-prototypes
cflags=-Wpointer-arith -Wcast-qual -Wsign-compare
dev {
cflags=-g
}
prod {
}

View File

@ -1 +0,0 @@
# pyko configuration

View File

@ -1,70 +0,0 @@
/*
* Copyright (c) 2018 Joris Vink <joris@coders.se>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <kore/kore.h>
#include <kore/python_api.h>
#include <stdio.h>
#include <limits.h>
#include <unistd.h>
void
kore_parent_configure(int argc, char **argv)
{
struct stat st;
int len;
FILE *fp;
char *module, pwd[PATH_MAX], config[PATH_MAX];
if (getcwd(pwd, sizeof(pwd)) == NULL)
fatal("getcwd: %s", errno_s);
if (argc == 0) {
module = &pwd[0];
} else if (argc == 1) {
if (!strcmp(argv[0], "."))
module = &pwd[0];
else
module = argv[0];
} else {
fatal("Usage: pyko [options] [kore python app]");
}
if (stat(module, &st) == -1)
fatal("stat(%s): %s", module, errno_s);
if (!S_ISDIR(st.st_mode))
fatal("python module directory required");
len = snprintf(config, sizeof(config), "%s/kore.conf", module);
if (len == -1 || (size_t)len >= sizeof(config))
fatal("failed to create configuration path");
if ((fp = fopen(config, "r")) == NULL)
fatal("cannot open configuration '%s': %s", config, errno_s);
kore_python_path(module);
kore_module_load(module, NULL, KORE_MODULE_PYTHON);
if (chdir(module) == -1)
fatal("chdir(%s): %s", module, errno_s);
kore_parse_config_file(fp);
(void)fclose(fp);
}