定制 tholcomb/goes-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tholcomb/goes-php

Composer 安装命令:

composer create-project tholcomb/goes-php

包简介

Web service for downloading and serving NOAA GOES imagery for live-ish background images

README 文档

README

A web service for downloading and serving NOAA GOES imagery for live-ish background images.

If you're unfamiliar, that's the Geostationary Operational Environmental Satellite.

GOES Imagery

Requirements

  • PHP 8
    • w/ Imagick extension
  • SQLite3
  • jpegoptim (optional)

Install

Composer:

$ composer create-project tholcomb/goes-php $INSTALL_DIR

Manual:

# Download from releases or:
$ git clone https://github.com/tholcomb/goes-php.git $INSTALL_DIR

$ cd $INSTALL_DIR
$ composer install
$ php bin/console.php goes:install

Setup

File Permissions

These instructions assume php-fpm runs as the www-data user and that your account is a member of the www-data group. Adjust accordingly.

$ sudo chgrp -R www-data $INSTALL_DIR

# 2 is the setgid bit
$ chmod -R 2775 $INSTALL_DIR

# Remove execute permission applied in last step
$ find $INSTALL_DIR -type f -exec chmod 664 {} \; 

crontab

This will cause the cron command to run every 5 minutes. Adjust to taste. This has the same assumptions as above.

*/5 * * * * www-data php $INSTALL_DIR/bin/console.php goes:cron

nginx

server {
        ...
        root $INSTALL_DIR/public;

        location / {
                try_files $uri /index.php$is_args$args;
        }
        location ~ ^/index\.php(/|$) {
                fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
                fastcgi_split_path_info ^(.+\.php)(/.*)$;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
                fastcgi_param DOCUMENT_ROOT $realpath_root;
                internal;
        }
        location ~ \.php$ {
                return 404;
        }
}

Usage

Managing users

Add a user

$ php bin/console.php goes:user add

Then, follow the prompts. If you answer "yes" to the "Include time data" prompt, a timestamp and info from the original image will appear below Antarctica, otherwise, it will be cropped.

NOTE: The API Key does not need to be secure. That is, unless your threat model includes extremely petty people who will research what obscure software you're using in order to mildly inconvenience you.

List users

$ php bin/console.php goes:user list

Remove user

$ php bin/console.php goes:user remove $API_KEY

Getting images

Simply send a GET request to /latest.jpg with your API Key. The API Key can be included two ways:

  1. As the GET parameter 'apiKey' (ex. /latest.jpg?apiKey=$API_KEY)
  2. As the HTTP Header 'Api-Key' (ex. Api-Key: $API_KEY)

See download_goes.php for a working example.

iOS Shortcut

iCloud link

Limitations

These limitations are due to the base image URL being hardcoded. (Sue me.) If you're running up against these, feel free to email me or submit a pull request.

  • Imagery is only available from the GOES-East satellite
  • Screen sizes with dimensions greater than 1808px may suffer image degradation

Acknowledgements

This project would not have been possible without the fine work done by the folks at the National Atmospheric & Oceanic Administration (NOAA), and more specifically, the National Environmental Satellite, Data, and Information Service (NESDIS) and the Center for Satellite Applications and Research (STAR).

Send them your love! Preferably, in the form of a letter to your congressperson.

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固