-
Notifications
You must be signed in to change notification settings - Fork 2
Online Database
Onride Photos supports uploading your ride photos to an online database, so they can be displayed on your website.
Currently, the plugin only supports connecting with Supabase. If you need something else, please get in contact. Supabase was chosen because its free, and does not require any extra software or port-forwarding on your server.
Create a new project on supabase. Todo this, create your organization
https://supabase.com/dashboard/organizations

Then create a new project in this organization, you can use the default values.
Go to the 'table editor' tab, and create a new table


Name the table 'photos' and setup the following columns:
- id = int8
- created_at = timestamptz
- layout = text
- players = text
You also need a bucket, here the image data is stored.
Navigate to storage

And click 'new bucket'

name it 'photos', and turn on 'Public bucket' as we want people to be able to look at them on our site.

Next up, open the 'database.yml' file in the plugins folder.
Set 'enabled' to true, and the provider to 'supabase'
Set your project id, to the id of your supabase project. You can find this in the URL

Last, navigate to 'Project Settings' -> 'API Keys' -> 'Legacy anon, service_role API keys' and copy the 'service_role secret'
Keep the 'bucket' and 'table' settings to 'photo' as those are the names we gave earlier while setting up the buckets and tables.

Save the file, and restart or /photo reload the server.
When a picture is taken in game, its data should appear in the table.

To enable access on your website, go to the 'table editor', select the photos table, and 'Add RLS policy'

Then 'Create policy'

Add the 'Select' template, and save.

This allows external APIs to read the database.