GithubHelp home page GithubHelp logo

fixme-lausanne / openspacelint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spaceapi-archive/openspacelint

0.0 20.0 0.0 2.58 MB

The space API validator.

Home Page: http://spaceapi.net

ApacheConf 0.68% PHP 28.11% CSS 5.01% HTML 5.80% JavaScript 59.92% Shell 0.49%

openspacelint's Introduction

OpenSpaceLint

OpenSpaceLint is a validator for the Space API. It also be used it to reformat any JSON.

Checkout

In your DocumentRoot get OpenSpaceLint via git

git clone git://github.com/SpaceApi/OpenSpaceLint.git .
git submodule update --init --recursive

or if git isn't installed via wget

wget https://github.com/slopjong/OpenSpaceLint/archive/master.zip
unzip master.zip
mv OpenSpaceLint-master/* .
mv OpenSpaceLint-master/.* .
rm -rf master.zip OpenSpaceLint-master

If you were root when executing the above commands you may need to change the file permissions, owner and group.

chown -R www-data:www-data .
find . -type d -exec chmod g+s {} \;

Configuration

Copy config/config.sample.php to config/config.php and fill in the correct api keys.

By default the site_url variable is set to the hostname or if virtual hosts are used then it's set to its ServerName. Here is an example how the VirtualHost block looks like:

<VirtualHost *:80>
    ...
    ServerName openspace.slopjong.de
    ServerAlias www.openspace.slopjong.de
    ...
</VirtualHost>

It's highly recommended to change explicitly the site_url variable to the domain where it will be accessible. By default it's set to a server variable but php code run from the command line the $_SERVER["SERVER_NAME"] is undefined which might break cron jobs relying on the php API.

Use an URL of the form openspace.slopjong.de and leave the protocol away.

One place where the site_url is used is the cache update script which only allows requests from the server itself and redirects all other clients to site_url's error page.

Cache Cron Setup

In the setup directory execute the setup script. Replace www-data with the user under which your web server is running.

cd setup
./setup www-data

Then run

su www-data
crontab -e

to add the actual cronjobs. Replace www-data with the user under which your web server is running. In your linux distribution this could be http.

Now copy the following lines by replacing with the proper DocumentRoot from your VirtualHost configuration.

*/2   *     *    *    *    run-parts <docroot>/cron/scron.m.02
*/5   *     *    *    *    run-parts <docroot>/cron/scron.m.05
*/10  *     *    *    *    run-parts <docroot>/cron/scron.m.10
*/15  *     *    *    *    run-parts <docroot>/cron/scron.m.15
*/30  *     *    *    *    run-parts <docroot>/cron/scron.m.30
*     */1   *    *    *    run-parts <docroot>/cron/scron.h.01
*     */2   *    *    *    run-parts <docroot>/cron/scron.h.02
*     */4   *    *    *    run-parts <docroot>/cron/scron.h.04
*     */8   *    *    *    run-parts <docroot>/cron/scron.h.08
*     */12  *    *    *    run-parts <docroot>/cron/scron.h.12
*     *     */1  *    *    run-parts <docroot>/cron/scron.d.01
*     *     */1  *    *    run-parts <docroot>/cron/daily-tasks

Every cron directory starting with scron only contains so-called space crons which only update the space JSON files. The daily-tasks directory contains system tasks such as recreating the key tables which list what of the space api a space has implemented or even new introduced fields. These tables are displayed on openspace.slopjong.de, just click on directory below the editor to see them.

A space cron is located in all the space cron directories but only in one directory it is executable. If a space changes the schedule the execution bit will be removed in the old schedule directory and added in the new one. That's how scheduling works in OpenSpaceLint.

Recaptcha

Don't forget to enable the domain in your recaptcha account.

Proxy

If OpenSpaceLint is deployed on a shared host or on a machine where curl is not allowed to use non-standard ports an external proxy is used (available at jasonproxy.herokuapp.com) to bypass the firewall. The source code of the proxy is available in the JSONProxy repository.

Troubleshooting

In cli you can check some filepaths with php -f c/php/controller.php delegator=environment.

Submodules

Example of how to add a submodule:

git submodule add [email protected]:SpaceApi/phpjs.git c/js/phpjs

openspacelint's People

Contributors

brimstone avatar gr2m avatar neoalchemy avatar renatocron avatar rohieb avatar slopjong avatar umbrae avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.