https://github.com/daattali/cranalerts
Get email alerts when a CRAN package gets updated
https://github.com/daattali/cranalerts
rstats shiny shiny-apps
Last synced: 24 days ago
JSON representation
Get email alerts when a CRAN package gets updated
- Host: GitHub
- URL: https://github.com/daattali/cranalerts
- Owner: daattali
- Created: 2018-04-03T00:39:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-18T18:47:03.000Z (8 months ago)
- Last Synced: 2025-03-18T07:11:32.636Z (27 days ago)
- Topics: rstats, shiny, shiny-apps
- Language: R
- Homepage: https://cranalerts.com/
- Size: 276 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
- jimsghstars - daattali/cranalerts - Get email alerts when a CRAN package gets updated (R)
README
# CRANalerts
A service by [AttaliTech Ltd](https://attalitech.com) that lets you subscribe to updates to CRAN packages. Available at [CRANalerts.com](https://cranalerts.com/).
**If you find CRANalerts useful, please consider supporting it\!**
### Technical setup details (local testing):
1. Run the `dev_init()` function found in the `scripts/dev_init.R` file:
```
source("scripts/dev_init.R"); dev_init()
```A SQLite database `cranalerts.sqlite3` will be created.
2. If you have an SMTP server settings and would like to send emails, create a `config.yml` file in the root directory using the template of [`config.yml.sample`](./config.yml.sample), and edit all the values to match your settings.
### Technical setup details (production):
1. Create a SQLite database
```
sqlite3 cranalerts.sqlite3 < init_cranalerts_db.sql
```
Make sure to make the database file readable/writeable to the owner and group, so that both shiny and cronjobs will be able to write to it2. Create a `config.yml` file in the root directory using the template of [`config.yml.sample`](./config.yml.sample), and edit all the values to match your email server settings.
3. Install `rJava` package (for email sending using `mailr`) and configure it. I was having a lot of trouble getting it to work, it seems that it was not working with Java 11. I had to follow these steps after already having Java 11 installed:
- Run `apt install openjdk-8-jdk openjdk-8-jre`
- Run `update-alternatives --config java` (since I already had java 11 and I wanted to downgrade)
- Add java paths to environment `/etc/environment`: `JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64` and `JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre`
- (Reboot machine so that the envvars get loaded or set the environment variables temporarily)
- Make sure the path is set and java 8 is used: `printenv JAVA_HOME` and `java -version`
- Run `R CMD javareconf` to set up java with R
- Now installing `rJava` pacakge should work, and sending emails with `mailR` should work4. Set up a cron job (`crontab -e`) to run the update script (the following results in the script running daily at 13:00)
```
0 13 * * * /srv/shiny-server/cranalerts/scripts/run_cranalerts_script.sh > /srv/shiny-server/cranalerts/scripts/run_cranalerts_script.log 2>&1
```