feathercms / feather Goto Github PK
View Code? Open in Web Editor NEWFeather is a modern Swift-based content management system powered by Vapor 4.
Home Page: https://feathercms.com
License: MIT License
Feather is a modern Swift-based content management system powered by Vapor 4.
Home Page: https://feathercms.com
License: MIT License
In the Frontend/Index template the metadata canonical url is checked, but the head value is used.
When building Xcode the module bundle contains a Contents/Resources
dir structure, but when using the command line, the bundle looks quite different. The contents are located directly under the bundle root.
Error during setup
MySQL error: Server error: Data too long for column 'content' at row 6
Initial sql error due to field size constraints when porting to MySql (and presumably postgres), but not Sqlite.
I found that migration defines two columns, called 'content' & 'excerpts' with data type '.string', not as '.data', consequently causes an error on initial start. The difference is due to data type '.string' limits the size to varchar(255), while '.data' is a blob or nearly un-limited size. The 'content' value is nearly 5k, exceeding the 255 size limit. Two cases where necessary switching to from '.string' to '.data'
BlogMigration_v1_0_0
db.schema(BlogPostModel.schema)
.id()
.field(BlogPostModel.FieldKeys.title, .string, .required)
.field(BlogPostModel.FieldKeys.imageKey, .string, .required)
.field(BlogPostModel.FieldKeys.**excerpt, .data,** .required)
.field(BlogPostModel.FieldKeys.**content, .data,** .required)
.field(BlogPostModel.FieldKeys.categoryId, .uuid, .required)
.field(BlogPostModel.FieldKeys.authorId, .uuid, .required)
.foreignKey(BlogPostModel.FieldKeys.categoryId, references: BlogCategoryModel.schema, .id)
.foreignKey(BlogPostModel.FieldKeys.authorId, references: BlogAuthorModel.schema, .id)
.create(),
StaticPageMigration_v1_0_0
db.schema(StaticPageModel.schema)
.id()
.field(StaticPageModel.FieldKeys.title, .string, .required)
.field(StaticPageModel.FieldKeys.**content, .data** )
.create()
Not sure what happened. I've had Feather running for a while now on my server, just came back to it with the following errors...
I think my power got knocked out a while back so it could be as simple as a service not started but it seems as though Postgres is running so I don't think that's the issue... I'm just very stumped.
Hi Tim
Many thanks for your efforts.
Is It possible to provide a docker file to create a container?
The old file allows create the image without errors, but it is not possible to run it.
I tried with "swift:5.5.2-focal as builder"
The log
`
docker run 7a1616d0ce5a
FeatherCore/Environment+Fetch.swift:24: Fatal error: The following key FEATHER_WORK_DIR
is not defined in the environment file.
Check the README or the documentation for how to set environment variables.
Received signal 4. Backtrace:
0x55a06f3b5a92, Backtrace.(printBacktrace in _B82A8C0ED7C904841114FDF244F9E58E)(signal: Swift.Int32) -> () at /opt/feather/.build/checkouts/swift-backtrace/Sources/Backtrace/Backtrace.swift:66
0x7fa4e85c53bf
0x7fa4e88910ab
0x55a06f6ee07f, static (extension in FeatherCore):Vapor.Environment.featherRequired(Swift.String) -> Swift.String at /opt/feather/.build/checkouts/feather-core/Sources/FeatherCore/Extensions/Environment+Fetch.swift:24
0x55a06f6f7ce9, one-time initialization function for (workDir in _4CA58FEA3E295A70C8D04B97347E9C51) at /opt/feather/.build/checkouts/feather-core/Sources/FeatherCore/Feather/Feather.swift:22
0x7fa4e85c247e
0x7fa4e8b400d5
0x55a06f6f81e6, FeatherCore.Feather.(workDir in _4CA58FEA3E295A70C8D04B97347E9C51).unsafeMutableAddressor : Swift.String at /opt/feather/.build/checkouts/feather-core/Sources/FeatherCore/Feather/Feather.swift:22
0x55a06f6f81e6, one-time initialization function for base at /opt/feather/.build/checkouts/feather-core/Sources/FeatherCore/Feather/Feather.swift:35
0x7fa4e85c247e
0x7fa4e8b400d5
0x55a06f6f8353, FeatherCore.Feather.Paths.base.unsafeMutableAddressor : Foundation.URL at /opt/feather/.build/checkouts/feather-core/Sources/FeatherCore/Feather/Feather.swift:35
0x55a06f6f8353, one-time initialization function for public at /opt/feather/.build/checkouts/feather-core/Sources/FeatherCore/Feather/Feather.swift:38
0x7fa4e85c247e
0x7fa4e8b400d5
0x55a06f6f83a3, FeatherCore.Feather.Paths.public.unsafeMutableAddressor : Foundation.URL at /opt/feather/.build/checkouts/feather-core/Sources/FeatherCore/Feather/Feather.swift:38
0x55a06f6d300a, Feather.configure(Vapor.Application) throws -> () at /opt/feather/Sources/Feather/main.swift:23
0x55a06f6d2e96, Feather_main at /opt/feather/Sources/Feather/main.swift:42
0x7fa4e7e430b2
0x55a06f1dd9ad
0xffffffffffffffff
/opt/feather/start: line 5: 7 Illegal instruction Feather serve --hostname 0.0.0.0 --port ${BASE_PORT}
`
Nice year 2022.
When the user saves a form it'd be nice to see some kind of visual feedback about what happened, instead of just reloading the page. The edit form notification box should be enabled by default for all the edit forms.
Two regions have different URL schemes, need to add support for them.
In the Frontend/Index template the site description variable is never used
It'd be nice to see what's the file size limit for file uploads.
Throw out the frontend.css
file from the frontend module and use Peacock CSS instead.
It'd be nice to have a system variable to disable indexing for the site globally (edit under the site settings form).
The login page username should be case insensitive.
Unlike today where [email protected] != [email protected]
Hi Tibor,
With my old docker file I try to run a old FeatherCMS version but now I found this error message: /opt/feather: error: unknown package 'sponsor-module' in dependencies of target 'Feather'. I tried to search for this module in the repository.No success! What happens? My CMS is now off. I have several articles in this blog, but now I am not able to run my CMS feather anymore. Please, if you can, or anybody can help, provide a solution for that. I'm using Feather CMS in a docker container.
Thanks a lot
Jorge
Tib, thanks for the truly amazing product.
But could you subj? :)
Showcase:
My first FEAHER CMS runs at http://gravato.aejm.pt (is still in the process of customization). Thanks to all.
Suggestions:
Doubts:
Happy New Year to all.
If there is no additional development, can it be deployed directly?
# ================================
# Build image
# ================================
FROM swift:5.3-xenial as build
# Install OS updates and, if needed, sqlite3
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
&& apt-get install -y libsqlite3-dev \
&& apt-get install -y zip \
&& rm -rf /var/lib/apt/lists/*
# Set up a build area
WORKDIR /build
# First just resolve dependencies.
# This creates a cached layer that can be reused
# as long as your Package.swift/Package.resolved
# files do not change.
COPY ./Package.* ./
RUN swift package resolve
# Copy entire repo into container
COPY . .
# Build everything, with optimizations and test discovery
RUN swift build --enable-test-discovery -c release
# Switch to the staging area
WORKDIR /staging
# Uncomment the next line if you need to load resources from the `Public` directory.
# Ensure that by default, neither the directory nor any of its contents are writable.
#
RUN mv /build/Public ./Public && chmod -R a-w ./Public
# Copy main executable to staging area
# We copy all needed Swift runtime libraries into this folder as well.
# We do this by checking which libraries are needed at runtime with the ldd command and copy only those that have swift in the name.
RUN cp "$(swift build --package-path /build -c release --show-bin-path)/Run" ./ \
&& ldd ./Run | grep swift | awk '{print $3}' | xargs cp -Lv -t ./ \
&& ln -s "Run" "bootstrap" \
&& zip --symlinks lambda.zip *
#!/bin/sh
# Build image
docker build -t vapor_one . -f Dockerfile.build
docker create --name extract vapor_one
docker cp extract:/staging ./app
docker rm -f extract
Although makefile
is properly working and it's part of the standard.
https://www.gnu.org/software/make/manual/make.html#Makefile-Names
GNU recommends naming it as Makefile
(We recommend Makefile because it appears prominently near the beginning of a directory listing, right near other important files such as README.)
Hi,
I'm following your tutorial to make my own blog using your CMS and when I try to login for the first time with the given id and password, I get a segmentation fault 11. I have no idea what could have caused it and the server crashes. This appears only when running the server from terminal. Could it be caused by a chmod or chown setting ?
When I try to swift build --configuration release
on both MacOS and Ubuntu I get this error:
/Users/ianapplebaum/Documents/github/feather/Sources/App/Extensions/Environment+FetchValue.swift:18:9: error: 'guard' body must not fall through, consider using a 'return' or 'throw' to exit the scope
}
^
This doesn't show up when I do a normal build. Not sure what to make of this?
There is a precondition on the line the compiler is unhappy with saying
precondition(false, """
\(key) is not defined in the Environment.
Check README.md or documentation for how to set environment variables.
""")
I don't know why this would be an issue in the release configuration, but not the normal swift build
or vapor build
I installed feather as described in your blog post. In my .env.development
file I configured the BASE_PATH
as ~/git/feather/
. This resulted in a crash-loop of Xcode when I ran the server. I noticed that when I tried to visit the server for the first time a folder named ~
was created in the root directory of the project. That resulted in a cash of the server and the debugger followed by Xcode.
To me it looks like that the path is not resolved correctly.
For example the menu item -> open in new window field.
This could be a checkbox or an option list with a Same tab / window, New tab / window label (a11y).
The root tmp folder should be hidden from the user, also the tmp name should be reserved?
If I try to change the metadata for my last post, I have: {"reason":"Something went wrong.","error":true}.
If you wish, I can send you the credentials.
The logs:
gravato | [ INFO ] GET /admin/frontend/metadatas/93668A47-3093-40C3-8DE1-33027526582B/update/ [request-id: A8493C74-2B1F-468E-A94B-7EEA7DDBACCF]
gravato | [ ERROR ] Serializer.swift.evaluateScope():369
gravato | TauKit: field.data is not a dictionary; field.data.options is invalid [request-id: A8493C74-2B1F-468E-A94B-7EEA7DDBACCF]
nginx_1 | ----- - [23/Apr/2021:13:39:06 +0000] "GET /admin/frontend/metadatas/93668A47-3093-40C3-8DE1-33027526582B/update/ HTTP/1.1" 500 47 "http://gravato.aena.pt/admin/blog/posts/FF08DA30-AFBD-4221-81A9-DDC73AACB0B8/update/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15" "-"
Error Message:
~/git/feather/.build/checkouts/feather-core/Sources/FeatherCore/Modules/Admin/AdminModule.swift:19:16: Type 'Bundle' has no member 'module'
As a site admin
I want CSRF tokens on /admin routes
So that actions I take on the site are initiated only by me.
Unlike today when I could click a malicious link and unknowingly do admin actions like change email, password, and other site content.
I’d like to add the VaporCSRF library to admin actions.
Xcode Version 11.6 (11E708)
When running feather, any request results in the following error:
[ INFO ] GET / [request-id: 198CA90B-5B5A-458F-8C81-9EFE3F0B7480]
[ ERROR ] LeafError(file: "/Users/mcritz/Library/Developer/Xcode/DerivedData/feather-cngubcvrjcvskeejodbirpwuzeyd/SourcePackages/checkouts/leaf-kit/Sources/LeafKit/LeafSource/LeafSources.swift", function: "searchSources(t:on:s:)", line: 76, column: 69, reason: LeafKit.LeafError.Reason.noTemplateExists("Blog/Frontend/Home")) [request-id: 198CA90B-5B5A-458F-8C81-9EFE3F0B7480]
In Makefile
env:
echo '' > .env.development
echo 'BASE_URL="http://localhost:8080"' >> .env.development
echo 'BASE_PATH="$(CUR_DIR)/"' >> .env.development
Using localhost can have problems in certain configurations. (For example if you want to test the app in a different computer than your localhost e.g. 192.168.0.x).
More Info:
https://superuser.com/questions/949428/whats-the-difference-between-127-0-0-1-and-0-0-0-0
Hello,
I'm new to this. I've just manage to install it in development environment. It doesn't seem to login and showing Invalid username or password.
Did I miss something during installation & configuration?
when using make install
in a clean codebase.
for f in Sources/App/Modules/*; do m=$(basename $f); cp -r "${f}/Views/" "Resources/Views/${m}" ; done;
cp: Resources/Views/Admin: No such file or directory
cp: Sources/App/Modules/Admin/Views/: unable to copy extended attributes to Resources/Views/Admin: No such file or directory
cp: Resources/Views/Admin/Actions.html: No such file or directory
cp: Resources/Views/Admin/Form.html: No such file or directory
cp: Resources/Views/Admin/Index.html: No such file or directory
cp: Resources/Views/Admin/Home.html: No such file or directory
cp: Resources/Views/Admin/Pager.html: No such file or directory
cp: Resources/Views/Admin/Table.html: No such file or directory
cp: Resources/Views/Admin/FormFields: No such file or directory
cp: Sources/App/Modules/Admin/Views//FormFields: unable to copy extended attributes to Resources/Views/Admin/FormFields: No such file or directory
cp: Resources/Views/Admin/FormFields/Select.html: No such file or directory
cp: Resources/Views/Admin/FormFields/Textarea.html: No such file or directory
cp: Resources/Views/Admin/FormFields/File.html: No such file or directory
cp: Resources/Views/Admin/FormFields/Input.html: No such file or directory
cp: Sources/App/Modules/Api/Views/: No such file or directory
cp: Resources/Views/Blog: No such file or directory
cp: Sources/App/Modules/Blog/Views/: unable to copy extended attributes to Resources/Views/Blog: No such file or directory
cp: Resources/Views/Blog/.DS_Store: No such file or directory
cp: Resources/Views/Blog/Frontend: No such file or directory
cp: Sources/App/Modules/Blog/Views//Frontend: unable to copy extended attributes to Resources/Views/Blog/Frontend: No such file or directory
cp: Resources/Views/Blog/Frontend/Post.html: No such file or directory
cp: Resources/Views/Blog/Frontend/Home.html: No such file or directory
cp: Resources/Views/Blog/Frontend/Posts.html: No such file or directory
cp: Resources/Views/Blog/Frontend/Category.html: No such file or directory
cp: Resources/Views/Blog/Frontend/Author.html: No such file or directory
cp: Resources/Views/Blog/Frontend/Authors.html: No such file or directory
cp: Resources/Views/Blog/Frontend/Categories.html: No such file or directory
cp: Resources/Views/Blog/Admin: No such file or directory
cp: Sources/App/Modules/Blog/Views//Admin: unable to copy extended attributes to Resources/Views/Blog/Admin: No such file or directory
cp: Resources/Views/Blog/Admin/Posts: No such file or directory
cp: Sources/App/Modules/Blog/Views//Admin/Posts: unable to copy extended attributes to Resources/Views/Blog/Admin/Posts: No such file or directory
cp: Resources/Views/Blog/Admin/Posts/List.html: No such file or directory
cp: Resources/Views/Blog/Admin/Posts/Edit.html: No such file or directory
cp: Resources/Views/Blog/Admin/Authors: No such file or directory
cp: Sources/App/Modules/Blog/Views//Admin/Authors: unable to copy extended attributes to Resources/Views/Blog/Admin/Authors: No such file or directory
cp: Resources/Views/Blog/Admin/Authors/List.html: No such file or directory
cp: Resources/Views/Blog/Admin/Authors/Edit.html: No such file or directory
cp: Resources/Views/Blog/Admin/Links: No such file or directory
cp: Sources/App/Modules/Blog/Views//Admin/Links: unable to copy extended attributes to Resources/Views/Blog/Admin/Links: No such file or directory
cp: Resources/Views/Blog/Admin/Links/List.html: No such file or directory
cp: Resources/Views/Blog/Admin/Links/Edit.html: No such file or directory
cp: Resources/Views/Blog/Admin/Categories: No such file or directory
cp: Sources/App/Modules/Blog/Views//Admin/Categories: unable to copy extended attributes to Resources/Views/Blog/Admin/Categories: No such file or directory
cp: Resources/Views/Blog/Admin/Categories/List.html: No such file or directory
cp: Resources/Views/Blog/Admin/Categories/Edit.html: No such file or directory
cp: Resources/Views/Frontend: No such file or directory
cp: Sources/App/Modules/Frontend/Views/: unable to copy extended attributes to Resources/Views/Frontend: No such file or directory
cp: Resources/Views/Frontend/Index.html: No such file or directory
cp: Resources/Views/Frontend/Pager.html: No such file or directory
cp: Resources/Views/Frontend/Sitemap.html: No such file or directory
cp: Resources/Views/Frontend/NotFound.html: No such file or directory
cp: Resources/Views/Frontend/Admin: No such file or directory
cp: Sources/App/Modules/Frontend/Views//Admin: unable to copy extended attributes to Resources/Views/Frontend/Admin: No such file or directory
cp: Resources/Views/Frontend/Admin/Contents: No such file or directory
cp: Sources/App/Modules/Frontend/Views//Admin/Contents: unable to copy extended attributes to Resources/Views/Frontend/Admin/Contents: No such file or directory
cp: Resources/Views/Frontend/Admin/Contents/List.html: No such file or directory
cp: Resources/Views/Frontend/Admin/Contents/Edit.html: No such file or directory
cp: Resources/Views/Frontend/Rss.html: No such file or directory
cp: Sources/App/Modules/Markdown/Views/: No such file or directory
cp: Resources/Views/Redirect: No such file or directory
cp: Sources/App/Modules/Redirect/Views/: unable to copy extended attributes to Resources/Views/Redirect: No such file or directory
cp: Resources/Views/Redirect/Admin: No such file or directory
cp: Sources/App/Modules/Redirect/Views//Admin: unable to copy extended attributes to Resources/Views/Redirect/Admin: No such file or directory
cp: Resources/Views/Redirect/Admin/Redirects: No such file or directory
cp: Sources/App/Modules/Redirect/Views//Admin/Redirects: unable to copy extended attributes to Resources/Views/Redirect/Admin/Redirects: No such file or directory
cp: Resources/Views/Redirect/Admin/Redirects/List.html: No such file or directory
cp: Resources/Views/Redirect/Admin/Redirects/Edit.html: No such file or directory
cp: Sources/App/Modules/Splash/Views/: No such file or directory
cp: Resources/Views/Sponsor: No such file or directory
cp: Sources/App/Modules/Sponsor/Views/: unable to copy extended attributes to Resources/Views/Sponsor: No such file or directory
cp: Resources/Views/Sponsor/Box.html: No such file or directory
cp: Resources/Views/Static: No such file or directory
cp: Sources/App/Modules/Static/Views/: unable to copy extended attributes to Resources/Views/Static: No such file or directory
cp: Resources/Views/Static/.DS_Store: No such file or directory
cp: Resources/Views/Static/Frontend: No such file or directory
cp: Sources/App/Modules/Static/Views//Frontend: unable to copy extended attributes to Resources/Views/Static/Frontend: No such file or directory
cp: Resources/Views/Static/Frontend/Page.html: No such file or directory
cp: Resources/Views/Static/Admin: No such file or directory
cp: Sources/App/Modules/Static/Views//Admin: unable to copy extended attributes to Resources/Views/Static/Admin: No such file or directory
cp: Resources/Views/Static/Admin/Pages: No such file or directory
cp: Sources/App/Modules/Static/Views//Admin/Pages: unable to copy extended attributes to Resources/Views/Static/Admin/Pages: No such file or directory
cp: Resources/Views/Static/Admin/Pages/List.html: No such file or directory
cp: Resources/Views/Static/Admin/Pages/Edit.html: No such file or directory
cp: Resources/Views/System: No such file or directory
cp: Sources/App/Modules/System/Views/: unable to copy extended attributes to Resources/Views/System: No such file or directory
cp: Resources/Views/System/Admin: No such file or directory
cp: Sources/App/Modules/System/Views//Admin: unable to copy extended attributes to Resources/Views/System/Admin: No such file or directory
cp: Resources/Views/System/Admin/Variables: No such file or directory
cp: Sources/App/Modules/System/Views//Admin/Variables: unable to copy extended attributes to Resources/Views/System/Admin/Variables: No such file or directory
cp: Resources/Views/System/Admin/Variables/List.html: No such file or directory
cp: Resources/Views/System/Admin/Variables/Edit.html: No such file or directory
cp: Resources/Views/User: No such file or directory
cp: Sources/App/Modules/User/Views/: unable to copy extended attributes to Resources/Views/User: No such file or directory
cp: Resources/Views/User/Frontend: No such file or directory
cp: Sources/App/Modules/User/Views//Frontend: unable to copy extended attributes to Resources/Views/User/Frontend: No such file or directory
cp: Resources/Views/User/Frontend/Login.html: No such file or directory
cp: Resources/Views/User/Admin: No such file or directory
cp: Sources/App/Modules/User/Views//Admin: unable to copy extended attributes to Resources/Views/User/Admin: No such file or directory
cp: Resources/Views/User/Admin/Users: No such file or directory
cp: Sources/App/Modules/User/Views//Admin/Users: unable to copy extended attributes to Resources/Views/User/Admin/Users: No such file or directory
cp: Resources/Views/User/Admin/Users/List.html: No such file or directory
cp: Resources/Views/User/Admin/Users/Edit.html: No such file or directory
make: *** [views] Error 1
I solved by including a mkdir "Resources/Views" in Makefile
views:
mkdir "Resources/Views"
for f in Sources/App/Modules/*; do m=$$(basename $$f); cp -r "$${f}/Views/" "Resources/Views/$${m}" 2>/dev/null; done;
But maybe a better solution should be thinkered :)
Hi, I just try to start the app form step by step tutorial form readMe and I found that you provide wrong password for user in text is FeatherCMS but that password don't work. But I found password in tests Feather and that one works.
Thank you and good work.
I need to include in my web AMQEP a link to the more recent post from my GRAVATO blog. Is there a route out of the box for that? I'm looking for a solution like this: a Ajax call to http://gravato.aena.pt/lastpost and the json response with a title and the link for the first image.
Hi. I’m running from the macOS 11 command line using swift run
and followed the README.md instructions.
Visiting login and entering user: [email protected] with password FeatherCMS
gets this result:
[ INFO ] POST /login/ [request-id: 7454CFA2-BD23-4801-81E0-E95263B6979A]
[1] 43303 segmentation fault swift run
I’ve tried this several times with the same problem. Same results with both SQLite and PostgreSQL. dropdb
and creating a fresh db has the same result.
Clicking on a key of a file should open the preview window instead of navigating into a sub-directory.
Thanks for your hard work; I like where FeatherCMS has gone so far. Is it possible to add i18n support? Or maybe there is already a way to do it?
On run command swift run Feather
handle an error:
error: multiple products named 'Feather' in: 'feather-core', 'feather-main'
error: multiple targets named 'Feather' in: 'feather-core', 'feather-main'
It's not clear enough what to write into the source and destination fields.
Source -> Source (e.g. /path/)*
Destination -> Destination URL*
Validation?
I recently created a cms project with your name. Trust me i didn't know this exist. The official name of my project is Feather CMS not Feather. Can i use that name?
I couldn't find your contact info sorry for asking it here.
In my blog http://gravato.aena.pt I found this error in the admin/analytics/overview:
400 - Value of type 'String' required for key
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.