Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 551 Vote(s) - 3.43 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database on a personal github page

#1
Is it possible to have some data stored somewhere on your personal github page?

For example a button that triggers a counter. When you click on the button , counter increments by 1. When other user visits that page and clicks the button , counter gets incremented by 1 once again.

So it would be a sum of all click across all visitors that would be displayed on the page.
Reply

#2
The accepted answer about Firebase is a good, quick reply, but I want to write a longer and more comprehensive response for anyone who is investigating this topic, as Firebase is one of several ways to achieve this kind of functionality.

By way of background, databases/datastores like mysql, postgres, redis, mongodb, etc. are the most common way to store visitor data in the way that the next visitor and see or access it. Content management systems such as Django, Wordpress, and Drupal are built to read and write to a database. These services tend to be server-side technology, which is to say that a server admin sets them up, and blocks of code that the website's users cannot see communicate with the database. That server side code base also builds the rendered html that a user will see. So in general, Github Pages are not used with these kinds of technology because they support only static html, css, and javascript--that is, they allow client side code only.

For more on this topic, see

[To see links please register here]


If you want to set up a read only datastore, you have a lot of options on Github pages. You could put a json file in your repo, query a drive document, upload an sqlite.db file to your repo and query it, etc. In this imagined example, you would have to be ok with a website user seeing any data in your datastore, as the setup would not provide a way to make some data invisible to the user.

As soon as you're thinking about writing to your database, however, security is a concern. If you set up some kind of offsite database and put DB access credentials into your client-side code, any user could see those credentials and compromise your database (inject data, take it over, delete it, etc.) For this reason alone, you need a setup that passes data from the front end to the back end and vice versa without letting website traffic see under the hood. As I understand it, this is a level of functionality that Github Pages can't give you.

For more on client-side database security, see this thread:

[To see links please register here]


One potential workaround is to use your static side to link to a third party service. You can, for example, embed a Google form in an html page. That form can link to a Google sheet. That sheet can be published to the web and be set to update automatically. Your Github pages site can reference the public version of that page and update (on a delay) when changes are submitted. This type of setup is clunky (I assume Google sheets get slow if they get too big) and should be used with caution, as a poorly designed form of this kind could be a spam magnet. Not to mention that anyone who looks at your client side code will be able to find an view the public version of your Google sheet, which will include submission time and user data if you collect it. However, if used carefully, it could work for the use case mentioned above.


Reply

#3
Using Github's HTTP REST API:

[To see links please register here]

One can commit/update a json file or an sqllite file into a github pages repo via browser js.
Reply

#4
Depending on your needs, you can try **[GithubDB](

[To see links please register here]

)**

From their docs:

> Ever wanted to use Github as your private database, now you can.
>
> Why would I want to use Github as my database?
>
> Good question. Developers have many choices of different databases,
> GithubDB however leverages all the features you have come to love from
> Github.
>
> Logging (With Github, you can quicky look at your commits and see the
> write and updates for your request).
>
> Visualization (Github offers amazing tools to visualize the incoming
> number of read/writes).
>
> Persistance (With Github you can rollback to early stages of your data
> and see how it has evolved).
>
> Security (Using Github, your database inherits the same standards from
> Github).
>
> Availability (Github has known to be down, but let's be honest, it is
> good enough unless you are Facebook).

Reply

#5
Github pages only allow for static content, so you'd have to use something like [firebase][1] in order to get a database.


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through