Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
openvpn-app
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cloudron
openvpn-app
Commits
50816ccd
Commit
50816ccd
authored
Sep 24, 2020
by
Johannes Zellner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow restart.sh to be run as root
parent
bdc4de88
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
Dockerfile
Dockerfile
+12
-8
cloudron.sudo
cloudron.sudo
+2
-0
restart.sh
restart.sh
+2
-0
server.js
server.js
+1
-1
No files found.
Dockerfile
View file @
50816ccd
...
...
@@ -16,6 +16,18 @@ ADD easyrsa-vars.sh /app/code/easyrsa/
# Workaround quantum permissions bug
RUN
chown
-R
cloudron:cloudron /app/code/easyrsa
## Sudoers
ADD
cloudron.sudo /etc/sudoers.d/cloudron
ADD
restart.sh /app/code/restart.sh
## Setting up TUN device
RUN
mknod
/app/code/net-tun c 10 200
## Supervisor
ADD
supervisor/ /etc/supervisor/conf.d/
RUN
sed
-e
's,^logfile=.*$,logfile=/run/supervisord.log,'
-i
/etc/supervisor/supervisord.conf
RUN
sed
-e
's,^chmod=.*$,chmod=0760\nchown=cloudron:cloudron,'
-i
/etc/supervisor/supervisord.conf
## Installing web-admin interface & packaging scripts
ADD
package.json package-lock.json /app/code/
ADD
src /app/code/src
...
...
@@ -26,12 +38,4 @@ ADD start.sh server.js openvpn.conf.template regen-crl.sh restart.sh /app/code/
# Somehow postinstall is not run automatically when building docker image
RUN
npm
install
--production
&&
npm run postinstall
## Setting up TUN device
RUN
mknod
/app/code/net-tun c 10 200
## Supervisor
ADD
supervisor/ /etc/supervisor/conf.d/
RUN
sed
-e
's,^logfile=.*$,logfile=/run/supervisord.log,'
-i
/etc/supervisor/supervisord.conf
RUN
sed
-e
's,^chmod=.*$,chmod=0760\nchown=cloudron:cloudron,'
-i
/etc/supervisor/supervisord.conf
CMD
[ "/app/code/start.sh" ]
cloudron.sudo
0 → 100644
View file @
50816ccd
Defaults!/app/code/restart.sh env_keep="HOME"
cloudron ALL=(ALL) NOPASSWD: /app/code/restart.sh
restart.sh
View file @
50816ccd
...
...
@@ -4,6 +4,8 @@ set -eu
# WARNING if this file is changed also check if start.sh needs adjustment!
echo
"==> Restart after config changes"
# Add iptables rules for NATing VPN traffic
network
=
$(
cat
/app/data/openvpn.conf |
sed
-ne
's/^server \(.*\) .*$/\1/p'
)
echo
"==> Configuring nat rules for
${
network
}
"
...
...
server.js
View file @
50816ccd
...
...
@@ -115,7 +115,7 @@ function setOpenVPNSetting(settings) {
function
restartOpenVPN
()
{
try
{
execSync
(
'
/app/code/restart.sh
'
);
execSync
(
'
sudo /app/code/restart.sh
'
,
{
stdio
:
'
inherit
'
}
);
}
catch
(
e
)
{
return
e
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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