shafy / fugu Goto Github PK
View Code? Open in Web Editor NEWFugu is simple, privacy-friendly, open-source and self-hostable product analytics. 🐡
Home Page: https://fugu.lol
License: GNU Affero General Public License v3.0
Fugu is simple, privacy-friendly, open-source and self-hostable product analytics. 🐡
Home Page: https://fugu.lol
License: GNU Affero General Public License v3.0
Hi, I'm trying to get the remote docker-compose file to work, but it won't work. It starts up but then keeps redirecting me to https, which does not work. It puts this in the logs:
fugudb_1 |
fugudb_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
fugudb_1 |
fugudb_1 | 2022-09-12 21:25:52.454 UTC [1] LOG: starting PostgreSQL 14.5 (Debian 14.5-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
fugudb_1 | 2022-09-12 21:25:52.454 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
fugudb_1 | 2022-09-12 21:25:52.454 UTC [1] LOG: listening on IPv6 address "::", port 5432
fugudb_1 | 2022-09-12 21:25:52.490 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
fugudb_1 | 2022-09-12 21:25:52.530 UTC [26] LOG: database system was shut down at 2022-09-12 21:25:44 UTC
fugudb_1 | 2022-09-12 21:25:52.604 UTC [1] LOG: database system is ready to accept connections
web_1 | Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
web_1 | Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!
fugudb_1 | 2022-09-12 21:25:55.523 UTC [33] ERROR: database "fugu" already exists
fugudb_1 | 2022-09-12 21:25:55.523 UTC [33] STATEMENT: CREATE DATABASE "fugu" ENCODING = 'unicode'
web_1 | Database 'fugu' already exists
web_1 | Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
web_1 | Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!
web_1 | Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
web_1 | Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!
web_1 | Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeReadIO` instead!
web_1 | Top level ::Parts is deprecated, require 'multipart/post' and use `Multipart::Post::Parts` instead!
web_1 | => Booting Puma
web_1 | => Rails 7.0.3.1 application starting in production
web_1 | => Run `bin/rails server --help` for more startup options
web_1 | Puma starting in single mode...
web_1 | * Puma version: 5.6.4 (ruby 3.0.0-p0) ("Birdie's Version")
web_1 | * Min threads: 5
web_1 | * Max threads: 5
web_1 | * Environment: production
web_1 | * PID: 1
web_1 | * Listening on http://0.0.0.0:3030
web_1 | Use Ctrl-C to stop
web_1 | 2022-09-12 21:25:59 +0000 HTTP parse error, malformed request: #<Puma::HttpParserError: Invalid HTTP format, parsing fails. Are you trying to open an SSL connection to a non-SSL Puma?>
web_1 | 2022-09-12 21:25:59 +0000 HTTP parse error, malformed request: #<Puma::HttpParserError: Invalid HTTP format, parsing fails. Are you trying to open an SSL connection to a non-SSL Puma?>
web_1 | 2022-09-12 21:26:01 +0000 HTTP parse error, malformed request: #<Puma::HttpParserError: Invalid HTTP format, parsing fails. Are you trying to open an SSL connection to a non-SSL Puma?>
web_1 | 2022-09-12 21:26:01 +0000 HTTP parse error, malformed request: #<Puma::HttpParserError: Invalid HTTP format, parsing fails. Are you trying to open an SSL connection to a non-SSL Puma?>
web_1 | 2022-09-12 21:26:01 +0000 HTTP parse error, malformed request: #<Puma::HttpParserError: Invalid HTTP format, parsing fails. Are you trying to open an SSL connection to a non-SSL Puma?>
We have implemented selection saving for the Events view. We should also add it to the Funnels view (and make sure to differentiate between Events and Funnels in the cookies).
For Funnels, we need to save the selected funnel name and date range (for now).
Some aggregation levels don't make sense based on the time range selected. We already limit selecting "Day" as aggregation if the time range is longer than 6 days. Now, we should also add the following:
Should be pretty straight-forward and could be useful to check your analytics from your phone now and then.
The goal of a conversion funnel is to see how many users continue to the next step in that funnel. This gives an indication of how you can improve certain user flows, e.g. sign ups or getting users to pay for your product.
Funnel creation view
Users should be able to create conversion funnels by selecting an event for each step of that funnel. Users then can name the funnel and save it.
Funnels view
Users can select from the funnels they have previously saved. Compared to the current events view, instead of the "Events" dropdown we will show a "Funnels" drop down, and don't show the time aggregation dropdown (doesn't make sense). If a funnel is selected, the user will see the different steps and how many times the event has occured in the selected time frame. We can also show the per-step conversion rates.
Getting SSL errors with FORCE_SSL_PROD=false
▲ cat .env
# REQUIRED if you're self-hosting
ALLOW_REGISTRATION=true # setting this to false disallows new sign ups
DATABASE_NAME=<snip>
DATABASE_USER=<snip>
DATABASE_PASSWORD=<snip>
SECRET_KEY_BASE=<snip>
# Generate key with `rails secret` or manually (alphanumeric string with 128 chars)
# OPTIONAL if you're self-hosting
[email protected] # set this if you run with docker-compose and want to create an initial user
INIT_USER_PASSWORD=<snip> # set this if you run with docker-compose and want to create an initial user
#DATABASE_URL= # required if you're running Fugu without docker-compose in production
#SENTRY_DSN= # if you want to use Sentry to track errors
RAILS_LOG_TO_STDOUT=true # if you want to log errors in server logs
#DATABASE_NAME_TEST= # only needed if you are running automated tests during development
FORCE_SSL_PROD=false # sets config.force_ssl in production.rb - defaults to true.
▲ podman-compose -f docker-compose.prod-remote.yml up
podman create --name=fugu_web_1 --requires=fugu_db_1 --label io.podman.compose.config-hash=9eb49d161fdae9120b9607ed1537f6137b1dee5e06c1b9b6d0b9ecdd4b9cbacd --label io.podman.compose.project=fugu --label io.podman.compose.version=1.0.6 --label [email protected] --label com.docker.compose.project=fugu --label com.docker.compose.project.working_dir=/Users/micro/work/reaktor/equinox/analytics/fugu --label com.docker.compose.project.config_files=docker-compose.prod-remote.yml --label com.docker.compose.container-number=1 --label com.docker.compose.service=web -e RAILS_ENV=production -e RACK_ENV=production -e RAILS_SERVE_STATIC_FILES=true -e DATABASE_NAME=fugu -e DATABASE_URL=postgres://fugu:fugupassword@db:5432/fugu -e SECRET_KEY_BASE=bc55e112f61b193a3ac58119746ecbefbe9fae4d9712754865e582f869aa8d2c0a355c448b0e6534d9026f2c3c523b33c5cfc2ca48676f760966e4382e1c59727077844a98e2b6e0e737a90ce3ce6720f9d365d6fe01c724947a932d00f0ab9982a8c7fc31b1b533240e3f3a02c2885fdd8c374c8b4417ac71cfc7ca7e1e08e3 -e RAILS_LOG_TO_STDOUT=true -e SENTRY_DSN= -e ALLOW_REGISTRATION=true -e [email protected] -e INIT_USER_PASSWORD=examplefugupassword -e FORCE_SSL_PROD=false --net fugu_default --network-alias web -p 3000:3000 -w /app --tty --restart unless-stopped --entrypoint ["sh", "/app/docker-entrypoint.sh"] --platform linux/amd64 shafyy/fugu:latest bash -c rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'
▲ xh localhost:3000
HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Location: https://localhost:3000/
Transfer-Encoding: chunked
Currently, users can only select from different predefined time ranges. I think it would be useful to allow users to set custom time ranges additionally.
I'm not sure yet how to best implement this UI-wise. One idea could be to show it as an additional option in the date range dropdown, and when the user clicks on it they will see two date fields to set a range (e.g., below the predefined date ranges or in a new pop up). Another idea could be that the custom date range inputs are shown by default.
For the first iteration I wouldn't go with a custom JavaScript date picker, but use the default HTML <input type="date">
. I think that it looks good enough and going forward will also be improved.
We currently don't have a character limit on the property names, which are defined arbitrarily by user input. This can lead to unnecessarily long property names, leading to a worse user experience. Let's limit their length to 15 (?) characters.
Somewhere, there should be an edit button when viewing Funnels.
Do it!
Somewhere, there should be a delete button when viewing a funnel
Add a validation that checks property names and disallows "all" or "All", since this interferes with our default property selection dropdown value (which is "All").
Currently, you need to select the event, property, aggregation and time range again when closing the tab and going back to the project.
It would improve the UX if we save the last picked value for those on a per project basis in a cookie.
I had to swap the volume mount to a named volume for it to work for me:
diff --git a/docker-compose.prod-remote.yml b/docker-compose.prod-remote.yml
index 7987194..dcc5432 100644
--- a/docker-compose.prod-remote.yml
+++ b/docker-compose.prod-remote.yml
@@ -3,10 +3,11 @@ services:
db:
image: postgres
volumes:
- - ./tmp/db:/var/lib/postgresql/data
+ - postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
+ platform: linux/amd64
environment:
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_USER=${DATABASE_USER}
@@ -22,6 +23,7 @@ services:
depends_on:
- db
restart: unless-stopped
+ platform: linux/amd64
environment:
- RAILS_ENV=production
- RACK_ENV=production
@@ -35,3 +37,7 @@ services:
- INIT_USER_EMAIL=${INIT_USER_EMAIL}
- INIT_USER_PASSWORD=${INIT_USER_PASSWORD}
- FORCE_SSL_PROD=${FORCE_SSL_PROD}
+
+volumes:
+ postgres-data:
+
Let's limit project names to something like 40 chars.
We currently don't show the total event count for an event in the selected time range. It would be helpful to see that :-)
I think those are useful for people as standard ranges. The default selected range should still be "Last 7 days".
Currently, we save the latest selections (e.g., event name, time range) but don't differentiate between projects. If a user has more than one project, this is annoying. We should save the selections per project.
Currently, dates are always displayed as YYYY-MM-DD, regardless of the aggregation selected.
I propose the following formatting per aggregation:
When I hit the endpoint POST https://app.fugu.lol/api/v1/events
as referenced in the README with the body
{
api_key: my_api_key
name: 'Clicked Contact'
properties: {userId: 'niko'}
}
I receive the response
{
"error": {
"type": "NoMethodError",
"message": "undefined method `titleize' for nil:NilClass"
}
}
Currently, users can arbitrarly add property values. This means that they can also save personally identifiable information (PII) like email addresses or ip addresses. While we can't possibly prevent every piece of PII, we should "blacklist" some obvious ones.
I suggest adding validation that checks for email addresses and IP addresses to start with.
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.