- PHP 90.9%
- CSS 9.1%
|
|
||
|---|---|---|
| html | Add html/faq.php | |
| src | Update src/func/fundraisers.php | |
| LICENSE | Initial commit | |
| README.md | Update README.md | |
Kuno Fundraisers
A non-custodial Monero fundraising platform.
Warning: This code is amateur-level, messy and not fully tested.
Why Monero?
Monero is "cash for the internet" – a fast, secure and inclusive way to send and receive money worldwide.
No bank account, application or government ID is required to use Monero.
Monero can easily be exchanged for physical cash (e.g. LocalMonero.co), virtual debit cards and gift cards (e.g. CakePay.com) or spent on products and services (e.g. Monerica.com).
For more information, visit GetMonero.org.
How to install
Use the following instructions to run your own instance of Kuno Fundraisers on a fresh Ubuntu or Debian VPS.
Shared hosting also works – In that case, login to cPanel, upload the files via the File Manager or FTP, manage the database via PHPMyAdmin, and then setup the cron.
1. Install the web server
sudo apt install apache2 mysql-server php7.4 libapache2-mod-php7.4 php7.4-mysql php7.4-gd php7.4-gmp php7.4-bcmath php7.4-curl run-one certbot python3-certbot-apache postfix
Warning: Kuno currently doesn't work with PHP 8.
2. Get a free SSL certificate
sudo certbot -d yourdomain.com
3. Setup the website
curl -LO https://codeberg.org/anarkio/kuno/archive/main.zip
unzip kuno-main.zip
shopt -s dotglob
mv kuno/* /var/www/
sudo chown -R www-data:www-data /var/www/
4. Set the domain name
find /var/www/ -iname "*.php" -exec sed -i "s_kuno.bitejo.com_yourdomain.com_g" {} \;
find /var/www/ -iname "*.php" -exec sed -i "s_noreply@bitejo.com_noreply@yourdomain.com_g" {} \;
sed -i "s_kuno.bitejo.com_yourdomain.com_g" /var/www/html/assets/style.css
sudo a2enmod rewrite
sudo service apache2 restart
sudo nano /etc/apache2/apache2.conf
Replace:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
With:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
5. Setup the database
sudo mysql
CREATE DATABASE kuno DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE USER 'kuno_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOUR_PASSWORD_HERE';
GRANT ALL ON kuno.* TO 'kuno_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
sudo mysql -u kuno_user -p kuno < /var/www/src/db/structure.sql
Then add the database name, username and password to connect.php:
nano /var/www/src/db/connect.php
6. Setup cron (important, syncs donations)
crontab -u www-data -e
Add this line to the end of the file:
*/3 * * * * /usr/bin/run-one /usr/bin/timeout 15m /usr/bin/php7.4 /var/www/src/func/cron.php fxq5Lgd1h9EwKHow12b134PQYu831s5m >/dev/null 2>&1
7. Done!
TX syncing
Kuno currently uses a PHP script to fetch each new block from a remote node, deserialize the block and its transactions, and try to decrypt each transaction with the private view key. However, it is slow and can support up to 100 active fundraisers before lagging. An alternative would be to port the code in /src/func/monero_scraper.php to C++ or Rust and call it via PHP's exec() function. Monero LWS may also work.
This was done in order to avoid requiring a full node (=expensive storage VPS), importing many view-only wallets to Monero RPC, or burdening Xmrchain.net's API.
To validate TX keys, Kuno Fundraisers uses the Onion Monero Blockchain Explorer API.
If you have the resources to run your own instance of this API (requires a full node, which requires around 200~ GB storage), you can download it here: https://github.com/moneroexamples/onion-monero-blockchain-explorer and add the URL of your instance to /src/func/monero_api.php
If not, there are some instances listed in /src/func/monero_api.php
Admin
There is currently no admin area. You can manage translations in /src/func/translation.php, set your instance to public or invite-only in /src/func/invite_codes.php and enable/disable federation in /src/func/fediverse.php.
If you need to delete a fundraiser (e.g. scam, impersonation, user lost access to their account or wallet):
sudo mysql
USE kuno;
DELETE FROM fundraisers WHERE guid = 'abcd';
Change email address (if the user lost access to their old email):
sudo mysql
USE kuno;
UPDATE fundraisers SET email = 'example@example.com' WHERE guid = 'abcd';
Reset password manually (if the user didn't set a recovery email address):
php -r "echo password_hash('testing123', PASSWORD_DEFAULT);"
2ドルy10ドル$niorEEGTwtrR9.HjSN/vs.Z7fG0tCYCI7/AT/pMbW39LbCvJilhQW
sudo mysql
USE kuno;
UPDATE fundraisers SET password = '2ドルy10ドル$niorEEGTwtrR9.HjSN/vs.Z7fG0tCYCI7/AT/pMbW39LbCvJilhQW' WHERE guid = 'abcd';
The GUID is in the fundraiser URL, e.g. https://kuno.bitejo.com/fundraiser/abcd/
If there are any errors, check:
tail -n100 /var/log/apache2/error.log
Future ideas
- Optional monetization features for operators:
- Featured fundraisers on the homepage and search page (payment via TXID and TX key).
- Non-intrusive ads for KYC-free crypto platforms/merchants/media.
- Affiliate links of KYC-free services such as Trocador, LocalMonero, MoneroMarket, CoinCards, etc.
- A Kuno fundraiser for continued maintenance / new features.
- Premium features, such as:
- Digital downloads for Donation Pages (similar to Patreon) where donors can submit the TX key and download an ebook/song/channel link/chatroom invite/etc. Possibly based on https://codeberg.org/anarkio/vendo/
- Custom themes for fundraisers/donation pages
- Embed the fundraiser/donation page on your website
- A paid service to install a private instance for e.g. FOSS projects, content creators or charities who want to host their own fundraisers. The benefits would be 1) non-custodial zero-fee fundraisers/donation pages 2) donations and totals are visible on page 3) donors can leave comments and optionally add an email address for donor rewards 4) visibility via the federated search 5) possibility of a custom white-label design that fits the website's theme.
- ❌ TX fees aren't possible, as fundraisers are non-custodial and donations are sent directly to the user.
- ❌ Listing fees would be prohibitive, especially for charity/medical/living costs fundraisers, as well as Kickstarters without start capital. Even if someone could afford the fee, it may be difficult for them to acquire KYC-free Monero in their location, e.g. low cash by mail/cash in person liquidity.
License
Kuno Fundraisers is in the public domain. Feel free to fork or use this code for your own projects.
Disclaimer
This code is public domain and can be used for any purpose. However there is no warranty, guarantee or liability. Treat this as an experimental work in progress, instead of a production-ready finished product.