Git Product home page Git Product logo

ponzu-cms / ponzu Goto Github PK

View Code? Open in Web Editor NEW
5.6K 134.0 384.0 3.53 MB

Headless CMS with automatic JSON API. Featuring auto-HTTPS from Let's Encrypt, HTTP/2 Server Push, and flexible server framework written in Go.

Home Page: https://docs.ponzu-cms.org

License: BSD 3-Clause "New" or "Revised" License

Go 97.28% CSS 1.09% JavaScript 0.56% Shell 0.84% Dockerfile 0.22%
cms tls http2 golang cli json api server productivity

ponzu's Introduction

My friend, "Gotoro"

Ponzu

Current Release GoDoc CircleCI Build Status

Watch the video introduction

Ponzu is a powerful and efficient open-source HTTP server framework and CMS. It provides automatic, free, and secure HTTP/2 over TLS (certificates obtained via Let's Encrypt), a useful CMS and scaffolding to generate content editors, and a fast HTTP API on which to build modern applications.

Ponzu is released under the BSD-3-Clause license (see LICENSE). (c) Boss Sauce Creative, LLC

Why?

With the rise in popularity of web/mobile apps connected to JSON HTTP APIs, better tools to support the development of content servers and management systems are necessary. Ponzu fills the void where you want to reach for Wordpress to get a great CMS, or Rails for rapid development, but need a fast JSON response in a high-concurrency environment.

Because you want to turn this:

$ ponzu gen content song title:"string" artist:"string" rating:"int" opinion:"string":richtext spotify_url:"string"

Into this:

Generated content/song.go

What's inside

  • Automatic & Free SSL/TLS1
  • HTTP/2 and Server Push
  • Rapid development with CLI-controlled code generators
  • User-friendly, extensible CMS and administration dashboard
  • Simple deployment - single binary + assets, embedded DB (BoltDB)
  • Fast, helpful framework while maintaining control

1 TLS:

  • Development: self-signed certificates auto-generated
  • Production: auto-renewing certificates fetched from Let's Encrypt

Documentation

For more detailed documentation, check out the docs

Installation

$ go get -u github.com/ponzu-cms/ponzu/...

Requirements

Go 1.8+

Since HTTP/2 Server Push is used, Go 1.8+ is required. However, it is not required of clients connecting to a Ponzu server to make HTTP/2 requests.

Usage

$ ponzu command [flags] <params>

Commands

new

Creates a project directory of the name supplied as a parameter immediately following the 'new' option in the $GOPATH/src directory. Note: 'new' depends on the program 'git' and possibly a network connection. If there is no local repository to clone from at the local machine's $GOPATH, 'new' will attempt to clone the 'github.com/ponzu-cms/ponzu' package from over the network.

Example:

$ ponzu new github.com/nilslice/proj
> New ponzu project created at $GOPATH/src/github.com/nilslice/proj

Errors will be reported, but successful commands return nothing.


generate, gen, g

Generate boilerplate code for various Ponzu components, such as content.

Example:

            generator      struct fields and built-in types...
             |              |
             v              v    
$ ponzu gen content review title:"string" body:"string":richtext rating:"int"
                     ^                                   ^
                     |                                   |
                    struct type                         (optional) input view specifier

The command above will generate the file content/review.go with boilerplate methods, as well as struct definition, and corresponding field tags like:

type Review struct {
	Title  string   `json:"title"`
	Body   string   `json:"body"`
	Rating int      `json:"rating"`
}

The generate command will intelligently parse more sophisticated field names such as 'field_name' and convert it to 'FieldName' and vice versa, only where appropriate as per common Go idioms. Errors will be reported, but successful generate commands return nothing.

Input View Specifiers (optional)

The CLI can optionally parse a third parameter on the fields provided to generate the type of HTML view an editor field is presented within. If no third parameter is added, a plain text HTML input will be generated. In the example above, the argument shown as body:string:richtext would show the Richtext input instead of a plain text HTML input (as shown in the screenshot). The following input view specifiers are implemented:

CLI parameter Generates
checkbox editor.Checkbox()
custom generates a pre-styled empty div to fill with HTML
file editor.File()
hidden editor.Input() + uses type=hidden
input, text editor.Input()
richtext editor.Richtext()
select editor.Select()
textarea editor.Textarea()
tags editor.Tags()

build

From within your Ponzu project directory, running build will copy and move the necessary files from your workspace into the vendored directory, and will build/compile the project to then be run.

Optional flags:

  • --gocmd sets the binary used when executing go build within ponzu build step

Example:

$ ponzu build
(or)
$ ponzu build --gocmd=go1.8rc1 # useful for testing

Errors will be reported, but successful build commands return nothing.


run

Starts the HTTP server for the JSON API, Admin System, or both. The segments, separated by a comma, describe which services to start, either 'admin' (Admin System / CMS backend) or 'api' (JSON API), and, optionally, if the server should utilize TLS encryption - served over HTTPS, which is automatically managed using Let's Encrypt (https://letsencrypt.org)

Optional flags:

  • --port sets the port on which the server listens for HTTP requests [defaults to 8080]
  • --https-port sets the port on which the server listens for HTTPS requests [defaults to 443]
  • --https enables auto HTTPS management via Let's Encrypt (port is always 443)
  • --dev-https generates self-signed SSL certificates for development-only (port is 10443)

Example:

$ ponzu run
(or)
$ ponzu run --port=8080 --https admin,api
(or) 
$ ponzu run admin
(or)
$ ponzu run --port=8888 api
(or)
$ ponzu run --dev-https

Defaults to $ ponzu run --port=8080 admin,api (running Admin & API on port 8080, without TLS)

Note: Admin and API cannot run on separate processes unless you use a copy of the database, since the first process to open it receives a lock. If you intend to run the Admin and API on separate processes, you must call them with the 'ponzu' command independently.


upgrade

Will backup your own custom project code (like content, add-ons, uploads, etc) so we can safely re-clone Ponzu from the latest version you have or from the network if necessary. Before running $ ponzu upgrade, you should update the ponzu package by running $ go get -u github.com/ponzu-cms/ponzu/...

Example:

$ ponzu upgrade

add, a

Downloads an add-on to GOPATH/src and copies it to the Ponzu project's ./addons directory. Must be called from within a Ponzu project directory.

Example:

$ ponzu add github.com/bosssauce/fbscheduler

Errors will be reported, but successful add commands return nothing.


version, v

Prints the version of Ponzu your project is using. Must be called from within a Ponzu project directory. By passing the --cli flag, the version command will print the version of the Ponzu CLI you have installed.

Example:

$ ponzu version
> Ponzu v0.8.2
(or)
$ ponzu version --cli
> Ponzu v0.9.2

Contributing

  1. Checkout branch ponzu-dev
  2. Make code changes
  3. Test changes to ponzu-dev branch
    • make a commit to ponzu-dev
    • to manually test, you will need to use a new copy (ponzu new path/to/code), but pass the --dev flag so that ponzu generates a new copy from the ponzu-dev branch, not master by default (i.e. $ponzu new --dev /path/to/code)
    • build and run with $ ponzu build and $ ponzu run
  4. To add back to master:
    • first push to origin ponzu-dev
    • create a pull request
    • will then be merged into master

A typical contribution workflow might look like:

# clone the repository and checkout ponzu-dev
$ git clone https://github.com/ponzu-cms/ponzu path/to/local/ponzu # (or your fork)
$ git checkout ponzu-dev

# install ponzu with go get or from your own local path
$ go get github.com/ponzu-cms/ponzu/...
# or
$ cd /path/to/local/ponzu 
$ go install ./...

# edit files, add features, etc
$ git add -A
$ git commit -m 'edited files, added features, etc'

# now you need to test the feature.. make a new ponzu project, but pass --dev flag
$ ponzu new --dev /path/to/new/project # will create $GOPATH/src/path/to/new/project

# build & run ponzu from the new project directory
$ cd /path/to/new/project
$ ponzu build && ponzu run

# push to your origin:ponzu-dev branch and create a PR at ponzu-cms/ponzu
$ git push origin ponzu-dev
# ... go to https://github.com/ponzu-cms/ponzu and create a PR

Note: if you intend to work on your own fork and contribute from it, you will need to also pass --fork=path/to/your/fork (using OS-standard filepath structure), where path/to/your/fork must be within $GOPATH/src, and you are working from a branch called ponzu-dev.

For example:

# ($GOPATH/src is implied in the fork path, do not add it yourself)
$ ponzu new --dev --fork=github.com/nilslice/ponzu /path/to/new/project

Credits

Logo

The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com) The design is licensed under the Creative Commons 3.0 Attribution license. Read this article for more details: http://blog.golang.org/gopher

The Go gopher vector illustration by Hugo Arganda @argandas (http://about.me/argandas)

"Gotoro", the sushi chef, is a modification of Hugo Arganda's illustration by Steve Manuel (https://github.com/nilslice).

ponzu's People

Contributors

bketelsen avatar bradleyfalzon avatar crackcomm avatar eticzon avatar fedir avatar ferhatelmas avatar guycalledseven avatar iharsuvorau avatar ivanov avatar kkeuning avatar krismeister avatar lucperkins avatar mangelajo avatar martint17r avatar mavimo avatar nanohard avatar nicksrandall avatar nilslice avatar olliephillips avatar robbawebba avatar rohanpai avatar tom-f avatar torniker avatar vkuznecovas avatar xmikus01 avatar zshipko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ponzu's Issues

Please Support TiDB

Being able to use TiDB (also developed in go) would allow us to have a lot more flexibility specifically with complex queries. I really like the simplicity behind ponzu but I strongly believe a different db engine will be required sooner or later once the CMS gains adoption.

I would not consider a database engine other than [TiBD] its performance is amazing and would still allow to produce a single binary when deploying a ponzu app.

Features suggestions

Hi,

Hope you are all well !

I am testing ponzu cms those days and made myself a couple of remarks about what could be awesome to have embedded in it.

It would be awesome to have:

  • Searchkit, for some advanced search features
  • vue-admin for more backend oriented widgets
  • admin-on-rest a rest admin boilerplate for content browsing, editing and filtering
  • An html ui composition interface, eg lib-compose

What is the current road-map for ponzu ? What are your goals with this framework ?

Cheers,
Richard

Addon setup - `ponzu get github.com etc`

Just thinking out loud as I to get grips with Ponzu features - would a go get style install of addons be useful - something like this?

ponzu get github.com/etc

Many code editors offer auto import and code completion. Addons need calling from a content struct to work with, but auto import and code completion will not work, since the addon is not in the go path, if it has only been copied to the /addons folder.

This is not a big deal, but it struck me that ponzu get could wrap go get adding the addon to the gopath and then additionally copying it to the /addons directory.

With a flag it could be also auto installed in Ponzu project, by writing the import to a file with a prefixed underscore, so you see the admin/addons interface first, before adding any calling code from a content struct file - which is more intuitive. I maybe don't understand the practicalities/side effects of this.

Just wanted to log my ideas as I go, if there is a better way than in an issue please say.

Unexpected behaviour creating a ponzu project

Using go1.8 there's a 'default' GOPATH, so, it isn't required to install ponzu and use it.

But ponzu requires to have a GOPATH configured, so it can put inside GOPATH/src the new project.

I think that ponzu should do the same, and fallback to the default GOPATH when using Go 1.8.

@nilslice What do you think?

Feature Discussion: Full Text Search

This is a fork of the issue #49, to specifically talk about Full Text Search

We can use bleve to allow all content in the CMS to have high quality search.

  • Full text search
  • Facet based search

This is a global feature, and each Content Item interface needs to support a simple "GetBleveMapping" function interface, that is parsed back to the Main bleve code.
When content is added, deleted, updated bleve also needs to be told.
Designing it this way makes it very easy to integrate bleve, and i have found works well.

I want to add that the way Bleve works with mapping will help the Admin GUi allot too.
This is because Bleve has good support for Numeric ranges and datetime range. If this is a first class thing in the whole system it means the Admin GUI can then express these 2 types perfectly.
You can see what i mean here:
http://www.blevesearch.com/docs/Result-Faceting/

Then there is the Time when a user searches the system.
There are a few user story patterns for how search can operate.
First is a global search page. The idea is that on the left you express ALL the facets (which as just content types), and on the right you show the results.
Here is a Demo of exactly this:
https://ouava.github.io/#/pubsearch

  • Enter the word "test" in the top right search bar - here is a bug in the search and you have to keep trying searching in the top right. But it will work after 10 seconds.
  • then you will see results for all content facets that contain the text you searched for.
  • then you can use the facets on the left to drill down.

As you can see, with this approach, you can use the search with any pre scoping you need also.
Maybe you just want to search for Emails by Person X ? So the content type is only Emails, and the Author is onlx X.
So you might have a users page about Email, and so you can use the global search system to search for emails and show the results using the same facets system (if you want).

Lastly, after you have done your search, how do you get your documents ? The ID's to the Content Items (or Documents) are saved in bleve. All you as a programmer have to do is take the ID, and ask the main CMS for it.
You can store the Content / Docuemnts inside Bleve too BTW. But this CMS system has a nice wy to do that already. SO its seem silly.

Thats it for now. I hope this opens up discussion on this.

Bleve uses boltdb, but it can use other Database engines.
BoltDB is nice because of its portability. You can run it on mobiles, desktops, servers with no code change.
Bleve can scale out using aliases.
See this and demo code : http://www.philipotoole.com/increasing-bleve-performance-sharding/bleve-corrected/

It support markdown?

As I know it not support markdown currently.

And how can I visit my content after save it?

Sluggable

I'm not clear whether items should be accessible by slug (sluggable) by default. The interface methods seem to be about overriding the default slug should there be conflicts.

This request to the API (with a valid slug), gives me a blank page and 400 Bad Request error:

GET http://localhost:8080/api/contents?slug=item-id-50b1fcdd-87b1-4e4a-a9a5-5ca6d61a43cd

What am I doing wrong here?

Filterable Interface?

Again, just thinking out loud. I know we discussed queries/reports early on and I'll quite happily do this in the client app, but it keeps striking me that a filterable interface could be useful.

A single method item.filter(data) (data) {}

This would allow some basic data manipulation of item type resultset, by ranging through it and making comparisons.

One example, removing items with a timestamp in the future - unpublished as yet if you like. This could be simply achieved if this behaviour was preferred.

Taking it further, if multiple filters could be specified and the API could also accept filter in the querystring to select which filter to use, items could have their own stored procedures in effect.

This cuts down on the handballing of data client side and is maintainable and extendable.

I don't think I could put this together, but wanted to log it. Hope that's ok.

Feature discussion: Data sync using First Class types

I was working on a CMSish system that runs on mobiles and did code gen too.
The CMS was running on mobiles and desktops and web and each user had a
offline database using boltdb..

I offered 3 first class types that I generated from that all related to data synchronisation.
I can them sync behaviours.

  • Forms
    • Just plain old struct record. Like a standard apps needs
  • WAL
    • a Log. Just like what you need for building google hangouts for example or comments for an item.
  • Doc
    • a Ops based system. Just like what you need to build google docs.

The sync system then knew what do do based on these archetypes ( a better
word for this ). The common CMS admin GUI also knew what to do to display the right widgets.

Example

Use a data model of Users and Books as an example:
Users can have Books
- uses the Forms sync behavious
Users can chat to each other
- Use the WAL Sync behaviour
Books can have content.
- Uses the Doc sync behavious
- A book can have disucssion log usig a WAL type.

Mozilla has a nice golang library that does this sync btw.

They use it for Firefox sync of tabs, bookmarks , etc. It is very simple and self contained
like your ponzu is.

https://github.com/Jeffail/leaps

  • This is a library to provide sync of documents using operations.
  • The operations is generates can be merged later ?

I might get time to help on it later, but am currently on holidays right now so no computer work for me for a month.

Error during go get

Hello,

I was very excited to test it but I got an issue:

go get github.com/ponzu-cms/ponzu/...
# github.com/ponzu-cms/ponzu/system/api
../../../golang/src/github.com/ponzu-cms/ponzu/system/api/push.go:14: undefined: http.Pusher

Ponzu + Buffalo

The Ponzu/Buffalo video did not cover its original agenda.

Can we expect that info soon ? I ask cos Buffalo does look very interesting.

Ponzu and Buffalo use different databases; do they play nicely together ?

Handle routes besides /api, /content and /admin

Am I missing something or is there just no way at the moment to handle routes other than /admin, /content and /api? All other routes are returning a 404 error and when I try to run ponzu with another "service" like ponzu run admin,api,app , it returns an error.

It seems that it's hardcoded on line 182 in main.go that there should only be these two "services".

My use case is that I want to render my SPA server side on any url other than /api, /admin or /content. The reason is SEO.

Docu request: Kitchen sink demo

It would be great to have a "kitchen sink" demo that shows all available widgets. It would consist of a long "ponzu gen" command plus some additional instructions to modify the generated files to get additional widget types, for example a Richtext editor widget.

Add ponzu generate myfield:"xml"

This would add a new field type "xml". This could configure the field to use editor.Richtext, and install by default some additional markup-friendly editor features, plus the ability to specify XML validation.

I see that nilslice/summernote uses Codemirror(.net), so I guess Codemirror is used for ponzu richtext codeview mode (the "<>" button) ? So all the features & options that Codemirror offers are in principle available for ponzu richedit in codeview mode, and maybe in non-codeview mode too ?

breaking under heavy http insert load

I have a cli loader that is managing to panic the ponzu server while doing about 160 http post requests in a loop, new http.Client for each request. Putting a 50 millisecond delay between each request causes the issue to go away and all requests in the loop to complete with success.

Server listening on :8080 for HTTP requests...

visit /admin to get started.
unexpected fault address 0x3402530
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x3402530 pc=0x12abb18]

goroutine 137 [running]:
runtime.throw(0x1501e3f, 0x5)
/Users/kkeuning/sdk/go1.8rc3/src/runtime/panic.go:596 +0x95 fp=0xc423d6b890 sp=0xc423d6b870
runtime.sigpanic()
/Users/kkeuning/sdk/go1.8rc3/src/runtime/signal_unix.go:297 +0x28c fp=0xc423d6b8e0 sp=0xc423d6b890
encoding/json.(*decodeState).scanWhile(0xc4244158c0, 0x0, 0x7)
/Users/kkeuning/sdk/go1.8rc3/src/encoding/json/decode.go:350 +0x38 fp=0xc423d6b908 sp=0xc423d6b8e0
encoding/json.(*decodeState).literal(0xc4244158c0, 0x145f6c0, 0xc424417d28, 0x198)
/Users/kkeuning/sdk/go1.8rc3/src/encoding/json/decode.go:793 +0x41 fp=0xc423d6b960 sp=0xc423d6b908
encoding/json.(*decodeState).value(0xc4244158c0, 0x145f6c0, 0xc424417d28, 0x198)
/Users/kkeuning/sdk/go1.8rc3/src/encoding/json/decode.go:405 +0x32e fp=0xc423d6b9e0 sp=0xc423d6b960
encoding/json.(*decodeState).object(0xc4244158c0, 0x144b000, 0xc4244a5370, 0x16)
/Users/kkeuning/sdk/go1.8rc3/src/encoding/json/decode.go:733 +0x12d8 fp=0xc423d6bc38 sp=0xc423d6b9e0
encoding/json.(*decodeState).value(0xc4244158c0, 0x144b000, 0xc4244a5370, 0x16)
/Users/kkeuning/sdk/go1.8rc3/src/encoding/json/decode.go:402 +0x2f4 fp=0xc423d6bcb8 sp=0xc423d6bc38
encoding/json.(*decodeState).unmarshal(0xc4244158c0, 0x144b000, 0xc4244a5370, 0x0, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/encoding/json/decode.go:184 +0x21a fp=0xc423d6bd30 sp=0xc423d6bcb8
encoding/json.Unmarshal(0x340237d, 0x360, 0x360, 0x144b000, 0xc4244a5370, 0xc4244a5360, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/encoding/json/decode.go:104 +0x148 fp=0xc423d6bd78 sp=0xc423d6bd30
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.SortContent(0xc42454ce90, 0x4)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/content.go:446 +0x1b8 fp=0xc423d6bfd0 sp=0xc423d6bd78
runtime.goexit()
/Users/kkeuning/sdk/go1.8rc3/src/runtime/asm_amd64.s:2197 +0x1 fp=0xc423d6bfd8 sp=0xc423d6bfd0
created by github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.insert
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/content.go:156 +0x1dd

goroutine 1 [IO wait]:
net.runtime_pollWait(0x1fc3068, 0x72, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/runtime/netpoll.go:164 +0x59
net.(*pollDesc).wait(0xc4231d83e8, 0x72, 0x0, 0xc42000c560)
/Users/kkeuning/sdk/go1.8rc3/src/net/fd_poll_runtime.go:75 +0x38
net.(*pollDesc).waitRead(0xc4231d83e8, 0xffffffffffffffff, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/net/fd_poll_runtime.go:80 +0x34
net.(*netFD).accept(0xc4231d8380, 0x0, 0x17281e0, 0xc42000c560)
/Users/kkeuning/sdk/go1.8rc3/src/net/fd_unix.go:430 +0x1e5
net.(*TCPListener).accept(0xc4231de068, 0xc4201201c0, 0x1478180, 0xffffffffffffffff)
/Users/kkeuning/sdk/go1.8rc3/src/net/tcpsock_posix.go:136 +0x2e
net.(*TCPListener).AcceptTCP(0xc4231de068, 0xc4200538a0, 0xc4200538a8, 0xc420053898)
/Users/kkeuning/sdk/go1.8rc3/src/net/tcpsock.go:215 +0x49
net/http.tcpKeepAliveListener.Accept(0xc4231de068, 0x15275e0, 0xc420120140, 0x172e420, 0xc4231db260)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:3044 +0x2f
net/http.(*Server).Serve(0xc4231f4160, 0x172de20, 0xc4231de068, 0x0, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:2643 +0x228
net/http.(*Server).ListenAndServe(0xc4231f4160, 0x0, 0xc4231fe310)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:2585 +0xb0
net/http.ListenAndServe(0xc4231fe310, 0x5, 0x0, 0x0, 0x1, 0xc4231fe310)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:2787 +0x7f
main.main()
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/main.go:220 +0xb42

goroutine 17 [syscall, 10 minutes, locked to thread]:
runtime.goexit()
/Users/kkeuning/sdk/go1.8rc3/src/runtime/asm_amd64.s:2197 +0x1

goroutine 26 [select]:
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/analytics.serve()
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/analytics/init.go:118 +0x251
created by github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/analytics.Init
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/analytics/init.go:99 +0x222

goroutine 27 [IO wait, 9 minutes]:
net.runtime_pollWait(0x1fc2fa8, 0x72, 0x7)
/Users/kkeuning/sdk/go1.8rc3/src/runtime/netpoll.go:164 +0x59
net.(*pollDesc).wait(0xc4231d8458, 0x72, 0x1729ae0, 0x1725598)
/Users/kkeuning/sdk/go1.8rc3/src/net/fd_poll_runtime.go:75 +0x38
net.(*pollDesc).waitRead(0xc4231d8458, 0xc42005e000, 0x1000)
/Users/kkeuning/sdk/go1.8rc3/src/net/fd_poll_runtime.go:80 +0x34
net.(*netFD).Read(0xc4231d83f0, 0xc42005e000, 0x1000, 0x1000, 0x0, 0x1729ae0, 0x1725598)
/Users/kkeuning/sdk/go1.8rc3/src/net/fd_unix.go:250 +0x1b7
net.(*conn).Read(0xc4231aa008, 0xc42005e000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/net/net.go:181 +0x70
net/http.(*connReader).Read(0xc4231a0180, 0xc42005e000, 0x1000, 0x1000, 0xc42013f910, 0x1068222, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:754 +0x140
bufio.(*Reader).fill(0xc4231ae120)
/Users/kkeuning/sdk/go1.8rc3/src/bufio/bufio.go:97 +0x117
bufio.(*Reader).ReadSlice(0xc4231ae120, 0xa, 0x1503263, 0x6, 0x0, 0xc42013fa00, 0x10b45d8)
/Users/kkeuning/sdk/go1.8rc3/src/bufio/bufio.go:338 +0xbb
bufio.(*Reader).ReadLine(0xc4231ae120, 0xc423188400, 0x100, 0xf8, 0x14f5040, 0xc423285600, 0x186a4b0)
/Users/kkeuning/sdk/go1.8rc3/src/bufio/bufio.go:367 +0x37
net/textproto.(*Reader).readLineSlice(0xc423271530, 0xc42013fac8, 0xc42013fac8, 0x1010f68, 0x100, 0x14f5040)
/Users/kkeuning/sdk/go1.8rc3/src/net/textproto/reader.go:55 +0x5f
net/textproto.(*Reader).ReadLine(0xc423271530, 0xc423188400, 0x72, 0x8000000000000000, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/net/textproto/reader.go:36 +0x2f
net/http.readRequest(0xc4231ae120, 0x0, 0xc423188400, 0x0, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/request.go:918 +0xa5
net/http.(*conn).readRequest(0xc4201200a0, 0x172e360, 0xc4231a0140, 0x0, 0x0, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:934 +0x213
net/http.(*conn).serve(0xc4201200a0, 0x172e360, 0xc4231a0140)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:1763 +0x49a
created by net/http.(*Server).Serve
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:2668 +0x2ce

goroutine 153 [runnable]:
syscall.Syscall6(0x9a, 0x3, 0xc423cf9000, 0x1000, 0x2b000, 0x0, 0x0, 0x1000, 0x0, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/syscall/asm_darwin_amd64.s:41 +0x5
syscall.Pwrite(0x3, 0xc423cf9000, 0x1000, 0x7fffffff, 0x2b000, 0x1000, 0x0, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/syscall/zsyscall_darwin_amd64.go:956 +0x77
os.(*File).pwrite(0xc42010a010, 0xc423cf9000, 0x1000, 0x7fffffff, 0x2b000, 0x1000, 0x0, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/os/file_unix.go:212 +0x78
os.(*File).WriteAt(0xc42010a010, 0xc423cf9000, 0x1000, 0x7fffffff, 0x2b000, 0x1000, 0x0, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/os/file.go:166 +0xb3
os.(*File).WriteAt-fm(0xc423cf9000, 0x1000, 0x7fffffff, 0x2b000, 0x1000, 0x0, 0x0)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt/db.go:192 +0x52
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt.(*Tx).write(0xc4244b6620, 0x28515515, 0x176d560)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt/tx.go:496 +0x333
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt.(*Tx).Commit(0xc4244b6620, 0x0, 0x0)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt/tx.go:198 +0x342
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt.(*DB).Update(0xc4201281e0, 0xc423d6df78, 0x0, 0x0)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt/db.go:602 +0xf7
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.SortContent(0xc4244d1540, 0x4)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/content.go:494 +0x821
created by github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.insert
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/content.go:156 +0x1dd

goroutine 13 [semacquire]:
sync.runtime_SemacquireMutex(0xc42012835c)
/Users/kkeuning/sdk/go1.8rc3/src/runtime/sema.go:62 +0x34
sync.(*Mutex).Lock(0xc420128358)
/Users/kkeuning/sdk/go1.8rc3/src/sync/mutex.go:87 +0x9d
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt.(*DB).beginRWTx(0xc4201281e0, 0x0, 0x0, 0x0)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt/db.go:512 +0x65
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt.(*DB).Begin(0xc4201281e0, 0x1, 0x10, 0x1463fc0, 0xc420150d78)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt/db.go:461 +0x38
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt.(*DB).Update(0xc4201281e0, 0xc420150d60, 0x0, 0x0)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/boltdb/bolt/db.go:579 +0x46
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.SetConfig(0xc420150eb0, 0xc424692340, 0xc420150e60)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/config.go:101 +0x82
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.PutConfig(0x1501456, 0x4, 0x145f6c0, 0xc42454de10, 0xc4201510f8, 0xc420151100)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/config.go:202 +0x447
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.InvalidateCache(0xc400000010, 0x1527160)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/cache.go:40 +0x80
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.insert(0xc42454ce90, 0x4, 0xc4244b3ec0, 0x1, 0xc424548e00, 0x2)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/content.go:160 +0x13c
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.SetContent(0xc42454ce90, 0x7, 0xc4244b3ec0, 0x0, 0x0, 0x1500d22)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/content.go:33 +0xec
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.externalContentHandler(0x172da60, 0xc423fba620, 0xc4245fc000)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/external.go:170 +0x104a
net/http.HandlerFunc.ServeHTTP(0x1527120, 0x172da60, 0xc423fba620, 0xc4245fc000)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:1942 +0x44
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.CORS.func1(0x172da60, 0xc423fba620, 0xc4245fc000)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/cors.go:72 +0x9c
net/http.HandlerFunc.ServeHTTP(0xc4231ba180, 0x172da60, 0xc423fba620, 0xc4245fc000)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:1942 +0x44
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.CacheControl.func1(0x172da60, 0xc423fba620, 0xc4245fc000)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/cache.go:26 +0x247
net/http.HandlerFunc.ServeHTTP(0xc4231d60e0, 0x172da60, 0xc423fba620, 0xc4245fc000)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:1942 +0x44
github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.Record.func1(0x172da60, 0xc423fba620, 0xc4245fc000)
/kmk/academy/go/src/github.com/kkeuning/gobservatory/gobservatory-cms/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/record.go:14 +0x74
net/http.HandlerFunc.ServeHTTP(0xc4231ba190, 0x172da60, 0xc423fba620, 0xc4245fc000)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:1942 +0x44
net/http.(*ServeMux).ServeHTTP(0x176d100, 0x172da60, 0xc423fba620, 0xc4245fc000)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:2238 +0x130
net/http.serverHandler.ServeHTTP(0xc4231f4160, 0x172da60, 0xc423fba620, 0xc4245fc000)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc420120140, 0x172e360, 0xc42015c200)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:2668 +0x2ce

goroutine 136 [IO wait]:
net.runtime_pollWait(0x1fc2ee8, 0x72, 0x8)
/Users/kkeuning/sdk/go1.8rc3/src/runtime/netpoll.go:164 +0x59
net.(*pollDesc).wait(0xc4231d8068, 0x72, 0x1729ae0, 0x1725598)
/Users/kkeuning/sdk/go1.8rc3/src/net/fd_poll_runtime.go:75 +0x38
net.(*pollDesc).waitRead(0xc4231d8068, 0xc42015c251, 0x1)
/Users/kkeuning/sdk/go1.8rc3/src/net/fd_poll_runtime.go:80 +0x34
net.(*netFD).Read(0xc4231d8000, 0xc42015c251, 0x1, 0x1, 0x0, 0x1729ae0, 0x1725598)
/Users/kkeuning/sdk/go1.8rc3/src/net/fd_unix.go:250 +0x1b7
net.(*conn).Read(0xc420104018, 0xc42015c251, 0x1, 0x1, 0x0, 0x0, 0x0)
/Users/kkeuning/sdk/go1.8rc3/src/net/net.go:181 +0x70
net/http.(*connReader).backgroundRead(0xc42015c240)
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:656 +0x58
created by net/http.(*connReader).startBackgroundRead
/Users/kkeuning/sdk/go1.8rc3/src/net/http/server.go:652 +0xdf
exit status 2

ponzu version command prints project version, not CLI version

Will add a --cli flag so the command can return both the project version you're using and the CLI version installed.

This is helpful to quickly determine if a Ponzu project being worked on is using a different version than the CLI (in which case you should upgrade your project by running $ ponzu upgrade)

Regression bug in Gen.

This uses the code on the wiki.

The bug is with the "item" field name :)

this script fails:



REPO_TARGET=github.com/ponzu-cms/test03
GO_TARGET=$GOPATH/src/$REPO_TARGET


echo "REPO_TARGET: " $REPO_TARGET
echo "GO_TARGET: " $GO_TARGET

# Check paths are good before deleting stuff !
read -p "This wil delete any existing project at this location. Are you sure? (y/n)" -n 1 -r
echo    # (optional) move to a new line
if [[ $REPLY =~ ^[Nn]$ ]]
then
    exit
fi


echo "Creating new Project at: " $GO_TARGET
rm -R $GO_TARGET
ponzu new $REPO_TARGET


echo "Creating Content Types at: " $GO_TARGET
cd $GO_TARGET

ponzu gen content review title:"string" author:"string" rating:"float64" body:"string" website_url:"string" item:"[]string" photos:"[]string"


# Build & Run
cd $GO_TARGET
ponzu build 
ponzu run

# Lets add content :)
#https://github.com/ponzu-cms/ponzu/wiki/API

you get :


x-MacBook-Pro:03 apple$ ./t-run.sh 
REPO_TARGET:  github.com/ponzu-cms/test03
GO_TARGET:  /Users/apple/workspace/go/src/github.com/ponzu-cms/test03
This wil delete any existing project at this location. Are you sure? (y/n)y
Creating new Project at:  /Users/apple/workspace/go/src/github.com/ponzu-cms/test03
rm: /Users/apple/workspace/go/src/github.com/ponzu-cms/test03: No such file or directory
Cloning into '/Users/apple/workspace/go/src/github.com/ponzu-cms/test03'...

done.
New ponzu project created at /Users/apple/workspace/go/src/github.com/ponzu-cms/test03
Creating Content Types at:  /Users/apple/workspace/go/src/github.com/ponzu-cms/test03
# github.com/ponzu-cms/test03/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/content
cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/content/review.go:18: duplicate field Item
Ponzu build step failed. Please try again. 
exit status 2
fork/exec ./ponzu-server: no such file or directory

Error during the installation of Ponzu

I gave the installation command as stipulated on github: go get github.com/ponzu-cms/ponzu/...
and then get this error: go install runtime/internal/atomic: open /usr/local/go/pkg/linux_amd64/runtime/internal/atomic.a: permission denied

I checked all directory permissions on the path mentioned in the error and they seem the be ok, which is world reading rights. I'm using Go 1.8 on Debian. And my paths are set like this:
export GOPATH=/home/arjan/Development/Go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

Is this a bug or am I doing something wrong?

Issue when using editor.Tags and reference.SelectRepeater

values in fields for select repeaters and tags end up being merged/copied into one another in some scenarios

example where it can be reproduced:

package content

import (
	"fmt"

	"github.com/bosssauce/reference"

	"github.com/ponzu-cms/ponzu/management/editor"
	"github.com/ponzu-cms/ponzu/system/item"
)

type Channel struct {
	item.Item

	Title  string   `json:"title"`
	Videos []string `json:"videos"`
	Rating string   `json:"rating"`
	Tags   []string `json:"tags"`
}

// MarshalEditor writes a buffer of html to edit a Channel within the CMS
// and implements editor.Editable
func (c *Channel) MarshalEditor() ([]byte, error) {
	view, err := editor.Form(c,
		// Take note that the first argument to these Input-like functions
		// is the string version of each Channel field, and must follow
		// this pattern for auto-decoding and auto-encoding reasons:
		editor.Field{
			View: editor.Input("Title", c, map[string]string{
				"label":       "Title",
				"type":        "text",
				"placeholder": "Enter the Title here",
			}),
		},
		editor.Field{
			View: reference.SelectRepeater("Videos", c, map[string]string{
				"label": "Videos",
			}, "Video", `{{.title}} ({{.rating}})`),
		},
		editor.Field{
			View: editor.Select("Rating", c, map[string]string{
				"label": "Rating",
			}, map[string]string{
				"G":     "G",
				"PG":    "PG",
				"PG-13": "PG-13",
				"R":     "R",
			}),
		},
		editor.Field{
			View: editor.Tags("Tags", c, map[string]string{
				"label": "Tags",
			}),
		},
	)

	if err != nil {
		return nil, fmt.Errorf("Failed to render Channel editor view: %s", err.Error())
	}

	return view, nil
}

func init() {
	item.Types["Channel"] = func() interface{} { return new(Channel) }
}

func (c *Channel) String() string {
	return c.Title
}

func (c *Channel) Push() []string {
	return []string{
		"videos",
	}
}

Syntax highlighting

Hi,

Nice work on this CMS, it's very nice. There's just one obstacle I haven't been able to work around: the lack of ability to display snippets of code in a richtext field. I tried using highlight.js in my frontend, with the standard <pre><code>...</code></pre> syntax in my body field, but the editor strips it out.

Beyond changing the field to a plain textarea for now, any other suggestions? Could this be considered for a potential feature?

Thanks

Make things more sortable

Currently, there isn't a good way to sort drop downs when selecting sub-content.

I'm starting this issue to have a discussion on prosed fixes.

I believe based on some conversation I've already had that it may make the most sense to add some sortable interfaces to this file:

https://github.com/ponzu-cms/ponzu/blob/master/system/item/item.go

I'm still getting acclimated with the code so any direction would be helpful, and I'm more than happy to make the changes.

Setting Config issues

It seems like there is currently a bug when trying to Invalidate Cache while Disable CORS is set to true:

submit-both

will work on this - but if anyone sees the same issue, let me know if it is under the conditions I mentioned above.

Add context cancellation to backup routines

When backing up components of a Ponzu system via HTTP backup utility, we should provide a cancellation context so dropped connections will stop the backup. Some backups can be very expensive, especially the tar/gzip archiving of uploads.

func backupHandler(res http.ResponseWriter, req *http.Request) {

each Backup func will need to take the req with the context added with cancellation propagation.

Few ideas

I've got few ideas, I'm not sure I will be able to work on them but I'll write them here.

  • Slug fields (eq. artist + title)
  • Super-types (eq. URL), definable in addons
  • Field validators (eq. email, URL), definable in addons
    • Go to JS (in browser validation)
  • Admin table fields (eq. --table-fields title,artist)
  • Admin search fields (eq. --search-fields title,artist)
  • Admin hidden fields
  • Swappable database backend
  • Model descriptors
  • GraphQL endpoint (dreams)
  • Users management with ACL (eq. hydra, dex)

I would love to hear your opinions on them, especially the last one.

Plan client model/class generators

I would like to start a discussion to plan a way to easily generate client models or classes which interact with Ponzu server content API endpoints, keeping an extensible design in mind so that multiple languages can be added.

Either building upon @natdm's typewriter package or implementing something ponzu-specific for generating client code in various languages including Go, Swift/ObjC, Java, JS, etc. Also, @bketelsen's ponzigen is a good example of making clients to interact with Ponzu from the outside.

My initial thoughts for the command line API would be similar to the content type generator:

$ ponzu gen model:js review
# or, to generate multiple client models in one pass:
$ ponzu gen model:js,go,swift review

Here is a gist with some example client code and other files for people to suggest code in other languages: https://gist.github.com/nilslice/297ce9d7eb18c58bab375f0844f4cd19

/cc @natdm @briandowns @bketelsen

All feedback is welcome & appreciated. Thank you!

Help with ponzu as daemon

Hello, I added ponzu-server in upstart, but I start ponzu-server have some error.

sudo service ponzu-server start
Job for ponzu-server.service failed because the control process exited with error code. See "systemctl status ponzu-server.service" and "journalctl -xe" for details.

journalctl -xe:

Jan 28 19:12:22 cs67724 systemd[1]: ponzu-server.service: Unit entered failed state.
Jan 28 19:12:22 cs67724 systemd[1]: ponzu-server.service: Failed with result 'exit-code'.
Jan 28 19:12:22 cs67724 sudo[1069]: pam_unix(sudo:session): session closed for user root
Jan 28 19:12:30 cs67724 sudo[1095]:    ponzu : TTY=pts/0 ; PWD=/home/ponzu/work ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 28 19:12:30 cs67724 sudo[1095]: pam_unix(sudo:session): session opened for user root by ponzu(uid=0)
Jan 28 19:13:14 cs67724 sudo[1095]: pam_unix(sudo:session): session closed for user root
Jan 28 19:16:58 cs67724 sudo[1118]:    ponzu : TTY=pts/0 ; PWD=/home/ponzu/work/src/remoteConfig/deployment/sysv ; USER=root ; COMM
Jan 28 19:16:58 cs67724 sudo[1118]: pam_unix(sudo:session): session opened for user root by ponzu(uid=0)

Materials Design

Google have a new material design lib.
Called Materials Components.
https://github.com/material-components/material-components-web

Demo:
http://material-components-web.appspot.com
Many examples show off the i18n support aspects too.
http://material-components-web.appspot.com/textfield.html

This is their rewrite of Material Design to fix up the limiting architecture that the first v.ersion had. They reached the law of diminishing returns on the first architecture.

They support i18n better with RTL and LTR for example. Its not as complete as the libs out there yet, but its much much tighter than materials Design Lite, etc now.

I think it will be a good fit for Ponzu, but putting this out here for now for comment.

I used this for a quick and dirty project and it was fast with no road blocks. Really nice

ponzu does not handle underscores in the variable names very well

`{
data: [
{
uuid: "574cb970-2863-4e7a-b9da-a440987dc55e",
id: 1,
slug: "item-id-574cb970-2863-4e7a-b9da-a440987dc55e",
timestamp: 1491778146000,
updated: 1491821466260,
c_o_n_f_i_r_m_h_e_a_d_i_n_g_p_a_p_e_r_s_i_g_n_i_n_g: "lalalal",
c_o_n_f_i_r_m_b_o_d_y_p_a_p_e_r_s_i_g_n_i_n_g: "",

Why all the underscores in the repsonse from the API?

When creating a content with: CONFIRM_HEADING_PAPER_SIGNING:"string" this is what gets shown in the UI: CONFIRMHEADINGPAPERSIGNING. and the JSON response is shown above...

Ludacris underscorestrings.... why....

Multiple language support?

I took a quick pass through the code but didn't see any references i18n. Do you have plans to offer multiple language support for content? Is this something that's better left as an exercise for the consumer?

Content Field Blank With Ponzu

I love what you guys have done with ponzu unfortunately it's not working for me.

I followed the quickstart performing the following steps

I installed ponzu with go get

I created a new 'ponzu' project in my go path

I changed directories to the new project

I ran ponzu generate content review title:”string” author:”string” rating:”float64” body:”string” website_url:”string” items:”[]string” photos:”[]string”

I ran ponzu build

I ran ponzu run

then I navigated to localhost:8080

this is the directory
screen shot 2017-04-13 at 10 41 43 am

this is my terminal
screen shot 2017-04-13 at 10 41 27 am

this is the admin running
screen shot 2017-04-13 at 10 40 48 am

Design folder to hold examples.

i also think that a "design" folder is needed somewhere just like goa has.
This is used to hold the scripts and anything you need to generate examples so devs can quickly try stuff out. Maybe later this will evolve further in the way it works but for nwo this is what i started to do.


TARGET=$GOPATH/src/github.com/ponzu-cms/test01

# This is an example to show of the references Addon.
# Data Model is:
# 	- Channel
#		- Title (editor.Input)
#		- VideoRef[] (Addon.Reference.SelectRepeater)
#		- Rating (editor.Select)
#		- Tags (editor.Tags)
# 	- Video
#		- Title (editor.Input)
#		- VideoUrl (editor.Input)
#			- VideoThumbnail (Addon.Design.ThumbnailFromURL)
#		- Description (editor.Richtext)
#		- Rating (editor.Select)
#		- Contributor (reference.Select(ContributorType.Name))
# 	- Contributor
#		- Name (editor.Input)
#		- Picture (editor.File)
#		- Bio (editor.textarea)

# Delete DB
rm $TARGET/analytics.db
rm $TARGET/system.db


# Delete content types
rm -f $TARGET/content/*.*


# Copy Content Types
# There is NO Generate support for Addons (like a reference), so what would it look like ?
# For nwo just copy the hand coded ones in.
cp -R ./content $TARGET/


# Build
cd $TARGET
ponzu build
ponzu run

# Set Content (dont know how to do this)
# Either use the api.Externalable interface and add content via HTTP POSTs or
# see the `SetContent` function in the `system/db` package

# Get Content
# http://localhost:8080/api/content?slug=item-id-f2a84403-6b58-4709-95bd-c5591d910b21
# http://localhost:8080/api/contents?type=Channel

on windows

Got generate to complete on windows. Had to do stuff like the following:

func setFieldView(field *generateField, viewType string) error {
var err error
var tmpl *template.Template
buf := &bytes.Buffer{}

//pwd, err := os.Getwd()
pwd, err := osext.ExecutableFolder() // import "github.com/kardianos/osext"
if err != nil {
	panic(err)
}
//tmplDir := filepath.Join(pwd, "cmd", "ponzu", "templates")
tmplDir := filepath.Join(pwd, "templates")

Haven't tried this on linux. On to build. Similar issues in there I think.

Error after upgrading to 0.8.2

I'll dig into this myself, but wanted to post this stack trace here too:

2017/01/31 19:44:10 http: panic serving 127.0.0.1:52350: runtime error: invalid memory address or nil pointer dereference
goroutine 7 [running]:
net/http.(*conn).serve.func1(0xc4201270e0)
/root/sdk/go1.8rc2/src/net/http/server.go:1721 +0xd0
panic(0x88e400, 0xb6af10)
/root/sdk/go1.8rc2/src/runtime/panic.go:489 +0x2cf
github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.gzipResponseWriter.Push(0xb39a40, 0xc420116380, 0x0, 0x0, 0xc420ddf290, 0xc420e19f60, 0x1d, 0xc420e19f80, 0xc420e19f60, 0x1d)
/root/go/src/github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/handlers.go:371 +0x76
github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.(*gzipResponseWriter).Push(0xc420017c80, 0xc420e19f60, 0x1d, 0x0, 0x11, 0xc420e19f60)
:6 +0x87
github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.push.func1(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0xc420e19f01, 0x18, ...)
/root/go/src/github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/push.go:26 +0xf7
github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/tidwall/gjson.Result.ForEach(0x5, 0xc420e19f00, 0x1a, 0x0, 0x0, 0x0, 0xf6, 0xc420047930)
/root/go/src/github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/tidwall/gjson/gjson.go:219 +0x34d
github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.push(0xb39bc0, 0xc420017c80, 0xc42000b900, 0x931628, 0xc4200f7d40, 0x111, 0x111)
/root/go/src/github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/push.go:32 +0x1ee
github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.contentHandler(0xb39bc0, 0xc420017c80, 0xc42000b900)
/root/go/src/github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/handlers.go:132 +0x248
net/http.HandlerFunc.ServeHTTP(0x9316f0, 0xb39bc0, 0xc420017c80, 0xc42000b900)
/root/sdk/go1.8rc2/src/net/http/server.go:1942 +0x44
github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.Gzip.func1(0xb39a40, 0xc420116380, 0xc42000b900)
/root/go/src/github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/handlers.go:342 +0x2d5
net/http.HandlerFunc.ServeHTTP(0xc42011aa20, 0xb39a40, 0xc420116380, 0xc42000b900)
/root/sdk/go1.8rc2/src/net/http/server.go:1942 +0x44
github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.CORS.func1(0xb39a40, 0xc420116380, 0xc42000b900)
/root/go/src/github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/handlers.go:310 +0x9c
net/http.HandlerFunc.ServeHTTP(0xc42011aa30, 0xb39a40, 0xc420116380, 0xc42000b900)
/root/sdk/go1.8rc2/src/net/http/server.go:1942 +0x44
github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db.CacheControl.func1(0xb39a40, 0xc420116380, 0xc42000b900)
/root/go/src/github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/db/cache.go:26 +0x247
net/http.HandlerFunc.ServeHTTP(0xc42011d400, 0xb39a40, 0xc420116380, 0xc42000b900)
/root/sdk/go1.8rc2/src/net/http/server.go:1942 +0x44
github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api.Record.func1(0xb39a40, 0xc420116380, 0xc42000b900)
/root/go/src/github.com/gopheracademy/material/cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/system/api/handlers.go:319 +0x74
net/http.HandlerFunc.ServeHTTP(0xc42011aa40, 0xb39a40, 0xc420116380, 0xc42000b900)
/root/sdk/go1.8rc2/src/net/http/server.go:1942 +0x44
net/http.(*ServeMux).ServeHTTP(0xb795a0, 0xb39a40, 0xc420116380, 0xc42000b900)
/root/sdk/go1.8rc2/src/net/http/server.go:2238 +0x130
net/http.serverHandler.ServeHTTP(0xc420148160, 0xb39a40, 0xc420116380, 0xc42000b900)
/root/sdk/go1.8rc2/src/net/http/server.go:2568 +0x92
net/http.(*conn).serve(0xc4201270e0, 0xb3a340, 0xc420118f80)
/root/sdk/go1.8rc2/src/net/http/server.go:1825 +0x612
created by net/http.(*Server).Serve
/root/sdk/go1.8rc2/src/net/http/server.go:2668 +0x2ce

Provide http.ResponseWriter to content lifecycle hooks and api interfaces

things like api.Externalable#Accept should take both the response and request as arguments so Ponzu developers can have full control and add headers, write to the response, etc.

Currently:

package api

type Externalable interface {
    Accept(req *http.Request) error
}

type Trustable interface {
    AutoApprove(*http.Request) error
}

Replace with:

package api 

type Externalable interface {
    Accept(http.ResponseWriter, *http.Request) error
}

type Trustable interface {
    AutoApprove(http.ResponseWriter, *http.Request) error
}

Addons: They need a Design time interface so they can support getting involved in the generation of the Content Types.

Please let me know if i am misunderstanding something here.

I played with this example:
https://github.com/nilslice/gotv-example

From this examples, we can see that the content types need to know about each other, and so thats why the Reference Addon exists.
But you cant generate it yet , because the code requires they know about each other at Generate / Design time.

The main thing is to add the ability for Addons to support GenerateTime interface i feel.

What do you think ?

Non admin users

Is it possible to add non-admin users that only can edit the content and can't change the system settings?

Thanks in advance

Tendermint

As you may or may not know, I'm working on https://github.com/dawn-network/glogchain, (and I'm looking at ponzu now to generate an API for glogchain that I'll connect to the tendermint stuff) which is a blockchain-based mediat platform. Since blockchains are very, very computationally/storage/network expensive to operate, one of the key concepts with the chain I've been working on is to keep the "heavy" state entirely off-chain and store only IPFS hashes on the chain. So maybe, one thing I am saying is that my chain may not be the perfect example of this.

Anyway-- tendermint can fairly easily replace a web back end API with a distributed set of validator nodes, and it's pretty cool.

Tendermint and their exchange cosmos benefit from the launch of new chains in fact-- all tendermint chains benefit when new tencdermint chains are launched in some way, because all the chains can talk to one another.

So, basically, curious your thoughts on this. I think block-chain back ends could fund a new generation of web systems that work for their users, instead of selling them out entirely.

Please consider this a "tossing the idea out there"

and a

"If this existed, would you use it?"

And if you know ponzu really really well--

"Any tips that might save me hours of head-banging-on-wall-feeling?

Thanks!

Changes to File Overwritten if Changing Schema

First of all, I saw this in Golang Weekly the other day and this is just fantastic. Thanks for making such a cool tool.

After playing around with this for a bit, I've noticed that I'm having to edit the generated code quite a bit to customize the admin interface. i.e. I added a profile photo field, so I have to go into the generated code and change the type from editor.Input to editor.File. And then I added a relationship status field, so I had to go in and change it to editor.Select and add my choices.

After making these changes, I then realized I wanted to add another field. When I went to rerun the command, it required me to overwrite my existing changes to generate a new one. Maybe I missed something in the documentation, but there doesn't seem to be an ideal way to handle this scenario.

One suggestion might be a way to add, remove, and possibly modify (i.e. type from string to int) fields with the CLI - a schema migration ability of sorts. In the case of removing a field, I may want the data purged from Bolt as well.

On a related note, I feel that, at least optionally, uploading over / removing a file in the interface should delete it from disk. Wth my profile photo example, if someone uploads a new photo, I'd like the old one to be deleted since I've only specified one field for that file.

Another suggestion might just be to make the tool more robust so that if I want my field to manifest as a select element or file upload element, I can specify that from the CLI. The commands may get long, though, so optional input from a file in a format like JSON, TOML, etc. may be preferable.

Let me know if I'm missing something, and thanks again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.