Skip to content

Commit

Permalink
Improve first time installation, automate some steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Plajer committed Apr 27, 2020
1 parent 3124519 commit 47a21b4
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 13 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<img src="https://cdn.feedbacky.net/static/img/main_banner_ideas.png">
</p>

### Minimum requirements
## Minimum requirements
* ~300 MB ram for runtime (at least 1.5 GB for source compilation purposes)

**If you have small server with 1 GB or less ram you need to add swap space so compilation won't run out of memory and fail, link below.**
Expand Down Expand Up @@ -47,9 +47,6 @@ To clone repository with Git use:
2. Open `.env` file located in `feedbacky-project` folder (you can use `nano .env`) and configure database credentials i.e.
`MYSQL_USERNAME`, `MYSQL_PASSWORD` and `MYSQL_URL`.

**Please note that database Feedbacky will use must have utf8mb4 character set so to create database like that you can use
`CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci`**

Please note that `localhost` won't work in `MYSQL_URL` variable due to nature of Docker (container is considered as a remote machine).
IP of server must be provided and MySQL must be configured to accept non localhost connections.

Expand Down Expand Up @@ -102,14 +99,19 @@ and go to `feedbacky-project` folder.
Begin the source compilation process by doing `docker-compose up`, it will take few minutes depending on your server capabilities.
Server will likely use high amount of CPU at this part. After successful compilation your Feedbacky instance should be ready.
10. When server is running properly go to web page at your server ip (remember the port if it's not 80 (web port)), log in and restart
the instance and now you should be service admin and have Feedbacky fully configured.
## Further customizing
If you want you can customize your Feedbacky instance even more.
You can edit [this file](https://github.com/Plajer/feedbacky-project/blob/master/client/public/index.html) to add for example
your own OG meta tags like
![](https://static.plajer.xyz/feedbacky/img/og-example.png)
Mail templates can be edited [in this folder](https://github.com/Plajer/feedbacky-project/tree/master/server/src/main/resources/mail_templates).
### Updating from older versions
## Updating from older versions
This section will contain information about variables you need to put to .env file to make Feedbacky work after you update it.
It might include other information as well.
### Attribution note
## Attribution note
Icons (from client project at /src/views/admin/subviews/webhooks/steps/StepSecond.jsx) made by [Prosymbols](https://www.flaticon.com/authors/prosymbols) from www.flaticon.com
Some SVG illustrations provided by https://undraw.co/
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/app/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class App extends Component {

onLogin = (token) => {
//setting loaded to false because it was already loaded before this method call
this.setState({session: token, loaded: false, moderatingDataLoaded: false});
this.setState({session: token, loaded: false, serviceDataLoaded: false, moderatingDataLoaded: false});
//forcing reupdate the props
this.componentDidMount();
};
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/Idea.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class Idea extends Component {
return;
}
const ideaData = res.data;
if (data.title === null && data.user === null) {
if (ideaData.title === null && ideaData.user === null) {
this.setState({ideaDataLoaded: true, boardDataLoaded: true, moderatorsLoaded: true, privatePage: true});
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package net.feedbacky.app.config;

import org.hibernate.dialect.MySQL5Dialect;

/**
* @author Plajer
* <p>
* Created at 27.04.2020
*/
public class MySQLCustomDialect extends MySQL5Dialect {

//Custom MySQL dialect to support Unicode emojis in our database.
@Override
public String getTableTypeString() {
return " ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ public AboutRestController(LoginProviderRegistry loginProviderRegistry, UserRepo

@GetMapping("/v1/service/about")
public ResponseEntity<AboutFeedbackyData> handle() {
AboutFeedbackyData data;
//lazy init to make sure all login providers are registered before
if(this.aboutFeedbackyData == null) {
List<FetchUserDto> admins = userRepository.findByServiceStaffTrue().stream().map(user -> user.convertToDto().exposeSensitiveData(false)).collect(Collectors.toList());
this.aboutFeedbackyData = new AboutFeedbackyData(FeedbackyApplication.BACKEND_VERSION, loginProviderRegistry.getRegisteredProviders(), maintenanceMode, admins);
data = new AboutFeedbackyData(FeedbackyApplication.BACKEND_VERSION, loginProviderRegistry.getRegisteredProviders(), maintenanceMode, admins);
//only cache when there is at least 1 service admin registered (for first installation purposes)
if(!admins.isEmpty()) {
this.aboutFeedbackyData = data;
}
} else {
data = this.aboutFeedbackyData;
}
return ResponseEntity.ok(aboutFeedbackyData);
return ResponseEntity.ok(data);
}

}
2 changes: 1 addition & 1 deletion server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spring:
jdbc:
initialize-schema: "always"
jpa:
database-platform: "org.hibernate.dialect.MySQL5Dialect"
database-platform: "net.feedbacky.app.config.MySQLCustomDialect"
show-sql: false
generate-ddl: true
hibernate:
Expand Down

0 comments on commit 47a21b4

Please sign in to comment.