Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymilter-suspicious-from
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
misc
pymilter-suspicious-from
Commits
ecaa69e5
Commit
ecaa69e5
authored
5 years ago
by
Jan Philipp Timme
Browse files
Options
Downloads
Patches
Plain Diff
Add Vagrantfile for testing and figuring out install dependencies
parent
dc3c8794
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
Vagrantfile
+57
-0
57 additions, 0 deletions
Vagrantfile
with
58 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
ecaa69e5
__pycache__
__pycache__
.vagrant
This diff is collapsed.
Click to expand it.
Vagrantfile
0 → 100644
+
57
−
0
View file @
ecaa69e5
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant
.
configure
(
"2"
)
do
|
config
|
config
.
vm
.
box
=
"debian/buster64"
config
.
vm
.
synced_folder
"./"
,
"/vagrant"
,
type:
"rsync"
# Export postfix port 25 (guest) to port 2525 (host)
# This is useful for throwing swaks and other tools against postfix
config
.
vm
.
network
"forwarded_port"
,
guest:
7777
,
host:
7777
config
.
vm
.
provision
"shell"
,
inline:
<<-
SHELL
# Give that vagrant box an apparently good FQDN
echo "local-vagrant.example.com" > /etc/hostname
echo "local-vagrant.example.com" > /etc/mailname
echo "127.0.1.2 local-vagrant.example.com local-vagrant" > /etc/hosts
hostnamectl set-hostname local-vagrant.example.com
# Basic preparations
apt-get update
# Install postfix
DEBIAN_FRONTEND=noninteractive apt-get install -y postfix
# Add milter to configuration
postconf smtpd_milters=inet:127.0.0.1:7777
postconf non_smtpd_milters=inet:127.0.0.1:7777
# Enable and launch postfix
systemctl enable postfix.service
systemctl start postfix.service
# Install swaks
DEBIAN_FRONTEND=noninteractive apt-get install -y swaks
# Install required dependencies
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-venv build-essential python3-dev python3-wheel libmilter-dev
# Create virtualenv for project
sudo -u vagrant python3 -m venv /tmp/venv
sudo -u vagrant /tmp/venv/bin/pip install -r /vagrant/requirements.txt
echo "Fireing it up ..."
sudo -u vagrant /tmp/venv/bin/python /vagrant/main.py
SHELL
config
.
trigger
.
after
:up
do
|
t
|
t
.
info
=
"rsync"
t
.
run
=
{
inline:
"vagrant rsync"
}
# If you want it running in the background switch these
#t.run = {inline: "bash -c 'vagrant rsync-auto bork &'"}
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment