Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • monero-project/ccs-back
  • xiphon/ccs-back
  • Fudin/ccs-back
  • john_r365/ccs-back
  • plowsofff/ccs-back
5 results
Show changes
This diff is collapsed.
public/img/monero-logo.png

3.26 KiB

## About Monero FFS
# About Monero CCS
Monero FFS is a simple web system for capturing donations made to fund community projects
Monero CCS is a simple web system for capturing donations made to fund community projects
# CCS Deployment Quickstart
## Requirements
```
mysql >= 5.7.7
php >= 7.1
```
## Deployment
```
apt update
apt install -y cron git jekyll mysql-server nginx php php-curl php-fpm php-gd php-mbstring php-mysql php-xml unzip
```
Install `Composer` following the instructions at https://getcomposer.org/download/
Checkout and configure CCS backend, frontend and proposals repositories (replace `<REPOSITORY_CCS_BACKEND>`, `<REPOSITORY_CCS_FRONTEND>`, `<REPOSITORY_CCS_PROPOSALS>` with the actual URLs)
```
cd /var/www/html
git clone <REPOSITORY_CCS_BACKEND>
git clone <REPOSITORY_CCS_FRONTEND>
git clone <REPOSITORY_CCS_PROPOSALS> ccs-back/storage/app/proposals
rm -rf ccs-front/proposals
ln -s /var/www/html/ccs-back/storage/app/proposals ccs-front/proposals
ln -fs /var/www/html/ccs-back/storage/app/proposals.json ccs-front/_data/proposals.json
ln -fs /var/www/html/ccs-back/storage/app/complete.json ccs-front/_data/completed-proposals.json
cd ccs-back
composer update
cp .env.example .env
```
Spin up MYSQL server, create new database, user and grant user access to it
Open `.env` in editor of choice and edit the following lines:
> `COIN` - choose one of supported coins: `monero` or `zcoin`
> `REPOSITORY_URL` - CCS proposals Github URL or GitLab API endpoint (e.g. https://\<GITLAB_DOMAIN>/api/v4/projects/\<PROJECT_ID>)>
> `GITHUB_ACCESS_TOKEN` - leave empty if you are not using Github or visit https://github.com/settings/tokens to generate new `public_repo` token
```
APP_URL=http://<HOSTNAME>
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=<DB_NAME>
DB_USERNAME=<DB_USER_NAME>
DB_PASSWORD=<DB_USER_PASSWORD>
RPC_URL=http://127.0.0.1:28080/json_rpc
RPC_USER=
RPC_PASSWORD=
COIN=<COIN>
REPOSITORY_URL=<REPOSITORY_URL>
GITHUB_ACCESS_TOKEN=
```
Initialize the system
```
php artisan migrate:fresh
php artisan up
php artisan key:generate
php artisan proposal:process
php artisan proposal:update
```
Grant `www-data` user access to the files
```
cd ..
chown -R www-data ccs-back/
chown -R www-data ccs-front/
```
Remove Nginx example config
```
rm /etc/nginx/sites-enabled/default
```
Create new file `/etc/nginx/sites-enabled/ccs` in editor of choice and paste the following lines replacing `<HOSTNAME>` and `<PHP_VERSION>` with appropriate values
```
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html/ccs-front/_site/;
index index.php index.html;
server_name <HOSTNAME>;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# pass the PHP scripts to FastCGI server
#
location ~ \.php$ {
root /var/www/html/ccs-back/public/;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php<PHP_VERSION>-fpm.sock;
}
}
```
```
service nginx reload
```
Set up a cron job that will run periodic updates (every minute) and generate static HTML files
```
* * * * * git -C /var/www/html/ccs-back/storage/app/proposals/ pull; php /var/www/html/ccs-back/artisan schedule:run; jekyll build --source /var/www/html/ccs-front --destination /var/www/html/ccs-front/_site
```
## Optional
Instead of scheduling a cron job you can run the following commands in no particular order
1. Update CCS system proposals intenal state
```
php /var/www/html/ccs-back/artisan proposal:process
php /var/www/html/ccs-back/artisan generate:addresses
php /var/www/html/ccs-back/artisan wallet:notify
php /var/www/html/ccs-back/artisan proposal:update
```
2. Process incoming donations
*Run it either on new block/tx notification or schedule it to run every minute or so*
```
php /var/www/html/ccs-back/artisan monero:notify
```
1. Generate static HTML files
```
jekyll build --source /var/www/html/ccs-front --destination /var/www/html/ccs-front/_site
```
2. Get the full list of processed transactions in JSON format
```
php /var/www/html/ccs-back/artisan deposit:list
```
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CCS - Donate {{$project->title}}</title>
<link rel="apple-touch-icon" sizes="180x180" href="/meta/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/meta/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/meta/favicon-16x16.png">
<link rel="manifest" href="/meta/manifest.json">
<link rel="mask-icon" href="/meta/safari-pinned-tab.svg" color="#5bbad5">
<meta name="theme-color" content="#ffffff">
<link href="/css/custom.css" rel="stylesheet">
<meta name="msapplication-config" content="/ietemplates/ieconfig.xml">
</head>
<body>
<div class="page-wrapper">
<div class="mob-nav">
<input class="burger-check" id="mobile-burger" type="checkbox"><label for="mobile-burger" class="burger"></label>
<div class="slide-in-nav">
<div class="container slide-in">
<div class="row">
<div class="col-xs-12">
<div class="text-center nav-item mob">
<a href="/ideas/" class="top-link">Ideas</a>
</div>
<div class="text-center nav-item mob">
<a href="/funding-required/">Funding Required</a>
</div>
<div class="text-center nav-item mob">
<a href="/work-in-progress/">Work in Progress</a>
</div>
<div class="text-center nav-item mob">
<a href="/completed-proposals/">Completed Tasks</a>
</div>
<div class="text-center nav-item mob">
<a href="/donate/index.html">Donate</a>
</div>
<div class="text-center nav-item mob">
<a href="/completed-proposals/">Back to Getmonero.org</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="desktop-nav">
<nav class="container">
<div class="row middle-xs">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<p class="site-name"><a href="/">Community Crowdfunding System</a></p>
</div>
<div class="col-lg-8 col-md-8 col-sm-8 items end-xs">
<div class="row end-xs middle-xs">
<div class="col-md-12">
<div class="dropdown">
<label for="desktopdrop">CCS Stages<div class="arrow-down"></div></label>
<input class="burger-checkdropdown" id="desktopdrop" type="checkbox">
<div class="dropdown-content">
<a href="/ideas/">Ideas</a>
<a href="/funding-required/">Funding Required</a>
<a href="/work-in-progress/">Work in Progress</a>
<a href="/completed-proposals/">Completed Tasks</a>
</div>
</div>
<a href="https://getmonero.org">Getmonero.org</a>
<a href="/donate/" class="donate-btn">Donate</a>
</div>
</div>
</div>
</div>
</nav>
</div>
<div class="mob bot-nav white-nav">
<div class="row middle-xs">
<div class="col-xs-12">
<p class="site-name"><a href="
/
">Community Crowdfunding System</a></p>
</div>
</div>
</div>
<div class="site-wrap ffs-proposal ffs-con">
<div class="container ffs-breadcrumbs">
<div class="row">
<div class="col-xs-12">
<p><a href="/">Community Crowdfunding System</a></p>
<p><a href="/funding-required/">Funding Required</a></p>
<p><a href="/proposals/{{pathinfo($project->filename, PATHINFO_FILENAME)}}.html">{{$project->title}}</a></p>
<p class="bread-active">Contribute</p>
</div>
</div>
</div>
<section class="container full">
<div class="info-block">
<div class="row">
<div class="col-xs-12">
<h2>{{$project->title}}</h2>
<p class="author-list">{{$project->author}}</p>
<p class="date-list">{{date('F j, Y', strtotime($project->created_at))}}</p>
<p class="date-list contributor">{{$project->contributions}}</p>
<p class="bar-fund-status">Raised <span class="progress-number-funded">{{$project->raised_amount}}</span> of <span class="progress-number-goal">{{$project->target_amount}}</span> XMR</p>
<div class="progress-bar">
<span class="fund-progress" style="width: {{min(100, intval($project->raised_amount * 100 / $project->target_amount))}}%"></span>
</div>
<p>Your contribution should be visible within 5 minutes of you sending your contribution. If for some reason it is not there, please contact a member of the Core Team!</p>
</div>
</div>
</div>
</section>
<section class="container full">
<div class="row">
<div class="col-xs-12">
<div class="tabs con-how">
<input class="input" name="tabs" type="radio" id="tab-1" checked="checked"/>
<label class="label" for="tab-1">QR Code</label>
<div class="panel col-xs-12">
<div class="panel-segment">
<h3>Contribute with a QR code</h3>
<p>1. Choose the amount of XMR you wish to contribute to this proposal</p>
<p>2. Scan this QR code or tap to open in your Monero wallet app:</p>
<p>
<a href="{{$project->address_uri}}" class="qr"><img src="{{$project->qrCodeSrc}}"/></a>
</p>
<p>3. Send! Thank you! You are amazing!</p>
</div>
</div>
<input class="input" name="tabs" type="radio" id="tab-2"/>
<label class="label" for="tab-2">Address</label>
<div class="panel col-xs-12">
<div class="panel-segment">
<h3>Contribute using an address</h3>
<p>1. Choose the amount of XMR you wish to contribute to this proposal</p>
<p>2. Enter the following XMR address:</p> <p class="string">{{$project->address}}</p>
<p>3. Send! Thank you! You are amazing!</p>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<footer class="container-fluid">
<div class="container">
<div class="row center-xs footer-wrapper">
<div class="col-md-8 col-sm-10 col-xs-12">
<h3>Donate to the Monero Project</h3>
<p>By donating to the following Monero address (General Fund), you are supporting the Monero Project. If you wish to donate to a specific proposal, please see <a href="/funding-required/index.html" class="white gf">Funding Required</a>.</p>
<p><a href="monero:44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A" class="qr"><img src="/img/donate-monero.png" /></a></p>
<p class="gf-address">44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A</p>
</div>
</div>
</div>
<div class="row center-xs">
<div class="footer-links">
<ul class="list-unstyled list-inline">
<li><a href="https://repo.getmonero.org/monero-project/ccs-front" class="white footer-link">CCS Front End Repo</a></li>
<li><a href="https://repo.getmonero.org/monero-project/ccs-back" class="white footer-link">CCS Backend Repo</a></li>
<li><a href="https://repo.getmonero.org/monero-project/ccs-proposals" class="white footer-link">CCS Proposals Repo</a></li>
</ul>
</div>
</div>
</footer>
</div>
</body>
</html>
\ No newline at end of file
......@@ -10,11 +10,11 @@
<tbody>
@foreach ($projects as $project)
<tr>
<td><a href='{!! url('/projects/'.$project->payment_id); !!}'>{{ $project->payment_id }}</a></td>
<td><a href='{!! url('/projects/'.$project->subaddr_index); !!}'>{{ $project->subaddr_index }}</a></td>
<td>{{$project->status}}</td>
<td>{{$project->amount_received}} XMR</td>
<td>{{$project->raised_amount}} XMR</td>
<td>{{$project->target_amount}} XMR</td>
</tr>
@endforeach
</tbody>
</table>
\ No newline at end of file
</table>
XMR {{$project->amount_received}} / XMR {{$project->target_amount}} Target
XMR {{$project->raised_amount}} / XMR {{$project->target_amount}} Target
{{$project->contributions}} contributions made. {{$project->percentage_funded}}%
<br>
<img src="data:image/png;base64,{!! base64_encode($project->qrcode) !!}">
\ No newline at end of file
<img src="data:image/png;base64,{!! base64_encode($project->qrcode) !!}">
......@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Monero FFS</title>
<title>Monero CCS</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet" type="text/css">
......@@ -79,7 +79,7 @@
<div class="content">
<div class="title m-b-md">
Monero FFS
Monero CCS
</div>
<div class="links">
......
......@@ -16,3 +16,4 @@ Route::get('/', function () {
});
Route::get('projects', ['as' => 'ffs', 'uses' => FundingController::class.'@index']);
Route::get('projects/{paymentId}', ['as' => 'ffs', 'uses' => FundingController::class.'@show']);
Route::get('projects/{paymentId}/donate', ['as' => 'ffs', 'uses' => FundingController::class.'@donate']);
*
!.gitignore