Skip to content

Commit 8bca769

Browse files
committed
Finish initial version
1 parent d1b5b19 commit 8bca769

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2035
-0
lines changed

aws/s3/.gitignore

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/java,intellij+all,gradle
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=java,intellij+all,gradle
4+
5+
### Intellij+all ###
6+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
7+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
8+
9+
# User-specific stuff
10+
.idea/**/workspace.xml
11+
.idea/**/tasks.xml
12+
.idea/**/usage.statistics.xml
13+
.idea/**/dictionaries
14+
.idea/**/shelf
15+
16+
# Generated files
17+
.idea/**/contentModel.xml
18+
19+
# Sensitive or high-churn files
20+
.idea/**/dataSources/
21+
.idea/**/dataSources.ids
22+
.idea/**/dataSources.local.xml
23+
.idea/**/sqlDataSources.xml
24+
.idea/**/dynamic.xml
25+
.idea/**/uiDesigner.xml
26+
.idea/**/dbnavigator.xml
27+
28+
# Gradle
29+
.idea/**/gradle.xml
30+
.idea/**/libraries
31+
32+
# Gradle and Maven with auto-import
33+
# When using Gradle or Maven with auto-import, you should exclude module files,
34+
# since they will be recreated, and may cause churn. Uncomment if using
35+
# auto-import.
36+
# .idea/artifacts
37+
# .idea/compiler.xml
38+
# .idea/jarRepositories.xml
39+
# .idea/modules.xml
40+
# .idea/*.iml
41+
# .idea/modules
42+
# *.iml
43+
# *.ipr
44+
45+
# CMake
46+
cmake-build-*/
47+
48+
# Mongo Explorer plugin
49+
.idea/**/mongoSettings.xml
50+
51+
# File-based project format
52+
*.iws
53+
54+
# IntelliJ
55+
# out/
56+
57+
# mpeltonen/sbt-idea plugin
58+
.idea_modules/
59+
60+
# JIRA plugin
61+
atlassian-ide-plugin.xml
62+
63+
# Cursive Clojure plugin
64+
.idea/replstate.xml
65+
66+
# Crashlytics plugin (for Android Studio and IntelliJ)
67+
com_crashlytics_export_strings.xml
68+
crashlytics.properties
69+
crashlytics-build.properties
70+
fabric.properties
71+
72+
# Editor-based Rest Client
73+
.idea/httpRequests
74+
75+
# Android studio 3.1+ serialized cache file
76+
.idea/caches/build_file_checksums.ser
77+
78+
### Intellij+all Patch ###
79+
# Ignores the whole .idea folder and all .iml files
80+
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
81+
82+
.idea/
83+
84+
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
85+
86+
*.iml
87+
modules.xml
88+
.idea/misc.xml
89+
*.ipr
90+
91+
# Sonarlint plugin
92+
.idea/sonarlint
93+
94+
### Java ###
95+
# Compiled class file
96+
*.class
97+
98+
# Log file
99+
*.log
100+
101+
# BlueJ files
102+
*.ctxt
103+
104+
# Mobile Tools for Java (J2ME)
105+
.mtj.tmp/
106+
107+
# Package Files #
108+
*.jar
109+
*.war
110+
*.nar
111+
*.ear
112+
*.zip
113+
*.tar.gz
114+
*.rar
115+
116+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
117+
hs_err_pid*
118+
119+
### Gradle ###
120+
.gradle
121+
build/
122+
123+
# Ignore Gradle GUI config
124+
gradle-app.setting
125+
126+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
127+
!gradle-wrapper.jar
128+
129+
# Cache of project
130+
.gradletasknamecache
131+
132+
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
133+
# gradle/wrapper/gradle-wrapper.properties
134+
135+
### Gradle Patch ###
136+
**/build/
137+
138+
# End of https://www.toptal.com/developers/gitignore/api/java,intellij+all,gradle
139+
140+
# Dumps of the meta-db
141+
data/*.db

aws/s3/Readme.md

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
<!-- PROJECT LOGO -->
2+
<br />
3+
<p align="center">
4+
<img src="images/logo.png" alt="Logo" width="80" height="80">
5+
<h3 align="center">Private File Upload</h3>
6+
7+
<p align="center">
8+
Build on Spring Cloud & AWS S3
9+
</p>
10+
</p>
11+
12+
13+
14+
<!-- TABLE OF CONTENTS -->
15+
## Table of Contents
16+
17+
* [About the Project](#about-the-project)
18+
* [Built With](#built-with)
19+
* [Getting Started](#getting-started)
20+
* [Prerequisites](#prerequisites)
21+
* [Installation](#installation)
22+
* [Usage](#usage)
23+
* [Contact](#contact)
24+
* [Acknowledgements](#acknowledgements)
25+
26+
27+
28+
<!-- ABOUT THE PROJECT -->
29+
## About The Project
30+
31+
<p align="center">
32+
<img src="images/usage.gif">
33+
</p>
34+
35+
36+
### Built With
37+
- Spring Boot
38+
- Spring Cloud
39+
- AWS S3
40+
- ☕️ & ❤️
41+
42+
<!-- GETTING STARTED -->
43+
## Getting Started
44+
45+
### Prerequisites
46+
47+
In order to run this application you should have an Amazon Web Services (AWS) account.
48+
49+
### Installation
50+
51+
1. Update the `application.yaml` settings value for `cloud.aws.credentials.profile-name` to the name of your local AWS-profile
52+
2. run `./gradlew bootRun`
53+
3. Open your browser at `localhost:8080`
54+
55+
<!-- USAGE EXAMPLES -->
56+
## Usage
57+
58+
The application wraps a lot of S3-related API calls in easy to use UI elements to
59+
60+
- create/delete buckets (mapped as "spaces" so we can give them non-unique names)
61+
- upload/delete files
62+
- make files public/private
63+
- create pre-signed URLs for files
64+
- create bucket policy rules to set the lifecycle duration for elements
65+
66+
More detailed instructions can be found here:
67+
68+
<details>
69+
<summary>🪣 Create a bucket</summary>
70+
71+
1. Navigate to the _Spaces_ section
72+
2. Click on _New Space_
73+
3. Enter the name and click _Submit_
74+
4. A message should pop up to indicate success
75+
76+
</details>
77+
78+
<details>
79+
<summary>🗂 Upload a File</summary>
80+
81+
1. Navigate to the _Spaces_ section
82+
2. Select _Details_ on the target Space/Bucket
83+
3. Click on _Upload File_
84+
4. Pick our file, provide a name and click _Submit_
85+
5. A message should pop up to indicate success
86+
</details>
87+
88+
<details>
89+
<summary>🔎 List all Objects in a Bucket</summary>
90+
91+
1. Navigate to the _Spaces_ section
92+
2. Select _Details_ on the target Space/Bucket
93+
3. You see a list of all objects stored in the bucket
94+
</details>
95+
96+
<details>
97+
<summary>🌐 Get an Object's URL</summary>
98+
99+
1. Navigate to the _Spaces_ section
100+
2. Select _Details_ on the target Space/Bucket
101+
3. Select _Download_ on the target object
102+
4. The object's URL shall be opened in a new tab
103+
</details>
104+
105+
<details>
106+
<summary>📢 Make an object public</summary>
107+
108+
1. Navigate to the _Spaces_ section
109+
2. Select _Details_ on the target Space/Bucket
110+
3. Select _Make Public_ on the target object
111+
4. A message should pop up to indicate success
112+
</details>
113+
114+
<details>
115+
<summary>🤫 Make an Object private</summary>
116+
117+
1. Navigate to the _Spaces_ section
118+
2. Select _Details_ on the target Space/Bucket
119+
3. Select _Make Private_ on the target object
120+
4. A message should pop up to indicate success
121+
</details>
122+
123+
<details>
124+
<summary>🔥 Delete an Object</summary>
125+
126+
1. Navigate to the _Spaces_ section
127+
2. Select _Details_ on the target Space/Bucket
128+
3. Select _Delete_ on the target object
129+
4. The list of objects should reload without the deleted one
130+
</details>
131+
132+
<details>
133+
<summary>☄️ Delete a Bucket</summary>
134+
135+
1. Navigate to the _Spaces_ section
136+
2. Select _Delete_ on the target Space/Bucket
137+
3. The list of buckets should reload without the deleted one
138+
</details>
139+
140+
<details>
141+
<summary>👾 Generate a pre-signed URL</summary>
142+
143+
1. Navigate to the _Spaces_ section
144+
2. Select _Details_ on the target Space/Bucket
145+
3. Select _Magic Link_ on the target object
146+
4. A message should pop up, containing a pre-signed URL for that object (which is valid for 15 minutes)
147+
</details>
148+
149+
<details>
150+
<summary>⏳ Set Expiration on Bucket</summary>
151+
152+
1. Navigate to the _Spaces_ section
153+
2. Select _Make Temporary_ on the target Space/Bucket
154+
3. Select _Delete_ on the target object
155+
4. A message should pop up to indicate success
156+
</details>
157+
158+
<!-- CONTACT -->
159+
## Contact
160+
161+
Joshua Görner - [jgoerner](https://www.linkedin.com/in/jgoerner/) - joshua.goerner[at]gmail.com
162+
163+
164+
<!-- ACKNOWLEDGEMENTS -->
165+
## Acknowledgements
166+
* [O. Drew](https://github.com/othneildrew/Best-README-Template) - nice GH Readme template
167+
* [Hatchful](https://hatchful.shopify.com/) - Easy Logo Generation

aws/s3/build.gradle

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
plugins {
2+
id 'org.springframework.boot' version '2.4.2'
3+
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
4+
id 'java'
5+
}
6+
7+
group = 'io.jgoerner'
8+
version = '0.0.1-SNAPSHOT'
9+
sourceCompatibility = '11'
10+
11+
repositories {
12+
mavenCentral()
13+
}
14+
15+
ext {
16+
// set('springCloudVersion', "Hoxton.SR9")
17+
set('springCloudVersion', "Finchley.SR1")
18+
}
19+
20+
21+
dependencies {
22+
annotationProcessor 'org.projectlombok:lombok'
23+
developmentOnly 'org.springframework.boot:spring-boot-devtools'
24+
implementation 'org.springframework.boot:spring-boot-starter-web'
25+
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
26+
implementation 'org.springframework.cloud:spring-cloud-starter-aws'
27+
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
28+
implementation 'org.projectlombok:lombok:1.18.16'
29+
runtimeOnly 'com.h2database:h2'
30+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
31+
}
32+
33+
dependencyManagement {
34+
imports {
35+
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
36+
}
37+
}
38+
39+
test {
40+
useJUnitPlatform()
41+
}

aws/s3/data/.gitkeep

Whitespace-only changes.
57.8 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Mon Jan 04 22:38:53 CET 2021
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
3+
distributionBase=GRADLE_USER_HOME
4+
distributionPath=wrapper/dists
5+
zipStorePath=wrapper/dists
6+
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)