Skip to content

letloop/petit-cloud

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

petit-cloud

Deploy Scheme web application easily

Quickstart

Install FoundationDB:

wget https://github.com/apple/foundationdb/releases/download/7.1.30/foundationdb-clients_7.1.30-1_amd64.deb
wget https://github.com/apple/foundationdb/releases/download/7.1.30/foundationdb-server_7.1.30-1_amd64.deb
sudo dpkg -i foundationdb*

In a first terminal do:

  $ ./venv
  $ letloop exec . petit-cloud-server.scm -- 127.0.0.1 9999

In another terminal:

  $ curl http://localhost:9999
  hello world
  $ ./venv
  $ letloop exec . petit-cloud.scm -- http://localhost:9999/_/api/v0/ example.scm
  Please, input the secret: foobar
  Good! What is done, is not to be done!
  $ curl http://localhost:9999
  hello world 1 from example application
  $ curl http://localhost:9999
  hello world 2 from example application
  $

Kickstart

⚠️ 🚧 work in progress, use at your own risks 🚧 ⚠️

The get started you need to:

  • Buy a domain;
  • Buy a Virtual Private Server with Ubuntu, it is recommended to have two cores, and 8GB of RAM;

Make sure you have installed ssh on your own machine.

Next steps:

  1. setup the server;
  2. test it with a hello world application.

Setup the server

Let's install petit-cloud-server on the VPS.

  1. On the server download, install, and configure FoundationDB:

    ssh myserver.example
    wget https://github.com/apple/foundationdb/releases/download/7.1.30/foundationdb-clients_7.1.30-1_amd64.deb
    wget https://github.com/apple/foundationdb/releases/download/7.1.30/foundationdb-server_7.1.30-1_amd64.deb

    Install it:

    sudo dpkg -i foundationdb*.deb

    Configure ssd storage backend:

    fdbcli --exec 'configure ssd'
  2. Download the latest release of petit-cloud and petit-cloud-server.

  3. Upload petit-cloud-server in your virtual private server with something like:

    sftp myserver.example
    > put petite-cloud-server
  4. Via ssh, copy the binary inside /usr/local/bin/:

    ssh myserver.example
    mkdir -p /usr/local/bin/
    sudo cp petite-cloud-server /usr/local/bin/
  5. Install nginx, configure it using the directive proxy_pass to forward requests to local host, and port 9999;

  6. To start the application server on startup, in the directory /etc/systemd/system/ create a file called petit-cloud-server.service:

    [Unit]
    After=network.target
    StartLimitIntervalSec=0
    
    [Service]
    Type=simple
    Restart=always
    RestartSec=1
    User=www
    ExecStart=/usr/local/bin/petit-cloud-server
    
    [Install]
    WantedBy=multi-user.target
    

    Then execute the following commands:

    systemctl start petit-cloud-server
    systemctl enable petit-cloud-server

Support

LICENSE

Copyright © 2023 Amirouche BOUBEKKI

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.