Commit Graph

131 Commits

Author SHA1 Message Date
Joris Vink 6ef8d59f7d more directly include assets.h 2018-08-13 09:16:28 +02:00
Joris Vink 3312a2882f Let KORE_PREFIX override builtin prefix for kodev. 2018-07-17 15:59:59 +02:00
Joris Vink d5ca2b42c6 invoke platform specific compiler for kodev build. 2018-06-19 22:46:55 +02:00
Joris Vink 296b1693ac don't forward argc/argv for kodev create.
Means we don't have to do weird shit that doesn't work on !macos anyway.
2018-06-15 20:51:48 +02:00
Joris Vink 68f5e33768 kodev improvements.
Allow KORE_SOURCE and KORE_FLAVOR to come from the environment,
overriding any configured kore_source or kore_flavor configuration
setting from the build.conf for the application.

I wanted an easier way of switching between Kore trees while hacking
on some of my apps, this is it.
2018-05-03 21:27:52 +02:00
Joris Vink 98af796acd Improve kodev a tiny bit.
kodev is creating x509s and writing out the dh parameters if they
do not exist in the application each time. This is annoying if
you explictly specified NOTLS=1 in the kore_flavor build options.

So just tell kodev to not do this if NOTLS=1 is present.
2018-04-18 19:51:25 +00:00
Joris Vink 92bd546935 Remove unused argument. 2018-04-13 16:04:33 +02:00
Joris Vink bb210db3df let pyko skeletons setup 'appdb' if available.
If a worker can pickup PYKO_CONNINFO from the environment it will register a
new pgsql connection called 'appdb' tied to the given connection string.
2018-04-10 18:26:22 +02:00
Joris Vink a35dfc6d06 Teach kodev create about pyko applications.
Now you can create a pyko application skeleton using kodev:

	$ kodev create -p myapp

Not sure if this functionality will remain in kodev, but for now i'm undecided.
2018-04-10 16:20:50 +02:00
Joris Vink da8d1800bf free name if we're not using the asset in kodev.
minor leak, doesn't affect run-time of kore.
2018-04-03 10:53:41 +02:00
Joris Vink f05782440b shuffle output from kodev info a bit. 2018-03-30 14:04:07 +02:00
Joris Vink cb206a589a Use kore_source headers if single_binary is set.
Before kodev always picked up the kore headers installed on the system.
This presented some annoying problems as the system headers may not
match the headers used by the kore_source you're actually building
against.
2018-03-30 13:47:32 +02:00
Marcin Szczepaniak d9b385fe2e Ignore hidden files and some temporary editor files in assets (#225) 2018-02-17 20:03:08 +01:00
Joris Vink 548348f553 2018 2018-01-20 22:51:06 +01:00
Joris Vink c87a9286b4 reword a bit 2017-03-09 16:59:14 +01:00
Joris Vink 0ca08114bb unbreak flavor cflags 2017-03-09 16:55:04 +01:00
Joris Vink 41924d0262 make sure len isn't 0 from cli_file_read(). 2017-03-06 23:16:59 +01:00
Joris Vink f8c9e736e2 don't depend on \n for NUL-terminating, just do it. 2017-03-06 22:48:19 +01:00
Joris Vink 8aaf7866c8 Do not unlink assets.h after building.
as per suggestion in #175
2017-03-06 10:42:07 +01:00
Joris Vink 7ec26a8c30 switch asset checksum to SHA256.
while here constify the asset modified time, contents and length.
2017-03-06 10:33:44 +01:00
Joris Vink d09eb5e107 bump copyright 2017-02-22 21:37:14 +01:00
Joris Vink 93ab52dcf5 Add a reload command to the cli tool.
This will look at the kore.pid file in the current directory
and send a SIGHUP signal to it. It's mostly a handy shortcut
since you could of course do a kill -HUP `cat kore.pid` easily.
2017-02-22 20:38:24 +01:00
Joris Vink 6e6d2f005d Remove leftover feature defines from kodev. 2017-02-22 20:13:59 +01:00
Joris Vink fc6b3bf740 Split up kore cli tools into new binary.
Having the create, build, run tools baked into the kore binary
made things harder then they had to be for multiple projects with
each different build flavors.

So move away this functionality into a new "kodev" (name may change)
binary that is installed next to kore.

The new build tools will automatically pick up the correct flavors
the kore binary it points to is installed with. Or for single builds
what flavors where enabled.

The new tool also will honor looking into PREFIX for the kore binary
when doing a `kodev run`.

Additionally add a new command "info" that shows some basic info
about your project and how it will be built. For example it will
show you the flavors of the kore binary installed on the system
or the flavors you configured for a single binary build.

Obligitory, hacking on a plane comment.
2017-02-19 00:52:29 -05:00
Joris Vink 625d50b8dd use rootdir when making paths to features/ldflags. 2017-02-09 11:45:11 +01:00
Joris Vink e895446dfa Improve single binary builds.
Allow kore build to pickup the required libraries for kore when
building single binaries so that you no longer have to manually
add them to ldflags.
2017-02-09 11:30:44 +01:00
Joris Vink b8c6cddc3d Revert "TAILQ_FOREACH_SAFE() exists so use it."
Because some asshole distributions claim to have a sane queue.h
implementation while they do not.
2017-02-07 22:44:20 +01:00
Joris Vink 0ea911140e TAILQ_FOREACH_SAFE() exists so use it. 2017-02-07 22:35:09 +01:00
Joris Vink 5d09214591 only rebuild with "kore build" when we can. 2017-01-25 22:21:40 +01:00
Joris Vink f5ad76a2c3 better description. 2016-12-29 20:15:01 +01:00
Joris Vink fe7237fd74 Take over linker from env if present. 2016-12-29 20:14:16 +01:00
Joris Vink 6faed21a24 Revert "Invoke platform alternatives #158 (#160)"
This reverts commit 857a3cfb79.
2016-12-29 20:12:46 +01:00
Yvan Sraka 857a3cfb79 Invoke platform alternatives #158 (#160) 2016-12-28 09:29:13 +01:00
Joris Vink c16461c6c1 adjust format after changing it earlier. 2016-12-27 09:45:27 +01:00
Joris Vink be5d1f310f initialize mime_types when swapping flavors as well. 2016-12-27 09:39:06 +01:00
Joris Vink 8b528e0334 Add asset_sha1_* and asset_serve_* to assets.h. 2016-12-27 09:22:13 +01:00
Joris Vink 31d14d028a add compile-time configurable mime types.
these types are used for the new builtin asset_serve_* functions.

must be defined in conf/build.conf.
2016-12-26 23:37:05 +01:00
Joris Vink d783a1d22d Add auto generated serving functions for assets.
These functions are created by the cli tool when building
and follow the naming format: asset_serve_<name>_<ext>().

Those serving functions can be used directly in handlers and
callthrough to a http_serveable() function that uses the SHA1
of the asset as its ETag and automatically checks for if-none-match.
2016-12-26 21:15:03 +01:00
Joris Vink 194b575ebf Add SHA1 digests for assets. 2016-12-22 19:44:35 +01:00
Tobias Kortkamp 950977f2be Fix fd leak in cli_buildopt_parse() (#156)
The build.conf file is left open when using kore run.
2016-12-01 09:01:51 +01:00
Joris Vink 43fec8678e kore_buf_create -> kore_buf_alloc. 2016-07-14 12:34:29 +02:00
Joris Vink 4ad50caa29 Large changes to the memory subsystem in kore.
- Change pools to use mmap() for allocating regions.
- Change kore_malloc() to use pools for commonly sized objects.
  (split into multiple of 2 buckets, starting at 8 bytes up to 8192).
- Rename kore_mem_free() to kore_free().

The preallocated pools will hold up to 128K of elements per block size.

In case a larger object is to be allocated kore_malloc() will use
malloc() instead.
2016-07-12 13:54:14 +02:00
Joris Vink e96ed9ad66 Change default domain for kore create skeleton. 2016-07-07 12:36:08 +02:00
Joris Vink 39a5f21986 Allow "kore build" to produce single binaries.
Producing single binaries can now be done with building with
"kore build". To get started edit your build.conf and add the
following directives:

single_binary = yes
kore_source = /path/to/kore

optionally you can add kore_flavor to instruct how kore should
be built:

kore_flavor = NOTLS=1

When doing this your build.conf must also include the correct
linking options as the linking is now done fully by kore build.

The binary produced will include your configuration and takes
over a few of kore its command line flags (such as -f, -n or -r).
2016-07-06 16:16:15 +02:00
Joris Vink 589c7667be Cleanup cli.c a bit.
- Define CXXFLAGS_MAX as CFLAGS_MAX as we use CFLAGS_MAX usually.
- Fix formatting of a few blocks of code.
2016-06-29 16:25:52 +02:00
Corbin Hughes 91d29a9914 Better name consistency and only print CXXFLAGS if compiling C++ 2016-06-27 22:33:51 -05:00
Corbin Hughes 698b3f374f Compile and link C++ with g++ instead of gcc 2016-06-26 15:49:59 -05:00
Joris Vink 43a726c02d Use sys/types.h instead of sys/param.h for assets. 2016-06-23 16:18:36 +02:00
Joris Vink 2dfd22a79a Change kore_buf_stringify() a bit.
Takes a size_t pointer as its second argument now, if not
NULL this will be populated with the length of the string
that is being returned.
2016-06-02 07:08:19 +02:00
Joris Vink 40f69924bb Move shared file reading code to kore_read_line() 2016-02-01 22:10:10 +01:00