Giter VIP home page Giter VIP logo

fragmenta-cms's Introduction

Fragmenta CMS

Fragmenta CMS

Fragmenta CMS is a user-friendly Content Management System built with Go. For more information and a demo of the CMS in action, see the website at http://fragmenta.eu

Usage

Config

Session Name

The session_name key is used to set the name used in cookies.

Theme

The theme key is used to set the theme. To use a theme, add a key with the name of your theme folder to the fragmenta.json file. Theme templates will then override any templates in the app at the same path.

Requirements

Go 1.8 is now required, as some new features from this release and the 1.7 release are used.

Version History

fragmenta-cms's People

Contributors

kennygrant 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

fragmenta-cms's Issues

Complete instructions to get started?

I'm following the instructions on http://fragmenta.eu/develop, but it feels like its missing important details that a first-time user like myself doesn't know. I'm new to golang as well, which could be part of the problem.

Following the instructions as-is gets this:

[user@sandbox fragmenta-test]$ fragmenta server
01:21:58 
------
Fragmenta version: 1.3.3
------
01:21:58 Building server...
01:21:58 Running go fmt at ./...
01:21:59 Building server at /home/user/gocode/src/fragmenta-test/bin/fragmenta-server-local
01:22:00 Build completed successfully in 1.700707279s
01:22:00 Launching server...
2016/03/21 01:22:00 #info Opened log file at log/development.log
2016/03/21 01:22:00 #info Finished loading assets in 76.334µs
2016/03/21 01:22:00 #info Finished loading templates in 5.313037ms
2016/03/21 01:22:00 Error reading database pq: Ident authentication failed for user "fragmenta-test_server"

The last error gave me enough of a clue to find secrets/fragmenta.json. Here I see answers to questions like what database and database user I'll have to make, and what port the server will listen on. But there's 3 sets of answers (development, production, test) and I'm not even sure which of those environments is running!

error creating admin user

First pass after reorg to using gb build all

./bin/server

Using Postgres running on my local (Mac) system, from brew install postgresql (Highly possible it's not setup correctly.) It's v9.4.5 if that helps.


Error:Error querying database for count: pq: relation "users" does not exist
Query:SELECT COUNT("id") FROM "users" WHERE (email=$1);

screen shot 2015-11-24 at 8 25 43 pm

fragmenta server results in "a:unable to compile assets error:open public/assets/scripts/app-9ad47a746ac7acfa883dafa4ae0db5721bcea629.min.js: The system cannot find the path specified."

On a fresh installation of cms in Windows 10 with go 1.8:

fragmenta new cms xxx (project generated)
fragmenta migrate (the server role and development db was created)

Then.....run the following in bash shell:

$ fragmenta server
16:47:04

Fragmenta version: 1.5rc

16:47:04 Building server...
16:47:04 Running go fmt at ./...
16:47:05 Building server at d:\xxx\xxx\go\src\xxx\xxx/bin/fragmenta-server-local
16:47:06 Build completed successfully in 1.2570401s
16:47:06 Launching server...
2017-06-20:08:47:06 Starting server port:3000 �[32m#info�[0m
2017-06-20:08:47:06 Compiling Asssets �[32m#info�[0m
2017-06-20:08:47:06 a:unable to compile assets error:open public/assets/scripts/app-9ad47a746ac7acfa883dafa4ae0db5721bcea629.min.js: The system cannot find the path specified. �[31m#fatal�[0m

Media Library

Images should be available on pages and posts via some sort of media library, a la wordpress.

Stuck on fresh installation of Fragmenta cms

Im a new be for golang development, using windows 10 and my go Lang configuration setup as per the below details.

C:\work>go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=c:\work
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++

set CGO_ENABLED=1

I can run any go example projects in local.

Installed fragmenta as instructed in http://fragmenta.eu/install

C:\work>go get -u github.com/fragmenta/fragmenta
then use
C:\work>fragmenta new cms testcms
Getting this below error when i run this above line, am not sure why its ask me like this, please correct me, where am wrong.
"17:50:01 You must create your project in $GOPATH/src"
tried in this location to C:\work\src>fragmenta new cms testcms but same above message.

Problem with initial configuration

Hi,

I am trying to get the CMS up and running on a fresh gentoo linode. I installed Postgre & imported the database configuration from db/migrate. I've also tried this in debian & darwin...same result.

It could be that I am somewhat new to go-lang, but I spent a few good hours looking for what's going wrong yesterday to no avail.

I followed the instructions for installing fragmenta from fragmenta.eu, but I am stuck; getting the following message when I execute 'fragmenta' from the directory where I was expecting my cms files to be:

Fragmenta version: 1.3.1
------
18:49:20 Building server...
18:49:20 Running go fmt at ./...
18:49:21 Building server at /home/manhattan/frag/bin/fragmenta-server-local
18:49:21 CMD go build -o /home/manhattan/frag/bin/fragmenta-server-local server.go
server.go:8:2: import "/home/manhattan/frag/src/app": cannot import absolute path
18:49:21 Error running build exit status 1
18:49:21 Error building server: exit status 1

Error when running fragmenta migrate from root of project

13:20:30 No database found
13:20:30 Running migration 2015-10-28-125605-Create-Database.sql
13:20:30 Running database creation migration: db/migrate/2015-10-28-125605-Create-Database.sql
13:20:30 ERROR loading sql migration:exit status 2
13:20:30 All further migrations cancelled

13:20:30 No migrations to perform at path ./db/migrate

I keep getting "You must create your project in $GOPATH/src"

No matter what path I use even if it matches both the $GOPATH/src does not work because I get the "You must create your project in $GOPATH/src" error and I can't find a solution to the problem.
Here are the paths I have tried ($GOPATH = C:/Gosites)

C:/Gosites
C:/Gosites/src
C:/Gosites/src/github.com
C:/Gosites/src/github.com/app

And all of them give me the same error?

I have tried changing
if !strings.HasPrefix(projectPath, path.Join(os.Getenv("GOPATH"), "src")) {
to
if !strings.HasPrefix(projectPath, filepath.Join(os.Getenv("GOPATH"), "src")) {

But no success?
Please advise me on what I can do to solve this.


go version = go version go1.7 windows/amd64

fragmenta: command not found

I have go 1.8.3 in Ubuntu 16.04 and i ran 2 command below :-

go get -u github.com/fragmenta/fragmenta
then
fragmenta new cms blog

and i got the error fragmenta: command not found

how to change the top level bar?

Hello, when I install fragmenta I get the same top level bar as your site has. With the same links, etc. Is there a way to change it?

Support database transactions

Functions exposed in file named database_psql.go doesn't allow me to send transactions to database as it doesn't have a specific function that deal with pq driver transaction function.
I think we can solve this issue by generating new function that uses pq driver transaction functions.

Thanks in advance

JS Error: sel is not defined

The following JS error occurs when editing a blog post or page.
Trying to align the text in left, right, and center alignment causes the error.
Tried selecting the text and also just having the cursor on the line when selecting the alignment.

editable.js:127 Uncaught ReferenceError: sel is not defined
at Object.cleanAlign (editable.js:127)
at HTMLAnchorElement.<anonymous> (editable.js:86)

I can't pass null value to database

Whenever we have null value that needs to be persisted in database, the map in pages.Update() prevents as from doing so as the type of the map to be persisted is map[string]string and such map doesn't accept null as value
We think that if it was implemented map[string]*string/ map[string]interface this would get over this issue.
Thanks in advance

Swapping DB

Can you tell me if it's possible to use MongoDB, which is a NoSQL database? I can rewrite the code, I am simply just accessing if its possible to use a NoSQL db with this, and how difficult it would be...

uploaded file management

wordpress, drupal etc all made the uploaded files publicly accessible by default, you always need some extra plugin to protect those files, in many cases they did not work.

how does fragmenta handle this? if I upload a file, can I make that private, i.e. unless you're a logged in user, there is no way you can download that file.

Addons

Hi guys,

Hope you are doing well !

I was looking at your repo, saying to myself finally a good CMS oriented project, written in Go ! :-)

I want to suggest the following list of addons:

  1. Would help to scale the volume of tags or posts, you could publish
  2. Would implement some advanced full-text search functions and the addons like bleve explorer
  3. Would merge the benefits of the 2 above
  4. & 5. A Rest API would simplify how to build custom Admin GUI.

Did u shaped a roadmap for your project ? Maybe I missed the link :-)

Fragmenta sounds really promising :-)

Cheers,
Luc

I can't pass DML SQL commands to database

whenever i try to send custom SQL command to database in q.SQL() it reset q.sql at the end of the function so it send empty q.sql,and also q.sql is being reset in all other function ex.: q.Where(), q.Limit(), q.offSet(),
please tell me the difference between q.SQL() and q.Select(). If they both are used to pass sql commands why we don't use q.SQL() for all custom commands?

According to current implementation if we used q.Select() for update/ insert commands it would then need to accept arguments, the same idea of passing arguments to q.Where()

i think we can solve this issue also by creating q.Args() that will append args to q.args that then will be used is q.SQL()/q.Select().
Thanks in advance.

FRAG_ENV variables configuration.

Where does one set the fragmenta environment variables?

I see one mention of it in

github.com/fragmenta/server/server.go:41:   if os.Getenv("FRAG_ENV") == "production" {

Add rate limiting on IP

Add rate limiting with IP as a filter. Possibly allow config of max tries per IP, and timeout between sets of tries, either in config file or in the code for the middleware (to avoid bloating the config with too many options).

Error creating user

I have a fairly vanilla install, running in Dev mode

Sorry, an error occurred creating the user record.

File:src/users/actions/create.go:47
Error:length of string  0, expected > 3

The offending line seems to be
id, err := users.Create(params.Map())

Use tags for pages, and document use

Tags are at present unused. We should present them as a choice on pages/posts and use them for filtering posts say. They were added as I usually need some taxonomy like this in almost every project, so I tend to customise them and use them as I see fit, but for the cms we should use them to categorise pages, and perhaps have some default tags set.

See this closed issue: fragmenta/fragmenta#17

Error when using fragment migrate

Using a clean Ubuntu VM, I Have installed Postgresql and Go. The fragmenta new cms command compiles, Then when changing to the created site path using fragmenta server or migrate commands i get "bash: ./fragmenta: No such file or directory". any advice on what the issue may be?

Database user is configurable but hard-coded in migrations

The credentials for the database are configurable in secrets/fragmenta.json. However, the default migrations in db/migrations/*.sql also contain hard-coded usernames & passwords.

Why not simply create the user and database itself from the info in secrets/fragmenta.json? That would remove the need to have usernames & passwords in xxxx-Create-Database.sql.

When connecting to the database to perform migrations, wouldn't tables already be owned by the creating user? If I'm right in that, all the ALTER TABLE xxx OWNER TO "yyy"; lines can be removed from xxx-Create-Tables.sql.

Of course this requires the database connection to be made with the correct credentials, which might not be the case (see fragmenta/fragmenta#32).

Furthermore, I believe that migrations are files that should be loadable on any installation of the site, while the username/password credentials are installation-specific. This is exacerbated by the fact that test, development, and deploy configurations in secrets/fragmenta.json can be configured to use different usernames. Having those usernames hard-coded in the migration files makes no sense.

Logging out doesn't redirect properly.

Setup brand new fragmenta site. Log in. Then click the logout link. Instead of redirecting to "/" it shows a 404. Examining the logs it shows a very strange set of events:

2016/03/23 21:43:26 #info Started GET /users/logout for {my ip}
2016/03/23 21:43:26 #info Started POST /users/logout for {my ip}
2016/03/23 21:43:26 #info Handling with route [POST] /users/logout
2016/03/23 21:43:26 #info Handling with route [GET] /{path:[a-z0-9]+}
2016/03/23 21:43:26 #info Redirecting (302) to path:/
2016/03/23 21:43:26 #info Finished POST /users/logout for {my ip} status 200 in 1.35173ms
2016/03/23 21:43:26 #error Status 404 at src/pages/actions/show.go:44 : Error:404
2016/03/23 21:43:26 #info Started GET / for {my ip}
2016/03/23 21:43:26 #info Handling with route [GET] /
2016/03/23 21:43:26 #info Finished GET / for {my ip} status 200 in 16.520678ms

Why is there a log for a POST? I tried digging around but I think somewhere the request isn't following through all the way (maybe?) Tried on Chrome and Firefox, same result.

Required Go Version

Thought I'd mention that it might be worth putting the required Go version on the installation page on https://fragmenta.eu/ or elsewhere. It took me a while to figure out why my installation was failing on Go 1.5.3

$ fragmenta new cms go/src/foocms
15:41:40 Fetching from url: github.com/fragmenta/fragmenta-cms
15:43:25 Error calling go get exit status 1

Apparently the fragmenta command line tool was failing to retrieve this repository because of a reference to the "context" package which was added to Go in 1.7. For example:

$ go get github.com/fragmenta/fragmenta-cms
package context: unrecognized import path "context"

Editing top menu

It'd be nice if it was possible to rename and/or get rid of some elements in the top bar
screenshot from 2017-04-03 01-35-32

Incorrect REST API

I want to use rest api for angular2. I founded description like Standard REST handlers for .... in a code.

// Standard REST handlers for tags
r.Add("/tags", tagactions.HandleIndex)
r.Add("/tags/create", tagactions.HandleCreateShow)
r.Add("/tags/create", tagactions.HandleCreate).Post()
r.Add("/tags/{id:[0-9]+}/update", tagactions.HandleUpdateShow)
r.Add("/tags/{id:[0-9]+}/update", tagactions.HandleUpdate).Post()
r.Add("/tags/{id:[0-9]+}/destroy", tagactions.HandleDestroy).Post()
r.Add("/tags/{id:[0-9]+}", tagactions.HandleShow)

But it serve only HTML content only (I tried add "Accept: application/json" to request header)
Structure like .../update (it should be http insert)
Structure like .../destroy (it should be http delete)

It is incorrect REST / or it is not REST API.
Rest standard describe resource mapping and roles of all queries methods.

Runtime editable templates feature discussion

I was wondering if the templates themselves can be editted in the web GUI as part of an admin section.

My usecase is to allow Designers to create and control the templates. They use the existing datamodels available.
I think it might be possible to lookup the data binding so the user can see possible data fields based on the templates context also. On the right they can see the final result as they edit the template.
In short it's very similar to a markdown editor.

I think that this would also make it much easier for golang developers to make templates since you have instant feedback.

The exact approach for setting up the context of the databinding I am not sure about yet. For instance maybe the user would select a table in the database and use that as a context. Not sure yet.

The other thing is that the templates are added, editted and deleted at runtime. So these would have to live stored someone. The file system seems the most sensible

What do we think about this ?

Proposal: Parse JSON params in mux

In github/fragmenta/mux/params.go file line (52), it supports either "application/x-www-form-urlencoded" or "multipart/form-data" only, is there any reason behind not including JSON datatype?
Are you planning to include it in any coming release?
Thanks in advance .

Error copying project exec "cp"

Good day

I have an error I keep getting when trying to install on Windows 10. The message I get is as follows:
16:34:10 Fetching from url: github.com/fragmenta/fragmenta-cms
16:34:15 Creating files at: C:\Users\username\go\src\github.com\username\mycms
16:34:15 Error copying project exec: "cp": executable file not found in %PATH%

Where is this cp.exe supposed to be?

DB connection

I have my DB running in a separate instance. I cannot find a way to define the connection string. It always tries to connect to localhost. Where can I find some help?

restructure project to use `gb` for reproducible builds

gb is the preferred tool now for building and managing go projects, because gb can guarantee reproducible builds. This means that everything is self contained in the "project dir" and simplifies the differences between development and production environments.
http://getgb.io/docs/usage/
video intro to gb

Also, review the vendor plugin:
https://godoc.org/github.com/constabulary/gb/cmd/gb-vendor

I'm having issues with fragmenta no matter where my project is located on my local system.

I'm having issues with absolute paths.
Here, I placed my fragmenta "site" in my "gocode dir", which is in my path, but even in another location, I'm having trouble.

fragmenta
12:23:24
------
Fragmenta version: 1.3.1
------
12:23:24 Building server...
12:23:24 Running goimports at ./
12:23:24 Building server at /Users/chris/src/gocode/fragmenta/bin/fragmenta-server-local
12:23:24 CMD go build -o /Users/chris/src/gocode/fragmenta/bin/fragmenta-server-local server.go
server.go:8:2: import "/Users/chris/src/gocode/fragmenta/src/app": cannot import absolute path
12:23:24 Error running build exit status 1
12:23:24 Error building server: exit status 1

Don't tell after a failed login if the user is not present or if it's a bad password

From my point of view, we shouldn't tell to the user if it's an error from the login or from the password.
As a security issue, this open a possibility to brute-force the login handler to find a registered user then his password.

We should remove the two different messages and argument given by the redirect handler (?error=failed_email).

can't create project - panic: runtime error: slice bounds out of range

I can't create a new fragmenta project from src folder, when i run the command
fragmenta new cms fragmenta throws the following error:

clarking@falcon65:~/gocode/src$ fragmenta new cms fragmenta
00:21:33 Fetching from url: github.com/fragmenta/fragmenta-cms
00:21:47 Creating files at: /home/clarking/gocode/src/fragmenta
00:21:47 Removing all at:/home/clarking/gocode/src/fragmenta/.git
00:21:47 Initialising new git repo at:/home/clarking/gocode/src/fragmenta
00:21:47 Updating import paths to: fragmenta
00:21:47 Generating new config at /home/clarking/gocode/src/fragmenta/secrets/fragmenta.json
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
panic(0x6ddd80, 0xc4200101b0)
	/usr/local/go/src/runtime/panic.go:500 +0x1a1
main.ToCamel(0x0, 0x0, 0xc4201397da, 0x1)
	/home/clarking/gocode/src/github.com/fragmenta/fragmenta/textual.go:50 +0x28f
main.reifyString(0xc42027f400, 0x937, 0x937, 0xb37)
	/home/clarking/gocode/src/github.com/fragmenta/fragmenta/generate.go:527 +0x1db
main.generateCreateSQL(0xc420017440, 0x23, 0x0, 0x0)
	/home/clarking/gocode/src/github.com/fragmenta/fragmenta/new.go:218 +0x52e
main.RunNew(0xc42000c380, 0x4, 0x4)
	/home/clarking/gocode/src/github.com/fragmenta/fragmenta/new.go:88 +0x5ff
main.main()
	/home/clarking/gocode/src/github.com/fragmenta/fragmenta/fragmenta.go:69 +0x7d4
clarking@falcon65:~/gocode/src$ 

i'm on xubuntu 16.04 running go1.7.4 linux/amd64

any help on this issue would be appreciated

It needs a basic tutorial

Please, I no have idea how to start after install it.

Please, I would like to know if it has multi lang support for templates?
How works the template manager ?
Can use it to make a multilanguage post app?

Thanks a lot, great work

Handle multiple domains

The CMS should let you serve pages on multiple domains. At present the assumption is that each server only serves one domain.

This would require:

  • Add domains resource with at minimum name, aliases
  • Change pages, posts, tags to be domain specific with a domain_id col
  • Not sure if users should be shared or independent, there are arguments for both
  • Handle https - see server issue on multiple https domains

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.