Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
b472814c
Commit
b472814c
authored
Sep 25, 2017
by
Matija Obreza
Browse files
FTP server configuration
parent
473831a1
Changes
4
Hide whitespace changes
Inline
Side-by-side
docker/jetty/resources/genesys.properties
View file @
b472814c
...
...
@@ -19,3 +19,6 @@ db.hbm2ddl=true
hibernate.dialect
=
org.hibernate.dialect.MySQL5InnoDBDialect
data.dir
=
/data/genesys/
# Disable FTP
repository.ftp.port
=
-1
src/main/java/org/genesys2/spring/config/FileRepositoryConfig.java
View file @
b472814c
...
...
@@ -79,6 +79,15 @@ public class FileRepositoryConfig implements InitializingBean {
@Value
(
"${repository.ftp.keystore.password}"
)
private
String
ftpKeystorePwd
;
@Value
(
"${repository.ftp.port}"
)
private
int
ftpServerPort
;
@Value
(
"${repository.ftp.passivePorts}"
)
private
String
ftpServerPassivePorts
;
@Value
(
"${repository.ftp.externalAddress}"
)
private
String
ftpServerExternalAddress
;
/**
* File repository service.
*
...
...
@@ -164,15 +173,13 @@ public class FileRepositoryConfig implements InitializingBean {
@Bean
public
RepositoryFtpServer
ftpServer
()
{
RepositoryFtpServer
ftpServer
=
new
RepositoryFtpServer
();
ftpServer
.
setFtpPort
(
8022
);
ftpServer
.
setFtpPort
(
ftpServerPort
);
ftpServer
.
setUserManager
(
ftpUserManager
());
// TODO configurable!
ftpServer
.
setKeystorePath
(
ftpKeystorePath
);
ftpServer
.
setKeystorePsw
(
ftpKeystorePwd
);
// external IP address
// ftpServer.setExternalAddress("127.0.0.1");
ftpServer
.
setPassivePorts
(
"2300-2301"
);
ftpServer
.
setExternalAddress
(
ftpServerExternalAddress
);
ftpServer
.
setPassivePorts
(
ftpServerPassivePorts
);
return
ftpServer
;
}
...
...
@@ -182,7 +189,7 @@ public class FileRepositoryConfig implements InitializingBean {
return
new
AbstractUserManager
()
{
@Autowired
private
AccountLockoutManager
lockoutManager
;
private
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
...
...
@@ -231,7 +238,7 @@ public class FileRepositoryConfig implements InitializingBean {
org
.
genesys2
.
server
.
model
.
impl
.
User
user
=
userService
.
getUserByEmail
(
upauth
.
getUsername
());
if
(
user
==
null
||
!
user
.
isActive
()
||
user
.
isAccountLocked
()
||
user
.
isAccountExpired
()
||
!
user
.
isEnabled
()
||
user
.
isPasswordExpired
())
{
if
(
user
==
null
||
!
user
.
isActive
()
||
user
.
isAccountLocked
()
||
user
.
isAccountExpired
()
||
!
user
.
isEnabled
()
||
user
.
isPasswordExpired
())
{
// user not found
throw
new
AuthenticationFailedException
(
"Authentication failed"
);
}
...
...
@@ -270,9 +277,13 @@ public class FileRepositoryConfig implements InitializingBean {
System
.
err
.
println
(
"Using built-in keystore for FTP server /repository/ftpserver.jks"
);
ftpKeystorePath
=
getClass
().
getResource
(
DEFAULT_REPOSITORY_KEYSTORE_RESOURCE
).
getPath
();
}
if
(
StringUtils
.
isBlank
(
ftpKeystorePwd
))
{
System
.
err
.
println
(
"Using built-in keystore password"
);
ftpKeystorePwd
=
DEFAULT_REPOSITORY_KEYSTORE_PASSWORD
;
}
ftpServerExternalAddress
=
StringUtils
.
trimToNull
(
ftpServerExternalAddress
);
ftpServerPassivePorts
=
StringUtils
.
trimToNull
(
ftpServerPassivePorts
);
}
}
src/main/resources/spring/spring.properties
View file @
b472814c
...
...
@@ -180,3 +180,6 @@ s3.region=
# FTP
repository.ftp.keystore.path
=
repository.ftp.keystore.password
=
changeit!
repository.ftp.port
=
8021
repository.ftp.passivePorts
=
2300-2350
repository.ftp.externalAddress
=
src/test/resources/spring/spring.properties
View file @
b472814c
...
...
@@ -45,6 +45,9 @@ file.repository.dir=${data.dir}/repository
# FTP
repository.ftp.keystore.path
=
repository.ftp.keystore.password
=
changeit!
repository.ftp.port
=
8021
repository.ftp.passivePorts
=
2300-2350
repository.ftp.externalAddress
=
# ITPGRFA Easy-SMTA account (if you have one)
itpgrfa.easysmta.url
=
https://mls.planttreaty.org/itt/index.php?r=extsys/userinfo
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment