This repository has been archived by the owner on Oct 3, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Dockerfile for building docker images
- Loading branch information
Showing
14 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM alpine/git as clone | ||
WORKDIR /app | ||
RUN git clone https://github.com/FultonBrowne/Ara-Server.git | ||
|
||
|
||
FROM openjdk:8-jdk-alpine as build | ||
WORKDIR /app | ||
COPY --from=clone /app/Ara-Server /app | ||
RUN ./gradlew build | ||
|
||
FROM openjdk:8-jre-alpine | ||
WORKDIR /app | ||
COPY --from=build /app/bin/jar /app | ||
EXPOSE 80 | ||
ENTRYPOINT ["sh", "-c"] | ||
CMD ["java -jar Ara-Server.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: com.andromeda.araserver.Run | ||
|
||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
package com.andromeda.araserver.pages | ||
|
||
import com.andromeda.araserver.util.Sort | ||
import com.rometools.rome.feed.synd.SyndEntry | ||
import com.rometools.rome.feed.synd.SyndFeed | ||
import com.rometools.rome.feed.synd.SyndFeedImpl | ||
import com.rometools.rome.io.FeedException | ||
import com.rometools.rome.io.SyndFeedInput | ||
import com.rometools.rome.io.XmlReader | ||
|
||
|
||
import java.io.IOException | ||
import java.net.URL | ||
import java.util.* | ||
|
||
/** | ||
* Object used to handle RSS Feeds. | ||
*/ | ||
object RssMain { | ||
/** | ||
* Main Function. Returns feeds based on the passed in mode. | ||
* @param mode the specify the type of feeds to return. | ||
* @return The SyndFeed containing the feeds. | ||
* @throws IOException | ||
* @throws FeedException | ||
*/ | ||
@Throws(IOException::class, FeedException::class) | ||
fun rssMain1(mode: Int): SyndFeed { | ||
//Feed link text | ||
val feeds = arrayOfNulls<String>(4) | ||
when (mode) { | ||
1 -> { | ||
//World news | ||
feeds[0] = "https://www.cbsnews.com/latest/rss/world" | ||
feeds[1] = "http://feeds.foxnews.com/foxnews/world" | ||
feeds[2] = "http://feeds.bbci.co.uk/news/world/rss.xml" | ||
feeds[3] = "http://feeds.reuters.com/Reuters/worldNews" | ||
} | ||
2 -> { | ||
// Us news | ||
feeds[0] = "https://www.cbsnews.com/latest/rss/us" | ||
feeds[1] = "http://feeds.foxnews.com/foxnews/national" | ||
feeds[2] = "http://feeds.reuters.com/Reuters/domesticNews" | ||
feeds[3] = "http://news.yahoo.com/rss/" | ||
} | ||
3 -> { | ||
//Tech news | ||
feeds[0] = "https://www.cnet.com/rss/news/" | ||
feeds[1] = "http://www.foxnews.com/about/rss" | ||
feeds[2] = "http://feeds.bbci.co.uk/news/technology/rss.xml" | ||
feeds[3] = "https://hnrss.org/newest" | ||
} | ||
4 -> { | ||
//Business news | ||
feeds[0] = "http://feeds.reuters.com/reuters/businessNews" | ||
feeds[1] = "https://www.espn.com/espn/rss/news/rss.xml" | ||
feeds[2] = "http://feeds.bbci.co.uk/news/business/rss.xml" | ||
feeds[3] = "http://feeds.reuters.com/reuters/businessNews" | ||
} | ||
else -> { | ||
// general news | ||
feeds[0] = "https://www.cbsnews.com/latest/rss/main/" | ||
feeds[1] = "http://feeds.foxnews.com/foxnews/latest" | ||
feeds[2] = "https://www.espn.com/espn/rss/news" | ||
feeds[3] = "http://feeds.reuters.com/Reuters/worldNews" | ||
} | ||
} | ||
//Declare Feed | ||
val feed = SyndFeedImpl() | ||
//Set feed type | ||
feed.feedType = "rss_2.0" | ||
//Entries of the feeds | ||
val entries = ArrayList<SyndEntry>() | ||
//Entries after sorting by date | ||
val sortedEntries = ArrayList<SyndEntry>() | ||
|
||
|
||
// set general feed info | ||
feed.title = "Ara feed" | ||
feed.description = "a hole lot of feeds in one" | ||
feed.author = "Andromeda Software" | ||
feed.link = "" | ||
|
||
|
||
//get all the feed results | ||
for (i in feeds.indices) { | ||
val inputUrl = URL(feeds[i]) | ||
|
||
val input = SyndFeedInput() | ||
val inFeed = input.build(XmlReader(inputUrl)) | ||
|
||
entries.addAll(inFeed.entries) | ||
|
||
|
||
} | ||
//sort and reverse | ||
sortedEntries.addAll(Sort().sortDateSyndEntry(entries)) | ||
feed.entries = sortedEntries.reversed() | ||
//return the value | ||
return feed | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2019. Fulton Browne | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package com.andromeda.araserver.pages | ||
|
||
/** | ||
* Class used to for running update from beta testers. | ||
*/ | ||
class Update { | ||
/** | ||
* Function used for running update from beta testers. | ||
* @param ver version string. | ||
* @return String. | ||
*/ | ||
fun update(ver: String): String { | ||
//Remove the "/update from the uri | ||
val ver1 = ver.removeRange(0, 8) | ||
//Convert version string to version double | ||
val vers: Double = ver1.toDouble() | ||
//set a link value if update | ||
val out: String | ||
out = if (vers > 0.2) "link here" | ||
else "nope" | ||
//Return the fina value | ||
return out | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.andromeda.araserver.util | ||
|
||
import java.net.URL | ||
|
||
/** | ||
* Class used to return URL string. | ||
*/ | ||
class Url { | ||
/** | ||
* Returns the entire content from the url. | ||
* @param url URL that to obtain content from. | ||
* @return The entire content of the URL as a String as UTF-8. | ||
*/ | ||
fun main(url: URL): String { | ||
return url.readText() | ||
} | ||
} |