Giter Club home page Giter Club logo

microfeed's Introduction



microfeed: a lightweight cms self-hosted on cloudflare

Report Bug ยท Request Feature ยท Email Us Privately

Welcome to microfeed, a lightweight content management system (CMS) self-hosted on Cloudflare. With microfeed, you can easily publish a variety of content such as audios, videos, photos, documents, blog posts, and external URLs to a feed in the form of web, RSS, and JSON. It's the perfect solution for tech-savvy individuals who want to self-host their own CMS without having to run their own servers.

microfeed is built by Listen Notes and is hosted on Cloudflare's Pages, R2, D1, and Zero Trust.

If you have any questions or feedback, please don't hesitate to reach out to us at [email protected]. We'd love to hear from you!

๐Ÿ“š Table of contents

Deploy to Cloudflare Pages CI Email us stability-alpha

โญ๏ธ How it works

Since the 1990s, a significant portion of the web has been powered by feeds. People (and bots) publish items to a feed, and others can subscribe to that feed to receive new content.

microfeed makes it easy for individuals to self-host their own feed on Cloudflare, including but not limited to

microfeed uses Cloudflare Pages to host and run the code, R2 to host and serve media files, D1 to store metadata, and Zero Trust to provide logins to the admin dashboard. Cloudflare provides very generous free usage quotas, making it an affordable solution for personal or small business use. While you will still need to pay for a domain name, hosting microfeed on Cloudflare is essentially free.

With microfeed, you can publish a variety of content such as audios, videos, photos, documents, blog posts, and external URLs to a customizable website, an RSS feed, and a JSON feed. Check out some examples of microfeed in action:

microfeed provides a simple yet powerful admin dashboard that makes it easy to add items to the feed, upload media files, and customize web page styles. If you've used WordPress before, you'll find it familiar.

image-6d056193c81c0b8f5de0503f5af18116

Back to ๐Ÿ“šTOC

๐Ÿš€ Installation

Roughly you'll follow these steps to install a microfeed instance to Cloudflare:

  1. Fork the microfeed repo to your personal (or organizational) GitHub account.
  2. Obtain Cloudflare API tokens and save them as secrets on your forked GitHub repository.
  3. Use the predefined GitHub Action in your forked repository to deploy the code to Cloudflare Pages, using the secrets from step 2.
  4. Make a few clicks on Cloudflare's dashboard to set up custom domains and configure some security settings.
  5. Done. Start publishing!

We understand that not everyone is comfortable with reading documentation, so we've made it as easy as possible to get started with microfeed. However, we'd love to see Cloudflare implement a "Login with Cloudflare" OAuth feature, which would allow for almost one-click deployment of microfeed. In the meantime, we've tried to make the setup process as straightforward as possible for tech-savvy users.

Prerequisites

Back to TOC

Step 1. Fork the microfeed repo to your GitHub

Simply click on https://github.com/microfeed/microfeed/fork to fork the repository.

You may choose to modify the code in your forked repository in the future, but it's likely that you won't need to touch the code at all. Simply fork the repository and keep it synced for future use.

Back to ๐Ÿ“šTOC

Step 2. Put some secrets on your forked repo

Go to your forked repo's Settings -> Secrets -> Actions, and create 5 secrets (click for more details). With these secrets in place, you'll be able to use GitHub Actions to deploy your microfeed instance to Cloudflare Pages.

CLOUDFLARE_ACCOUNT_ID

You can get your cloudflare account id from your dashboard's url:

After you login your Cloudflare account, you'll be redirected to a url like this

https://dash.cloudflare.com/[your-cloudflare-account-id-here]

The last part of the url is your cloudflare account id.

For example, if you see a url like this:

https://dash.cloudflare.com/fff88980eeeeedcc3ffffd4f555f4999

Then you'll set CLOUDFLARE_ACCOUNT_ID to fff88980eeeeedcc3ffffd4f555f4999:

Screenshot 2022-12-17 at 10 31 10 AM
CLOUDFLARE_API_TOKEN

You'll need to create an API token here: https://dash.cloudflare.com/profile/api-tokens

Create a custom token:

Screenshot 2022-12-04 at 4 30 57 PM

We need edit permission for both Cloudflare Pages and D1:

Screenshot 2022-12-04 at 4 31 41 PM

Finally, copy the API token here:

Screenshot 2022-12-04 at 4 34 01 PM
R2_ACCESS_KEY_ID and R2_SECRET_ACCESS_KEY

Go to your R2 dashboard page. You may need to put your credit card there first. You won't need to pay, unless your usage exceeds the very generous free quota limit (i.e., 10GB storage + 10 million reads/month + 1 million writes/month).

Create an R2 API token here:

Screenshot 2022-12-04 at 4 43 58 PM

Select "Admin Read & Write" permission and create an API token:

Screenshot 2023-08-08 at 4 33 55 PM

Copy Access Key ID for R2_ACCESS_KEY_ID, and Secret Access Key for R2_SECRET_ACCESS_KEY Screenshot 2022-12-04 at 4 45 35 PM

CLOUDFLARE_PROJECT_NAME

A legit project name should have these characters: [a-z], [A-Z], [0-9], and -

We recommend using the custom domain name that you'll use for this project and replace dot (.) with dash (-)

For example, if you use photos.mycustomdomain.com, then the project name should be photos-mycustomdomain-com

Note: Don't use underscore (_), space ( ), and other characters outside [a-z], [A-Z], [0-9] and -. Or Cloudflare Pages won't let you create a project.

In total, you'll add 5 secrets for GitHub Actions:

Screenshot 2022-12-04 at 4 10 46 PM

Back to ๐Ÿ“šTOC

Step 3. Run GitHub Action to deploy code

Go to Actions -> Deploy to Cloudflare Pages and run Workflow

Screenshot 2022-12-04 at 4 11 19 PM

If you see the green checkmark, then the deployment is successful. And you can see a Pages project in your Cloudflare dashboard:

Screenshot 2022-12-04 at 4 55 10 PM

You can access the site via ${CLOUDFLARE_PROJECT_NAME}.pages.dev, for example, https://microfeed-org.pages.dev/

Back to ๐Ÿ“šTOC

Step 4. Make a few clicks on Cloudflare dashboard

To manage your microfeed instance, you'll use the admin dashboard at ${CLOUDFLARE_PROJECT_NAME}.pages.dev/admin, for example, https://microfeed-org.pages.dev/admin/ (the admin dashboard needs to be protected by Cloudflare Zero Trust).

Upon accessing the admin dashboard for the first time, you'll complete the setup process by following the checklist:

Screenshot 2022-12-17 at 10 34 05 AM

Back to ๐Ÿ“šTOC

Step 5. Done. Start publishing

Once you've completed the setup process, your microfeed instance will be ready to use. You can add, update, or delete items from the admin dashboard.

You can also customize the appearance of the website at Settings / Custom code by editing the raw HTML and CSS:

Screenshot 2022-12-30 at 7 57 45 PM

The HTML code is using mustache.js as a templating language, where you can access to variables from Feed Json or Item Json. For example, on our marketing website microfeed.org's home page (Feed Web), we use variables in the html code from microfeed.org/json/, and on an item's page (Item Web), we use variables from ${item_url}/json.

With the easy access to the json data of a microfeed instance (i.e., Feed Json and Item Json, you can use it as a headless CMS and build your own client apps to display the content.

Back to ๐Ÿ“šTOC

Bonus. Update to the latest version of microfeed

We'll continue to add new features and fix bugs in this microfeed repo. You may want to update your forked repo with the new code.

You'll first sync up the code in your forked repo:

Screenshot 2022-12-26 at 7 58 32 AM

Then go to Actions -> Deploy to Cloudflare Pages and run Workflow to deploy the new code.

Back to ๐Ÿ“šTOC

๐Ÿ’ป FAQs

How can I track podcast / video / image downloads?

To track podcast, video, or image downloads with microfeed, you can use the tracking URLs feature. This allows you to set up third-party tracking URLs for your media files, such as those provided by OP3, Podtrac, Chartable...

To set up tracking URLs, you will need to go to Settings / Tracking URLs: Screenshot 2023-01-05 at 7 57 02 AM

From there, you can add the third-party tracking URLs that you want to use. microfeed will automatically add these URLs to the front of the URL for your media files, allowing you to track download statistics.

This is a common practice in the podcast industry and can be a useful way to monitor the performance of your content and understand how it is being consumed by your audience.

Why Cloudflare? Isn't it dangerous to trust a for-profit company?

Many individuals and organizations trust and use Cloudflare's services because it has a reputation for providing reliable and effective services. We (Listen Notes) have been using Cloudflare for many years.

It's convenient to manage all things on a one-stop platform like Cloudflare (e.g., DNS, Cache, firewall, running code, CDN, trustless logins...).

microfeed is still in open alpha phase. Cloudflare is the first platform we support. We may consider supporting other serverless platforms, so you can easily migrate away if needed.

What if Cloudflare de-platforms my microfeed instance?

It is important to carefully review the terms of service for any service that you use, including Cloudflare. It is possible that if you violate the terms of service, the service may take action, such as de-platforming your instance.

To protect against the possibility of being de-platformed, it is a good idea to regularly backup your data from Cloudflare. This will allow you to recover your contents and potentially migrate them to a different platform if necessary. It is also a good idea to use your own custom domain, as this will give you more control over your content and make it easier to move your data to a different platform if needed.

Why should I use microfeed?

If you are already using Cloudflare and are satisfied with its services, then using microfeed may be a good option for you.

If you don't want to manage your own servers, microfeed can be a convenient alternative that allows you to take advantage of Cloudflare's infrastructure and security features.

If you don't want to pay for servers, microfeed can be a cost-effective solution, as Cloudflare provides generous free usage quotas.

If you are looking for something new and are interested in exploring different options, microfeed could be a good choice to consider. It is always a good idea to carefully evaluate any service before using it to ensure that it meets your needs and is a good fit for your use case.

How to download / backup data from microfeed / Cloudflare?

microfeed stores data in Cloudflare D1 and R2. Therefore, you'll download two things to backup your microfeed data:

How to download a sqlite database from D1?

You can use the command line tool wrangler to find sqlite database files and download backups:

https://developers.cloudflare.com/workers/wrangler/commands/#d1

How to download media files from R2?

As of Feb 16, 2023, Cloudflare has not provided tools to to batch download all files from a R2 bucket.

You may need to write a script to use S3-compatible APIs to fetch all objects from a specific R2 bucket.

Back to ๐Ÿ“šTOC

๐Ÿ’ช Contributions

We welcome contributions to microfeed! If you have an idea for a new feature or have found a bug, please open an issue in the repository. If you'd like to submit a fix or new feature, please create a pull request with a detailed description of your changes.

Run microfeed on local

Pre-requisites: node / npm, yarn, and wrangler

First, create a .vars.toml file in microfeed's root directory (same level as this README.md file) and put 5 secrets in the .vars.toml file (Similar to Step 2. Put some secrets on your forked repo):

# .vars.toml
CLOUDFLARE_PROJECT_NAME = "your-project-org"
CLOUDFLARE_ACCOUNT_ID = "account id"
CLOUDFLARE_API_TOKEN = 'api token'

R2_ACCESS_KEY_ID = "access key"
R2_SECRET_ACCESS_KEY = "secret key"

Second, run local dev server:

npm run dev

You should be able to access to a local microfeed instance via http://127.0.0.1:8788/.

Back to ๐Ÿ“šTOC

๐Ÿ›ก๏ธ License

microfeed is licensed under the AGPL-3.0 license. Please see the LICENSE file for more information.

Back to ๐Ÿ“šTOC

microfeed's People

Contributors

allanice001 avatar jarylc avatar jcary741 avatar orthanc42 avatar theonlywayup avatar wenbinf 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

microfeed's Issues

Invalid Bucket Name

I followed all the steps carefully.

When I deployed it from GitHub Actions, it failed. I checked and there is an error in the Setup section

Error InvalidBucketName: The specified bucket name is not valid.
    at Request.extractError (/github/workspace/node_modules/aws-sdk/lib/services/s3.js:711:35)
    at Request.callListeners (/github/workspace/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/github/workspace/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/github/workspace/node_modules/aws-sdk/lib/request.js:686:14)
    at Request.transition (/github/workspace/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/github/workspace/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /github/workspace/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/github/workspace/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/github/workspace/node_modules/aws-sdk/lib/request.js:688:12)
    at Request.callListeners (/github/workspace/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
  code: 'InvalidBucketName',
  region: null,
  time: 2022-12-28T06:50:02.829Z,
  requestId: null,
  extendedRequestId: undefined,
  cfId: undefined,
  statusCode: 400,
  retryable: false,
  retryDelay: 47.97243175497938
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Do I have to create a bucket first in R2 explicitly? because I didn't. I just crated ID And Secret as mentioned in the Readme.

Project not found

Hello, sorry if this is a stupid question. But I'm trying this and during the workflow I get this. Any ideas?

Database id (num of chars): 36 Successfully synced for [production]! { result: null, success: false, errors: [ { code: 8000007, message: 'Project not found. The specified project name does not match any of your existing projects.' } ], messages: [] } wrangler pages publish public --project-name *** --branch main

Deleting a bunch of old items

Since it's not possible to delete multiple items from the items/list page, we need to alternate between the items/list and admin/items pages.

After deleting an item, the user is returned to the items list. If the items had been sorted by oldest first, it might be preferable to return to the list page with sort=oldest_first.

Settings changes are not getting saved

I installed microfeed around Feb 1 and was able to make a change to one of the settings on Feb 3 (I added meta og tags to the web header). Today I was trying to make further changes, but the changes don't get saved. For example, if I try to modify one of my meta og tags in the Web Header, and then click Update, the UI shows "Updated" but if I refresh the Settings page I can see the update was not saved, and if I go to Cloudflare D1 I can see the database tables haven't been updated since Feb 3 (to be clear, I haven't tried to work on this between Feb 3 and tonight). How can I troubleshoot the failure to update the database tables? Thanks!

Error In Deploy operation

I get this problem when I tried to deploy the repo to Cloudflare Pages:

Screenshot_2

Error InvalidArgument: Invalid Argument: Credential access key has length 34, should be 32

Can't run it locally

After setting up .vars.toml file, and then running yarn dev/npm run dev it gives
CLOUDFLARE_ACCOUNT_ID not an internal or external similar for each variable

Feature request - Admin search and bulk action

I am very happy with running microfeed on https://dstif.io, and have been using it as a feed aggregator.

Everyso often, a scenario comes up where due to some automation i've built, i get duplicate entries, and would like to be able to bulk delete these duplications

having the ability to search within the admin interface would be a nice to have (search by title?)
Additionally having the ability to bulk select would also have a nice to have (manually deleting 100 entries iis not fun)

My name doesn't appear in the copyright information.

https://{mydomain.com}/admin/settings/code-editor/?type=themes&theme=custom#webBodyEnd
image

My name doesn't appear in the copyright information.
Only ยฉ is displayed.
If it's displayed properly, it should have the year and your name (nickname).

By Default No GitHub Actions shows

No Action Appear

image

and if I copy the code from Deploy.yml into a new action it say Deploy.yml already exist
image

But if I copy the code from Deploy.yml in New Action and name it Main.yml it works and I could deploy successfully
image

Any Idea ?

Cannot create self-hosted app

It is not possible to create a self-hosted app when there's no zones configured - the button is completely disabled (which is the case for a first-time user who wants to use a *.pages.dev domain).

However, I could find a workaround: it is possible to do it by going the pages setting page and enabling access policy - and then it's possible to change it to the admin path only.

Error during Action run: "The engine 'node' is incompatible with this module"

During the "Setup" job I receive following error:

yarn run v1.22.21
$ sh ops/generate_vars_toml.sh && yarn install && node ops/init_r2.js && node ops/init_feed_db.js && node ops/init_project.js
[1/4] Resolving packages...
warning jest > @jest/core > jest-haste-map > [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
warning jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > [email protected]: Use your platform's native atob() and btoa() methods instead
warning jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > data-urls > [email protected]: Use your platform's native atob() and btoa() methods instead
warning jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > [email protected]: Use your platform's native DOMException instead
warning jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3[14](https://github.com/dirsigler/microfeed/actions/runs/7575757607/job/20633073962#step:4:15)2
warning jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > w3c-xmlserializer > [email protected]: Use your platform's native DOMException instead
warning jest > @jest/core > jest-haste-map > sane > micromatch > snapdragon > [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
warning jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > [email protected]: Use your platform's native performance.now() and performance.timeOrigin.
warning jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > request > [email protected]: this library is no longer supported
warning jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > request > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning jest > @jest/core > jest-haste-map > sane > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning jest > @jest/core > jest-haste-map > sane > micromatch > snapdragon > source-map-resolve > [email protected]: See https://github.com/lydell/source-map-url#deprecated
warning jest > @jest/core > jest-haste-map > sane > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning aws-sdk > [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning aws-sdk > url > [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning webpack-dev-server > webpack-dev-middleware > [email protected]: this will be v4
warning wrangler > @esbuild-plugins/node-modules-polyfill > rollup-plugin-node-polyfills > [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
warning wrangler > @esbuild-plugins/node-modules-polyfill > rollup-plugin-node-polyfills > rollup-plugin-inject > magic-string > [email protected]: Please use @jridgewell/sourcemap-codec instead
[2/4] Fetching packages...
error @jest/[email protected]: The engine "node" is incompatible with this module. Expected version "^14.[15](https://github.com/dirsigler/microfeed/actions/runs/7575757607/job/20633073962#step:4:16).0 || ^[16](https://github.com/dirsigler/microfeed/actions/runs/7575757607/job/20633073962#step:4:17).10.0 || >=18.0.0". Got "[17](https://github.com/dirsigler/microfeed/actions/runs/7575757607/job/20633073962#step:4:18).9.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.

[`D1_ERROR`] Cloudflare Worker Threw Exception

Issue Summary

After deploying my workflow and verifying that all secrets were valid, I tried to access the CF Pages site but got a 500 error instead. I looked at the CF Pages logs and saw that there was a D1 error. I checked D1 and found that no tables had been created. I ran the init.sql statement manually and that fixed the problem. I'm not sure if this is a bug or if I missed something.

{
  "outcome": "exception",
  "scriptName": "pages-worker--980544-production",
  "exceptions": [
    {
      "name": "Error",
      "message": "D1_ERROR",
      "timestamp": 1680774207584
    }
  ],
...

Steps to Reproduce

  1. Deploy the workflow and make sure all secrets are valid.
  2. Try to access the CF Pages site.
  3. See the 500 error and check the CF Pages logs.
  4. Find the D1 error in the logs and check D1 for missing tables.
  5. Run the init.sql statement manually.
  6. Verify that the CF Pages site is accessible after running the init.sql statement.

Expected Behavior

The CF Pages site should be accessible without any issues after a successful deployment.

Actual Behavior

The CF Pages site returns a 500 error and the CF Pages logs show a D1 error due to missing tables.

Possible Solution/Workaround

Manually running the init.sql statement in the CF D1 console resolved the problem. It's possible that the statement wasn't executed during the deployment process, which caused the missing tables and D1 error.

Open cloudflare pages F12 shows `NS_BINDING_ABORTED`

My browser: 110.0.1(64 bit) Firefox Windows 11

request head:

GET / undefined
Host: microfeed-org.pages.dev
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate, br
Referer: https://github.com/
Connection: keep-alive
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: cross-site
Sec-Fetch-User: ?1
Sec-GPC: 1

browser shows:

Secure Connection Failed

An error occurred during a connection to microfeed-org.pages.dev. PR_CONNECT_RESET_ERROR

Error code: PR_CONNECT_RESET_ERROR

    The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
    Please contact the website owners to inform them of this problem.

So does my site which followed README.

Support for Multiple Channels?

I am just looking for a Cloudflare stack CMS and found this project.

I am wondering if this system might be expanded to support multiple channels?

This would be useful to for example work with posts and pages?

Thanks for your consideration and for building this.

CORS errors and 403 Forbidden's

I think the first time I uploaded an image I saw it in the UI but now I just get a broken image icon

image

It looks like I am getting CORS errors. If I try to load the image directly in a new tab then it will load.

But after a couple of refreshes in another tab I get 403 Forbidden (I think this is some kind of rate limiting because if I then try to load the image on my phone it works).

I am accessing through a custom domain so I was not expecting rate limiting.

Any idea how I fix the CORS error as I did not see a step to allow-origin: "*" on:

cdn.mysite.com

Way to host in any other place then CF/Git?

I like the idea and your implementation. However, is there a way to implement/host this outside of cloudflare/github? Like on a hosting platform, by say placing the code on a site and running from there? It would be helpful and great.

github Deploy to Cloudflare Pages erro

image

Run yarn deploy:github
yarn run v1.22.19
$ node ops/sync_project_config.js && node ops/direct_upload.js
Sync-ing for [production]...
/home/runner/work/microfeed-cloudflare-cms/microfeed-cloudflare-cms/ops/lib/utils.js:94
body.result.forEach((result) => {
^

TypeError: Cannot read properties of undefined (reading 'forEach')
at IncomingMessage. (/home/runner/work/microfeed-cloudflare-cms/microfeed-cloudflare-cms/ops/lib/utils.js:94:21)
at IncomingMessage.emit (node:events:539:35)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)

Node.js v17.9.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.

Bookmarklet: add a "to microfeed" issues

First of all, great project and very good docs.

There are a couple of small issues with the js code that is presented in Add new item -> external URL, "Bookmarklet: add a "to microfeed" button to browser".

If I add this code to browser favorites and click on it on some random url I will get redirected to correct admin page (/admin/items/new/) with the Title and URL prefilled correctly however the Create button is not active.
It seems that if I put focus in any field (description, link, etc) and add some character the Create button becomes active, but when pressed it actually create a item of type audio, rather than external URL.
Issue happens in both Fireforx and Chrome (on windows 11)

Admin API

Admin API

  • GET /v1/api/admin/feed
  • PUT /v1/api/admin/channel
  • POST /v1/api/admin/items
  • PUT /v1/api/admin/items/{id}
  • DELETE /admin/items/{id}
  • PUT /v1/api/admin/settings
  • POST /v1/api/admin/storage-presigned-urls

Public API

  • GET /json

Template

  • Everything from GET /json, plus
  • โ€ฆ

[Request] Author field

First I wanted to say this is a wonderfully creative and awesome use of Cloudflare's tech, well done!

Now on to the feature request - would it be possible to add a field to the item which either takes the user's details from Cloudflare Access, or, as a stretch request, have an Author schema which can be tied to an item, and in the schema give the ability to upload an avatar/profile pic for the author so that the metadata of the post can be enriched?

Once again, thank you very much!

Post api call return 201 code but no records.

hello and thanks for this project.
after setting up microfeed, i tried to use teh provided api.
posting via admin is ok
but i cannot get the api working. the call returns a 201 status with a json id. but there a re no records in the D1.

see my call made via postman :
Capture dโ€™eฬcran 2023-07-19 aฬ€ 16 13 41

in cloudflare dashboard i can monitor api calls

image

here is the log:

{ "outcome": "ok", "scriptName": "pages-worker--1248874-production", "diagnosticsChannelEvents": [], "exceptions": [], "logs": [], "eventTimestamp": 1689776465911, "event": { "request": { "url": "https://62b09bdd.pods-postite-com.pages.dev/api/items/", "method": "POST", "headers": { "accept": "*/*", "accept-encoding": "gzip", "cf-connecting-ip": "78.202.112.102", "cf-ipcountry": "FR", "cf-ray": "7e939bdfec31d393", "cf-visitor": "{\"scheme\":\"https\"}", "connection": "Keep-Alive", "content-length": "828", "content-type": "application/json", "host": "62b09bdd.pods-postite-com.pages.dev", "postman-token": "REDACTED", "user-agent": "PostmanRuntime/7.31.3", "x-forwarded-proto": "https", "x-microfeedapi-key": "REDACTED", "x-real-ip": "78.202.112.102" }, "cf": { "clientTcpRtt": 14, "longitude": "1.44510", "latitude": "43.60460", "tlsCipher": "AEAD-AES128-GCM-SHA256", "continent": "EU", "asn": 12322, "clientAcceptEncoding": "gzip, deflate, br", "country": "FR", "isEUCountry": "1", "tlsClientAuth": { "certIssuerDNLegacy": "", "certIssuerSKI": "", "certSubjectDNRFC2253": "", "certSubjectDNLegacy": "", "certFingerprintSHA256": "", "certNotBefore": "", "certSKI": "", "certSerial": "", "certIssuerDN": "", "certVerified": "NONE", "certNotAfter": "", "certSubjectDN": "", "certPresented": "0", "certRevoked": "0", "certIssuerSerial": "", "certIssuerDNRFC2253": "", "certFingerprintSHA1": "" }, "tlsExportedAuthenticator": { "clientFinished": "168b7fa5952b47eecce2758dbe0e55784814403cecad332ec38952c09d0b09ea", "clientHandshake": "c7fc3bd77b7c716568c5b56cdf42fc4f74cf48baefb65467ac2ccf58f0d9687a", "serverHandshake": "0e8a40fc6c884c55c101b73be50371316ecc971b4c101af75a0e403dd910a9e7", "serverFinished": "16d9cbc287ac314b7b50ec6dd8397915123dd011256603cce4442d543d5fdebe" }, "tlsVersion": "TLSv1.3", "city": "Toulouse", "timezone": "Europe/Paris", "postalCode": "31300", "edgeRequestKeepAliveStatus": 1, "requestPriority": "", "colo": "CDG", "httpProtocol": "HTTP/1.1", "region": "Occitanie", "regionCode": "OCC", "asOrganization": "Free SAS", "pagesHostName": "62b09bdd.pods-postite-com.pages.dev", "botManagement": { "corporateProxy": false, "verifiedBot": false, "jsDetection": { "passed": false }, "staticResource": false, "detectionIds": {}, "score": 99 } } }, "response": { "status": 201 } }, "id": 0 }

same thing with /api/media_files/presigned_urls

what could go wrong ? thx

How do I delete unreferenced objects in R2?

Thanks for making microfeed!

I replaced an old image with a new one, but the old one is still stored in the R2 bucket, is there a convenient way to delete all unreferenced/unused objects in R2?

It was successfully deployed according to the process, but uploading all resources shows 404

Thanks to the developers for open sourcing this front-end project, I couldn't wait to follow the tutorial and deploy it after seeing the push report

According to the tutorial I successfully resolved to new.ldd.cc

But when I started to upload avatars, graphics and other non-text data, it showed 404 See

https://new.ldd.cc/new-ldd-cc/production/media/image-1cdb66d9d2cd6dd000188d5a167072f8.jpg

I am not a professional developer and am not sure what is causing this, offering this bug in the hope that it can be fixed.

CI feature: integrate pull request preview environments

I would like to support Microfeed by implementing Uffizzi preview environments.
Disclaimer: I work on Uffizzi.

Uffizzi is a Open Source full stack previews engine and our platform is available completely free for Microfeed (and all open source projects). This will provide maintainers with preview environments of every PR in the cloud, which enables faster iterations and reduces time to merge. You can see the open source repos which are currently using Uffizzi over here

Uffizzi is purpose-built for the task of previewing PRs and it integrates with your workflow to deploy preview environments in the background without any manual steps for maintainers or contributors.

We can go ahead and create an Initial PoC for you right away if you think there is value in this proposal.

Cloudflare Access protection

I attempted to use the original instructions for configuring Cloudflare Access protection but it did not work.

I have cobbled together protection and wanted to share it here. I almost updated the documentation but it's a lot to do and wasn't sure it belongs there.

  1. Setup a custom domain.
  2. Create a bulk redirect list (if you don't have one)
  3. Add a redirect for {microfeed}.pages.dev -> {mirofeed}.tld
  4. Setup a cloudflare access rule for {microfeed}.tld/admin

And it's working. If I open {microfeed}.pages.dev it immediately redirects to the tld, and admin forces auth.

This setup does require a few additional cloudflare things which is why I paused when updating the readme in my fork. I'd be happy to work on adding this to the docs over the next few days if the team would like.

Feature requests / bug reports for Cloudflare, Inc.

Overall

Pages

  • API (or wrangler2) to check if the name of a new Pages project is legal / unique. #7
  • more informative error 1101 page than "you should login to Cloudflare and check the error logs for ..."

R2

D1

Zero Trust

  • Don't show error message "the zone does not exist" when adding *.pages.dev in Zero Trust Self-Hosted Application. #20 (comment)
  • Don't disallow editing path when adding *.pages.dev. It's very confusing.
  • An easy way to refresh jwt token? This is relate to an issue: POST ajax requests won't refresh jwt token.

Settings: Channel description custom html source is overridden by visual editor HTML code

After entering custom HTML source for the description and clicking update, the custom HTML source successfully updates the page.

However, upon returning the settings page at /admin/channels/primary/, the form defaults to selecting "visual editor" and the associated HTML code from the visual editor overrides the previous updated custom HTML source.

Steps to reproduce:

  1. Go to /admin/channels/primary/, enter some text into description using visual editor. Click update.
  2. Refresh the page, select "html source" for description. Enter some HTML edits. Click update.
  3. Refresh the page, select "html source" for description. The updates from step 2 will not be present.

Inconsistent date on backend and frontend

I noticed that the post published date are inconsistently displayed between the front end and the back end.

qq

Is there a way to fix this and make it consistent on both sides?

[Request] Edit robots.txt

It would be great if we had the ability to edit the robots.txt that gets deployed from within the admin dashboard.

[Request] Microfeed logo link should go to /admin

Generally speaking, a logo in the upper left of a webpage links to the homepage.
image
This Microfeed links to the microfeed.org homepage. However as an admin user I consider the "homepage" in this context to be /admin, I expect clicking that logo to take me there.

Cannot upload channel image, CORS issue

Hi there,

I'm getting a CORS error when attempting to change the channel image. Maybe it's something obvious as I'm not super-familiar with Cloudflare R2, but everything else in the checklist seems to be working fine.

Screen Shot 2023-01-03 at 9 46 38 PM

This is using a brand new domain I purchased today through Cloudflare.

FWIW, if I upload the image directly to my bucket using the Cloudflare console, I'm able to view the image by going to media-cdn.my-custom-domain.com/MYIMG.jpeg just fine.

Cloudflare Access doesn't work with pages.dev

Per the Known Issues merely adding a Cloudflare Access rule will not prevent one from accessing .pages.dev. This needs to be fixed using either a redirect to the custom domain once one is connected or allow the user to switch on enforcement of the JWT. I'd be willing to attempt a pull request once it is determined which approach would cause fewer accidental lockouts. Personally, I've setup a global redirect to enforce my custom domain.

Add ActivityPub support

This is a neat little project, thank you! I appreciate that you added an RSS feed in the first version of microfeed. It is very important for podcasters and bloggers alike.

Would you consider adding ActivityPub support to the project, so anyone could follow a microfeed site on the fediverse?

Here are some useful links that may help you get started, although you may find other useful resources on the web about this, since more and more people are considering ActivityPub for their projects.

Thanks for the consideration!

Support for HTTP HEAD requests

Discussed in #18

Originally posted by hailspuds December 30, 2022
This might be less an idea, and more a bug? Or maybe my implementation?

Anyway, I was running my test feed through a few validators, and they are whinging about HTTP HEAD requests.

I'm not sure if this is an issue with my Cloudflare setup rather than Microfeed itself?

Screen Shot 2022-12-30 at 12 38 57 pm

Cannot undone media file in item

I added external url to a post. Then I wanted remove that url in the post. But it's still show website homepage's url. Seems like default value is website homepage when field is empty.

Firefox form issue when updating/creating item

Hello,

When you go into the "add new item" or edit an existing item in Firefox, you get a warning box when you create/update (pages: /admin/items/new/ and /admin/items/xxxxxxxID/)

I'm running version 108.0.1 on OS X - and the same issue doesn't seem to occur in Chrome.

Here's a screenshot of the issue:

Screen Shot 2022-12-30 at 8 29 50 am

The developer tools console throws a warning saying "Form contains a file input, but is missing method=POST and enctype=multipart/form-data on the form. The file will not be sent."

It does still save/create the item no matter what you push, so there doesn't seem to be any data loss.

Thanks!

[Request] Tailwind CSS in CMS

It would be a big step up for this project if tailwind worked within the CMS, right now it works only for the styles that are compiled on build and not for any classes exclusively rendered from the database.

This would mean doing the same job that tailwind does at build using workers and I have no idea if that's even technically possible but if it is it would make the project a lot easier to modify in the CMS. Let me know if I've missed something here.

[bug/feature] title link customisation

Would it be possible to customise the link to an item, to for example, be a slug of the title (possibly combined with the published date) without the guid? It feels friendlier for both search and readability.

Many thanks indeed!

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.